Open dmiyakawa opened 8 years ago
may i ask how would you use this code ? in a separate script ? or maybe contribute back into setuptools as a separate flag to enable it ?
Use it as a separate script toward the egg file that is discussed as problematic here.
Could you tell me where exactly, we need to keep the above script? Below is the structure of my folder. root_folder/ --------app_folder --------setup.py --------README.rst --------MANIFEST.in
@dmiyakawa I created a PR (https://github.com/pypa/setuptools/pull/1145) to mend this issue.
The PR directly rename files in the bdist_egg
command.
Your comments or suggestions are welcome.
Sorry I had been satisfied with my workaround and haven't seen this issue for a while.
Seems there are people who want the functionality, while I am still not sure if mainstream developers think the feature itself is still important enough, or, should be deprecated and removed in the future (I hope the former of course). #1145 looks quite nice.
Maybe wheel should have same functionality?
@bRsatUoh Try it after building the egg. dist/ dir and compiled egg will be needed.
@haobibo Looks very nice but CI complains something.
Today, I encountered the same problem when build .egg
package for Scrapy deployment. (.egg
packages are required by scrapyd
for deployment).
Even there's no __pycache__
in my source files, __pycache__
folders are added within the .egg
pacakge, which doesn't happen with .wheel
packages.
Seems a bug.
Environment:
(Coming from here: https://bugs.python.org/issue28630)
I'm trying to prepare an egg file without source code. I had used
python setup.py bdist_egg --exclude-source-files
, which does not work with Python3.After digging into the issue more, I found PEP-3147 is related to the problem. https://www.python.org/dev/peps/pep-3147/
Here,
greeting/__pycache__/__init__.cpython-35.pyc
andgreeting/__pycache__/greeting.cpython-35.pyc
are not where they should be. See the following results (with Python 2.7.12)According to the chart in PEP-3147, original py file must also exist to make pyc cache in
__pycache__
effective.To let bdist_egg's
--exclude-sourcce-files
option work as it worked in Python2 era, pyc files in__pycache__
must be at where legacy Python2 placed. I tried tweaking the Py3's egg content with the following code, and the tweaked egg worked nicely.