Closed hroncok closed 1 year ago
(venv) [hatch-vcs (master %)]$ ~/.local/share/hatch/env/virtual/hatch-vcs/oGrlL7N9/hatch-vcs/bin/pip list
Package Version Editable project location
----------------- ------- ------------------------------------
attrs 22.1.0
coverage 7.0.0
editables 0.3
hatch-vcs 0.3.0 .../hatch-vcs
hatchling 1.11.1
iniconfig 1.1.1
packaging 22.0
pathspec 0.10.3
pip 22.3.1
pluggy 1.0.0
pytest 7.2.0
setuptools 65.6.3
setuptools-scm 7.1.0
typing_extensions 4.4.0
wheel 0.38.4
this may be a issue in hatch/hatchling - hatch explicitly does not use setuptools_scm version hooks, i gotta check whats going on
ok, its a upstream issue - the template in setuptools_scm changed , while the api is compatible, the file contents aint
while the api is compatible, the file contents ain't
Do I understand correctly that while the test fail, hatch-vcs still works as expected?
while the api is compatible, the file contents ain't
Do I understand correctly that while the test fail, hatch-vcs still works as expected?
One would have to look at the actual contents of the generated _version.py
to be sure, but this is almost certainly true. The test makes assumptions about the exact text of the generated file, which makes it brittle. It has already needed adjustment once before (https://github.com/ofek/hatch-vcs/issues/8, https://github.com/ofek/hatch-vcs/pull/9).
@hroncok its highly likely to just work
The contents of the generated _version.py
with setuptools_scm 7.1 are:
# file generated by setuptools_scm
# don't change, don't track in version control
__version__ = version = '1.2.3'
__version_tuple__ = version_tuple = (1, 2, 3)
So assert lines[3].startswith(('version =', '__version__ ='))
could perhaps be changed to assert any(line.startswith(('version =', '__version__ =') for line in lines)
. What do you think?
It’s still a little brittle, but it should at least accommodate the current template and the known previous templates, and it seems like it has a good chance of not immediately breaking again. It does produce a less-helpful message if it breaks, though.
hello, I am updating setuptools_scm in Fedora to 7.1.0 and I found a problem in the tests of this project.
Reproduced locally with: