diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2018-01-04 20:33:25 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-04 20:33:25 -0500 |
| commit | 23b940e9fb32a4f8f4c63f0c3d2af9169df65d70 (patch) | |
| tree | 28b43a1dbb862a6992b22181a802f38d15ec46ae /setuptools/dist.py | |
| parent | 1ad2c11ca1d8535c61215b184d18bf713ef813c9 (diff) | |
| parent | 780a6f161ed4ce1026f5279c53c196d3bfdcec37 (diff) | |
| download | python-setuptools-git-23b940e9fb32a4f8f4c63f0c3d2af9169df65d70.tar.gz | |
Merge pull request #1207 from cryvate/fix-issue-1206
Add setup.cfg support for long_description_content_type
Diffstat (limited to 'setuptools/dist.py')
| -rw-r--r-- | setuptools/dist.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py index 477f93dd..e79058c3 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -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()) @@ -326,14 +323,16 @@ 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) + + 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 :) self.metadata.version = str(self.metadata.version) |
