Fyn:一个 uv 分叉,包含新功能、错误修复,并已移除遥测数据。
Fyn: An uv fork with new features, bug fixes, stripped telemetry

原始链接: https://github.com/duriantaco/fyn

## fyn:下一代 Python 包和项目管理器 fyn 是一款基于 Rust 的超快速工具,旨在取代 `pip`、`poetry`、`virtualenv` 等。它为 Python 项目和依赖管理提供全面的解决方案,速度比传统工具快 10-100 倍。 主要功能包括:通用锁定文件、在 `pyproject.toml` 中定义的内置任务运行器、轻松激活虚拟环境 (`fyn shell`) 以及简化的依赖升级 (`fyn upgrade`)。fyn 还管理 Python 版本,安装和运行基于 Python 包的工具(如 `pipx`),并支持用于大型项目的 Cargo 风格工作区。 重要的是,fyn 优先考虑用户隐私,**不含遥测数据**。它通过与 `pip` 兼容的接口与现有工作流程兼容,并支持 macOS、Linux 和 Windows。它通过全局依赖缓存有效地管理磁盘空间,并允许使用自定义锁定文件和索引 URL。fyn 与 `uv` 完全兼容,并提供任务运行器和可配置缓存限制等改进。 安装很简单,通过 `pip install fyn` 或从源代码构建即可。更多信息请参阅 `fyn help`。

一个名为“Fyn”的 `uv` 包管理器的新分支发布,专注于改进并移除遥测数据收集。最初的 `uv` 因在没有明确披露的情况下包含遥测数据而受到批评,尽管一些评论员认为它微不足道且对开发有帮助。 Fyn 解决了用户痛点,例如未限制的缓存大小和原始 `uv` 中缺失的 shell 命令。开发者普遍对这个分支持积极态度,一些人认为这是开发者工具中对隐私需求日益增长的标志。 虽然有些人质疑新环境变量的命名约定(以 `UV_` 为前缀),但另一些人则赞赏它提供的清晰度。Fyn 的采用仍在发展中,但它旨在继续开发,而原始 `uv` 可能会进入维护模式。
相关文章

原文

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

fyn is an independent Python package manager built on uv's foundation, with telemetry removed, new features added, and long-standing bugs fixed. See MANIFESTO.md for the full story.

From PyPI:

# With pip.
pip install fyn
# Or pipx.
pipx install fyn

Or build from source:

cargo install --path crates/fyn

See the command line reference documentation with fyn help.

fyn manages project dependencies and environments, with support for lockfiles, workspaces, and more, similar to rye or poetry:

$ fyn init example
Initialized project `example` at `/home/user/example`

$ cd example

$ fyn add ruff
Creating virtual environment at: .venv
Resolved 2 packages in 170ms
Installed 2 packages in 1ms
 + ruff==0.5.0

$ fyn run ruff check
All checks passed!

$ fyn lock
Resolved 2 packages in 0.33ms

$ fyn sync
Resolved 2 packages in 0.70ms
Checked 1 package in 0.02ms

Define tasks in your pyproject.toml and run them with fyn run:

[tool.fyn.tasks]
test = "pytest -xvs"
lint = "ruff check ."
format = { cmd = "ruff format .", description = "Format code" }
check = { chain = ["lint", "test"], description = "Lint then test" }
$ fyn run test
# runs pytest -xvs

$ fyn run test -- -k mytest
# extra args are passed through

$ fyn run --list-tasks
Available tasks:
  check    Lint then test
  format   Format code
  lint     ruff check .
  test     pytest -xvs

Activate the project's virtual environment in a new shell:

$ fyn shell
success: Activated virtual environment at .venv
Type exit to deactivate.

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

Upgrade all or specific dependencies in one command:

$ fyn upgrade
info: Upgrading all dependencies...
success: Dependencies upgraded successfully.

$ fyn upgrade requests flask
info: Upgrading: requests, flask
success: Dependencies upgraded successfully.

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

fyn manages dependencies and environments for single-file scripts.

Create a new script and add inline metadata declaring its dependencies:

$ echo 'import requests; print(requests.get("https://example.com"))' > example.py

