Skip to main content

CLI tool to validate the version of a local PIP package against its currently published version. Intended to be used as part of a CI build.

Project description

validate-pip-version

CLI tool to validate the version of a local PIP package against its currently published version. Intended to be used as part of a CI build.

CI CD

Installation

First Install:

pip install validate-pip-version

Upgrading

pip install validate-pip-version --upgrade



GitHub Actions Example

https://github.com/werzl/validate-pip-version/blob/master/.github/workflows/CI.yml

name: CI

env:
  PACKAGE_NAME: <package_name>
  VERSION_FILE_PATH: <path_to__init__.py>

on:
  pull_request:
    branches: [master]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: "3.8"
          architecture: "x64"
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install setuptools wheel twine
      - name: Run Version Checker
        run: |
          pip install ${{ env.PACKAGE_NAME }}
          pip install validate-pip-version
          validate_pip_version check-init-file -n ${{ env.PACKAGE_NAME }} --init_file_path ${{ env.VERSION_FILE_PATH }}
      - name: Build
        run: python setup.py sdist bdist_wheel

image



Usage

validate_pip_version [OPTIONS] COMMAND [ARGS]

check-init-file

Retrieves the local package version from an init.py, by matching the string '__version__'.

validate_pip_version check-init-file -n <package_name> --init_file_path <path_to__init__.py>

Options

Option Required Description
-n, --package_name Required Name of the package on PyPi
--init_file_path Required Relative file path for the __init__.py file
(uses current working dir)
--help Optional Show help message and exit




check-setup-file

Retrieves the local package version from an setup.py file, by matching the string 'version=' and stripping away spaces/newlines.

validate_pip_version check-setup-file -n <package_name> --init_file_path <path_to_setup.py>

Options

Option Required Description
-n, --package_name Required Name of the package on PyPi
--setup_file_path Required Relative file path for the setup.py file
(uses current working dir)
--help Optional Show help message and exit

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

validate_pip_version-1.0.3.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.

validate_pip_version-1.0.3-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file validate_pip_version-1.0.3.tar.gz.

File metadata

  • Download URL: validate_pip_version-1.0.3.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

File hashes

Hashes for validate_pip_version-1.0.3.tar.gz
Algorithm Hash digest
SHA256 8b322aa75ee5c3eb72a9489160f54ac774357a1ed08a1fdcb2d895450a693923
MD5 b73e8c293563225728d69fb8059f8339
BLAKE2b-256 8e4c4accf09f26bb1ab239e9f900a6b4746e39280c9ebd94c58b37207fb9477d

See more details on using hashes here.

File details

Details for the file validate_pip_version-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: validate_pip_version-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

File hashes

Hashes for validate_pip_version-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0999c3887f77d3a36af70d49dad4fc48f4bf7d44f5f8b1e94f307e4c0f6d5bce
MD5 dc580ae22fdc84c52aac1658c0a71c33
BLAKE2b-256 a705b3348f96d19624ccdc3fd83730b26cc2811019e32b9522622d0b46f02899

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