From 52e21fa94ef895ff51ae97814aa233cfe96638ff Mon Sep 17 00:00:00 2001 From: Jose Tiago Macara Coutinho Date: Tue, 9 Feb 2021 18:48:48 +0100 Subject: [PATCH] setup: Refine extra config requirements --- README.md | 11 +++++------ setup.py | 11 +++++++++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3a875ed..8116f44 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,10 @@ ![License][license] A simulator for real hardware. This project provides a server able to spawn -multiple simulated devices and serve requests concurrently +multiple simulated devices and serve requests concurrently. This project provides only the required infrastructure to launch a server from -a configuration file (YAML, TOML or json) and a means to register third-party device plugins through -the python entry point mechanism. +a configuration file (YAML, TOML or json) and a means to register third-party device plugins through the python entry point mechanism. So far, the project provides transports for TCP, UDP and serial line. Support for new transports (ex: USB, GPIB or SPI) is being implemented on a @@ -20,7 +19,7 @@ PRs are welcome! ## Installation -(**TL;DR**: `pip install sinstruments pyyaml toml`) +(**TL;DR**: `pip install sinstruments[all]`) From within your favorite python environment: @@ -31,13 +30,13 @@ $ pip install sinstruments Additionally, if you want to write YAML configuration files in YAML: ``` -$ pip install pyyaml +$ pip install sinstruments[yaml] ``` ...or, for TOML based configuration: ``` -$ pip install toml +$ pip install sinstruments[toml] ``` ## Execution diff --git a/setup.py b/setup.py index defde92..c9aece9 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,13 @@ with open('README.md') as readme_file: readme = readme_file.read() -requirements = [ 'gevent', 'PyYAML', 'enum34; python_version < "3.4"' ] +requirements = ['gevent'] + +extras = [ + 'yaml': ['PyYAML'], + 'toml': ['toml'], +} +extras["all"] = list(set.union(*(set(i) for i in extras.values()))) setup_requirements = ['pytest-runner', ] @@ -22,7 +28,7 @@ author="Tiago Coutinho", author_email='coutinhotiago@gmail.com', classifiers=[ - 'Development Status :: 2 - Pre-Alpha', + 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', 'Natural Language :: English', @@ -44,6 +50,7 @@ setup_requires=setup_requirements, test_suite='tests', tests_require=test_requirements, + extras_require=extras, python_requires=">=3.5", url='https://github.com/tiagocoutinho/sinstruments', version='1.2.0',