Skip to content

Commit 15c1c8d

Browse files
author
Nissan Pow
committed
refactor: consolidate test deps into setup.py [dev]
Move pytest-timeout, pytest-cov, pytest-xdist, pytest-rerunfailures, and localbatch into setup.py extras_require[dev] so there is a single source of truth. tox.ini, GHA, and requirements-devstack.txt all just do 'pip install -e .[dev]' and pick everything up automatically.
1 parent 399c5c5 commit 15c1c8d

4 files changed

Lines changed: 13 additions & 16 deletions

File tree

.github/workflows/ux-tests.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Install Metaflow and test dependencies
4747
run: |
4848
pip install --upgrade pip
49-
pip install -e ".[dev]" pytest-timeout pytest-cov
49+
pip install -e ".[dev]"
5050
5151
- name: Run unit and command tests
5252
run: |
@@ -138,8 +138,7 @@ jobs:
138138
- name: Install Metaflow and test dependencies
139139
run: |
140140
pip install --upgrade pip
141-
pip install -e ".[dev]" pytest-xdist pytest-timeout pytest-cov pytest-rerunfailures
142-
pip install "git+https://github.com/npow/localbatch.git@main#egg=localbatch"
141+
pip install -e ".[dev]"
143142
144143
- name: Set up minikube
145144
uses: medyagh/setup-minikube@aba8d5ff1666d19b9549133e3b92e70d4fc52cb7

devtools/requirements-devstack.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
localbatch
1+
-e .[dev]

setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ def find_devtools_files():
6464
install_requires=["requests", "boto3"],
6565
extras_require={
6666
"stubs": ["metaflow-stubs==%s" % version],
67-
"dev": ["pytest", "omegaconf", "kubernetes"],
67+
"dev": [
68+
"pytest",
69+
"pytest-timeout",
70+
"pytest-cov",
71+
"pytest-xdist",
72+
"pytest-rerunfailures",
73+
"omegaconf",
74+
"kubernetes",
75+
"localbatch",
76+
],
6877
},
6978
)

tox.ini

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,18 @@ commands = ./test_runner
88
passenv = *
99
deps =
1010
-e {toxinidir}[dev]
11-
pytest-timeout>=2.0
12-
pytest-cov>=4.0
1311

1412
[testenv:unit]
1513
commands = pytest test/unit/ test/cmd/ test/plugins/ --ignore=test/unit/spin -v --tb=short --timeout=120 {posargs}
1614

1715
[testenv:ux-local]
18-
deps = {[testenv]deps}
19-
pytest-xdist>=3.0
2016
commands = pytest test/ux/core/ --only-backend local -n 4 -v --tb=short --timeout=1800 {posargs}
2117

2218
[testenv:ux-sfn]
23-
deps = {[testenv]deps}
24-
pytest-xdist>=3.0
25-
localbatch @ git+https://github.com/npow/localbatch.git@main
2619
commands = pytest test/ux/core/ --only-backend sfn-batch -n 4 -v --tb=short --timeout=1800 {posargs}
2720

2821
[testenv:ux-argo]
29-
deps = {[testenv]deps}
30-
pytest-xdist>=3.0
3122
commands = pytest test/ux/core/ --only-backend argo-kubernetes -n 2 -v --tb=short --timeout=1800 {posargs}
3223

3324
[testenv:ux-airflow]
34-
deps = {[testenv]deps}
35-
pytest-xdist>=3.0
3625
commands = pytest test/ux/core/ --only-backend airflow-kubernetes -n 2 -v --tb=short --timeout=1800 {posargs}

0 commit comments

Comments
 (0)