From 0b55981631658d337bf48b5919a2569dbb4175fd Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Sun, 28 Jun 2020 20:29:28 -1000 Subject: [PATCH] Improve requirements handling (#1287) * setup: read requirements.txt for dependencies This makes it easier to keep required packages in sync. Signed-off-by: Paul Spooren * requirements: Update to click 5.0 and redis 3.5.0 Click 5.0 was already required by the `setup.py` and is not brought in sync. Redis Python library 3.5.0 introduces the `HSET` command with mapping support which replaces the previous `hmset`. By lifting the minimal required version to 3.5.0 we can remove the combat function if Redis server 4.0 is guaranteed. Signed-off-by: Paul Spooren * ci: remove Python3.4 testing `redis-py` 3.5.0 does no longer support Python 3.4, so drop it in CI. Signed-off-by: Paul Spooren --- .travis.yml | 1 - requirements.txt | 4 ++-- setup.py | 14 ++++++++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1c4fe39..f51ee9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ services: - redis matrix: include: - - python: "3.4" - python: "3.5" - python: "3.6" - python: "3.7" diff --git a/requirements.txt b/requirements.txt index 7c061a7..f499594 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -redis>=3.0 -click>=3.0.0 +redis>=3.5.0 +click>=5.0.0 diff --git a/setup.py b/setup.py index c35e40d..7069774 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,15 @@ def get_version(): raise RuntimeError('No version info found.') +def get_requirements(): + basedir = os.path.dirname(__file__) + try: + with open(os.path.join(basedir, 'requirements.txt')) as f: + return f.readlines() + except FileNotFoundError: + raise RuntimeError('No requirements info found.') + + setup( name='rq', version=get_version(), @@ -31,10 +40,7 @@ setup( include_package_data=True, zip_safe=False, platforms='any', - install_requires=[ - 'redis >= 3.0.0', - 'click >= 5.0' - ], + install_requires=get_requirements(), python_requires='>=3.4', entry_points={ 'console_scripts': [