Repository navigation
Releases: pypa/setuptools-scm
Release list
vcs-versioning v2.6.0
Added
- Add the
towncrier-fragments-zeroverversion scheme: liketowncrier-fragments, but while the last tag is0.x,breakingandremovalfragments bump the minor version and only amajorfragment proposes1.0.0. (#1556)
vcs-versioning v2.5.0
Added
- Add
discover_file_workdir(), which finds the checkout a project sits in for
the purpose of listing files.discover_workdir()answers which checkout
defines the version, scoped byrootandsearch_parent_directories; which
files a project ships is a separate question, and a project in a subdirectory
of a checkout still ships that checkout's files. (#1543)
Fixed
- Accept the
toolkeyword in_version_missing()again. setuptools-scm 10.1.0
through 10.2.3 pass it and allow anyvcs-versioning<3; since 2.4.1 removed it,
a build without a detectable version failed with
TypeError: _version_missing() got an unexpected keyword argument 'tool'
instead of theLookupErrorthat says how to set a version. The keyword is
ignored; the tool is taken from the configuration's environment. (#1550)
setuptools-scm v10.3.4
Fixed
-
Ship the tracked files of projects whose
pyproject.tomlsits in a subdirectory
of the checkout.rootdefaults to the project directory, so version inference
correctly finds no SCM there and answers fromSETUPTOOLS_SCM_PRETEND_VERSION
orfallback_version-- but that says nothing about which files git tracks, and
the sdist and wheel came out with none of them. This was the 10.3.0 regression
fixed in 10.3.3, surviving in the subdirectory layout.File discovery now follows the checkout the project sits in, independently of
therootthat scopes versioning, and recordsscm_file_list.jsonin the
egg-info as a root-level project already did. (#1543) -
Require
vcs-versioning>=2.5.0. The subdirectory file-discovery fix (#1543) imports
discover_file_workdir, which no earlier release has, while the declared floor still
named 2.4.0 -- an install against a published vcs-versioning raisedImportError
during the build. (#1546)
vcs-versioning v2.4.1
Fixed
-
The error raised when a
.jj/directory is found butjjis not installed now names the environment variables that actually disable jj discovery (SETUPTOOLS_SCM_DISABLE_JJ=1/VCS_VERSIONING_DISABLE_JJ=1) instead of an unprefixedDISABLE_JJ=1, which was never read. (#1537) -
The "unable to detect version" error now names the environment variables the
running integration actually reads. It previously suggested
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_${NORMALIZED_DIST_NAME}unconditionally,
which is not read byvcs-versioningon its own (or by any other integrator),
and it named setuptools-scm as the failing tool regardless of which one ran.When the distribution name is known the suggested variable is spelled out in
full. When it is not, the generic variables are suggested instead, with a note
that the per-distribution..._FOR_<DIST>form needs a dist name to match --
the previous message offered a${NORMALIZED_DIST_NAME}template that could
never be filled in. (#1539) -
Warn when file discovery is suppressed while a VCS marker sits in the
project directory.scm_search_known_failed()means an integrator already
looked and found no checkout, so a.git,.hgor.jjright there
contradicts it and the artifact is about to lose every tracked file. That
combination was the signature of the pretend-version regression and stayed
invisible for three releases. Parent directories are not searched, since an
unpacked sdist inside an unrelated checkout is the case the suppression
exists for, and roots listed inIGNORE_VCS_ROOTSare skipped. (#1540)
Miscellaneous
-
Environment variable names are now built in one place (
env_var_name/
EnvReader.candidate_names), shared by the lookup inEnvReader.readand by
every error message that suggests a variable, so a message cannot name a
variable the lookup would not honour.The "repository found in a parent directory" error no longer offers a
get_version(relative_to=...)call to integrators that do not ship one; the
remaining options are renumbered instead. (#1539)
setuptools-scm v10.3.3
Fixed
-
Keep file discovery working when the version is pretended.
SETUPTOOLS_SCM_PRETEND_VERSIONand its scoped_FOR_<DIST>form made
version inference return before discovering a workdir, and theegg_info
mixin read the absent workdir as "searched, found no checkout" -- the signal
it acts on by suppressing thesetuptools.file_finderschain. Every
SCM-tracked file that setuptools' own package discovery does not find was
then dropped from the sdist and the wheel, silently, since the build
succeeded and the version was correct.A pretended version still skips discovery, because most builds only want a
version and probing for a checkout nobody asks about costs subprocesses for
nothing. What no longer happens is passing that off as an answer: "nobody
looked yet" is now distinct from "looked and found nothing", and the workdir
is discovered on demand the first time a consumer needs a file list.scm_file_list.jsonis now written to the egg-info for pretended builds as
well. It describes which files the checkout tracks, which a pretended
version says nothing about.scm_version.jsonstays absent there, because
a pretended version must not be recorded as what the SCM said. (#1540)
setuptools-scm v10.3.2
Fixed
-
Stop the command mixins from reordering a project's own
build_py,egg_info
orbdist_wheelMRO.ScmVersionFileMixinand friends inherited from the
corresponding setuptools command, so wrapping a project class built on a disjoint
hierarchy --distutils.command.build_py, or the standalonewheelpackage's
bdist_wheel-- placed setuptools' command ahead of the project's class.
setuptools.build_py.run()does not delegate any further, so the project's
run()was silently skipped, surfacing as
error: package directory '...' does not exist. The mixins now carry no runtime
base class and linearise to(wrapped, mixin, *project_command.__mro__). (#1531) -
Leave a project's
cmdclassalone when setuptools-scm is installed but not
actually inferring a version.build_py,egg_infoandbdist_wheelare
now registered only once version inference has stored data on the distribution --
the precondition for any of the mixins doing something. Previously every project
with apyproject.tomlhad its commands wrapped, including projects with no
[tool.setuptools_scm]section at all.Note for projects that used to configure setuptools-scm and no longer do: a
scm_version.jsonleft behind in a stale*.egg-infodirectory is no longer
stripped from built wheels, because thebdist_wheelmixin that strips it is no
longer registered either. Remove the stale*.egg-infodirectory. (#1533)
setuptools-scm v10.3.1
Fixed
- Require
vcs-versioning>=2.4.0. setuptools-scm 10.3.0 declared>=2.3.2but
importsvcs_versioning._file_finders.scm_search_known_failed, which vcs-versioning
only gained in 2.4.0, so installing it alongside an older vcs-versioning failed with
ImportError. CI now installs setuptools-scm against the oldest vcs-versioning its
metadata permits, so the lower bound can no longer go stale unnoticed. (#1528)
vcs-versioning v2.4.0
Added
- Add
scm.git.distance_scopeandscm.git.distance_count, restricting the distance count to the commits that touch a monorepo project (and optionally further shared directories) instead of every commit in the repository. Counting uses--full-historyby default, or--first-parent; git's default history simplification is not offered because it can make the distance shrink across a merge. Git only. (#1056)
Fixed
-
Select file finders by the VCS marker their entry point is named for (
.git,.hg,.jj) instead of running every backend's command in turn. A tree with no VCS marker -- an unpacked sdist, say -- now spawns no subprocess at all, so a slowhgonPATHcan no longer fail an unrelated build.The finders also survive a subprocess timeout:
subprocess.TimeoutExpiredwas uncaught and aborted the build, and is now treated like any other failed probe. (#1212) -
Prefer the fallback metadata nearest the project directory. A
.git_archival.txtorPKG-INFOat the VCS root no longer shadows a monorepo project's own, which silently produced the root project's version. (#1522)
setuptools-scm v10.3.0
Deprecated
- Emit a
DeprecationWarningwhen thesetuptools.file_findersentry point is invoked for a project that does not configure setuptools-scm. The entry point will be removed in a future major release. (#1407)
Fixed
-
Run the
setuptools.file_findershook inside a setuptools-scm override context. It previously resolved settings under theVCS_VERSIONINGprefix only, so documented variables such asSETUPTOOLS_SCM_SUBPROCESS_TIMEOUTandSETUPTOOLS_SCM_HG_COMMANDwere ignored when finding files.When version inference has already run and found no SCM checkout, the
egg_infomixin now tells the file finders so, rather than lettingwalk_revctrl()re-probe every backend for a repository known to be absent. (#1212)
vcs-versioning v2.3.4
Fixed
- Ensure the vcs-versioning testsuite passes without setuptools-scm installed; the egg-info vs PKG-INFO discovery priority test moved to the setuptools-scm testsuite, which owns the egg-info entry point it needs. (#1512)