8000 Python Wheel includes PYC files and should not · Issue #913 · prometheus/client_python · GitHub
[go: up one dir, main page]

Skip to content

Python Wheel includes PYC files and should not #913

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

Closed
jkugler opened this issue May 23, 2023 · 4 comments
Closed

Python Wheel includes PYC files and should not #913

jkugler opened this issue May 23, 2023 · 4 comments

Comments

@jkugler
Copy link
jkugler commented May 23, 2023

We are trying to use the tool virtualenv-tools to build a deployable packages.

We are creating our virtualenv with Python 3.11 and when virtualenv-tools tries to unmarshal the PYC files, it of course fails, because the bytecode does not match.

According to the wheel spec (https://packaging.python.org/en/latest/specifications/binary-distribution-format/)

Wheel, being an installation format that is intended to work across multiple versions of Python, does not generally include .pyc files.

and

Wheel archives do not need to include .pyc and are less tied to a specific Python version or implementation.

So, while including PYCs is not explicitly prohibited, it is apparently not best practice nor recommended. According to the maintainer of virtualenv-tools, apparently it is wrong. :) See: Yelp/virtualenv-tools#29

Could we get another wheel without the PYC files? I would be happy to submit a PR, but this appears to be a build issue, and the repo doesn't contain that information.

Thanks!

@csmarchbanks
Copy link
Member

I think this was fixed in #906, but I haven't done another release yet. I will work on that soon, but I think in the meantime you could pin the version to 0.15.0 which doesn't have the .pyc files.

@jkugler
Copy link
Author
jkugler commented May 23, 2023

Thanks! Sorry I didn't see the previous bug.

@csmarchbanks
Copy link
Member

I just released 0.17.0, would you give that version a try and make sure the new build/release process looks good? Thanks!

@jkugler
Copy link
Author
jkugler commented May 24, 2023

I pulled down https://files.pythonhosted.org/packages/5b/62/75fc6f255e214ff0a8bd3267a0bd337521dd24f76cd593c10795e488f41b/prometheus_client-0.17.0-py3-none-any.whl and there are no __pycache__ directories in the wheel. Looks good.

Thanks you so much for the quick turn around on this.

@jkugler jkugler closed this as completed May 24, 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
0