Registry / devops / incremental

incremental

JSON →
library24.11.0pypypi✓ verified 25d ago

Incremental is a Python library that implements a CalVer (Calendar Versioning) manager for Python projects. It provides tools to define and manage project versions following a YY.MM.PATCH scheme, including release candidates, post-releases, and development releases. The library is currently at version 24.11.0 and follows a calendar-based release cadence.

pip install incremental
INSTALL
IMPORT
SIG · INCREMENTAL
I
incremental
devopspythonv24.11.0
Install
1.7s avg
Import
38ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v24.11.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.040s · 19MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.036s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Version
from incremental import Version
The primary class for defining project versions.

Define your project's version using the `Version` class in a `_version.py` file. Optionally, expose it via your package's `__init__.py`. For modern Python (>=3.8), `importlib.metadata.version()` is the recommended way to retrieve an installed package's version dynamically. The `incremental update` CLI tool automates the `_version.py` file management.

# 1. In your project's `_version.py` file: from incremental import Version __version__ = Version("my_project", 24, 11, 0, release_candidate=0) # 2. In your project's top-level `__init__.py` file: # from ._version import __version__ # 3. Accessing the version (e.g., from setup.py or build system): # import importlib.metadata # project_version = importlib.metadata.version('my_project') # Or, if __version__ is exposed via __init__.py: # from my_project import __version__ # print(__version__.public()) # '24.11.0rc0'
Debug
Known issues
breakingVersion 24.7.0 introduced a breaking change where projects using build backends like `setuptools.build_meta` could fail to build with a `KeyError: 'project'` during `_load_pyproject_toml`.
fix
Upgrade to a newer version of `incremental` (e.g., 24.7.1 or later) which contains a fix for this `pyproject.toml` parsing issue. Ensure your `pyproject.toml` explicitly defines a `[project]` table with a `name` key if you are using a dynamic version.
affects: 24.7.0
deprecatedExposing `__version__` directly in `__init__.py` is becoming less common. Python 3.6 and later provide `importlib.metadata.version()` as a standard, more robust way to retrieve an installed package's version at runtime.
fix
While `incremental` still supports populating `__version__`, consider migrating your code to use `importlib.metadata.version('your-package-name')` for runtime version checks. This also allows `incremental` to be solely a build dependency, removing it from `install_requires`.
affects: All versions (best practice guidance for Python >= 3.6)
gotchaThe `incremental` CLI tool (e.g., `incremental update`) requires `click` and is best installed via `pipx` to avoid polluting your project's dependencies with CLI tools.
fix
Install `incremental` with `pipx install incremental` to ensure the command-line utility is available in an isolated environment, preventing potential dependency conflicts with your project.
affects: All versions
gotchaWhen initializing `incremental.Version`, the 'package' argument must precisely match the name used in your `pyproject.toml` or `setup.py` (e.g., `[project] name = "my_project"`). Mismatches can lead to unexpected behavior or build failures.
fix
Always verify that the `package` argument in `Version("package_name", ...)` exactly matches the declared package name in your build configuration.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'incremental'
The 'incremental' library is not installed in the Python environment or is not accessible within the current Python path.
fix
Install the library using pip: `pip install incremental`
AttributeError: type object 'Version' has no attribute 'parse' (or similar attribute)
Developers might mistakenly assume the `incremental.Version` class has a direct parsing method or a different attribute name, similar to other versioning libraries, when attempting to manipulate version strings.
fix
Instantiate the `Version` object directly with its components (package name, major, minor, micro, etc.) or use `incremental.Version.from_string()` if parsing a PEP 440-compatible string is available and desired (check official documentation for specific parsing methods).
incremental update <projectname> --create error: Cannot create _version.py for project '<projectname>' (directory not found)
The `incremental update --create` command is being run from a directory where the specified project's package directory (or its parent) does not exist, or the project structure is not as expected by the command.
fix
Ensure you are running the `incremental update` command from the root of your project where your `pyproject.toml` or `setup.py` is located, and that the package directory structure is correct for `incremental` to place the `_version.py` file. You may need to specify the path to your package if it's not directly in the root.
TypeError: Version() missing 3 required positional arguments: 'major', 'minor', and 'micro'
The `incremental.Version` constructor was called without providing the essential version components (major, minor, micro) that are mandatory for defining a CalVer version.
fix
When creating a `Version` object, provide the required arguments: `from incremental import Version; __version__ = Version('your_package_name', 24, 11, 0)` (or your specific version numbers).
Upgrade
Version history
24.11.0latest on PyPI · released Nov 28, 2025
Audit
Dependencies
clickrequiredRequired for the 'incremental' command-line interface.
setuptoolsoptionalBuild backend dependency when using with setuptools.
hatchlingoptionalBuild backend dependency when using with Hatchling.
packagingrequiredCore utilities for Python packages, an indirect dependency via build backends.
Agent activity
11 hits · last 30 days
node
10
Resources