Skip to main content

Something Completely different

Project description

PyPI Build Status Code Coverage

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.

John Cleese on Something Completely Different

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

scd-1.2.0.tar.gz (19.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scd-1.2.0-py2.py3-none-any.whl (23.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file scd-1.2.0.tar.gz.

File metadata

  • Download URL: scd-1.2.0.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for scd-1.2.0.tar.gz
Algorithm Hash digest
SHA256 3771a9024b449c0a77299a70b994d68f7e1830604a3d5d250ad10ae2ddf32110
MD5 69a9b40a9fee599c27ba762b4381c02b
BLAKE2b-256 367197595143f042fdcd6726fbae1453fc14558063fbb8fdc2d6d74e33a56aee

See more details on using hashes here.

File details

Details for the file scd-1.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for scd-1.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2b32772418e72338b02e8e3978f0e20bf6f7101a797a212522ff4025becccc74
MD5 ec5bf5f7c7fd41e6e80a14be43140d74
BLAKE2b-256 7b48e7123aa96d7234b290a9481b98e76186953788cecaefeb7b3f505542c49b

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