mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-08 16:53:23 +00:00
Merge pull request #346 from carsonyl/patch-1
Convert extras_require conditional deps to PEP 508 form.
This commit is contained in:
34
setup.py
34
setup.py
@@ -1,11 +1,9 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import logging
|
|
||||||
|
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
from setuptools.command.test import test as TestCommand
|
from setuptools.command.test import test as TestCommand
|
||||||
import pkg_resources
|
|
||||||
|
|
||||||
long_description = open('README.rst', 'r').read()
|
long_description = open('README.rst', 'r').read()
|
||||||
|
|
||||||
@@ -24,29 +22,14 @@ class PyTest(TestCommand):
|
|||||||
sys.exit(errno)
|
sys.exit(errno)
|
||||||
|
|
||||||
|
|
||||||
install_requires = ['PyYAML', 'wrapt', 'six>=1.5']
|
install_requires = [
|
||||||
|
'PyYAML',
|
||||||
|
'wrapt',
|
||||||
extras_require = {
|
'six>=1.5',
|
||||||
':python_version in "2.7"': ['contextlib2', 'mock'],
|
'contextlib2; python_version=="2.7"',
|
||||||
':python_version in "3.4, 3.5, 3.6"': ['yarl'],
|
'mock; python_version=="2.7"',
|
||||||
}
|
'yarl; python_version>="3.4"',
|
||||||
|
]
|
||||||
|
|
||||||
try:
|
|
||||||
if 'bdist_wheel' not in sys.argv:
|
|
||||||
for key, value in extras_require.items():
|
|
||||||
if key.startswith(':') and pkg_resources.evaluate_marker(key[1:]):
|
|
||||||
install_requires.extend(value)
|
|
||||||
except Exception:
|
|
||||||
logging.getLogger(__name__).exception(
|
|
||||||
'Something went wrong calculating platform specific dependencies, so '
|
|
||||||
"you're getting them all!"
|
|
||||||
)
|
|
||||||
for key, value in extras_require.items():
|
|
||||||
if key.startswith(':'):
|
|
||||||
install_requires.extend(value)
|
|
||||||
|
|
||||||
|
|
||||||
excluded_packages = ["tests*"]
|
excluded_packages = ["tests*"]
|
||||||
if sys.version_info[0] == 2:
|
if sys.version_info[0] == 2:
|
||||||
@@ -66,7 +49,6 @@ setup(
|
|||||||
packages=find_packages(exclude=excluded_packages),
|
packages=find_packages(exclude=excluded_packages),
|
||||||
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
|
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
|
||||||
install_requires=install_requires,
|
install_requires=install_requires,
|
||||||
extras_require=extras_require,
|
|
||||||
license='MIT',
|
license='MIT',
|
||||||
tests_require=['pytest', 'mock', 'pytest-httpbin'],
|
tests_require=['pytest', 'mock', 'pytest-httpbin'],
|
||||||
classifiers=[
|
classifiers=[
|
||||||
|
|||||||
Reference in New Issue
Block a user