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
70e95ee6
Commit
70e95ee6
authored
Mar 25, 2020
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When copying package data, make sure it's writable, but otherwise preserve the mode. Fixes #2041.
parent
a3620a45
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
setuptools/command/build_py.py
setuptools/command/build_py.py
+7
-2
No files found.
setuptools/command/build_py.py
View file @
70e95ee6
...
@@ -7,6 +7,7 @@ import textwrap
...
@@ -7,6 +7,7 @@ import textwrap
import
io
import
io
import
distutils.errors
import
distutils.errors
import
itertools
import
itertools
import
stat
from
setuptools.extern
import
six
from
setuptools.extern
import
six
from
setuptools.extern.six.moves
import
map
,
filter
,
filterfalse
from
setuptools.extern.six.moves
import
map
,
filter
,
filterfalse
...
@@ -20,6 +21,10 @@ except ImportError:
...
@@ -20,6 +21,10 @@ except ImportError:
"do nothing"
"do nothing"
def
make_writable
(
target
):
os
.
chmod
(
target
,
os
.
stat
(
target
).
st_mode
|
stat
.
S_IWRITE
)
class
build_py
(
orig
.
build_py
,
Mixin2to3
):
class
build_py
(
orig
.
build_py
,
Mixin2to3
):
"""Enhanced 'build_py' command that includes data files with packages
"""Enhanced 'build_py' command that includes data files with packages
...
@@ -120,8 +125,8 @@ class build_py(orig.build_py, Mixin2to3):
...
@@ -120,8 +125,8 @@ class build_py(orig.build_py, Mixin2to3):
target
=
os
.
path
.
join
(
build_dir
,
filename
)
target
=
os
.
path
.
join
(
build_dir
,
filename
)
self
.
mkpath
(
os
.
path
.
dirname
(
target
))
self
.
mkpath
(
os
.
path
.
dirname
(
target
))
srcfile
=
os
.
path
.
join
(
src_dir
,
filename
)
srcfile
=
os
.
path
.
join
(
src_dir
,
filename
)
outf
,
copied
=
self
.
copy_file
(
outf
,
copied
=
self
.
copy_file
(
srcfile
,
target
)
srcfile
,
target
,
preserve_mode
=
False
)
make_writable
(
target
)
srcfile
=
os
.
path
.
abspath
(
srcfile
)
srcfile
=
os
.
path
.
abspath
(
srcfile
)
if
(
copied
and
if
(
copied
and
srcfile
in
self
.
distribution
.
convert_2to3_doctests
):
srcfile
in
self
.
distribution
.
convert_2to3_doctests
):
...
...
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