Skip to main content

This package provides a python executable that delivers a path-wide version bump feature. It reads ~/.update-package-version.yml file for root paths from which it should start its recursive package search.

Package versions are updated using these glob patterns by default: - **/Pipfile - **/requirements.txt - requirements/**.txt

Installation

pip install update-package-version

Usage

./upv.py -- --help

# upv.py [CONFIG_FILE_PATH] [CONFIG_FILE_NAME] [CWD]
# upv.py [--config-file-path CONFIG_FILE_PATH] [--config-file-name CONFIG_FILE_NAME] [--cwd CWD]
# You can use update-package-version command
# or upv shortcut
upv find package-name --src 0.0.1
upv find package-name
upv update package-name --src 0.0.1 --trg 1.1.1

# Assumes src == *
upv update package-name --trg 1.1.1

Configuration

######################################
# CONVENIENCE PYTHON PACKAGE ALIASES #
######################################
.RE:
    # matches `sample-package` and `sample-package==0.0.1`
    .package: &include-package '(?P<package>{package})(?P<sign>\=\=|\<\=|\>\=|\<|\>)?(?P<version>[\-\d\.]+)?'

    # matches `sample-package.git@0.0.1`
    .git-package: &include-git-package '(?P<package>{package})\.git@(?P<version>[\-\d\.]+)'

    .EXCLUDE:
        # matches all the lines start with the hash character
        .comment: &no-comment '^\s*#.+'

        # just aliasing `*include-git-package` to make it more readable across the config file
        .git-package: &no-git-package '(?P<package>{package})\.git@(?P<version>[\-\d\.]+)'

########################################
# SOME USEFUL PYTHON PATTERN TEMPLATES #
########################################
.GENERIC-PATTERNS:
    # use these lines along with something like `pattern: '**/requirements.txt'`
    .generic-requirements-package: &generic-requirements-package
        replacer: RegexReplacer
        # AND logic is used here
        include-patterns: []
        # OR logic is used here
        match-patterns:
            - *include-package
        # OR logic is used here
        exclude-patterns:
            - *no-git-package
            - *no-comment

    .git-repo-requirements-package: &git-repo-requirements-package
        replacer: RegexReplacer
        match-patterns:
            - *include-git-package
        exclude-patterns:
            - *no-comment

defaults:
  file-patterns: &default-file-patterns
    # Generic Pipfile parser
    - pattern: '**/Pipfile'
      replacer: PipfileReplacer

    # an utterly broad glob pattern for everything that looks like a python package file,
    # but NOT a .git repo
    - pattern: '**/requirements.txt'
      <<: *generic-requirements-package

    # and this one for .git repo ONLY
    - pattern: '**/requirements.txt'
      <<: *git-repo-requirements-package

    # ... when you love segmentation too much
    - pattern: '**/requirements/*.txt'
      <<: *generic-requirements-package

    - pattern: '**/requirements/*.txt'
      <<: *git-repo-requirements-package

origins:
  - root: '/tmp/sample-project-group'
    file-patterns: *default-file-patterns
    on-update:
      - echo LOL LOL LOL
      - echo COOL COOL COOL

Metadata

Release files for update-package-version 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for update-package-version 0.1.3
File Size Uploaded
update-package-version-0.1.3.tar.gz 15.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for update-package-version 0.1.3
File Interpreter ABI Platform
update_package_version-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 36.5 kB

Release files / update-package-version-0.1.3.tar.gz

Download URL update-package-version-0.1.3.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9748457ca4caf281a502342aba3f2cfc9722c788a424e22e9fbcf1c0a538c9e3
BLAKE2b-256 checksum
How to use checksums
504d3800220c851cba34d9d0b9871d37b909d2eb2073b3f775b17c2d26ec10aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.6

Release files / update_package_version-0.1.3-py3-none-any.whl

Download URL update_package_version-0.1.3-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
17ca7189920c08d6423bac625e8577d6523a71522f7d3093fe7e3874bea235a9
BLAKE2b-256 checksum
How to use checksums
6773fa3ff06bacb79d518ebdf86f9b6b7d2e8f4f36428e08541ba0cb0e877492
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.6

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page