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

Uploaded Python 3

File details

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

File metadata

  • Download URL: validate_pip_version-1.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 f89be9d9fcf361fb166bec488a397e33fb3ba9b909cce8dd6d28aa4049116db2
MD5 b88ee29384f663a816f17be2212b1d70
BLAKE2b-256 d85b009729223ac6d92c3904c7e36c3c59ee5d746f5a8ba028455a83f62fa0f0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: validate_pip_version-1.0.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 027f3eb5387021753f4414f1114202e61b9181f47f62ad3cd41dff9617d3d333
MD5 b705f46e7143dc9b943cb4b9626d5deb
BLAKE2b-256 c7911ed4bf3bb600494a20382037e0aee0763625828ec315375e446e1063c00f

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