Code Monkey home page Code Monkey logo

package-version-present's Introduction

Utility to check presence of the package in the PyPi-like repository

Installation

Stable version from the PyPi package repository

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
      - 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:

package-version-present

package-version-present's People

Contributors

nnseva avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.