You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pipx expects setuptools_scm (via hatch_vcs) to produce __version__ in the default template. However, older versions, such as the one supplied in FreeBSD, do not (this alias was added in version 7; for other reasons, FreeBSD is stuck on 6 and treats 7 as a new package).
Two easy fixes and one less so: the one I usually do is to import version (the original name) as __version__ (like in https://github.com/scikit-build/scikit-build-core/blob/f8c5798897852e107df0683893de59e15c558baf/src/scikit_build_core/__init__.py#L9). That was the original name, and is always available. You can also specify the template, which allows you to put whatever you want in version.py, but does require a bit more configuration. And the less-ideal fix would be to limit the version of setuptools_scm that hatch_vcs pulls in to some minimum that includes the addition of this feature (v7).
pipx run coverage xml -o coverage.xml
Traceback (most recent call last):
File "/usr/local/bin/pipx", line 5, in <module>from pipx.main import cli
File "/usr/local/lib/python3.9/site-packages/pipx/main.py", line 31, in <module>from pipx.version import__version__ImportError: cannot import name '__version__' from 'pipx.version' (/usr/local/lib/python3.9/site-packages/pipx/version.py)
Expected behavior
Would be nice not to have pipx crash on FreeBSD.
The text was updated successfully, but these errors were encountered:
Describe the bug
Pipx expects
setuptools_scm
(viahatch_vcs
) to produce__version__
in the default template. However, older versions, such as the one supplied in FreeBSD, do not (this alias was added in version 7; for other reasons, FreeBSD is stuck on 6 and treats 7 as a new package).https://github.com/pypa/pipx/blob/6918c4de5898d65807a2255eed43b6f5a6cf1a21/src/pipx/main.py#L31C1-L32C1
Two easy fixes and one less so: the one I usually do is to import
version
(the original name) as__version__
(like in https://github.com/scikit-build/scikit-build-core/blob/f8c5798897852e107df0683893de59e15c558baf/src/scikit_build_core/__init__.py#L9). That was the original name, and is always available. You can also specify the template, which allows you to put whatever you want inversion.py
, but does require a bit more configuration. And the less-ideal fix would be to limit the version of setuptools_scm that hatch_vcs pulls in to some minimum that includes the addition of this feature (v7).How to reproduce
Seen in abravalheri/validate-pyproject#142, logs: https://github.com/abravalheri/validate-pyproject/pull/142/checks?check_run_id=20500888256
Expected behavior
Would be nice not to have pipx crash on FreeBSD.
The text was updated successfully, but these errors were encountered: