Skip to main content

Get available versions of a package in the repository, and the installed version.

Project description

Get the versions of a package available in the repository via pip, and the installed version for the current interpreter.

You could use getversions in a deploy shell script to deploy the installed version of a package if it is not already available in the repository.

version=$(pygetversions -ie mypkg) \
&& echo deploying mypkg ${version} \
|| echo mypkg ${version} already in repo, not deploying

Installation

pip install getversions

Usage

There are a few ways to invoke the main function from the command line. You can use the console script installed with the package, run the package with Python, or run the main module with Python. In each case, pass arguments on the command line.

Check Installed Version Available in Repository

Pass the -e or --exists-in-repo option to produce an exit code of 0 if the installed version is not available in the repository, in which case you might want to upload the installed version to the repository.

pygetversions -e black

would produce output similar to

*22.10.0
22.8.0
22.6.0
22.3.0
22.1.0

and an exit code of 1 if black 22.10.0 is installed and available in the repository.

pygetversions -e getversions

may produce output similar to

0.0.2
0.0.1
+0.0.3

and an exit code of 0 if getversions 0.0.3 is installed, but not available in the repository.

You could print just the installed version:

pygetversions -ie getversions

which would produce output similar to

0.0.3

and an exit code of 0 if getversions 0.0.3 is installed, but not available in the repository.

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

getversions-0.1.0.tar.gz (7.5 kB view hashes)

Uploaded Source

Built Distribution

getversions-0.1.0-py3-none-any.whl (7.6 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