-
Notifications
You must be signed in to change notification settings - Fork 616
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
Don't create pyc files when building tables #135
Conversation
We don't want to include pyc files in source distributions.
I'm not sure I follow. Shoudln't they just be excluded from the manifest? It seems useful to create .pycs when doing install? and install calls _run_build_tables too |
So, that was my initial thought too. But they are excluded from the manifest, yet still appearing in the sdist. The problem here is that we are running a python script directly in the package build directory, between the source copying (that reads MANIFEST.in) and building the tarball.
pip will do that on the actual install. Shipping pycs in the source tarballs is not the way to solve that problem.
Yes 100%. This doesn't change that. |
Please bear with me here; there were a lot of issues with these tables in the past. The problem is, if there's no .pyc in the install directory, the .pyc is created locally where users of pycparser live, which is very bad because pycparser is used transitively but a lot of tools today. Currently Therefore, at the very least I wouldn't run with |
Any updates on this? |
Sorry, I haven't been on top of GitHub notifications.
My issue is entirely with the After that, I'm going to reply out of order, because I think that makes a little more sense.
Yeah, you can't do anything during installation in a wheel world, everything should be shipped in the wheel. However, you are running
Are you sure about that? That sounds completely wrong.
I think that'd be wrong. Then you'd ship |
If |
|
It is also completely wrong to include .pyc files in the sdist, as the .pyc files are being created using whatever version of Python that you used to create the sdist - not the version that the user is installing with. |
#251 points here If anyone wants to provide a well-tested PR that removes |
For what it's worth there was a release around Jan 30th of this year with changes to .pyc files for Python 3.7 (something with a new hash based pyc) |
Like I said in my other comment on that issue referenced. I used the same version and it suddenly started breaking one day on the python 3.7 dev branch so I'm pretty sure it's a change in the dev branch around that time. ~Jan 24th |
Fair enough. I'm going to leave this open until a volunteer is found to fix the issue(s) with |
FWIW, I tested this at the time :) |
Tested master + this branch:
Those are all correct, I think, except for the egg (which nobody uses any more), and the |
Can you explain the difference between the 2nd and 3rd lines? |
AFAIK wheels never contain pyc files. |
I think Edit: Actually, without the |
@@ -6,6 +6,7 @@ include README.* | |||
include LICENSE | |||
include CHANGES | |||
include setup.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this just say include setup.py
now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that, and it still included the pyc. I didn't go too far down that rabbit hole.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean have "include setup.py" and "exclude setup.pyc". The "*" seems mysterious now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also setup.cfg
setup.py
Outdated
call([sys.executable, '_build_tables.py'], | ||
cwd=os.path.join(dir, 'pycparser')) | ||
from subprocess import check_call | ||
check_call([sys.executable, '-B', '_build_tables.py'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to add a comment here explaining why the -B
and even linking to the PR discussion
setup.py
Outdated
call([sys.executable, '_build_tables.py'], | ||
cwd=os.path.join(dir, 'pycparser')) | ||
from subprocess import check_call | ||
# This is run inside the install dir, so we don't want to leave any .pyc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear what the install dir means here - the directory you install it from, or install it to? Please be more explicit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed.
Merging, thanks |
We don't want to include pyc files in source distributions.