A python executable that delivers a path-wide version bump feature
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for update-package-version-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9748457ca4caf281a502342aba3f2cfc9722c788a424e22e9fbcf1c0a538c9e3 |
|
MD5 | 4da8e25b755889db877942be846059d3 |
|
BLAKE2b-256 | 504d3800220c851cba34d9d0b9871d37b909d2eb2073b3f775b17c2d26ec10aa |
Close
Hashes for update_package_version-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17ca7189920c08d6423bac625e8577d6523a71522f7d3093fe7e3874bea235a9 |
|
MD5 | 0452621efa75840e285f3c30f2fab46a |
|
BLAKE2b-256 | 6773fa3ff06bacb79d518ebdf86f9b6b7d2e8f4f36428e08541ba0cb0e877492 |