https://github.com/nnseva/package-version-present
Utility to check presence of the package in the PyPi-like repository
https://github.com/nnseva/package-version-present
pypi pypi-packages simple-api version version-check
Last synced: 10 months ago
JSON representation
Utility to check presence of the package in the PyPi-like repository
- Host: GitHub
- URL: https://github.com/nnseva/package-version-present
- Owner: nnseva
- License: lgpl-3.0
- Created: 2024-01-26T13:08:04.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-06T09:19:39.000Z (almost 2 years ago)
- Last Synced: 2025-02-16T12:03:38.043Z (11 months ago)
- Topics: pypi, pypi-packages, simple-api, version, version-check
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Utility to check presence of the package in the PyPi-like repository
## Installation
*Stable version* from the PyPi package repository
```bash
pip install package-version-present
```
*Last development version* from the GitHub source version control system
```
pip install git+git://github.com/nnseva/package-version-present.git
```
## Using
Additionally to the central PyPi repository at https://pypi.org, you can use
your own custom PyPi-like private repository in your project.
Building CI/CD scripts, it can be necessary to check, whether the
particular package version is present in your PyPi-like repository.
For example, you would like to check, whether the version is present, and
break a pipeline in this case, because the programmer starting a pipeline
should provide a unique version number differ from the existent.
That's exactly a purpose of this script.
Below is the example code in the bitbucket-pipelines.yml. Use these project
environment variables if you would like to use this example in your pipeline:
- PYPI_REPOSITORY_URL - base URL of the custom private repository
- PYPI_USERNAME - username to authenticate yourself in the repository
- PYPI_PASSWORD - password to authenticate yourself in the repository
```yaml
- step:
name: Check the local version presence on the custom pypi repo
image: snakepacker/python:all
script:
- python3.8 -mpip install package-version-present
- package-version-present `python setup.py --name` `python setup.py --version` -R $PYPI_REPOSITORY_URL -U $PYPI_USERNAME -P "$PYPI_PASSWORD" -T -X
```
Notice that the script uses only built-in packages and doesn't need any additional libraries.
The script is self-descriptive, call it without parameters to see the help.
The script uses PyPi simple API, and is adopted to process the both, XML-based, as well as HTML based result.
After installation, run the following command in the command line to see the detailed help:
```bash
package-version-present
```