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 incrementalVerified import paths — ran on the pinned version, not inferred.
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.
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.
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`.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.
Always verify that the `package` argument in `Version("package_name", ...)` exactly matches the declared package name in your build configuration.Install the library using pip: `pip install incremental`
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).
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.
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).