single |
Incremental
===========
|gha|
|pypi|
|coverage|
Incremental is a small library that versions your Python projects.
API documentation can be found [here].
.. contents::
Quick Start
-----------
Using setuptools
~~~~~~~~~~~~~~~~
Add Incremental to your ``pyproject.toml``:
.. code-block:: toml
[build-system]
requires = [
"setuptools",
"incremental>=24.7.2", # ← Add incremental as a build dependency
]
build-backend = "setuptools.build_meta"
[project]
name = ""
dynamic = ["version"] # ← Mark the version dynamic
dependencies = [
"incremental>=24.7.2", # ← Depend on incremental at runtime
]
# ...
[tool.incremental] # ← Activate Incremental's setuptools
plugin
It's fine if the ``[tool.incremental]`` table is empty, but it must be
present.
Remove any ``[project] version = entry and any [tool.setuptools.dynamic]
version =`` entry.
Next, `initialize the project`_.
Using Hatchling
~~~~~~~~~~~~~~~
If you're using [Hatchling] to package your project,
activate Incremental's Hatchling plugin by altering your
``pyproject.toml``:
.. code:: toml
[build-system]
requires = [
"hatchling",
"incremental>=24.7.2", # ← Add incremental as a build dependency
]
build-backend = "hatchling.build"
[project]
name = ""
dynamic = ["version"] # ← Mark the version dynamic
dependencies = [
"incremental>=24.7.2", # ← Depend on incremental at runtime
]
# ...
[tool.hatch.version]
source = "incremental" # ← Activate Incremental's Hatchling plugin
Incremental can be configured as usual in an optional
``[tool.incremental]`` table.
The hatch version command will report the Incremental-managed version.
Use the ``python -m incremental.update`` command to change the version
(setting it with hatch version is not supported).
Next, `initialize the project`_.
Using ``setup.py``
~~~~~~~~~~~~~~~~~~
Incremental may be used from ``setup.py instead of pyproject.toml``.
Add this to your ``setup()`` call, removing any other versioning arguments:
.. code:: python
setup(
use_incremental=True,
setup_requires=['incremental'],
install_requires=['incremental'], # along with any other install
dependencies
...
}
|