Skip to main content

The definitive tools to manage VERSION and change file

Project description

cndversion

The definitive tools to manage VERSION and CHANGES files (based on semver)

Installation

pip install cndversion

Usage

Help accessible from here

cndversion --help

Setup a new project in a folder

cndversion -f mylib

if will create

project
│   VERSION
│   CHANGES  
└───mylib
│   │   __init__.py
│   │   __version__.py
│   │   VERSION 

Bump to major version

cndversion -M

it will increase the major version in mylib/VERSION file and add commit message to CHANGES

Bump to minor version

cndversion -m

it will increase the minor version in mylib/VERSION file and add commit message to CHANGES

Bump to patch version

cndversion -p

it will increase the patch version in mylib/VERSION file and add commit message to CHANGES

What in each file ?

VERSION

This file content is the path for the "real" VERSION file (use for compatibilities with somes old tools)

>>>> cat VERSION
mylib/VERSION

CHANGES

This file is just empty

>>>> cat CHANGE

mylib/init.py

Simply include in the beginning of the file the version file

>>>> cat mylib/__init__.py
from .__version__ import (__version__)  # noqa: F401

mylib/version.py

Allow you to include VERSION into the package (usefull for lib)

>>>> cat mylib/__version__.py
import pkg_resources


path = pkg_resources.resource_filename('mylib', 'VERSION')
__version__ = open(path).read()

mylib/VERSION

This file is the real version number

>>>> cat mylib/VERSION
0.1.1

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

cndversion-2.0.0.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

cndversion-2.0.0-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page