![]() Add a script to compare with pip-tools and pydantic input we can compare with it. Below is the output for `pydantic.in`, created from pydantic's pyproject.toml, which i added for that purpose: ```console $ scripts/compare_with_pip.sh scripts/benchmarks/requirements/pydantic.in Finished dev [unoptimized + debuginfo] target(s) in 0.08s Running `target/debug/puffin pip-compile scripts/benchmarks/requirements/pydantic.in` Resolved 85 packages in 1.61s real 0m1,733s user 0m1,714s sys 0m0,048s real 0m10,843s user 0m4,811s sys 0m0,399s --- /tmp/tmp.Y3FzvQ2xxo/pip-compile.txt 2023-11-06 15:47:29.221834123 +0100 +++ /tmp/tmp.Y3FzvQ2xxo/puffin.txt 2023-11-06 15:47:18.377408860 +0100 @@ -31,7 +31,7 @@ mdurl==0.1.2 memray==1.10.0 mergedeep==1.3.4 -mike @ git+https://github.com/jimporter/mike.git +mike @ git+https://github.com/jimporter/mike.git@076a4af3270a448f6aeb880c9c6c2fc0d80f603f mkdocs==1.5.3 mkdocs-autorefs==0.5.0 mkdocs-embed-external-markdown==3.0.1 @@ -52,7 +52,7 @@ py-cpuinfo==9.0.0 pydantic==2.4.2 pydantic-core==2.10.1 -pydantic-extra-types @ git+https://github.com/pydantic/pydantic-extra-types.git@main +pydantic-extra-types @ git+https://github.com/pydantic/pydantic-extra-types.git@a973b7942112df731e2618336e55e3343a2e1c32 pydantic-settings==2.0.3 pyflakes==3.1.0 pygments==2.16.1 @@ -61,7 +61,7 @@ pytest==7.4.3 pytest-benchmark==4.0.0 pytest-examples==0.0.10 -pytest-memray==1.5.0 ; platform_system != "Windows" +pytest-memray==1.5.0 pytest-mock==3.12.0 pytest-pretty==1.2.0 python-dateutil==2.8.2 ``` |
||
---|---|---|
.cargo | ||
.github/workflows | ||
crates | ||
scripts | ||
vendor/pubgrub | ||
workers/pypi-metadata | ||
.dockerignore | ||
.gitignore | ||
builder.dockerfile | ||
Cargo.lock | ||
Cargo.toml | ||
CONTRIBUTING.md | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
README.md | ||
ruff.toml | ||
rust-toolchain.toml |
puffin
An experimental Python packaging tool.
Motivation
Puffin is an extremely fast (experimental) Python package resolver and installer, intended to
replace pip
and pip-tools
(pip-compile
and pip-sync
).
Puffin itself is not a complete "package manager", but rather a tool for locking dependencies
(similar to pip-compile
) and installing them (similar to pip-sync
). Puffin can be used to
generate a set of locked dependencies from a requirements.txt
file, and then install those
locked dependencies into a virtual environment.
Puffin represents an intermediary goal in our pursuit of building a "Cargo for Python": a Python
package manager that is extremely fast, reliable, and easy to use -- capable of replacing not only
pip
, but also pipx
, pip-tools
, virtualenv
, tox
, setuptools
, and even pyenv
, by way of
managing the Python installation itself.
Puffin's limited scope allows us to solve many of the low-level problems that are required to
build such a package manager (like package installation) while shipping an immediately useful tool
with a minimal barrier to adoption. Try it today in lieu of pip
and pip-tools
.
Features
- Extremely fast dependency resolution and installation: install dependencies in sub-second time.
- Disk-space efficient: Puffin uses a global cache to deduplicate dependencies, and uses Copy-on-Write on supported filesystems to reduce disk usage.
Limitations
Puffin does not yet support:
- Source distributions
- VCS dependencies
- URL dependencies
- Windows
- ...
Like pip-compile
, Puffin generates a platform-specific requirements.txt
file (unlike, e.g.,
poetry
, which generates a platform-agnostic poetry.lock
file). As such, Puffin's
requirements.txt
files are not portable across platforms and Python versions.
Usage
To resolve a requirements.in
file:
cargo run -p puffin-cli -- pip-compile requirements.in
To install from a resolved requirements.txt
file:
cargo run -p puffin-cli -- pip-sync requirements.txt
For more, see cargo run -p puffin-cli -- --help
:
Usage: puffin-cli <COMMAND>
Commands:
compile Compile a `requirements.in` file to a `requirements.txt` file
sync Sync dependencies from a `requirements.txt` file
clean Clear the cache
freeze Enumerate the installed packages in the current environment
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
License
Puffin is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Puffin by you, as defined in the Apache-2.0 license, shall be dually licensed as above, without any additional terms or conditions.