Skip to main content

pip-preserve-requirements

PyPI - Version PyPI - Python Version


Preserve pinned PIP requirements in repositories you control.

It ensure pinned git references in pip requirements files are pushed to a repo you control, and have a tag associated with the commit, so they are preserved from garbage collection.

Table of Contents

Installation

pipx install pip-preserve-requirements

Usage

Usage: pip-preserve-requirements [OPTIONS] REQUIREMENTS_FILE...

  Ensure pinned VCS references in pip requirements files have a git tag.

Arguments:
  REQUIREMENTS_FILE...  The requirements files to look for requirements tag.
                        [required]

Options:
  --tag-prefix TEXT               The prefix to use when creating git tag
                                  names.  [default: ppr-]
  --match-any-tag                 Whether to consider that any tag on the
                                  commit is sufficient. If not, ensure commits
                                  are tagged with the requested prefix.
  -r, --project-root DIRECTORY    The project root directory. Default options
                                  and arguments are read from pyproject.toml
                                  in this directory.  [default: .]
  --install-completion [bash|zsh|fish|powershell|pwsh]
                                  Install completion for the specified shell.
  --show-completion [bash|zsh|fish|powershell|pwsh]
                                  Show completion for the specified shell, to
                                  copy it or customize the installation.
  --help                          Show this message and exit.

Configuration

pip-preserve-requirements is configured in a dedicated section of pyproject.toml:

Example:

[tool.pip-preserve-requirements]
tag_prefix = "ppr-"
# ensure a tag with the above prefix is present, if true, consider any tag is valid
match_any_tag = false

[[tool.pip-preserve-requirements.vcs_vaults]]
# any git provider which accepts URLs of the form https://host/owner/repo
# or ssh://git@host/owner/repo
provider = "github.com"
owner = "acme"
# set to true for private repos
ssh_only = false
# the vault where to push VCS reference
default = true

Limitations

At the moment, only git+https and git+ssh URLs are supported.

The following improvements would be considered in scope, although there is no current plan to work on them:

  • supporting other VCS (such as hg);
  • supporting non-VCS URLs, by pushing them to a user-controlled server;
  • supporting regular requirements, by pushing them to a user-controlled index.

License

pip-preserve-requirements is distributed under the terms of the MIT license.

Release files for pip-preserve-requirements 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pip-preserve-requirements 0.3.0
File Size Uploaded
pip_preserve_requirements-0.3.0.tar.gz 12.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pip-preserve-requirements 0.3.0
File Interpreter ABI Platform
pip_preserve_requirements-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.7 kB

Release files / pip_preserve_requirements-0.3.0.tar.gz

Download URL pip_preserve_requirements-0.3.0.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
76de3022b1abf57fe30fdb575fdf7eb982ef3f6f7b30ff7159b673841266b2c4
BLAKE2b-256 checksum
How to use checksums
8c4d739198a8bf2d5c5294195ef572df2bb9b7574d3dbe34f99143a1fb1d0d1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / pip_preserve_requirements-0.3.0-py3-none-any.whl

Download URL pip_preserve_requirements-0.3.0-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb75c1e831b6c69d2b46de458a50334f877569d6c4ed1029909e798619cfbcff
BLAKE2b-256 checksum
How to use checksums
71a5fbb43dfea3e5e4f5b94c6d70ebd563528de2e841c723f831de99236ad325
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page