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
f78c4893
Commit
f78c4893
authored
Mar 17, 2018
by
Paul Ganssle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue with unicode author/maintainer on PY2
parent
2005e53e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
setuptools/dist.py
setuptools/dist.py
+10
-4
No files found.
setuptools/dist.py
View file @
f78c4893
# -*- coding: utf-8 -*-
__all__
=
[
'Distribution'
]
import
re
...
...
@@ -38,7 +39,9 @@ def _get_unpatched(cls):
def
get_metadata_version
(
dist_md
):
if
dist_md
.
long_description_content_type
or
dist_md
.
provides_extras
:
return
StrictVersion
(
'2.1'
)
elif
getattr
(
dist_md
,
'python_requires'
,
None
)
is
not
None
:
elif
(
dist_md
.
maintainer
is
not
None
or
dist_md
.
maintainer_email
is
not
None
or
getattr
(
dist_md
,
'python_requires'
,
None
)
is
not
None
):
return
StrictVersion
(
'1.2'
)
elif
(
dist_md
.
provides
or
dist_md
.
requires
or
dist_md
.
obsoletes
or
dist_md
.
classifiers
or
dist_md
.
download_url
):
...
...
@@ -48,7 +51,7 @@ def get_metadata_version(dist_md):
# Based on Python 3.5 version
def
write_pkg_file
(
self
,
file
):
def
write_pkg_file
(
self
,
file
,
is_test
=
False
):
"""Write the PKG-INFO format data to a file object.
"""
version
=
get_metadata_version
(
self
)
...
...
@@ -59,7 +62,7 @@ def write_pkg_file(self, file):
file
.
write
(
'Summary: %s
\
n
'
%
self
.
get_description
())
file
.
write
(
'Home-page: %s
\
n
'
%
self
.
get_url
())
if
version
==
'1.2'
:
if
version
<
StrictVersion
(
'1.2'
)
:
file
.
write
(
'Author: %s
\
n
'
%
self
.
get_contact
())
file
.
write
(
'Author-email: %s
\
n
'
%
self
.
get_contact_email
())
else
:
...
...
@@ -72,6 +75,9 @@ def write_pkg_file(self, file):
for
field
,
attr
in
optional_fields
:
attr_val
=
getattr
(
self
,
attr
)
if
six
.
PY2
:
attr_val
=
self
.
_encode_field
(
attr_val
)
if
attr_val
is
not
None
:
file
.
write
(
'%s: %s
\
n
'
%
(
field
,
attr_val
))
...
...
@@ -88,7 +94,7 @@ def write_pkg_file(self, file):
if
keywords
:
file
.
write
(
'Keywords: %s
\
n
'
%
keywords
)
if
version
==
'1.2'
:
if
version
>=
StrictVersion
(
'1.2'
)
:
for
platform
in
self
.
get_platforms
():
file
.
write
(
'Platform: %s
\
n
'
%
platform
)
else
:
...
...
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