Skip to main content

req-pincheck

Reproducible builds die quietly when someone adds requests (no version) or django>=4 to a requirements file. req-pincheck lints requirements*.txt files and fails CI when dependencies aren't pinned to the level you require.

Install

pip install req-pincheck

Usage

req-pincheck requirements.txt                 # every dep must be pinned with == (default)
req-pincheck --level bounded requirements.txt # allow ranges, but require an upper bound (<, <=, ~=, ==)
req-pincheck --level any requirements.txt     # just require *some* version specifier
req-pincheck --ignore pip --ignore setuptools requirements*.txt
req-pincheck --json requirements.txt

Example output:

requirements.txt:3: requests — unpinned (no version specifier)
requirements.txt:5: django>=4.2 — not an exact pin (needs ==)
requirements.txt:9: numpy==1.* — wildcard pin (needs exact version)
3 problem(s) in 1 file(s)

Levels

level passes fails
exact ==1.2.3, ===1.2.3 everything else
bounded ==, ~=, anything with </<= >=1.0, !=1.1, no spec
any any specifier no specifier

What it understands

  • -r other.txt / --requirement includes (followed recursively, relative to the including file) and -c constraint files
  • Environment markers (foo==1.0; python_version < "3.10")
  • Extras (uvicorn[standard]==0.30.0)
  • Line continuations and --hash=... options
  • Comments, blank lines and pip options (--index-url, etc.) are skipped
  • Direct references (pkg @ https://..., git+https://..., local paths, -e) are reported as unversioned-url — use --allow-urls to accept them
  • Add # pincheck: ignore to a line to skip it

Exit codes

code meaning
0 everything pinned
1 at least one problem
2 a file could not be read

Python API

from req_pincheck import check_file

for problem in check_file("requirements.txt", level="bounded"):
    print(problem.path, problem.line, problem.name, problem.reason)

License

MIT

Metadata

Release files for req-pincheck 0.1.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 req-pincheck 0.1.0
File Size Uploaded Provenance Actions
req_pincheck-0.1.0.tar.gz 7.2 kB Without provenance Details for req_pincheck-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for req-pincheck 0.1.0
File Interpreter ABI Platform Actions
req_pincheck-0.1.0-py3-none-any.whl Python 3 none any Details for req_pincheck-0.1.0-py3-none-any.whl

Total release size: 14.2 kB

Release files / req_pincheck-0.1.0.tar.gz

Download URL req_pincheck-0.1.0.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6af724e0f396f3a949e2758ac76402234b352606811451e0a05764493c566731
BLAKE2b-256 checksum
How to use checksums
4da79901378105ada710c3e6d035138963db0602428cf57f8f17d22ff94e7e0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / req_pincheck-0.1.0-py3-none-any.whl

Download URL req_pincheck-0.1.0-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
27244612731f32a485b3f7867985b3fe452bebbd5a232b2029a554465178fb85
BLAKE2b-256 checksum
How to use checksums
fac10d2a7858002119d08209b559f11d2634948854eb7cf3085123c4f78e61c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for req-pincheck 0.1.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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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