Skip to main content

Ensures your dependencies work with minimum version

Project description

pessimist

The name "optimist" was already taken?

Given your listed requirements, and how to run your tests, tries various versions to ensure the minimums are accurate.

Usage

python -m pessimist [-c 'make test'] [--fast] [--extend=name[,name...]] [--requirements=requirements*.txt] /path/to/repo
  • -c -- command to run. If you're using a src/ layout you can use cd src; python -m unittest or so.
  • --fast -- only verify min and max versions
  • --extend -- ignore specifiers entirely for the listed canonical names; intended to let you go back past == and may be improved to do something more like that in the future. Also allows * as a name to mean all names that are "variable"
  • --requirements -- comma-separated globs which represented "fixed" requirements.
  • --verbose -- show logs as it's working

Fixed and variable

  • Fixed requirements are from requirements*.txt. If these match more than one version, only the newest is kept.
  • Variable requirements are from your setup.py/setup.cfg/etc that make it into the metadata. These are the ones we're interested in trying.
  • If a name is in both sets, the variable logic is followed.

Strategy

  1. Try newest versions of everything. Bail if this fails to pass.
  2. For each dep independently, try progressively older versions.
  3. Try oldest versions of all. Bail if this fails to pass.

I subscribe to the "requirements.txt should be concrete versions you want to use in CI" school of thought; the constraints in setup.py/setup.cfg/pyproject.toml should be >= the minimum version that works, and < the next major version ("compatible", in poetry terms).

My goal in creating this is to have an automated check that we haven't broken compatibility with an older version unintentionally. You could have a simpler version of this that does sed -e 's/>=/==/ on your requirements files, but if that fails, finding the new minimum is still a research projct that's automated by this one.

License

pessimist is copyright Tim Hatch, and licensed under the MIT license. I am providing code in this repository to you under an open source license. This is my personal repository; the license you receive to my code is from me and not from my employer. See the LICENSE file for details.

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

pessimist-0.9.4b1.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

pessimist-0.9.4b1-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file pessimist-0.9.4b1.tar.gz.

File metadata

  • Download URL: pessimist-0.9.4b1.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for pessimist-0.9.4b1.tar.gz
Algorithm Hash digest
SHA256 d608c12cd39ab4b2ad58e57953c9fa0ffcf28cb57166fad619b57884cad6352f
MD5 1ed3cb8d3fcac85641303850ac842433
BLAKE2b-256 70d664ebb0915edd8225b96b881ed1238530395120b9c9ee0b948d42da109fce

See more details on using hashes here.

File details

Details for the file pessimist-0.9.4b1-py3-none-any.whl.

File metadata

  • Download URL: pessimist-0.9.4b1-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for pessimist-0.9.4b1-py3-none-any.whl
Algorithm Hash digest
SHA256 8f967fd2d79cdff8d3600d2e1b94ac6b5ae658da2e81d5fe6a369abec5df5f4f
MD5 9c781538330fb6447c76d6f8da673b3e
BLAKE2b-256 9c5c2fe8a02323480d5e43705eec1529fcba162afca341d4d71761f1eaaca86f

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