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
780a6f16
Commit
780a6f16
authored
Nov 25, 2017
by
Henk-Jaap Wagenaar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rework how to handle long_description_content_type
parent
553e21e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
17 deletions
+6
-17
setuptools/command/egg_info.py
setuptools/command/egg_info.py
+1
-4
setuptools/dist.py
setuptools/dist.py
+5
-13
No files found.
setuptools/command/egg_info.py
View file @
780a6f16
...
...
@@ -597,10 +597,7 @@ def write_pkg_info(cmd, basename, filename):
metadata
=
cmd
.
distribution
.
metadata
metadata
.
version
,
oldver
=
cmd
.
egg_version
,
metadata
.
version
metadata
.
name
,
oldname
=
cmd
.
egg_name
,
metadata
.
name
metadata
.
long_description_content_type
=
getattr
(
cmd
.
distribution
.
metadata
,
'long_description_content_type'
)
try
:
# write unescaped data to PKG-INFO, so older pkg_resources
# can still parse it
...
...
setuptools/dist.py
View file @
780a6f16
...
...
@@ -58,11 +58,8 @@ def write_pkg_file(self, file):
if
self
.
download_url
:
file
.
write
(
'Download-URL: %s
\
n
'
%
self
.
download_url
)
long_desc_content_type
=
getattr
(
self
,
'long_description_content_type'
,
None
)
or
'UNKNOWN'
long_desc_content_type
=
\
self
.
long_description_content_type
or
'UNKNOWN'
file
.
write
(
'Description-Content-Type: %s
\
n
'
%
long_desc_content_type
)
long_desc
=
rfc822_escape
(
self
.
get_long_description
())
...
...
@@ -324,20 +321,15 @@ class Distribution(Distribution_parse_config_files, _Distribution):
self.dist_files = []
self.src_root = attrs.pop("src_root", None)
self.patch_missing_pkg_info(attrs)
self.long_description_content_type = attrs.get(
'
long_description_content_type
'
)
self.dependency_links = attrs.pop('
dependency_links
', [])
self.setup_requires = attrs.pop('
setup_requires
', [])
for ep in pkg_resources.iter_entry_points('
distutils
.
setup_keywords
'):
vars(self).setdefault(ep.name, None)
_Distribution.__init__(self, attrs)
try:
self.metadata.long_description_content_type
except AttributeError:
self.metadata.long_description_content_type =
\
self.long_description_content_type
self.metadata.long_description_content_type = attrs.get(
'
long_description_content_type
'
)
if isinstance(self.metadata.version, numbers.Number):
# Some people apparently take "version number" too literally :)
...
...
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