Incremental is a small library that versions your Python projects.
API documentation can be found here.
Add this to your setup.py’s setup() call, removing any other versioning arguments:
setup( use_incremental=True, setup_requires=['incremental'], install_requires=['incremental'], # along with any other install dependencies ... }
Then run python -m incremental.update <projectname> --create (you will need click installed from PyPI). It will create a file in your package named _version.py and look like this:
from incremental import Version __version__ = Version("widgetbox", 17, 1, 0) __all__ = ["__version__"]
Then, so users of your project can find your version, in your root package’s __init__.py add:
from ._version import __version__
Subsequent installations of your project will then use Incremental for versioning.
incremental.Version is a class that represents a version of a given project. It is made up of the following elements (which are given during instantiation):
You can extract a PEP-440 compatible version string by using the following methods:
Calling repr() with a Version will give a Python-source-code representation of it, and calling str() with a Version will provide a string similar to '[Incremental, version 16.10.1]'.
Incremental includes a tool to automate updating your Incremental-using project’s version called incremental.update. It updates the _version.py file and automatically updates some uses of Incremental versions from an indeterminate version to the current one. It requires click from PyPI.
python -m incremental.update <projectname> will perform updates on that package. The commands that can be given after that will determine what the next version is.
If you give no arguments, it will strip the release candidate number, making it a “full release”.
Incremental supports “indeterminate” versions, as a stand-in for the next “full” version. This can be used when the version which will be displayed to the end-user is unknown (for example “introduced in” or “deprecated in”). Incremental supports the following indeterminate versions:
When you run python -m incremental.update <projectname> --rc, these will be updated to real versions (assuming the target final version is 17.1.0):
Once the final version is made, it will become:
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|File Name & Checksum SHA256 Checksum Help||Version||File Type||Upload Date|
|incremental-17.5.0-py2.py3-none-any.whl (16.7 kB) Copy SHA256 Checksum SHA256||py2.py3||Wheel||May 23, 2017|
|incremental-17.5.0.tar.gz (15.5 kB) Copy SHA256 Checksum SHA256||–||Source||May 23, 2017|