CalVer (Setuptools Extension)

2025.10.20 · active · verified Tue Apr 14

CalVer is a setuptools extension that enables the use of Calendar Versioning (CalVer) for Python packages. It integrates seamlessly with `pyproject.toml` to dynamically generate package versions based on the current date, ensuring consistency with the CalVer specification. The current version is 2025.10.20, and it follows a calendar-versioned release cadence.

Warnings

Install

Imports

Quickstart

CalVer is configured declaratively in your `pyproject.toml` file. This example demonstrates how to set `calver` as the build backend and use it to dynamically set your project's version.

# pyproject.toml
[build-system]
requires = ["setuptools>=61", "calver"]
build-backend = "calver:__build_backend__"

[project]
name = "my-calver-package"
authors = [
    {name = "Your Name", email = "your.email@example.com"}
]
description = "A package using CalVer"
readme = "README.md"
requires-python = ">=3.9"
dynamic = ["version"]

[tool.setuptools.dynamic]
version = {attr = "calver.version"}

view raw JSON →