pipx <whatever> => 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) Indeed, there is no __version__ in pipx.version. Editing /usr/local/lib/python3.9/site-packages/pipx/version.py to define __version__ (duplicating 'version' definition) fixes the things. FreeBSD 14.0-p4, both the latest package and the port from the latest branch ❯ grep PORTVERSION /usr/ports/devel/py-pipx/Makefile PORTVERSION= 1.3.3
Created attachment 247545 [details] pipx-1.4.1.patch Description: * Fix ImportError: cannot import name '__version__' from 'pipx.version' - pipx requires `__version__` to be defined, but hatch-vcs does not generate it when using the ports tree. To fix this, a template based on the default template [1] is used. [1] https://github.com/pypa/setuptools_scm/blob/v6.4.0/src/setuptools_scm/__init__.py#L30-L39 ChangeLog: https://pipx.pypa.io/latest/changelog/#141 * Set default logging level to WARNING, so debug log messages won't be shown without passing additional flags such as --verbose. QA: * portlint: OK (looks fine.) * testport: OK (poudriere: 14.0-RELEASE, amd64)
The best fix would be to patch it to `from pipx.version import version as __version__`, since older versions of setuptools_scm don't provide the `__version__` alias; this was added in version 7, which for some reason seems to be a separate package and not a dependency of hatch_vcs. I've proposed an upstream fix at https://github.com/pypa/pipx/pull/1208, though ideally setuptools_scm should be updated to version 7 or even version 8.
I was just now able to build a working version 1.4.3 from ports (987b3aefae8dcd837edebefa792892faff7e8900) :)
*** Bug 276429 has been marked as a duplicate of this bug. ***
*** Bug 277080 has been marked as a duplicate of this bug. ***
(In reply to Jesús Daniel Colmenares Oviedo from comment #1) (In reply to Henry Schreiner from comment #2) The patch is no longer needed after py-setuptools-scm being updated to 8.0.4 in ports 5d4139f8bdb67bd6e8328422f9762661bd0d6454. Thanks.
Please, update PORTREVISION for the package to be scheduled for rebuild during next `poudriere bulk` run.
Created attachment 249265 [details] [PATCH] devel/py-pipx: bump PORTREVISION to schedule for rebuild
Comment on attachment 249265 [details] [PATCH] devel/py-pipx: bump PORTREVISION to schedule for rebuild Obsolete by release of 1.5.0