Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
ee33fa23
Commit
ee33fa23
authored
Sep 13, 2017
by
Bibo Hao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python 3 bdist_egg --exclude-source-files __pycache__ issue
parent
024139f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
setuptools/command/bdist_egg.py
setuptools/command/bdist_egg.py
+14
-0
No files found.
setuptools/command/bdist_egg.py
View file @
ee33fa23
...
...
@@ -8,6 +8,7 @@ from distutils import log
from
types
import
CodeType
import
sys
import
os
import
re
import
textwrap
import
marshal
...
...
@@ -238,6 +239,8 @@ class bdist_egg(Command):
def
zap_pyfiles
(
self
):
log
.
info
(
"Removing .py files from temporary directory"
)
py3
=
sys
.
version_info
>=
(
3
,
0
)
re_pycache_file
=
re
.
compile
(
'(.+)
\
.cpy
t
hon-3
\
d(.pyc)$
'
)
for base, dirs, files in walk_egg(self.bdist_dir):
for name in files:
if name.endswith('
.
py
'):
...
...
@@ -245,6 +248,17 @@ class bdist_egg(Command):
log.debug("Deleting %s", path)
os.unlink(path)
if py3 and base.endswith('
__pycache__
'):
path_old = os.path.join(base, name)
m = re_pycache_file.match(name)
path_new = os.path.join(base, os.pardir, m.group(1) + m.group(2))
log.info("Renaming Python 3 .pyc file from [%s] to [%s]" % (path_old, path_new))
if os.path.exists(path_new):
os.unlink(path_new)
os.rename(path_old, path_new)
def zip_safe(self):
safe = getattr(self.distribution, '
zip_safe
', None)
if safe is not None:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment