From 911bdb1c8033a8a463404ce2d2a0ca4b71ca7b19 Mon Sep 17 00:00:00 2001 From: Philip Xu Date: Tue, 26 Jun 2018 17:21:41 -0400 Subject: [PATCH] Use extras_require for optional dependencies. Close #73 . --- setup.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index 12d9a9f..ea7105b 100644 --- a/setup.py +++ b/setup.py @@ -4,14 +4,6 @@ import os from setuptools import setup, Extension, find_packages -# Uvloop and ujson are notoriously problematic at Windows so they are skipped for Windows users. -# They still can install and benefit from it... it's just that Vibora doesnt make it mandatory. -dependencies = ['pendulum'] -if platform.system().lower() == 'linux': - if os.environ.get('VIBORA_UVLOOP', 1) != '0': - dependencies.append('uvloop') - if os.environ.get('VIBORA_UJSON', 1) != '0': - dependencies.append('ujson') # Loading version here = pathlib.Path(__file__).parent @@ -35,7 +27,20 @@ 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3.6' ], - install_requires=dependencies, + install_requires=['pendulum'], + extras_require={ + 'dev': [ + 'flake8', + 'pytest', + 'tox', + ], + 'ujson': [ + 'ujson', + ], + 'uvloop': [ + 'uvloop', + ], + }, ext_modules=[ Extension( "vibora.parsers.parser",