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.4.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.4-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: validate_pip_version-1.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 9fdadc61c321bac869b3c7807685a391fb157a98753cfb21d6d7b3f11ca7f377
MD5 e35b413213c575a2f2f91dd346984b38
BLAKE2b-256 4af67030e345518c0e0e46f6fb03fc753b89122938760a5a2b307068f5845a9c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: validate_pip_version-1.0.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e2f5c2c13abed6608e8b7d3ceac1388e1b42b8b31ef0a9fb948cc9de75e446b2
MD5 943e64ad065fb37a21885555cbe43d58
BLAKE2b-256 01cdebddd76f32038d9a522c4270f2a4776eb84f849cb4771971c738f0013c5f

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