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
e7f29530
Commit
e7f29530
authored
Mar 21, 2020
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request 1424 from jorikdima.
parents
17dde199
52e71887
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
changelog.d/1424.change.rst
changelog.d/1424.change.rst
+1
-0
setuptools/command/build_py.py
setuptools/command/build_py.py
+1
-1
setuptools/tests/test_build_py.py
setuptools/tests/test_build_py.py
+27
-0
No files found.
changelog.d/1424.change.rst
0 → 100644
View file @
e7f29530
Prevent keeping files mode for package_data build. It may break a build if user's package data has read only flag.
\ No newline at end of file
setuptools/command/build_py.py
View file @
e7f29530
...
...
@@ -120,7 +120,7 @@ class build_py(orig.build_py, Mixin2to3):
target
=
os
.
path
.
join
(
build_dir
,
filename
)
self
.
mkpath
(
os
.
path
.
dirname
(
target
))
srcfile
=
os
.
path
.
join
(
src_dir
,
filename
)
outf
,
copied
=
self
.
copy_file
(
srcfile
,
target
)
outf
,
copied
=
self
.
copy_file
(
srcfile
,
target
,
preserve_mode
=
False
)
srcfile
=
os
.
path
.
abspath
(
srcfile
)
if
(
copied
and
srcfile
in
self
.
distribution
.
convert_2to3_doctests
):
...
...
setuptools/tests/test_build_py.py
View file @
e7f29530
import
os
import
stat
import
shutil
from
setuptools.dist
import
Distribution
...
...
@@ -20,3 +22,28 @@ def test_directories_in_package_data_glob(tmpdir_cwd):
os
.
makedirs
(
'path/subpath'
)
dist
.
parse_command_line
()
dist
.
run_commands
()
def
test_read_only
(
tmpdir_cwd
):
"""
Ensure mode is not preserved in copy for package modules
and package data, as that causes problems
with deleting read-only files on Windows.
#1451
"""
dist
=
Distribution
(
dict
(
script_name
=
'setup.py'
,
script_args
=
[
'build_py'
],
packages
=
[
'pkg'
],
package_data
=
{
'pkg'
:
[
'data.dat'
]},
name
=
'pkg'
,
))
os
.
makedirs
(
'pkg'
)
open
(
'pkg/__init__.py'
,
'w'
).
close
()
open
(
'pkg/data.dat'
,
'w'
).
close
()
os
.
chmod
(
'pkg/__init__.py'
,
stat
.
S_IREAD
)
os
.
chmod
(
'pkg/data.dat'
,
stat
.
S_IREAD
)
dist
.
parse_command_line
()
dist
.
run_commands
()
shutil
.
rmtree
(
'build'
)
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