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 details)

Uploaded Source

Built Distribution

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

getversions-0.1.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file getversions-0.1.0.tar.gz.

File metadata

  • Download URL: getversions-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for getversions-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d6b0f19bec11982b11a2968902dd7718131c59ff4044e45aacba7b32e8f67a73
MD5 8bd2fdc7fb6dc1d46dbbab6403a90744
BLAKE2b-256 ee7951ffde82f6466d6263b0e544adff1acb2365c295dc8078f82c4c8b80b602

See more details on using hashes here.

File details

Details for the file getversions-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: getversions-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for getversions-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8ad532e0decb9a95aa100700b7fdbeb2cc05c1cc0f1d11b8500983a196ff97c
MD5 750731761079ca2cb24e2c8307383836
BLAKE2b-256 8c21925982627fe6dcaa69c3a41fad9af1f69717b97d8ec7bab9fbd2357c49e9

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