Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e6db7a3a
Commit
e6db7a3a
authored
Sep 10, 2011
by
Éric Araujo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix determination of Metadata version in packaging (#8933).
Original patch by Filip Gruszczyński.
parent
6bbd7753
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
5 deletions
+19
-5
Lib/packaging/metadata.py
Lib/packaging/metadata.py
+2
-1
Lib/packaging/tests/test_metadata.py
Lib/packaging/tests/test_metadata.py
+14
-1
Misc/NEWS
Misc/NEWS
+3
-3
No files found.
Lib/packaging/metadata.py
View file @
e6db7a3a
...
...
@@ -61,7 +61,8 @@ _314_FIELDS = ('Metadata-Version', 'Name', 'Version', 'Platform',
'
License
', '
Classifier
', '
Download
-
URL
', '
Obsoletes
',
'
Provides
', '
Requires
')
_314_MARKERS = ('
Obsoletes
', '
Provides
', '
Requires
')
_314_MARKERS = ('
Obsoletes
', '
Provides
', '
Requires
', '
Classifier
',
'
Download
-
URL
')
_345_FIELDS = ('
Metadata
-
Version
', '
Name
', '
Version
', '
Platform
',
'
Supported
-
Platform
', '
Summary
', '
Description
',
...
...
Lib/packaging/tests/test_metadata.py
View file @
e6db7a3a
...
...
@@ -251,7 +251,11 @@ class MetadataTestCase(LoggingCatcher,
self
.
assertNotIn
(
'Obsoletes'
,
metadata
)
metadata
[
'Classifier'
]
=
[
'ok'
]
self
.
assertEqual
(
metadata
[
'Metadata-Version'
],
'1.2'
)
self
.
assertEqual
(
metadata
[
'Metadata-Version'
],
'1.1'
)
metadata
=
Metadata
()
metadata
[
'Download-URL'
]
=
'ok'
self
.
assertEqual
(
metadata
[
'Metadata-Version'
],
'1.1'
)
metadata
=
Metadata
()
metadata
[
'Obsoletes'
]
=
'ok'
...
...
@@ -269,6 +273,15 @@ class MetadataTestCase(LoggingCatcher,
metadata
[
'Version'
]
=
'1'
self
.
assertEqual
(
metadata
[
'Metadata-Version'
],
'1.0'
)
# make sure the _best_version function works okay with
# non-conflicting fields from 1.1 and 1.2 (i.e. we want only the
# requires/requires-dist and co. pairs to cause a conflict, not all
# fields in _314_MARKERS)
metadata
=
Metadata
()
metadata
[
'Requires-Python'
]
=
'3'
metadata
[
'Classifier'
]
=
[
'Programming language :: Python :: 3'
]
self
.
assertEqual
(
metadata
[
'Metadata-Version'
],
'1.2'
)
PKG_INFO
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'SETUPTOOLS-PKG-INFO'
)
metadata
=
Metadata
(
PKG_INFO
)
...
...
Misc/NEWS
View file @
e6db7a3a
...
...
@@ -274,9 +274,9 @@ Core and Builtins
Library
-------
- Issue #8933: distutils'
PKG
-
INFO
files
will
now
correctly
report
Metadata
-
Version
:
1.1
instead
of
1.0
if
a
Classifier
or
Download
-
URL
field
is
present
.
- Issue #8933: distutils'
PKG
-
INFO
files
and
packaging
's METADATA files will
now correctly report Metadata-Version: 1.1 instead of 1.0 if a Classifier or
Download-URL field is
present.
- Issue #12567: Add curses.unget_wch() function. Push a character so the next
get_wch() will return it.
...
...
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