File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ node: $Format:%H$
2+ node-date: $Format:%cI$
3+ describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
Original file line number Diff line number Diff line change 11* .bat text eol =crlf
2+
3+ # setuptools-scm reads the version out of this file when the source tree is a
4+ # ``git archive`` (a GitHub source download) rather than a checkout.
5+ # Deliberately the "stable" template: it records describe output but not
6+ # ``ref-names``, so the archive of a given commit does not change its content
7+ # -- and therefore its checksum -- when a branch that points at it later moves.
8+ .git_archival.txt export-subst
Original file line number Diff line number Diff line change 1+ # Only meaningful inside a ``git archive``, where ``export-subst`` has filled it
2+ # in; an sdist carries its version in the metadata instead. Shipping the
3+ # unexpanded template would leave setuptools-scm a stray ``$Format:...$`` to
4+ # consider on every build from an unpacked sdist.
5+ exclude .git_archival.txt
Original file line number Diff line number Diff line change 1+ Source archives of arbitrary commits -- the tarballs GitHub serves under
2+ ``/archive/ ``, not just the ones for tags -- can now be built into an sdist or a
3+ wheel with a correct version. A ``.git_archival.txt `` file, expanded by ``git
4+ archive `` via ``export-subst ``, carries the describe output that
5+ ``setuptools-scm `` would otherwise have to ask ``git `` for.
6+
7+ The archival file deliberately omits ``ref-names ``. Recording it would make the
8+ content of an archive -- and therefore its checksum -- change whenever a branch
9+ that points at the archived commit is moved afterwards, which is how the
10+ equivalent tarballs of tagged releases became unstable for other projects.
11+ Describe output alone depends only on the commit and on the tags reachable from
12+ it.
13+
14+ The archival file is not shipped in the sdist -- an sdist carries its version
15+ in its metadata, and the template is only ever expanded by ``git archive ``.
16+
17+ Building pytest from a git checkout now requires ``setuptools-scm >= 10.1 ``.
Original file line number Diff line number Diff line change 22build-backend = " setuptools.build_meta"
33requires = [
44 " setuptools>=77" ,
5- " setuptools-scm[toml]>=6.2.3 " ,
5+ " setuptools-scm[toml]>=10.1 " ,
66]
77
88[project ]
@@ -82,7 +82,10 @@ scripts.pytest = "_pytest.config:_console_main"
8282]
8383
8484[tool .setuptools_scm ]
85- write_to = " src/_pytest/_version.py"
85+ version_file = " src/_pytest/_version.py"
86+ # keep writing _version.py into the checkout: running pytest from a source
87+ # tree relies on it. The setuptools-scm default flips in a future major.
88+ write_to_source = true
8689
8790[tool .black ]
8891# See https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#t-target-version
You can’t perform that action at this time.
0 commit comments