summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Holth <dholth@fastmail.fm>2014-04-10 21:25:13 -0400
committerDaniel Holth <dholth@fastmail.fm>2014-04-10 21:25:13 -0400
commitde68e092aba8f44ad629a860adb5d35ba9a27379 (patch)
tree1a823dba74ff2bed55a15e6990c51169e98c6ca4
parent5a3d2b588c35cb218b2ddb11fc88345be4ba80d7 (diff)
downloadwheel-de68e092aba8f44ad629a860adb5d35ba9a27379.tar.gz
use & support setuptools extras:markers syntax.
-rw-r--r--setup.cfg9
-rw-r--r--setup.py4
-rw-r--r--wheel/metadata.py16
3 files changed, 14 insertions, 15 deletions
diff --git a/setup.cfg b/setup.cfg
index 9a562c0..99207b9 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -2,15 +2,6 @@
addopts=--ignore=dist --ignore=build --cov=wheel
[metadata]
-provides-extra =
- tool
- signatures
- faster-signatures
-requires-dist =
- argparse; python_version == '2.6'
- keyring; extra == 'signatures'
- pyxdg; sys.platform != 'win32' and extra == 'signatures'
- ed25519ll; extra == 'faster-signatures'
license-file = LICENSE.txt
[bdist_wheel]
diff --git a/setup.py b/setup.py
index 643840c..84ef5a2 100644
--- a/setup.py
+++ b/setup.py
@@ -49,7 +49,9 @@ setup(name='wheel',
],
install_requires=install_requires,
extras_require={
- 'signatures': signature_reqs,
+ ':python_version=="2.6"': ['argparse'],
+ 'signatures': ['keyring'],
+ 'signatures:sys_platform!="win32"': ['pyxdg'],
'faster-signatures': ['ed25519ll'],
'tool': []
},
diff --git a/wheel/metadata.py b/wheel/metadata.py
index 423d9b4..c582537 100644
--- a/wheel/metadata.py
+++ b/wheel/metadata.py
@@ -49,7 +49,7 @@ def unique(iterable):
def handle_requires(metadata, pkg_info, key):
"""
- Place the runtime requirements from pkg_info into metadata.
+ Place the runtime requirements from pkg_info into metadata.
"""
may_requires = defaultdict(list)
for value in pkg_info.get_all(key):
@@ -85,10 +85,10 @@ def handle_requires(metadata, pkg_info, key):
def pkginfo_to_dict(path, distribution=None):
"""
Convert PKG-INFO to a prototype Metadata 2.0 (PEP 426) dict.
-
- The description is included under the key ['description'] rather than
+
+ The description is included under the key ['description'] rather than
being written to a separate file.
-
+
path: path to PKG-INFO file
distribution: optional distutils Distribution()
"""
@@ -231,9 +231,15 @@ def pkginfo_to_metadata(egg_info_path, pkginfo_path):
requires = open(requires_path).read()
for extra, reqs in pkg_resources.split_sections(requires):
condition = ''
+ if extra and ':' in extra: # setuptools extra:condition syntax
+ extra, condition = extra.split(':', 1)
if extra:
pkg_info['Provides-Extra'] = extra
- condition = '; extra == %s' % repr(extra)
+ if condition:
+ condition += " and "
+ condition += 'extra == %s' % repr(extra)
+ if condition:
+ condition = '; ' + condition
for new_req in convert_requirements(reqs):
pkg_info['Requires-Dist'] = new_req + condition