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

Fails packaging on Python 3.8 - no 'importlib.resources.files' #35

Closed
tmontes opened this issue Sep 16, 2020 · 1 comment · Fixed by #36
Closed

Fails packaging on Python 3.8 - no 'importlib.resources.files' #35

tmontes opened this issue Sep 16, 2020 · 1 comment · Fixed by #36
Labels
bug Something isn't working @ plugin
Milestone

Comments

@tmontes
Copy link
Member

tmontes commented Sep 16, 2020

REPORTED by @tjguk, on Gitter's mu-editor/dev channel:

I gave it a go on Windows. Cloned pup; created a local venv; pip install -e.[dev]; and then ran -- from the pup directory pup package --launch-module=mu c:\work-in-progress\mu-master
It did stuff for a while (albeit with no output) and then I got an error:
20200915 072004 E pup Execution failure: module 'importlib.resources' has no attribute 'files'
This is with Python 3.8.3 on Win10

TO WHICH I RESPONDED:

Thanks for trying it @tjguk! :) Silly me trying to use 3.8 stdlib’s importlib.resources, while using PyPI’s “backported” but more capable on 3.7 - will be an easy fix. FYI, for more “noisy” output, add —log-level=info/debug between pup and package.

FACTS:

  • importlib.resources is used to "bundle" cookiecutter templates as packages within pup itself.
  • On 3.7 the PyPI backported importlib_resources package is used...
  • ...on 3.8, the standard library's importlib.resources is used instead.

CULPRIT:

  • The PyPI importlib_resources provides a files function that is not implemeted by 3.8's stdlib.

POSSIBLE FIXES:

  • Use PyPI's importlib_resources on both 3.7 and 3.8 (3.9's stdlib seems to include the files function we're using).
  • Use alternative implementation, supported by 3.8's stdlib.
@tmontes tmontes added bug Something isn't working @ plugin labels Sep 16, 2020
@tmontes tmontes added this to the 1.0.0a2 milestone Sep 16, 2020
@tmontes
Copy link
Member Author

tmontes commented Sep 16, 2020

THOUGHT + DECISION:

  • Given that 3.9 stdlb includes importlib.resources.files, we'll go ahead and use that into the future.
  • The fix is, thus, using PyPI's importlib_resources with 3.8.

maximilianvz added a commit to theochem/AtomDB that referenced this issue Feb 29, 2024
On Python versions < 3.10 (I think I'm correct in saying this fails for 3.9), running `pytest` fails if using `importlib.resources` (see mu-editor/pup#35). This can be fixed by using `importlib_resources` instead (GitHub Actions testing should work now for all tested versions of Python).
msricher pushed a commit to msricher/AtomDB_clean that referenced this issue May 7, 2024
On Python versions < 3.10 (I think I'm correct in saying this fails for 3.9), running `pytest` fails if using `importlib.resources` (see mu-editor/pup#35). This can be fixed by using `importlib_resources` instead (GitHub Actions testing should work now for all tested versions of Python).
marco-2023 pushed a commit to theochem/AtomDB that referenced this issue May 13, 2024
On Python versions < 3.10 (I think I'm correct in saying this fails for 3.9), running `pytest` fails if using `importlib.resources` (see mu-editor/pup#35). This can be fixed by using `importlib_resources` instead (GitHub Actions testing should work now for all tested versions of Python).
danibene added a commit to miso-sound/misosoupy that referenced this issue Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working @ plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant