summaryrefslogtreecommitdiff
path: root/setuptools/dist.py
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/dist.py')
-rw-r--r--setuptools/dist.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py
index e79058c3..fc5db5d1 100644
--- a/setuptools/dist.py
+++ b/setuptools/dist.py
@@ -44,7 +44,7 @@ def write_pkg_file(self, file):
self.classifiers or self.download_url):
version = '1.1'
# Setuptools specific for PEP 345
- if hasattr(self, 'python_requires'):
+ if hasattr(self, 'python_requires') or self.project_urls:
version = '1.2'
file.write('Metadata-Version: %s\n' % version)
@@ -57,6 +57,8 @@ def write_pkg_file(self, file):
file.write('License: %s\n' % self.get_license())
if self.download_url:
file.write('Download-URL: %s\n' % self.download_url)
+ for project_url in self.project_urls.items():
+ file.write('Project-URL: %s, %s\n' % project_url)
long_desc_content_type = \
self.long_description_content_type or 'UNKNOWN'
@@ -323,12 +325,20 @@ 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.project_urls = attrs.get('project_urls', {})
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)
+ # The project_urls attribute may not be supported in distutils, so
+ # prime it here from our value if not automatically set
+ self.metadata.project_urls = getattr(
+ self.metadata, 'project_urls', self.project_urls)
self.metadata.long_description_content_type = attrs.get(
'long_description_content_type'
)