Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 35 additions & 20 deletions MANIFESTO.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# fyn — A uv fork with a smaller package-index `User-Agent`
# fyn — A community fork of uv with its own commands and config

**fyn** is a Python package manager and project manager written in Rust. It's an independent fork of
[uv](https://github.com/astral-sh/uv), which is the fastest Python package installer around, with a
smaller package-index `User-Agent`, missing features added, and bugs fixed.
[uv](https://github.com/astral-sh/uv), which is the fastest Python package installer around. It
started as a relatively close fork, but fyn now ships fork-specific commands, config namespace,
defaults, policies, and behavior, along with a smaller package-index `User-Agent`, added features,
and bug fixes.

If you've used uv, fyn should feel familiar. Most day-to-day commands carry over, migration is
usually straightforward, and the main behavior differences are below.
If you've used uv, fyn should still feel familiar. Many day-to-day commands carry over and migration
is usually straightforward, but fyn is no longer just uv with a different binary name. The main
concrete differences are below.

## Why fork uv?

Expand All @@ -19,8 +22,10 @@ So we forked it. We called it **fyn**. You can infer the first letter however yo

## What's actually different

We're not trying to rewrite the thing. uv is really solid and we're keeping most of it. We're just
fixing the stuff that bugged us and adding the things people kept asking for.
We're not trying to rewrite the thing from scratch. uv is really solid and the shared ancestry still
matters. But fyn has diverged enough that "uv with a smaller package-index `User-Agent`" is no
longer a very good description. The project now has its own command surface, project conventions,
policies, and bug fixes.

### Reduced package-index request metadata

Expand All @@ -35,27 +40,37 @@ This reduces what is exposed in the header, but it does not make package install
indexes still see normal network and request information, including your IP address and the packages
you ask for.

### New features we added
### Some of the larger user-visible differences

- **Fork-specific project namespace** — fyn uses `[tool.fyn]` and `fyn.lock`, not `[tool.uv]` and
`uv.lock`.
- **Task runner** — define project tasks in `[tool.fyn.tasks]` and list them with
`fyn run --list-tasks`.
- **`fyn shell`**
- **`fyn upgrade`**
- **`fyn status`**
- **Managed-project pip guardrails** — configure `pip-in-project = "warn" | "error" | "allow"` to
control direct `fyn pip` mutations inside managed projects.
- **Cache size limits** — set `UV_CACHE_MAX_SIZE=2G` and the cache cleans itself. uv's cache just
grew forever.
- **Custom lockfile name** — set `UV_LOCKFILE` to use a non-default lockfile path.

## fyn vs uv — feature comparison

| Feature | uv | fyn |
| ------------------------------- | ------------------------------------- | ----------------------- |
| Speed (10-100x faster than pip) | Yes | Yes |
| Package index User-Agent | `uv/<version>` plus LineHaul metadata | Minimal `fyn/<version>` |
| `shell` command | Not available | `fyn shell` |
| `upgrade` command | Must chain two commands | `fyn upgrade` |
| Cache size limit | No limit | `UV_CACHE_MAX_SIZE` |
| Custom lockfile name | Not available | `UV_LOCKFILE` |
| `remove --group` sync behavior | Wipes other group packages | Fixed |
| Drop-in replacement for pip | Yes | Yes |
| Python version management | Yes | Yes |
| Lockfile support | Yes (`uv.lock`) | Yes (`fyn.lock`) |
| Area | uv | fyn |
| ------------------------------- | ------------------------------------- | ------------------------ | ----- | ------ |
| Speed (10-100x faster than pip) | Yes | Yes |
| Config namespace and lockfile | `[tool.uv]`, `uv.lock` | `[tool.fyn]`, `fyn.lock` |
| Package index User-Agent | `uv/<version>` plus LineHaul metadata | Minimal `fyn/<version>` |
| Task runner | No `[tool.uv.tasks]` | `[tool.fyn.tasks]` |
| `shell` command | No `uv shell` | `fyn shell` |
| `upgrade` command | No `uv upgrade` | `fyn upgrade` |
| `status` command | No `uv status` | `fyn status` |
| Managed-project `pip` policy | No `pip-in-project` setting | `pip-in-project = warn | error | allow` |
| Cache size limit | No `UV_CACHE_MAX_SIZE` | `UV_CACHE_MAX_SIZE` |
| Custom lockfile name | No `UV_LOCKFILE` | `UV_LOCKFILE` |
| Python version management | Yes | Yes |
| Lockfile support | Yes (`uv.lock`) | Yes (`fyn.lock`) |

## Roadmap

Expand Down
84 changes: 67 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

An extremely fast Python package and project manager, written in Rust.

**fyn** is an independent Python package manager built on [uv](https://github.com/astral-sh/uv)'s
foundation, with reduced package-index request metadata, new features added, and long-standing bugs
fixed. See [MANIFESTO.md](MANIFESTO.md) for the full story.
**fyn** is an independent community fork of [uv](https://github.com/astral-sh/uv). It started on
uv's foundation, but it now has its own commands, settings, defaults, and behavior, alongside
reduced package-index request metadata, added features, and long-standing bug fixes. See
[MANIFESTO.md](MANIFESTO.md) for the full story.

## Highlights

Expand Down Expand Up @@ -119,6 +120,10 @@ Type exit to deactivate.

Works with bash, zsh, fish, nushell, powershell, and cmd.

If you pass a path, `fyn shell` activates that environment directly. Otherwise it uses `VIRTUAL_ENV`
when set, then the discovered project environment, then a local `.venv`. Use `--no-project` to skip
project discovery and only check the current directory.

### Upgrade dependencies

Upgrade all or specific dependencies in one command:
Expand All @@ -135,6 +140,44 @@ success: Dependencies upgraded successfully.

Supports `--dry-run` and `--no-sync`.

`fyn upgrade` is the convenience form of running `fyn lock --upgrade` and then `fyn sync`.

### Project status

Inspect the current project and environment state:

```console
$ fyn status
current directory: /home/user/example
project directory: /home/user/example
managed project: yes
workspace root: /home/user/example
pyproject.toml: yes
fyn.lock: yes
pip-in-project: warn
environment: /home/user/example/.venv
python: /home/user/example/.venv/bin/python3 (3.12.0)
```

Use `--check` to fail when obvious project checks do not pass, or `--json` for scripting and editor
integrations.

### PyTorch backend diagnosis

Inspect the current machine and environment before installing or reinstalling PyTorch:

```console
$ fyn torch doctor
PyTorch doctor
recommended backend: cu130

next command:
fyn pip install torch torchvision torchaudio --torch-backend=cu130
```

Use `--json` for scripting. `fyn torch doctor` reports the recommendation and current package state,
but does not modify `pyproject.toml`.

### Scripts

fyn manages dependencies and environments for single-file scripts.
Expand Down Expand Up @@ -314,30 +357,37 @@ The same ones as uv: macOS, Linux, and Windows, across x86_64 and aarch64.

#### Is fyn compatible with uv?

Mostly at the workflow level, but not as a byte-for-byte drop-in replacement. Commands and many
`UV_*` environment variables carry over, but projects need `[tool.uv]` renamed to `[tool.fyn]` and
`uv.lock` renamed to `fyn.lock` unless you override the lockfile name.
At the workflow level, often yes, but not as a drop-in replacement. Many commands and `UV_*`
environment variables carry over, but fyn now has fork-specific commands, config, defaults, and
behavior. Projects still need `[tool.uv]` renamed to `[tool.fyn]` and `uv.lock` renamed to
`fyn.lock` unless you override the lockfile name.

#### What's different from uv?

See [MANIFESTO.md](MANIFESTO.md) for the full comparison, or the table below for a quick summary:

| Feature | uv | fyn |
| ------------------------ | ------------------------------------- | ----------------------- |
| Package index User-Agent | `uv/<version>` plus LineHaul metadata | Minimal `fyn/<version>` |
| Task runner | Not available | `[tool.fyn.tasks]` |
| `shell` command | Not available | `fyn shell` |
| `upgrade` command | Must chain two commands | `fyn upgrade` |
| Cache size limit | No limit | `UV_CACHE_MAX_SIZE` |
| Custom lockfile name | Not available | `UV_LOCKFILE` |
See [MANIFESTO.md](MANIFESTO.md) for the fuller comparison, or the table below for some of the
larger user-visible differences:

| Area | uv | fyn |
| ----------------------------- | ------------------------------------- | ------------------------ | ----- | ------ |
| Config namespace and lockfile | `[tool.uv]`, `uv.lock` | `[tool.fyn]`, `fyn.lock` |
| Package index User-Agent | `uv/<version>` plus LineHaul metadata | Minimal `fyn/<version>` |
| Task runner | No `[tool.uv.tasks]` | `[tool.fyn.tasks]` |
| `shell` command | No `uv shell` | `fyn shell` |
| `upgrade` command | No `uv upgrade` | `fyn upgrade` |
| `status` command | No `uv status` | `fyn status` |
| `torch doctor` command | No `uv torch doctor` | `fyn torch doctor` |
| Managed-project `pip` policy | No `pip-in-project` setting | `pip-in-project = warn | error | allow` |
| Cache size limit | No `UV_CACHE_MAX_SIZE` | `UV_CACHE_MAX_SIZE` |
| Custom lockfile name | No `UV_LOCKFILE` | `UV_LOCKFILE` |

## Acknowledgements

fyn's dependency resolver uses [PubGrub](https://github.com/pubgrub-rs/pubgrub) under the hood.
We're grateful to the PubGrub maintainers, especially [Jacob Finkelman](https://github.com/Eh2406),
for their support.

fyn's core is derived from [uv](https://github.com/astral-sh/uv) by Astral.
fyn started as a fork of [uv](https://github.com/astral-sh/uv) by Astral and still shares
substantial ancestry with it.

fyn's Git implementation is based on [Cargo](https://github.com/rust-lang/cargo).

Expand Down
4 changes: 2 additions & 2 deletions crates/fyn-cli/src/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ impl CompatArgs for PipCompileCompatArgs {
}
Resolver::Legacy => {
return Err(anyhow!(
"pip-compile's `--resolver=legacy` is unsupported (uv always backtracks)"
"pip-compile's `--resolver=legacy` is unsupported (fyn always backtracks)"
));
}
}
}

if self.max_rounds.is_some() {
return Err(anyhow!(
"pip-compile's `--max-rounds` is unsupported (uv always resolves until convergence)"
"pip-compile's `--max-rounds` is unsupported (fyn always resolves until convergence)"
));
}

Expand Down
31 changes: 31 additions & 0 deletions crates/fyn-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,12 @@ pub enum Commands {
after_long_help = ""
)]
Pip(PipNamespace),
/// Diagnose PyTorch backend selection for the current machine.
#[command(
after_help = "Use `fyn help torch` for more details.",
after_long_help = ""
)]
Torch(TorchNamespace),
/// Create a virtual environment.
///
/// By default, creates a virtual environment named `.venv` in the working
Expand Down Expand Up @@ -617,6 +623,13 @@ pub struct StatusArgs {
pub json: bool,
}

#[derive(Args, Debug, Clone)]
pub struct TorchDoctorArgs {
/// Display the diagnosis in JSON format.
#[arg(long)]
pub json: bool,
}

#[derive(Args)]
#[command(group = clap::ArgGroup::new("operation"))]
pub struct VersionArgs {
Expand Down Expand Up @@ -7291,6 +7304,24 @@ pub struct ToolUpgradeArgs {
pub build: BuildOptionsArgs,
}

#[derive(Args)]
pub struct TorchNamespace {
#[command(subcommand)]
pub command: TorchCommand,
}

#[derive(Subcommand)]
pub enum TorchCommand {
/// Inspect the current machine and recommend a PyTorch backend.
///
/// Detects the current accelerator, recommends the corresponding `--torch-backend` value, and
/// prints the exact `fyn pip install` command to run next.
///
/// This command only reports information. It never installs packages or modifies project
/// files.
Doctor(TorchDoctorArgs),
}

#[derive(Args)]
pub struct PythonNamespace {
#[command(subcommand)]
Expand Down
Loading
Loading