{"library":"hatch-vcs","code":"# pyproject.toml\n[project]\nname = \"my-package\"\nversion = \"0.0.1\" # This is a fallback/initial value, will be overridden by VCS\ndynamic = [\"version\"]\n\n[build-system]\nrequires = [\"hatchling>=1.27\", \"hatch-vcs>=0.3.0\"]\nbuild-backend = \"hatchling.build\"\n\n[tool.hatch.version]\nsource = \"vcs\"\n\n[tool.hatch.build.hooks.vcs]\nversion-file = \"src/my_package/_version.py\"\n\n# Example of how you might read the version in your package (e.g., in src/my_package/__init__.py)\n# from importlib.metadata import version\n# try:\n#     __version__ = version(\"my-package\")\n# except Exception:\n#     # Fallback for development installs or if metadata is not yet available\n#     __version__ = \"0.0.0+unknown\"\n","lang":"toml","description":"This configuration in `pyproject.toml` sets up `hatch-vcs` to derive your package's version from Git tags. It also specifies a `_version.py` file to be generated at build time, ensuring a static version is available in your distribution. The `project.dynamic` field should include `\"version\"` to enable dynamic versioning.","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}