Skip to main content

Find newer package versions on PyPI

Project description

Introduction

Find newer versions of your installed Python packages, or newer versions of packages in a buildout file.

This package provides a console script named checkversions.

https://github.com/zopefoundation/z3c.checkversions/actions/workflows/tests.yml/badge.svg

Install

you can install this package either in a virtualenv:

$ virtualenv sandbox
$ sandbox/bin/pip install z3c.checkversions
$ sandbox/bin/checkversions --help

or in your system:

$ sudo pip install z3c.checkversions
$ checkversions --help

or in a buildout:

[buildout]
parts = checkversions

[checkversions]
recipe=zc.recipe.egg
eggs=z3c.checkversions [buildout]

Note that buildout support is optional and must be enabled with [buildout] so that zc.buildout is installed as well.

If you need buildout support while installing this package via pip you have to install it like this:

pip install z3c.checkversions[buildout]

Usage

$ checkversions -h
Usage: checkversions [-v] [-1] [-l LEVEL] [-i INDEX] [-b BLACKLIST] [buildout_file]

This script will check new package versions of either your current installed
distributions or a buildout file if provided. It can detect major or minor
versions availability: level 0 gets the highest version (X.y.z), level 1 gets
the highest intermediate version (x.Y.z), level 2 gets the highest minor
version (x.y.Z).  Using level 2, you can automatically retrieve all bugfix
versions of a buildout.  If you provide a blacklist file with bad versions,
these versions won't be suggested.

Options:
  -h, --help            show this help message and exit
  -l LEVEL, --level=LEVEL
                        Version level to check
  -i INDEX, --index=INDEX
                        Provide and alternative package index URL
  -b BLACKLIST, --blacklist=BLACKLIST
                        Provide a blacklist file with bad versions
  -1, --incremental     Suggest only one upgrade. Skip others.
  -v, --verbose         Verbose mode (prints old versions too)

Examples

For installed packages

Example with a virtualenv:

$ virtualenv --no-site-packages sandbox
$ sandbox/bin/pip install z3c.checkversions
$ sandbox/bin/checkversions -v -l 1
# Checking your installed distributions
pip=0.7.1 # was: 0.6.3

For a buildout

It can work either with a full buildout.cfg or with a simple versions.cfg file.

Here is a sample versions.cfg file:

[versions]
somepackage=0.5.3
otherpackage=0.1.1

You can generate a new versions.cfg

$ checkversions -v -l 1 versions.cfg
# Checking buildout file versions.cfg
somepackage=0.6.2 # was: 0.5.0
otherpackage=0.1.2 # was: 0.1.1

If you provide a blacklist file, such as blacklist.cfg containing bad versions, such as:

somepackage=0.6.2
somepackage=0.6.1

Then these versions won’t be suggested:

$ checkversions -v -l 1 versions.cfg -b blacklist.cfg
# Checking buildout file versions.cfg
somepackage=0.6.0 # was: 0.5.0
otherpackage=0.1.2 # was: 0.1.1

If you enable the –incremental option, only one upgrade will be suggested:

$ checkversions --incremental -v -l 1 versions.cfg
# Checking buildout file versions.cfg
somepackage=0.6.0 # was: 0.5.0
otherpackage=0.1.1

Run tests

Uncompress the archive, then run:

$ virtualenv .
$ bin/pip install tox
$ tox

Changelog

3.0 (2025-04-14)

  • Replace pkg_resources namespace with PEP 420 native namespace.

2.2 (2025-04-09)

  • Add support for Python 3.12, 3.13.

  • Drop support for Python 3.7, 3.8.

2.1 (2023-02-06)

  • Fix parsing of versions that are really requirements specifications. (#24)

2.0 (2023-02-14)

  • Add support for Python 3.10, 3.11.

  • Drop support for Python 2.7, 3.5, 3.6.

  • Pin setuptools < 66 as newer versions are no longer compatible.

1.2 (2020-04-13)

  • Add support for Python 3.8, drop support for Python 3.4.

  • Improve error message in case zc.buildout is not installed.

  • Improve installation instruction.

  • Pass the index url to both the ‘installed’ and ‘buildout’ checkers.

1.1 (2018-11-03)

  • Add support for Python 3.7.

  • Drop support for python setup.py test.

1.0 (2018-05-23)

  • Fix compatibility with setuptools 39 by using an API introduced in setuptools 8. (GH #8)

  • Add support for Python 3.5, 3.6 and PyPy3.

  • Drop support for Python 2.6 and 3.3.

  • Standardize namespace __init__.

0.5 (2014-09-15)

  • Python 3 support by Nicolas Dietrich (GH #2, GH #4)

0.4.2 (2013-10-02)

  • ignore installed packages while searching for new versions, only look in the package index (makes the test suite more reliable, among other things).

  • fix IndexError: list index out of range when buildout.cfg had a package with a blank version pin.

  • show updates for non-final package versions, if there’s a newer non-final version available on PyPI (GH #1)

0.4.1 (2010-08-25)

  • fixed edge case bug where 1.0 was never updated to 1.0.x

  • warn buildout users about the extra requirement

0.4 (2010-07-26)

  • added a blacklist option for passing versions to avoid (possibly coming from a buildbot)

  • added a incremental option to suggest only one upgrade

  • remove a temporary file during tests

0.3 (2010-07-09)

  • don’t accumulate old comments

  • prefer final versions

0.2 (2010-05-22)

  • added a verbose option to print old versions as well

  • updated metadata, doc and license

0.1 (2010-05-16)

  • Initial release

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

z3c_checkversions-3.0.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

z3c_checkversions-3.0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file z3c_checkversions-3.0.tar.gz.

File metadata

  • Download URL: z3c_checkversions-3.0.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for z3c_checkversions-3.0.tar.gz
Algorithm Hash digest
SHA256 54c19296872011d741ad44f40388a1b4276149b8ab5987bd166434432386384b
MD5 92ae5f4eda3dd8c1e77cf173948507c2
BLAKE2b-256 d99732d7ce78ec92cdd46db433433eb7c77a2f6815cee034e0f93ec4ded9cb2c

See more details on using hashes here.

File details

Details for the file z3c_checkversions-3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for z3c_checkversions-3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 060df4573564e0195fc2a523b8cb5c9c23b102263d0fcfcb2343d9768361d8cc
MD5 bf97eb5671d9aba50aeb482dc473960d
BLAKE2b-256 338a880d2694b43fba3a05986e1647ee087bd28ce753c5085f0f1068993ae3ec

See more details on using hashes here.

Supported by

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