{"id":14439750,"url":"https://github.com/pypa/setuptools-scm","last_synced_at":"2025-12-11T21:03:30.303Z","repository":{"id":34451218,"uuid":"38386331","full_name":"pypa/setuptools-scm","owner":"pypa","description":"the blessed package to manage your versions by scm tags","archived":false,"fork":false,"pushed_at":"2025-12-08T18:48:25.000Z","size":3079,"stargazers_count":928,"open_issues_count":48,"forks_count":228,"subscribers_count":25,"default_branch":"main","last_synced_at":"2025-12-11T06:36:49.385Z","etag":null,"topics":["metadata","packaging","python","version-control"],"latest_commit_sha":null,"homepage":"https://setuptools-scm.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pypa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"tidelift":"pypi/setuptools-scm"}},"created_at":"2015-07-01T17:57:56.000Z","updated_at":"2025-12-10T09:31:39.000Z","dependencies_parsed_at":"2025-12-03T04:01:19.796Z","dependency_job_id":null,"html_url":"https://github.com/pypa/setuptools-scm","commit_stats":{"total_commits":1318,"total_committers":146,"mean_commits":9.027397260273972,"dds":0.5318664643399089,"last_synced_commit":"3c145dfd784e41cdb774449a421fe5e17a664786"},"previous_names":[],"tags_count":132,"template":false,"template_full_name":null,"purl":"pkg:github/pypa/setuptools-scm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pypa%2Fsetuptools-scm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pypa%2Fsetuptools-scm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pypa%2Fsetuptools-scm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pypa%2Fsetuptools-scm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pypa","download_url":"https://codeload.github.com/pypa/setuptools-scm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pypa%2Fsetuptools-scm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27662481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-11T02:00:11.302Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["metadata","packaging","python","version-control"],"created_at":"2024-08-31T17:00:42.994Z","updated_at":"2025-12-11T21:03:30.295Z","avatar_url":"https://github.com/pypa.png","language":"Python","funding_links":["https://tidelift.com/funding/github/pypi/setuptools-scm","https://tidelift.com/badges/package/pypi/setuptools-scm","https://tidelift.com/subscription/pkg/pypi-setuptools-scm?utm_source=pypi-setuptools-scm\u0026utm_medium=readme","https://tidelift.com/security"],"categories":["Python","Build Tools"],"sub_categories":[],"readme":"# setuptools-scm\n[![github ci](https://github.com/pypa/setuptools-scm/actions/workflows/python-tests.yml/badge.svg)](https://github.com/pypa/setuptools-scm/actions/workflows/python-tests.yml)\n[![Documentation Status](https://readthedocs.org/projects/setuptools-scm/badge/?version=latest)](https://setuptools-scm.readthedocs.io/en/latest/?badge=latest)\n[![tidelift](https://tidelift.com/badges/package/pypi/setuptools-scm) ](https://tidelift.com/subscription/pkg/pypi-setuptools-scm?utm_source=pypi-setuptools-scm\u0026utm_medium=readme)\n\n## about\n\n[setuptools-scm] extracts Python package versions from `git` or `hg` metadata\ninstead of declaring them as the version argument\nor in a Source Code Managed (SCM) managed file.\n\nAdditionally [setuptools-scm] provides `setuptools` with a list of\nfiles that are managed by the SCM\n\u003cbr/\u003e\n(i.e. it automatically adds all the SCM-managed files to the sdist).\n\u003cbr/\u003e\nUnwanted files must be excluded via `MANIFEST.in`\nor [configuring Git archive][git-archive-docs].\n\n\u003e **⚠️ Important:** Installing setuptools-scm automatically enables a file finder that includes **all SCM-tracked files** in your source distributions. This can be surprising if you have development files tracked in Git/Mercurial that you don't want in your package. Use `MANIFEST.in` to exclude unwanted files. See the [documentation] for details.\n\n## `pyproject.toml` usage\n\nThe preferred way to configure [setuptools-scm] is to author\nsettings in a `tool.setuptools_scm` section of `pyproject.toml`.\n\nThis feature requires setuptools 61 or later (recommended: \u003e=80 for best compatibility).\nFirst, ensure that [setuptools-scm] is present during the project's\nbuild step by specifying it as one of the build requirements.\n\n```toml title=\"pyproject.toml\"\n[build-system]\nrequires = [\"setuptools\u003e=80\", \"setuptools-scm\u003e=8\"]\nbuild-backend = \"setuptools.build_meta\"\n```\n\nThat will be sufficient to require [setuptools-scm] for projects\nthat support [PEP 518] like [pip] and [build].\n\n[pip]: https://pypi.org/project/pip\n[build]: https://pypi.org/project/build\n[PEP 518]: https://peps.python.org/pep-0518/\n\n\nTo enable version inference, you need to set the version\ndynamically in the `project` section of `pyproject.toml`:\n\n```toml title=\"pyproject.toml\"\n[project]\n# version = \"0.0.1\"  # Remove any existing version parameter.\ndynamic = [\"version\"]\n\n[tool.setuptools_scm]\n```\n\n!!! note \"Simplified Configuration\"\n\n    Starting with setuptools-scm 8.1+, if `setuptools_scm` (or `setuptools-scm`) is\n    present in your `build-system.requires`, the `[tool.setuptools_scm]` section\n    becomes optional! You can now enable setuptools-scm with just:\n\n    ```toml title=\"pyproject.toml\"\n    [build-system]\n    requires = [\"setuptools\u003e=80\", \"setuptools-scm\u003e=8\"]\n    build-backend = \"setuptools.build_meta\"\n\n    [project]\n    dynamic = [\"version\"]\n    ```\n\n    The `[tool.setuptools_scm]` section is only needed if you want to customize\n    configuration options.\n\nAdditionally, a version file can be written by specifying:\n\n```toml title=\"pyproject.toml\"\n[tool.setuptools_scm]\nversion_file = \"pkg/_version.py\"\n```\n\nWhere `pkg` is the name of your package.\n\nIf you need to confirm which version string is being generated or debug the configuration,\nyou can install [setuptools-scm] directly in your working environment and run:\n\n```console\n$ python -m setuptools_scm\n# To explore other options, try:\n$ python -m setuptools_scm --help\n```\n\nFor further configuration see the [documentation].\n\n[setuptools-scm]: https://github.com/pypa/setuptools-scm\n[documentation]: https://setuptools-scm.readthedocs.io/\n[git-archive-docs]: https://setuptools-scm.readthedocs.io/en/stable/usage/#builtin-mechanisms-for-obtaining-version-numbers\n\n\n## Interaction with Enterprise Distributions\n\nSome enterprise distributions like RHEL7\nship rather old setuptools versions.\n\nIn those cases its typically possible to build by using an sdist against `setuptools-scm\u003c2.0`.\nAs those old setuptools versions lack sensible types for versions,\nmodern [setuptools-scm] is unable to support them sensibly.\n\nIt's strongly recommended to build a wheel artifact using modern Python and setuptools,\nthen installing the artifact instead of trying to run against old setuptools versions.\n\n!!! note \"Legacy Setuptools Support\"\n    While setuptools-scm recommends setuptools \u003e=80, it maintains compatibility with setuptools 61+\n    to support legacy deployments that cannot easily upgrade. Support for setuptools \u003c80 is deprecated\n    and will be removed in a future release. This allows enterprise environments and older CI/CD systems\n    to continue using setuptools-scm while still encouraging adoption of newer versions.\n\n\n## Code of Conduct\n\n\nEveryone interacting in the [setuptools-scm] project's codebases, issue\ntrackers, chat rooms, and mailing lists is expected to follow the\n[PSF Code of Conduct].\n\n[PSF Code of Conduct]: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md\n\n\n## Security Contact\n\nTo report a security vulnerability, please use the\n[Tidelift security contact](https://tidelift.com/security).\nTidelift will coordinate the fix and disclosure.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpypa%2Fsetuptools-scm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpypa%2Fsetuptools-scm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpypa%2Fsetuptools-scm/lists"}