And Now for Something Completely Different!
scd (something competely different) is a small tool with one intention: make your version bumping underoverengineered. It takes slightly different approach than bumpversion: it does not make commits or tags and do not updates version by command. It takes configuration file and adjust your version regarding this file.
It may seems a little bit complex, but it works really-really well if you have a complex setup, where you need to manage versions not only in literal format, but in different, complex ways in absolutely different files. Also, it can eliminate a huge amount of copypasting in your .bumpversion.cfg. Also, it works with regular expressions therefore it can eliminate design restrictions of bumpversion.
Please check official documentation for details. This README file is just a whirlwind tour.
Installation
As any Python package, you can install scd with pip or sources.
pip install scd[yaml,colors]
or
git clone https://github.com/9seconds/scd
cd scd
python setup.py install
Configuration
Here is an example how can configuration file may looks like:
version:
number: 1.0.1
scheme: semver
search_patterns:
full: "{{ semver }}"
vfull: "v{{ semver }}"
major_minor_block: "\\d+\\.\\d+(?=\\s\\#\\sBUMPVERSION)"
replacement_patterns:
full: "{{ full }}"
major_minor: "{{ major }}.{{ minor }}"
major_minor_p: "{{ major }}.{{ minor }}{% if patch %}.{{ patch }}{% endif %}"
defaults:
search: full
replace: full
files:
setup.py:
- search_raw: "(?>=version\\s=\\s\\\"){{ full }}"
docs/conf.py:
- default
- search: vfull
replace: major_minor_p
- search: major_minor_block
replace_raw: "{{ next_major }}"
Yes, YAML! But you can use JSON or TOML also.
Mustaches are Jinja2 templates (like in Ansible, for example). Also, as you can see, it is possible to have a list of replacements per file.
And yes, versioning is done by schemes.
You can find a thorough explanations in docs.
Usage
Well, you would not belive, but
scd
or more verbose
scd -v
>>> Use /home/sergey/dev/pvt/scd/.scd.yaml as config file
>>> Parsed config as YAML
>>> Version is 0.1.0.dev34+342f2c2
>>> Start to process /home/sergey/dev/pvt/scd/setup.py
>>> Modify 'version="0.0.1",' to 'version="0.1.0.dev34+342f2c2",'
>>> Start to process /home/sergey/dev/pvt/scd/docs/source/conf.py
>>> Modify "version = '1.0'" to "0.1'"
>>> Modify "release = '1.0.0b1'" to "0.1.0'"
>>> Start to process /home/sergey/dev/pvt/scd/scd/__init__.py
>>> Modify '__version__ = "0.1.0"' to '0.1.0.dev34"'
Why scd?
Because every version releases look the same.
Metadata
Release files for scd 1.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| scd-1.2.3.tar.gz | 19.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scd-1.2.3-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 43.3 kB
Release files / scd-1.2.3.tar.gz
| Download URL | scd-1.2.3.tar.gz |
|---|---|
| Size | 19.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe1e53bbf6105aa93f41a2883601513ae701e721d7bcd15c2e7c692c54266d4a
|
|
BLAKE2b-256 checksum How to use checksums |
5706ffda92466710d72413cb82b161bf4c69109b7083a58fbe018e57e3aa5de1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / scd-1.2.3-py2.py3-none-any.whl
| Download URL | scd-1.2.3-py2.py3-none-any.whl |
|---|---|
| Size | 23.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
19b4d09cc5a7f1bdd41bbf9bb812cbc7470e64089408fcc65f8589066516e324
|
|
BLAKE2b-256 checksum How to use checksums |
731cd1ddc7321ac7fc8b5995255c7e4f98bb78521054bfd9ad1fd2c75968ef01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for scd 1.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.