From e295d01c164af646095ab1189e370ac69c92242c Mon Sep 17 00:00:00 2001 From: Christophe de Vienne Date: Mon, 17 Sep 2012 23:25:13 +0200 Subject: [PATCH] Still need to specify the requires int the setup.py, as d2to1 does not seem to handle python_version dependant metadata --- setup.cfg | 13 ------------- setup.py | 19 ++++++++++++++++++- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/setup.cfg b/setup.cfg index 420182e..7529089 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,24 +28,11 @@ classifier = Topic :: Internet :: WWW/HTTP :: WSGI Topic :: Software Development :: Libraries :: Python Modules -requires = - six - simplegeneric - [entry_points] wsme.protocols = restjson = wsme.protocols.restjson:RestJsonProtocol restxml = wsme.protocols.restxml:RestXmlProtocol -[metadata:python_version == '2.5'] -requires = WebOb <= 1.1.1 - -[metadata:python_version == '2.6' or python_version == '2.7'] -requires = WebOb - -[metadata:python_version != '2.5' and python_version != '2.6' and python_version != '2.7'] -requires = WebOb >= 1.2b3 - [files] packages = wsme diff --git a/setup.py b/setup.py index 7b26f9d..0773bbd 100644 --- a/setup.py +++ b/setup.py @@ -1,2 +1,19 @@ from setuptools import setup -setup(setup_requires=['d2to1'], d2to1=True) +import sys + +if sys.version_info[:2] <= (2, 5): + webob_version = ' <= 1.1.1' +elif sys.version_info[:2] >= (3, 0): + webob_version = ' >= 1.2.2' +else: + webob_version = '' + +setup( + setup_requires=['d2to1'], + install_requires=[ + 'six', + 'simplegeneric', + 'WebOb' + webob_version + ], + d2to1=True +)