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
aefeb976
Commit
aefeb976
authored
Aug 14, 2010
by
Éric Araujo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a marker in generated MANIFEST files, don't touch files without it. Fixes #8688.
parent
8e471803
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
4 deletions
+49
-4
command/sdist.py
command/sdist.py
+15
-2
tests/test_sdist.py
tests/test_sdist.py
+34
-2
No files found.
command/sdist.py
View file @
aefeb976
...
...
@@ -335,8 +335,21 @@ class sdist(Command):
by '
add_defaults
()
' and '
read_template
()
') to the manifest file
named by '
self
.
manifest
'.
"""
self.execute(file_util.write_file,
(self.manifest, self.filelist.files),
if os.path.isfile(self.manifest):
fp = open(self.manifest)
try:
first_line = fp.readline()
finally:
fp.close()
if first_line != '
# file GENERATED by distutils, do NOT edit\n':
log
.
info
(
"not writing to manually maintained "
"manifest file '%s'"
%
self
.
manifest
)
return
content
=
self
.
filelist
.
files
[:]
content
.
insert
(
0
,
'# file GENERATED by distutils, do NOT edit'
)
self
.
execute
(
file_util
.
write_file
,
(
self
.
manifest
,
content
),
"writing manifest file '%s'"
%
self
.
manifest
)
def
read_manifest
(
self
):
...
...
tests/test_sdist.py
View file @
aefeb976
...
...
@@ -29,6 +29,7 @@ setup(name='fake')
"""
MANIFEST
=
"""
\
# file GENERATED by distutils, do NOT edit
README
inroot.txt
setup.py
...
...
@@ -294,7 +295,7 @@ class SDistTestCase(PyPIRCCommandTestCase):
finally
:
f
.
close
()
self
.
assertEquals
(
len
(
manifest
),
4
)
self
.
assertEquals
(
len
(
manifest
),
5
)
# adding a file
self
.
write_file
((
self
.
tmp_dir
,
'somecode'
,
'doc2.txt'
),
'#'
)
...
...
@@ -314,9 +315,40 @@ class SDistTestCase(PyPIRCCommandTestCase):
f
.
close
()
# do we have the new file in MANIFEST ?
self
.
assertEquals
(
len
(
manifest2
),
5
)
self
.
assertEquals
(
len
(
manifest2
),
6
)
self
.
assertIn
(
'doc2.txt'
,
manifest2
[
-
1
])
def
test_manifest_marker
(
self
):
# check that autogenerated MANIFESTs have a marker
dist
,
cmd
=
self
.
get_cmd
()
cmd
.
ensure_finalized
()
cmd
.
run
()
f
=
open
(
cmd
.
manifest
)
try
:
manifest
=
[
line
.
strip
()
for
line
in
f
.
read
().
split
(
'
\
n
'
)
if
line
.
strip
()
!=
''
]
finally
:
f
.
close
()
self
.
assertEqual
(
manifest
[
0
],
'# file GENERATED by distutils, do NOT edit'
)
def
test_manual_manifest
(
self
):
# check that a MANIFEST without a marker is left alone
dist
,
cmd
=
self
.
get_cmd
()
cmd
.
ensure_finalized
()
self
.
write_file
((
self
.
tmp_dir
,
cmd
.
manifest
),
'README.manual'
)
cmd
.
run
()
f
=
open
(
cmd
.
manifest
)
try
:
manifest
=
[
line
.
strip
()
for
line
in
f
.
read
().
split
(
'
\
n
'
)
if
line
.
strip
()
!=
''
]
finally
:
f
.
close
()
self
.
assertEqual
(
manifest
,
[
'README.manual'
])
def
test_suite
():
return
unittest
.
makeSuite
(
SDistTestCase
)
...
...
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