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

4.3.0 release is breaking on Windows #395

Closed
gr8jam opened this issue Dec 10, 2023 · 6 comments
Closed

4.3.0 release is breaking on Windows #395

gr8jam opened this issue Dec 10, 2023 · 6 comments
Labels

Comments

@gr8jam
Copy link

gr8jam commented Dec 10, 2023

After upgrading Chameleon package to the latest release (4.3.0) I noticed that my project stopped working on Windows (on macOS everything seems fine). Here is the last part of the exception's traceback:

  ...
  File "C:\Users\myproject\venv\Lib\site-packages\chameleon\template.py", line 391, in read
    files = importlib_resources.files(self.spec.pname)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\importlib\resources\_common.py", line 22, in files
    return from_package(get_package(package))
                        ^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\importlib\resources\_common.py", line 53, in get_package
    resolved = resolve(package)
               ^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\importlib\resources\_common.py", line 44, in resolve
    return cand if isinstance(cand, types.ModuleType) else importlib.import_module(cand)
                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'C'

After looking at the Changes, my hunch is that it's something related to:

  • Replace pkg_resources with newer and faster importlib.resources and importlib.metadata. Just importing pkg_resources becomes slower and slower the more packages are installed.

but, I am not sure how to fix it.

@malthe
Copy link
Owner

malthe commented Dec 11, 2023

This is a bug introduced in ad7a498. Let me first add a Windows test run, then fix the issue.

@gr8jam
Copy link
Author

gr8jam commented Dec 11, 2023

Thanks for jumping on this so quickly!

@mahmoud
Copy link

mahmoud commented Dec 17, 2023

I saw the changelog about 4.4.0 potentially fixing this, but alas, no such luck on my end: https://github.com/mahmoud/clastic/actions/runs/7241001024/job/19724620933?pr=37

mahmoud added a commit to mahmoud/clastic that referenced this issue Dec 17, 2023
@malthe
Copy link
Owner

malthe commented Dec 17, 2023

@mahmoud strange I'll take a look.

@malthe
Copy link
Owner

malthe commented Dec 18, 2023

@mahmoud something went wrong with the 4.4.0 release – I have released 4.4.1 to replace it.

@malthe malthe closed this as completed Dec 18, 2023
mahmoud added a commit to mahmoud/clastic that referenced this issue Dec 18, 2023
@mahmoud
Copy link

mahmoud commented Dec 21, 2023

Just circling back to confirm the new build worked. Thanks!

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

No branches or pull requests

3 participants