$ fyn add --script example.py requests
Updated `example.py`

Then, run the script in an isolated virtual environment:

$ fyn run example.py
Reading inline script metadata from: example.py
Installed 5 packages in 12ms
<Response [200]>

fyn executes and installs command-line tools provided by Python packages, similar to pipx.

Run a tool in an ephemeral environment using fynx (an alias for fyn tool run):

$ fynx pycowsay 'hello world!'
Resolved 1 package in 167ms
Installed 1 package in 9ms
  """

  ------------
< hello world! >
  ------------
   \   ^__^
    \  (oo)\_______
       (__)\       )\/\
           ||----w |
           ||     ||

Install a tool with fyn tool install:

$ fyn tool install ruff
Resolved 1 package in 6ms
Installed 1 package in 2ms
 + ruff==0.5.0
Installed 1 executable: ruff

$ ruff --version
ruff 0.5.0

fyn installs Python and allows quickly switching between versions.

Install multiple Python versions:

$ fyn python install 3.12 3.13 3.14
Installed 3 versions in 972ms
 + cpython-3.12.12-macos-aarch64-none
 + cpython-3.13.9-macos-aarch64-none
 + cpython-3.14.0-macos-aarch64-none

Use a specific Python version in the current directory:

$ fyn python pin 3.11
Pinned `.python-version` to `3.11`

fyn provides a drop-in replacement for common pip, pip-tools, and virtualenv commands.

Migrate to fyn without changing your existing workflows — and experience a 10-100x speedup — with the fyn pip interface.

Compile requirements into a platform-independent requirements file:

$ fyn pip compile requirements.in \
   --universal \
   --output-file requirements.txt
Resolved 43 packages in 12ms

Create a virtual environment:

$ fyn venv
Using Python 3.12.3
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate

Install the locked requirements:

$ fyn pip sync requirements.txt
Resolved 43 packages in 11ms
Installed 43 packages in 208ms
 + babel==2.15.0
 + certifi==2024.7.4
 ...

Keep your cache from growing unbounded:

export UV_CACHE_MAX_SIZE=2G

Oldest entries are automatically pruned after every command when the cache exceeds the limit. Supports K, M, G, and T suffixes.

Use different lockfiles for different environments:

UV_LOCKFILE=linux.lock fyn lock
UV_LOCKFILE=macos.lock fyn lock

Environment variables work in index URLs — useful for private indexes with credentials:

[[tool.fyn.index]]
name = "private"
url = "https://${PYPI_TOKEN}@pypi.example.com/simple/"

Explicit indexes are also respected for transitive dependencies — you don't have to list every internal package as a direct dependency anymore.

fyn is a drop-in replacement for uv. Same config files, same pyproject.toml settings, same fyn.lock format, same UV_* environment variables. The only change is the binary name.

# before
uv sync
uv run pytest
uvx ruff check .

# after
fyn sync
fyn run pytest
fynx ruff check .

We are passionate about supporting contributors of all levels of experience and would love to see you get involved in the project. See the contributing guide to get started.

What platforms does fyn support?

The same ones as uv: macOS, Linux, and Windows, across x86_64 and aarch64.

Is fyn compatible with uv?

Yes. Same config format, same lockfile, same environment variables. You can switch between them freely on the same project.

What's different from uv?

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

Feature uv fyn
Telemetry (linehaul) Sends OS, Python, CI info None
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
Explicit index for transitive deps Broken Fixed
Env vars in index URLs Only in requirements.txt Everywhere

fyn's dependency resolver uses PubGrub under the hood. We're grateful to the PubGrub maintainers, especially Jacob Finkelman, for their support.

fyn's core is derived from uv by Astral.

fyn's Git implementation is based on Cargo.

Some of fyn's optimizations are inspired by the great work we've seen in pnpm, Orogene, and Bun. We've also learned a lot from Nathaniel J. Smith's Posy and adapted its trampoline for Windows support.

fyn is licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in fyn by you, as defined in the Apache-2.0 license, shall be dually licensed as above, without any additional terms or conditions.

联系我们 contact @ memedata.com