{"id":5870,"library":"calver","title":"CalVer (Setuptools Extension)","description":"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.","status":"active","version":"2025.10.20","language":"en","source_language":"en","source_url":"https://github.com/di/calver","tags":["build-backend","setuptools","versioning","calver","pyproject.toml"],"install":[{"cmd":"pip install calver","lang":"bash","label":"Install library"}],"dependencies":[],"imports":[{"note":"This is not a Python import statement, but rather the entry point specified in `pyproject.toml` for setuptools to use CalVer as the build backend.","symbol":"__build_backend__","correct":"build-backend = \"calver:__build_backend__\""},{"note":"This is used within the `[tool.setuptools.dynamic]` section of `pyproject.toml` to instruct setuptools to retrieve the version dynamically from `calver.version`.","symbol":"version","correct":"version = {attr = \"calver.version\"}"}],"quickstart":{"code":"# pyproject.toml\n[build-system]\nrequires = [\"setuptools>=61\", \"calver\"]\nbuild-backend = \"calver:__build_backend__\"\n\n[project]\nname = \"my-calver-package\"\nauthors = [\n    {name = \"Your Name\", email = \"your.email@example.com\"}\n]\ndescription = \"A package using CalVer\"\nreadme = \"README.md\"\nrequires-python = \">=3.9\"\ndynamic = [\"version\"]\n\n[tool.setuptools.dynamic]\nversion = {attr = \"calver.version\"}","lang":"toml","description":"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."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer, or pin `calver` to an older version compatible with your Python interpreter (e.g., `<2025.03.31` for 3.5/3.6, `<2025.04.01` for 3.7/3.8).","message":"Python 3.5, 3.6, 3.7, and 3.8 support has been dropped in recent versions. Earlier versions supported these, but new releases require Python 3.9 or newer.","severity":"breaking","affected_versions":"Before 2025.03.31 (supported 3.5-3.6); 2025.03.31 (dropped 3.7-3.8); 2025.04.01 and later (requires >=3.9)."},{"fix":"Migrate your project configuration to the modern `pyproject.toml` structure as shown in the quickstart example and the official documentation.","message":"Significant changes were made to adopt `pyproject.toml` fully, deprecating older `setup.py` based configurations. Projects using `setup.py` or older `pyproject.toml` configurations might need updates.","severity":"breaking","affected_versions":"Versions prior to 2025.04.01."},{"fix":"Upgrade `calver` to version `2025.10.20` or newer to resolve the `DeprecationWarning`.","message":"The internal use of `datetime.datetime.utcnow()` was deprecated and could cause `DeprecationWarning` in specific Python environments or when warnings are treated as errors during builds.","severity":"gotcha","affected_versions":"All versions prior to 2025.10.20."},{"fix":"Set the `SOURCE_DATE_EPOCH` environment variable to a Unix timestamp in your build environment (e.g., CI/CD pipelines) to ensure consistent versioning across builds.","message":"For reproducible builds, `calver` supports the `SOURCE_DATE_EPOCH` environment variable. If not set, the build will use the current timestamp.","severity":"gotcha","affected_versions":"All versions."}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z","problems":[]}