Skip to main content

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.

Metadata

Release files for pessimist 0.9.3

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

Source distribution (sdist)

Source distribution for pessimist 0.9.3
File Size Uploaded
pessimist-0.9.3.tar.gz 14.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pessimist 0.9.3
File Interpreter ABI Platform
pessimist-0.9.3-py3-none-any.whl Python 3 none any Details

Total release size: 24.2 kB

Release files / pessimist-0.9.3.tar.gz

Download URL pessimist-0.9.3.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a9c9be7ec8133fd188d73359d12b9346e97e5c675491557f3c7d0ae29888448a
BLAKE2b-256 checksum
How to use checksums
369e50a29c11bcb571c12497a929bf599a5cc264440b584052517652b8beace4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.8.2 requests/2.27.1 setuptools/48.0.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.4

Release files / pessimist-0.9.3-py3-none-any.whl

Download URL pessimist-0.9.3-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd074b0d207a89f4e88a34ea6a4d7f1a6ca685dbe9a91cc3bd90858870357018
BLAKE2b-256 checksum
How to use checksums
8ca4fe644106a9442e16c11e3f37c68fc6600e58657f12c5d90267c3e972e551
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.8.2 requests/2.27.1 setuptools/48.0.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.4

Release history Release notifications | RSS feed

This release

0.9.3 This release

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.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