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.1.0 wheel doesn't work under Python 3.11 #383

Closed
mcdonc opened this issue Aug 30, 2023 · 5 comments
Closed

4.1.0 wheel doesn't work under Python 3.11 #383

mcdonc opened this issue Aug 30, 2023 · 5 comments

Comments

@mcdonc
Copy link
Contributor

mcdonc commented Aug 30, 2023

I first noticed this when running pyramid_chameleon tests, but when you install Chameleon with a simple pip install chameleon under Python 3.11, the result can't be imported. It can't be imported apparnetly because it uses the 3.10 wheel version from PyPI. I think this is normal; newer Python versions can use wheels from older Python versions. But for whatever reason, trying to import chameleon under Python 3.11 when it was installed using the 3.10 wheel produces the following error:

Python 3.11.0rc1 (main, Aug 12 2022, 10:02:14) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import chameleon
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: bad magic number in 'chameleon': b'o\r\r\n'
>>> 

When the package is installed under 3.11 using ```pip install https://files.pythonhosted.org/packages/a6/b3/a12f28e3a0ed85d2b953ab67dcba7983e6f6aed9c74f4faee2551c71dd20/Chameleon-4.1.0.tar.gz`` (bypassing the wheel), everything works.

Using the wheel under 3.10 works fine.

I think just removing the wheel from PyPI would resolve the issue; that said I don't really understand the issue, so this may recur.

chameleon-wheel.mp4

I'm attaching a movie which demonstrates the issue.

@mcdonc
Copy link
Contributor Author

mcdonc commented Aug 30, 2023

Further research reveals that the wheel has only .pyc files in it. I don't think that's how wheels are supposed to be created, but I could be wrong.

@mcdonc
Copy link
Contributor Author

mcdonc commented Aug 30, 2023

FWIW, you might take a look at https://github.com/Pylons/waitress/blob/main/tox.ini#L68 in order to build a wheel via ``tox -e build". This seems to produce a proper wheel.

@malthe
Copy link
Owner

malthe commented Aug 30, 2023

I have removed the wheel that included .pyc-files only – it was actually intentional but I had not considered the obvious downside, that those files are interpreter-specific.

And while the wheel had py310 in it, it would still get picked for Python 3.11.

@malthe
Copy link
Owner

malthe commented Aug 30, 2023

I have uploaded a new wheel "Chameleon-4.1.0-py3-none-any.whl" – with .py-files instead – and tested it with Python 3.11.

It's a bit surprising to me that PyPi allows me to upload a new wheel after the initial release. I haven't thought very deep about it, but I would think that a 5-minute limit or so would be a wise policy.

@mcdonc
Copy link
Contributor Author

mcdonc commented Aug 30, 2023

Works now, thanks!

@malthe malthe closed this as completed Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants