Skip to main content

A flake8 extension that checks for exact pins (e.q.: `foo==1.5.6`) in setup.py

Project description

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: P001 exact pin found in install_requires: "pyramid==1.5.6"

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

flake8-exact-pin-0.0.2.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

flake8_exact_pin-0.0.2-py2-none-any.whl (4.4 kB view details)

Uploaded Python 2

File details

Details for the file flake8-exact-pin-0.0.2.tar.gz.

File metadata

  • Download URL: flake8-exact-pin-0.0.2.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.6

File hashes

Hashes for flake8-exact-pin-0.0.2.tar.gz
Algorithm Hash digest
SHA256 7807780e1113f1066857c9f22a88e36841f7ce509cce9be8d7fb2e16f6dc0254
MD5 5d7e0542a8e4b27d2a2e1b8575345f3b
BLAKE2b-256 441936026e2d93a580ccfbf2b9dca34a8d19c7326932a8c0257eb9f7303447ef

See more details on using hashes here.

File details

Details for the file flake8_exact_pin-0.0.2-py2-none-any.whl.

File metadata

  • Download URL: flake8_exact_pin-0.0.2-py2-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.6

File hashes

Hashes for flake8_exact_pin-0.0.2-py2-none-any.whl
Algorithm Hash digest
SHA256 ae20a80e517bd985d96f30ec5f4ca71aa1fad7c36a59c563b495bd89486b1083
MD5 1307f91c6bd0c6f8fcb0e01d1d71f48e
BLAKE2b-256 baae12733dd625e25684505a5e77e7ad89df71d3ef46d5a77e89b405e5264b85

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page