Skip to main content

Check version of a Python module

Project description

cv

PyPI Build Status Test Coverage Supported Python

Check version of a Python module.

Queries PyPI and looks for the <module>.__version__ among all available versions. Raises an error if the version already exists.

Comes useful during CI PR checks.

Installation

Available from PyPI:

pip install cv

Module Example

With a "module" present on PyPI and module.py in current directory:

__version__ = '7.7.7'

...

Simply run:

cv module

If 7.7.7 version of module is on PyPI already you’ll get a VersionExists error:

Traceback (most recent call last):
  File "./cv", line 86, in <module>
    main(sys.argv[1:])
  File "./cv", line 82, in main
    check_unique(name, version)
  File "./cv", line 28, in check_unique
    raise VersionExists(name, version)
__main__.VersionExists: Package "module" with version "7.7.7" already exists on PyPI. Change the "module.__version__" to fix this error.

Package Example

Packages work in the same way as modules except __version__ is defined in module/__init__.py

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

cv-1.0.0.dev6.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

cv-1.0.0.dev6-py3-none-any.whl (5.5 kB view hashes)

Uploaded Python 3

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