diff --git a/analyzer/setup.py b/analyzer/setup.py index 3a7025406..7b3b9d7a0 100644 --- a/analyzer/setup.py +++ b/analyzer/setup.py @@ -27,8 +27,8 @@ setup( ], extras_require={ "dev": [ - "distro", - "types-requests", + "distro>=1.8.0,<1.9", + "types-requests>=2.25.1,<2.29", ], }, zip_safe=False, diff --git a/api-client/setup.py b/api-client/setup.py index bce0e2e50..c41f3d002 100644 --- a/api-client/setup.py +++ b/api-client/setup.py @@ -21,9 +21,9 @@ setup( ], extras_require={ "dev": [ - "requests-mock", - "types-python-dateutil", - "types-requests", + "requests-mock>=1.10.0,<1.11", + "types-python-dateutil>=2.8.1,<2.9", + "types-requests>=2.25.1,<2.29", ], }, zip_safe=False, diff --git a/api/setup.py b/api/setup.py index 01651851f..7fde6208b 100644 --- a/api/setup.py +++ b/api/setup.py @@ -35,14 +35,14 @@ setup( "psycopg2>=2.8.6,<2.10", ], "dev": [ - "django-coverage-plugin", - "django-stubs", - "djangorestframework-stubs", - "model_bakery", - "psycopg2-binary", - "pylint-django", - "pytest-django", - "requests-mock", + "django-coverage-plugin>=3.0.0,<3.1", + "django-stubs>=1.14.0,<1.15", + "djangorestframework-stubs>=1.8.0,<1.9", + "model_bakery>=1.10.1,<1.11", + "psycopg2-binary>=2.8.6,<2.10", + "pylint-django>=2.5.3,<2.6", + "pytest-django>=4.5.2,<4.6", + "requests-mock>=1.10.0,<1.11", ], }, ) diff --git a/playout/setup.py b/playout/setup.py index 50123eb22..f767709ef 100644 --- a/playout/setup.py +++ b/playout/setup.py @@ -34,12 +34,12 @@ setup( ], extras_require={ "dev": [ - "distro", - "requests-mock", - "syrupy", - "types-backports", - "types-python-dateutil", - "types-requests", + "distro>=1.8.0,<1.9", + "requests-mock>=1.10.0,<1.11", + "syrupy>=3.0.6,<3.1", + "types-backports>=0.1.3,<0.2", + "types-python-dateutil>=2.8.1,<2.9", + "types-requests>=2.25.1,<2.29", ], }, zip_safe=False, diff --git a/shared/setup.py b/shared/setup.py index d41902b74..a747d8c1d 100644 --- a/shared/setup.py +++ b/shared/setup.py @@ -18,8 +18,8 @@ setup( ], extras_require={ "dev": [ - "types-backports", - "types-pyyaml", + "types-backports>=0.1.3,<0.2", + "types-pyyaml>=5.3.1,<6.1", ], }, ) diff --git a/tools/python-requirements.txt b/tools/python-requirements.txt new file mode 100644 index 000000000..233baf102 --- /dev/null +++ b/tools/python-requirements.txt @@ -0,0 +1,9 @@ +bandit>=1.7.4,<1.8 +black>=23.1.0,<24.0 +flake8>=6.0.0,<6.1 +isort>=5.12.0,<5.13 +mypy==0.991 +pylint>=2.16.1,<2.17 +pytest-cov>=4.0.0,<4.1 +pytest-xdist>=3.1.0,<3.2 +pytest>=7.2.1,<7.3 diff --git a/tools/python.mk b/tools/python.mk index f0ee2c5d9..dfdfef6ca 100644 --- a/tools/python.mk +++ b/tools/python.mk @@ -8,28 +8,18 @@ CPU_CORES := $(shell N=$$(nproc); echo $$(( $$N > 4 ? 4 : $$N ))) # BANDIT_ARG = # PYTEST_ARG = -SHARED_DEV_REQUIREMENTS = \ - bandit \ - black \ - flake8 \ - isort \ - mypy \ - pylint \ - pytest \ - pytest-cov \ - pytest-xdist - -VENV = .venv -$(VENV): - python3 -m venv $(VENV) - $(MAKE) install - # SETUPTOOLS_ENABLE_FEATURES=legacy-editable is required to work # around https://github.com/PyCQA/pylint/issues/7306 +VENV = .venv install: $(VENV) +$(VENV): + python3 -m venv $(VENV) $(VENV)/bin/pip install --upgrade pip setuptools wheel - $(VENV)/bin/pip install $(SHARED_DEV_REQUIREMENTS) - [[ -z "$(PIP_INSTALL)" ]] || SETUPTOOLS_ENABLE_FEATURES=legacy-editable $(VENV)/bin/pip install $(PIP_INSTALL) + + SETUPTOOLS_ENABLE_FEATURES=legacy-editable \ + $(VENV)/bin/pip install \ + --requirement ../tools/python-requirements.txt \ + $(PIP_INSTALL) .PHONY: .format .format: $(VENV) diff --git a/worker/setup.py b/worker/setup.py index aa8ea848f..5067b0e17 100644 --- a/worker/setup.py +++ b/worker/setup.py @@ -22,8 +22,8 @@ setup( ], extras_require={ "dev": [ - "requests-mock", - "types-requests", + "requests-mock>=1.10.0,<1.11", + "types-requests>=2.25.1,<2.29", ], }, zip_safe=False,