Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] scm6 seems to generate unexpected version.py - ModuleNotFoundError when importing urwid (no __version__) #674

Closed
jhgit opened this issue Nov 20, 2023 · 0 comments · Fixed by #675
Labels

Comments

@jhgit
Copy link

jhgit commented Nov 20, 2023

Description:
$ python3.9 -c 'import urwid'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/var/run/amd/duck/z/h/jhein/gen/src/git/urwid/urwid/urwid/__init__.py", line 114, in <module>
    from urwid.version import __version__, __version_tuple__
ModuleNotFoundError: No module named 'urwid.version'

It turns out that if you build with an older py-setuptools_scm (e.g., 6.4.2), the build creates a version.py that looks like the following:

$ cat /usr/local/lib/python3.9/site-packages/urwid/version.py
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
version = '2.2.3'
version_tuple = (2, 2, 3)

Notice there is no __version__.

pyproject.toml claims that it can use any version of py-setuptools_scm >= 6.2 (commit 8d8e4b6). Maybe that is not correct? I did not (yet) dig into the difference between scm6 and scm7 that causes a different version.py to be generated.

Affected versions (if applicable)

2.2.0 - 2.2.3

Steps to reproduce (if applicable)

Install py-setuptools_scm 6.4.2 (possibly any 6.x version?). Build urwid (from source tarball at PyPI). Check version.py in build/.

Expected/actual outcome

expected: successful import of the urwid package, of course.

@jhgit jhgit added the bug label Nov 20, 2023
penguinolog added a commit to penguinolog/urwid that referenced this issue Nov 21, 2023
* Require `setuptools_scm` > 7.1
  Python 3.7 is minimally supported
  A lot of git bugfixes, including container support
* Use compatible imports (use aliases)
@penguinolog penguinolog linked a pull request Nov 21, 2023 that will close this issue
6 tasks
penguinolog added a commit that referenced this issue Nov 21, 2023
* Fix #674 : old versions of setuptools_scm support

* Require `setuptools_scm` > 7.1
  Python 3.7 is minimally supported
  A lot of git bugfixes, including container support
* Use compatible imports (use aliases)

* fix ruff check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant