A plugin for PDM providing the ability to modify the version according to PEP440
Project description
pdm-bump
A small PEP440 compliant bump utility for the Python development master
Why ?
As of PEP621, the pyproject.toml supports project metadata including a project version. If you are using the PDM build backend (according to PEP517), you can also use a file provider that contains your version, which is often referred to as dynamic
versions.
The project version itself must comply to PEP440, which tells us, that it must consist of
- an optional epoch
- a mandatory major version part
- a mandatory minor version part
- a mandatory micro version part
- an optional pre-release part supporting alpha, beta or release-candidate part.
Tools like bumpversion or bump2version use their own configuration an their own configuration and might not consider the PEP440 specifications.
Installation
You can install it using either pip (pip install [--user] pdm-bump
) or using the pdm cli (pdm plugin add [--pip-args=--user] pdm-bump
).
Usage
You can use it the following way:
$ grep version= pyproject.toml
version=0.1.0
$ pdm bump pre-release --pre alpha # creates 0.1.1a1
$ pdm bump pre-release --pre beta # creates 0.1.1.b1
$ pdm bump pre-release --pre release-candidate # creates 0.1.1rc1
$ pdm bump no-pre-release # creates 0.1.1
$ pdm bump micro # creates 0.1.2
$ pdm bump minor # creates 0.2.0
$ pdm bump major # creates 1.0.0
VCS based actions
NOTE: Currently, only git
is supported as VCS provider.
You can create tags based on your pyproject.toml
version (or dynamic version) using the following command.
$ pdm bump tag # Creates a git tag with a leading v
Contributing
Feel free to submit issues and pull requests. Contributions are welcome.
Pre-checks
- Tests: To run the tests for your current checks, run
pdm run pytest
. - Tox: If you are using
pyenv
you can usepdm run tox
to run the tests for all supported python versions. - Code-Style: You can use
pdm check-style
to check code format. - Format: You can use
pdm format
to format your code. - Commit messages: You can run
pdm check-commits
to rungitlint
across your commit messages.
Before opening a Pull Request, make sure, that the quality gates should succeed.
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
Hashes for pdm_bump-0.6.7.post1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 145c48337f5ec20082d2b4bcfabd41415253ebd3730d4e3d12639e31bc4b2b60 |
|
MD5 | a69a339596a494ff5b38dd625cbc4ab7 |
|
BLAKE2b-256 | de1bd07e199a46763760f3ae39ed96a3d33eefcadf05a66eac65c5acfd193dd0 |