Pin all dependencies in pyproject.toml to their currently installed versions
Project description
pin-versions
A CLI tool and pre-commit hook that pins all unpinned dependencies in pyproject.toml to their currently installed versions.
Installation
pip install pin-versions
Or with uv:
uv add pin-versions
Usage
Run in a project directory with a pyproject.toml and a virtual environment:
pin-versions
This pins dependencies in [project].dependencies, [project.optional-dependencies], and [dependency-groups].
Options
| Flag | Description |
|---|---|
--operator, -o |
Version pin operator (default: ==). Supports >=, ~=, etc. |
--pyproject, -p |
Path to pyproject.toml (default: ./pyproject.toml) |
--venv |
Path to the virtual environment (default: .venv) |
--pin-latest |
Pin uninstalled packages to their latest version on PyPI |
--dry-run |
Preview changes without modifying the file |
Pre-commit hook
Add to your .pre-commit-config.yaml:
repos:
- repo: https://github.com/kjaymiller/pin-versions
rev: v0.1.0
hooks:
- id: pin-versions
Contributing
- Fork the repo and clone it locally.
- Create a virtual environment and install the project in editable mode:
uv venv && uv pip install -e ".[dev]"
- Create a branch for your changes:
git checkout -b my-feature
- Make your changes and ensure they work by running:
pin-versions --dry-run - Open a pull request against
main.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pin_versions-0.0.0.tar.gz.
File metadata
- Download URL: pin_versions-0.0.0.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18303f43f320015bd10582bf0bf3ac3e4bde7a04cb91f346ff1ae7c8aa85167e
|
|
| MD5 |
0a922145269666d65528f0166601e7ff
|
|
| BLAKE2b-256 |
5290a47d2aa98a3f5166bfd5ea166ac07e832fc16e6f6fd6056ac2a2b80d47ab
|
Provenance
The following attestation bundles were made for pin_versions-0.0.0.tar.gz:
Publisher:
publish.yml on kjaymiller/pin-versions
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pin_versions-0.0.0.tar.gz -
Subject digest:
18303f43f320015bd10582bf0bf3ac3e4bde7a04cb91f346ff1ae7c8aa85167e - Sigstore transparency entry: 1154785823
- Sigstore integration time:
-
Permalink:
kjaymiller/pin-versions@213441caa60651491608fc7f6bb4236dc5ba0a79 -
Branch / Tag:
refs/tags/2026.3.0 - Owner: https://github.com/kjaymiller
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@213441caa60651491608fc7f6bb4236dc5ba0a79 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pin_versions-0.0.0-py3-none-any.whl.
File metadata
- Download URL: pin_versions-0.0.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5195e8a829ae07401f7966c66ed2c203c581ecb5a24770c94dc0944695014a42
|
|
| MD5 |
dbdabab955c008bcf66ef6abf207e116
|
|
| BLAKE2b-256 |
de738aae4e20100fdc9b340b097d477e30df0a32c39e3a7c87ce0d652ba4e35b
|
Provenance
The following attestation bundles were made for pin_versions-0.0.0-py3-none-any.whl:
Publisher:
publish.yml on kjaymiller/pin-versions
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pin_versions-0.0.0-py3-none-any.whl -
Subject digest:
5195e8a829ae07401f7966c66ed2c203c581ecb5a24770c94dc0944695014a42 - Sigstore transparency entry: 1154785829
- Sigstore integration time:
-
Permalink:
kjaymiller/pin-versions@213441caa60651491608fc7f6bb4236dc5ba0a79 -
Branch / Tag:
refs/tags/2026.3.0 - Owner: https://github.com/kjaymiller
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@213441caa60651491608fc7f6bb4236dc5ba0a79 -
Trigger Event:
release
-
Statement type: