Skip to content

Commit 689a1d5

Browse files
committed
AUTO-6263: requirements.txt: Add dependency version constraints based on Python version
Drop the version constraints from the dependencies listed in the install_requires[] keyword argument to setup(). Instead, require that "-r requirements.txt" be supplied to "pip install" and populate the file with rules conditional on the version of Python being used. Determine the rules for a dependency by examining the Python versions shown as Requires and Classifiers on the documentation for its versions on PyPi. Also, rearrange the list of dependencies in install_requires[] to be in alphabetical order and indicate for which submodule the dependency is for.
1 parent b55c0ec commit 689a1d5

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

requirements.txt

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
websockets>=7.0
2-
websocket-client==0.57.0 # for dreamview
3-
numpy # for evaluator
4-
environs
1+
2+
# - PACKAGE >= PKG_VERSION ; python_version >= PYTHON_VERSION
3+
# PKG_VERSION is the first version of PACKAGE that supports PYTHON_VERSION
4+
# - PACKAGE < PKG_VERSION ; python_version < PYTHON_VERSION
5+
# PKG_VERSION is the first version of PACKAGE that no longer supports
6+
# PYTHON_VERSION; add entries for PYTHON_VERSION > "python_requires" of
7+
# lgsvl in setup.py
8+
# - Keep in alphabetical order.
9+
environs >= 8.1.0 ; python_version >= '3.9'
10+
numpy < 1.20 ; python_version < '3.7'
11+
numpy >= 1.20 ; python_version >= '3.7'
12+
websocket-client >= 0.58.0 ; python_version >= '3.8'
13+
websockets < 8.1 ; python_version < '3.6.1'
14+
websockets >= 8.1 ; python_version >= '3.8'
15+
websockets >= 9.0.1 ; python_version >= '3.9'

setup.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ def get_version(git_tag):
8686
url="https://github.com/lgsvl/PythonAPI",
8787
packages=["lgsvl", "lgsvl.dreamview", "lgsvl.evaluator", "lgsvl.wise"],
8888
install_requires=[
89-
"websockets==7.0",
90-
"websocket-client==0.57.0",
91-
"numpy",
92-
"environs"
89+
"environs",
90+
"numpy", # for evaluator
91+
"websocket-client", # for dreamview
92+
"websockets"
9393
],
9494
setup_requires=[
9595
"GitPython==3.1.14"

0 commit comments

Comments
 (0)