Pyprojectx: All-inclusive Python Projects
Execute scripts from pyproject.toml, installing tools on-the-fly
Full documentation
Introduction
Pyprojectx makes it easy to create all-inclusive Python projects; no need to install any tools upfront, not even Pyprojectx itself!
Tools that are specified within your pyproject.toml file will be installed on demand when invoked from Pyprojectx:
> ./pw ruff check src
Installed 1 package in 149ms
+ ruff==0.12.7
All checks passed!
Feature highlights
- Reproducible builds by treating tools and utilities as (locked) dev-dependencies
- No global installs, everything is stored inside your project directory (like npm's node_modules)
- Bootstrap your entire build process with a small wrapper script (like Gradle's gradlew wrapper)
- Configure shortcuts for routine tasks
- Simple configuration in pyproject.toml
Projects can be build/tested/used immediately without explicit installation nor initialization:
git clone https://github.com/pyprojectx/px-demo.git
cd px-demo
./pw build
Installation
One of the key features is that there is no need to install anything explicitly (except a Python 3.9+ interpreter).
cd into your project directory and download the
wrapper scripts:
Linux/Mac
curl -LO https://github.com/pyprojectx/pyprojectx/releases/latest/download/wrappers.zip && unzip wrappers.zip && rm -f wrappers.zip
Windows
Invoke-WebRequest https://github.com/pyprojectx/pyprojectx/releases/latest/download/wrappers.zip -OutFile wrappers.zip; Expand-Archive -Path wrappers.zip -DestinationPath .; Remove-Item -Path wrappers.zip
Getting started
Initialize a new or existing project by adding tools (on Windows, replace ./pw with pw):
./pw --add uv,ruff,pre-commit,px-utils
./pw --install-context main
# invoke a tool via the wrapper script
./pw uv --version
./pw ruff check src
# or activate the tool context
source .pyprojectx/main/activate
uv --version
ruff check src
For reproducible builds and developer experience, it is recommended to lock the versions of the tools and add the generated pw.lock file to your repository:
./pw --lock
Create command shortcuts
The tool.pyprojectx.aliases section in pyproject.toml can contain commandline aliases:
[tool.pyprojectx.aliases]
# convenience shortcuts
run = "uv run"
test = "uv run pytest"
lint = ["ruff check"]
check = ["@lint", "@test"]
Usage
Instead of calling the CLI of a tool directly, prefix it with ./pw (pw on Windows).
Examples:
./pw uv add --dev pytest
cd src
../pw lint
Aliases can be invoked as is or with extra arguments:
./pw uv run my-script --foo bar
# same as above, but using the run alias
./pw run my-script --foo bar
Why yet another tool?
- As Python noob I had hard times setting up a project and building existing projects
- There is always someone in the team having issues with his setup, either with a specific tool, with Homebrew, pipx, ...
- Using (uv, PDM or Poetry) dev-dependencies to install tools, impacts your production dependencies and can even lead to dependency conflicts
- Different projects often require different versions of the same tool
Example projects
- This project (using uv)
- px-demo (using uv, PDM or Poetry)
Development
- Build/test:
git clone https://github.com/pyprojectx/pyprojectx.git
cd pyprojectx
./pw build
- Use your local pyprojectx copy in another project: set the path to pyprojectx in the PYPROJECTX_PACKAGE environment variable and create a symlink to the wrapper script.
# Linux, Mac
export PYPROJECTX_PACKAGE=path/to/pyprojectx
ln -s $PYPROJECTX_PACKAGE/src/pyprojectx/wrapper/pw.py pw
# windows
set PYPROJECTX_PACKAGE=path/to/pyprojectx
mklink pw %PYPROJECTX_PACKAGE%\src\pyprojectx\wrapper\pw.py
# or copy the wrapper script if you can't create a symlink on windows
copy %PYPROJECTX_PACKAGE%\src\pyprojectx\wrapper\pw.py pw
Metadata
Release files for pyprojectx 4.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyprojectx-4.0.0.tar.gz | 19.9 kB | Without provenance | Details for pyprojectx-4.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyprojectx-4.0.0-py3-none-any.whl | Python 3 | none | any | Details for pyprojectx-4.0.0-py3-none-any.whl |
Total release size: 44.8 kB
Release files / pyprojectx-4.0.0.tar.gz
| Download URL | pyprojectx-4.0.0.tar.gz |
|---|---|
| Size | 19.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a9ff6e3ac8ebe7cc2b9539e26cd8ec8a04d17c8cd7e8c92b51dc359b65866c7
|
|
BLAKE2b-256 checksum How to use checksums |
0fa02ea55ae6f100cea233119566b51d614ba28eb724139cfc89b54aa6407246
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / pyprojectx-4.0.0-py3-none-any.whl
| Download URL | pyprojectx-4.0.0-py3-none-any.whl |
|---|---|
| Size | 24.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1c9e777c56c25f58dab2a88df196b0db7157498ecbad6bf40715486fce58574d
|
|
BLAKE2b-256 checksum How to use checksums |
13c9f67d2c4b8318008be260fbf12aac3eaaf1066b850860c54d0733fc93142a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for pyprojectx 4.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.