Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
da668ff2
Kaydet (Commit)
da668ff2
authored
Agu 14, 2010
tarafından
Éric Araujo
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use a marker in generated MANIFEST files, don't touch files without it. Fixes #8688.
üst
e406ef41
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
9 deletions
+61
-9
sourcedist.rst
Doc/distutils/sourcedist.rst
+8
-5
sdist.py
Lib/distutils/command/sdist.py
+15
-2
test_sdist.py
Lib/distutils/tests/test_sdist.py
+34
-2
NEWS
Misc/NEWS
+4
-0
No files found.
Doc/distutils/sourcedist.rst
Dosyayı görüntüle @
da668ff2
...
...
@@ -103,6 +103,10 @@ per line, regular files (or symlinks to them) only. If you do supply your own
:file:`MANIFEST`, you must specify everything: the default set of files
described above does not apply in this case.
.. versionadded:: 3.2
:file:`MANIFEST` files start with a comment indicated they are generated.
Files without this comment are not overwritten or removed.
The manifest template has one command per line, where each command specifies a
set of files to include or exclude from the source distribution. For an
example, again we turn to the Distutils' own manifest template::
...
...
@@ -187,10 +191,6 @@ The normal course of operations for the :command:`sdist` command is as follows:
* if neither :file:`MANIFEST` nor :file:`MANIFEST.in` exist, create a manifest
with just the default file set
* if either :file:`MANIFEST.in` or the setup script (:file:`setup.py`) are more
recent than :file:`MANIFEST`, recreate :file:`MANIFEST` by reading
:file:`MANIFEST.in`
* use the list of files now in :file:`MANIFEST` (either just generated or read
in) to create the source distribution archive(s)
...
...
@@ -205,4 +205,7 @@ distribution::
:option:`-o` is a shortcut for :option:`--manifest-only`.
.. versionchanged:: 3.2
An existing generated :file:`MANIFEST` will be regenerated without
:command:`sdist` comparing its modification time to the one of
:file:`MANIFEST.in` or :file:`setup.py`.
Lib/distutils/command/sdist.py
Dosyayı görüntüle @
da668ff2
...
...
@@ -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
):
...
...
Lib/distutils/tests/test_sdist.py
Dosyayı görüntüle @
da668ff2
...
...
@@ -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
)
...
...
Misc/NEWS
Dosyayı görüntüle @
da668ff2
...
...
@@ -83,6 +83,10 @@ Extensions
Library
-------
- Issue #8688: MANIFEST files created by distutils now include a magic
comment indicating they are generated. Manually maintained MANIFESTs
without this marker will not be overwritten or removed.
- Issue #7467: when reading a file from a ZIP archive, its CRC is checked
and a BadZipfile error is raised if it doesn't match (as used to be the
case in Python 2.5 and earlier).
...
...
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