• Stars
    star
    133
  • Rank 272,600 (Top 6 %)
  • Language
    Python
  • License
    Other
  • Created almost 9 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A library for versioning your Python projects.

Incremental

gha pypi coverage

Incremental is a small library that versions your Python projects.

API documentation can be found here.

Quick Start

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
    ...
}

Install Incremental to your local environment with pip install incremental[scripts]. Then run python -m incremental.update <projectname> --create. 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 Versions

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):

  • package (required), the name of the package this Version represents.
  • major, minor, micro (all required), the X.Y.Z of your project's Version.
  • release_candidate (optional), set to 0 or higher to mark this Version being of a release candidate (also sometimes called a "prerelease").
  • post (optional), set to 0 or higher to mark this Version as a postrelease.
  • dev (optional), set to 0 or higher to mark this Version as a development release.

You can extract a PEP-440 compatible version string by using the .public() method, which returns a str containing the full version. This is the version you should provide to users, or publicly use. An example output would be "13.2.0", "17.1.2dev1", or "18.8.0rc2".

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]'.

Updating

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.

  • --newversion=<version>, to set the project version to a fully-specified version (like 1.2.3, or 17.1.0dev1).
  • --rc, to set the project version to <year-2000>.<month>.0rc1 if the current version is not a release candidate, or bump the release candidate number by 1 if it is.
  • --dev, to set the project development release number to 0 if it is not a development release, or bump the development release number by 1 if it is.
  • --patch, to increment the patch number of the release. This will also reset the release candidate number, pass --rc at the same time to increment the patch number and make it a release candidate.
  • --post, to set the project postrelease number to 0 if it is not a postrelease, or bump the postrelease number by 1 if it is. This will also reset the release candidate and development release numbers.

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:

  • Version("<projectname>", "NEXT", 0, 0)
  • <projectname> NEXT

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):

  • Version("<projectname>", 17, 1, 0, release_candidate=1)
  • <projectname> 17.1.0rc1

Once the final version is made, it will become:

  • Version("<projectname>", 17, 1, 0)
  • <projectname> 17.1.0

More Repositories

1

twisted

Event-driven networking engine written in Python.
Python
5,498
star
2

klein

werkzeug + twisted.web
Python
834
star
3

towncrier

Manage the release notes for your project.
Python
760
star
4

treq

Python requests like API built on top of Twisted's HTTP client.
Python
585
star
5

txmongo

asynchronous python driver for mongo
Python
337
star
6

pydoctor

This is pydoctor, an API documentation generator that works by static analysis.
Python
180
star
7

ldaptor

LDAP server, client and utilities, using Twisted Python
Python
158
star
8

vertex

Vertex is a generalized, secure, peer-to-peer communications platform; formerly of the divmod.org project (https://code.launchpad.net/divmod.org/)
Python
74
star
9

nevow

Web Application Construction Kit
Python
62
star
10

tubes

A series of tubes.
Python
55
star
11

qt5reactor

Twisted and PyQt5 eventloop integration. Borrowed from https://github.com/nehbit/aether-public/blob/master/qt5reactor.py
Python
47
star
12

txacme

Twisted client for the ACME (Automatic Certificate Management Environment) protocol
Python
45
star
13

imaginary

Imaginary is a system for building fictional, interactive worlds via parallel, intersecting simulations.
Python
34
star
14

txaws

Twisted-based Asynchronous Libraries for Amazon Web Services and clouds that support the AWS APIs
Python
32
star
15

axiom

Divmod Axiom is an object database, or alternatively, an object-relational mapper, implemented on top of Python.
Python
22
star
16

constantly

Symbolic Constants in Python
Python
22
star
17

ampoule

Process pool for Twisted, using AMP
Python
12
star
18

twistedchecker

twistedchecker is a tool to automatically verify code against the Twisted coding standard.
Python
9
star
19

filepath

An object-oriented API for manipulating filesystem paths on POSIX and Windows.
Python
8
star
20

twisted-dev-tools

Tools for twisted development.
Python
7
star
21

mantissa

Divmod Mantissa is an application server with a web interface built using Axiom and Nevow.
Python
6
star
22

quotient

Divmod Quotient is a messaging platform developed as an Offering for Divmod Mantissa.
Python
6
star
23

newsbuilder

Automatically generate and manage a NEWS file from snippets stored in per-ticket text files.
Python
5
star
24

epsilon

Library of utility modules, used by ex-Divmod projects
Python
4
star
25

trac-wiki-archive

Archive for the content of previous Trac Wiki
4
star
26

twisted.github.io

This is the repo for the Twisted Matrix presentation site
JavaScript
3
star
27

sine

Divmod Sine is a standards-based voice-over-IP application server, built as an offering for the Mantissa application server platform.
Python
3
star
28

hyperbola

Hyperbola is a blogging and forums system, for having discussions about things.
Python
3
star
29

parsley-protocols

Python
2
star
30

twisted-iocpsupport

`twisted-iocpsupport` is an extension module for the Twisted `iocp` reactor to use the Windows I/O Completion Ports (IOCP) networking API. You should not need to install it directly or interact with its API; it is a dependency of Twisted on Windows platforms.
Cython
2
star
31

documents

Hosting via GitHub Pages for legacy documentation files
1
star
32

python-info-action

A GitHub Actions action for printing Python environment information
Python
1
star
33

cython-test-exception-raiser

Testing only. A cython simple extension which is used as helper for twisted/twisted Failure tests.
Cython
1
star