Skip to main content

flake8-exact-pin

Check for exact pins (==) of package requirements in install_requires in setup.py.

For example:

setup(
    # ...
    install_requires=['pyramid==1.5.6'],
    # ...
)

Exact pins are often a bad idea, as they:

  • Limit flexibility if your package is going to be reused; i.e.: used as a library by other Python libraries or applications. You are forcing them to use a particular version that they may not want to use or that conflicts with what they already use. Not so much of an issue if your package is an application rather than a library; however, often requirements.txt is a better place to manage application requirements that you are pinning (see https://caremad.io/blog/setup-vs-requirement/)

  • Bake a very strict requirement into your package; you may have to rebuild your package just to use a new version of a package with a bug fix.

  • Create the potential for hard-to-resolve version conflicts, if you exact pin some package versions and don’t exact pin others. Some of your other packages may require a different version than the one you’re pinning and it might be impossible for pip to resolve this.

Installation

If you don’t already have it, install flake8:

$ pip install flake8

Then, install the extension:

$ pip install flake8-exact-pins

Usage

Run the following to verify that the plugin has been installed correctly:

$ flake8 --version
2.4.1 (pep8: 1.5.7, flake8-exact-pin: 0.0.0, pyflakes: 0.8.1, mccabe: 0.3) CPython 2.7.9 on Darwin

Now, when you run flake8, the plugin will automatically be used.

When an exact pin is found, flake8 will output something like:

./setup.py:28:37: PIN001 exact pin found in install_requires: "pyramid==1.5.6"

Metadata

Release files for flake8-exact-pin 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 flake8-exact-pin 0.1.0
File Size Uploaded Provenance Actions
flake8-exact-pin-0.1.0.tar.gz 4.0 kB Without provenance Details for flake8-exact-pin-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flake8-exact-pin 0.1.0
File Interpreter ABI Platform Actions
flake8_exact_pin-0.1.0-py3-none-any.whl Python 3 none any Details for flake8_exact_pin-0.1.0-py3-none-any.whl

Total release size: 8.4 kB

Release files / flake8-exact-pin-0.1.0.tar.gz

Download URL flake8-exact-pin-0.1.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e8010174364653b2ecf6d7960b1663fcdd28ef16ec6fc8921b06dc53daa6e5bf
BLAKE2b-256 checksum
How to use checksums
be6564af212080d81b49fba3c3f6c8579927b42a95a608e577221760e7ad261e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.5

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

Download URL flake8_exact_pin-0.1.0-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d876fc6aa69c14c7ffb86b743d64d7d4b503b421bb16c65cca187f2d54bf04fa
BLAKE2b-256 checksum
How to use checksums
94806aa60e374aa8ece274362ada8cc255110dedb762e10544a63caf7f7a4f65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.5

Security for flake8-exact-pin 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.

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