Skip to content

Commit 0c6be56

Browse files
committed
use version specific testing
1 parent 5661ff2 commit 0c6be56

File tree

2 files changed

+8
-177
lines changed

2 files changed

+8
-177
lines changed

.github/workflows/test-stubs.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,17 @@ jobs:
4848
- name: Install metaflow-stubs
4949
run: metaflow develop stubs install --force
5050

51+
- name: Create version-specific mypy config
52+
run: |
53+
# Copy the existing setup.cfg
54+
cp ./stubs/test/setup.cfg ./stubs/test/mypy_${{ matrix.ver }}.cfg
55+
# Add Python version setting
56+
echo "python_version = ${{ matrix.ver }}" >> ./stubs/test/mypy_${{ matrix.ver }}.cfg
57+
5158
- name: Run mypy tests
5259
uses: nick-fields/retry@v2
5360
with:
5461
max_attempts: 2
5562
timeout_minutes: 3
5663
retry_on: error
57-
command: cd ./stubs && pytest --mypy-ini-file test/setup.cfg --mypy-only-local-stub && cd -
64+
command: cd ./stubs && pytest --mypy-ini-file test/mypy_${{ matrix.ver }}.cfg --mypy-only-local-stub && cd -

stubs/test/test_stubs.yml

Lines changed: 0 additions & 176 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
- case: project_decorator_validity
22
regex: yes
3-
parametrized:
4-
- python_version: "3.7"
5-
- python_version: "3.8"
6-
- python_version: "3.9"
7-
- python_version: "3.10"
8-
- python_version: "3.11"
9-
- python_version: "3.12"
10-
mypy_config: python_version = {{ python_version }}
113
main: |
124
from metaflow import FlowSpec, project
135
@@ -48,14 +40,6 @@
4840
4941
- case: pypi_base_decorator_validity
5042
regex: yes
51-
parametrized:
52-
- python_version: "3.7"
53-
- python_version: "3.8"
54-
- python_version: "3.9"
55-
- python_version: "3.10"
56-
- python_version: "3.11"
57-
- python_version: "3.12"
58-
mypy_config: python_version = {{ python_version }}
5943
main: |
6044
from metaflow import FlowSpec, pypi_base
6145
@@ -96,14 +80,6 @@
9680
9781
- case: conda_base_decorator_validity
9882
regex: yes
99-
parametrized:
100-
- python_version: "3.7"
101-
- python_version: "3.8"
102-
- python_version: "3.9"
103-
- python_version: "3.10"
104-
- python_version: "3.11"
105-
- python_version: "3.12"
106-
mypy_config: python_version = {{ python_version }}
10783
main: |
10884
from metaflow import FlowSpec, conda_base
10985
@@ -144,14 +120,6 @@
144120
145121
- case: schedule_decorator_validity
146122
regex: yes
147-
parametrized:
148-
- python_version: "3.7"
149-
- python_version: "3.8"
150-
- python_version: "3.9"
151-
- python_version: "3.10"
152-
- python_version: "3.11"
153-
- python_version: "3.12"
154-
mypy_config: python_version = {{ python_version }}
155123
main: |
156124
from metaflow import FlowSpec, schedule
157125
@@ -192,14 +160,6 @@
192160
193161
- case: trigger_decorator_validity
194162
regex: yes
195-
parametrized:
196-
- python_version: "3.7"
197-
- python_version: "3.8"
198-
- python_version: "3.9"
199-
- python_version: "3.10"
200-
- python_version: "3.11"
201-
- python_version: "3.12"
202-
mypy_config: python_version = {{ python_version }}
203163
main: |
204164
from metaflow import FlowSpec, trigger
205165
@@ -240,14 +200,6 @@
240200
241201
- case: trigger_on_finish_decorator_validity
242202
regex: yes
243-
parametrized:
244-
- python_version: "3.7"
245-
- python_version: "3.8"
246-
- python_version: "3.9"
247-
- python_version: "3.10"
248-
- python_version: "3.11"
249-
- python_version: "3.12"
250-
mypy_config: python_version = {{ python_version }}
251203
main: |
252204
from metaflow import FlowSpec, trigger_on_finish
253205
@@ -288,14 +240,6 @@
288240
289241
- case: step_decorator_validity
290242
regex: yes
291-
parametrized:
292-
- python_version: "3.7"
293-
- python_version: "3.8"
294-
- python_version: "3.9"
295-
- python_version: "3.10"
296-
- python_version: "3.11"
297-
- python_version: "3.12"
298-
mypy_config: python_version = {{ python_version }}
299243
main: |
300244
from metaflow import FlowSpec, step
301245
@@ -352,14 +296,6 @@
352296
353297
- case: decorator_order
354298
regex: yes
355-
parametrized:
356-
- python_version: "3.7"
357-
- python_version: "3.8"
358-
- python_version: "3.9"
359-
- python_version: "3.10"
360-
- python_version: "3.11"
361-
- python_version: "3.12"
362-
mypy_config: python_version = {{ python_version }}
363299
main: |
364300
from metaflow import FlowSpec, step, retry, catch
365301
@@ -390,14 +326,6 @@
390326
391327
- case: batch_decorator_validity
392328
regex: yes
393-
parametrized:
394-
- python_version: "3.7"
395-
- python_version: "3.8"
396-
- python_version: "3.9"
397-
- python_version: "3.10"
398-
- python_version: "3.11"
399-
- python_version: "3.12"
400-
mypy_config: python_version = {{ python_version }}
401329
main: |
402330
from metaflow import FlowSpec, step, batch
403331
@@ -450,14 +378,6 @@
450378
451379
- case: kubernetes_decorator_validity
452380
regex: yes
453-
parametrized:
454-
- python_version: "3.7"
455-
- python_version: "3.8"
456-
- python_version: "3.9"
457-
- python_version: "3.10"
458-
- python_version: "3.11"
459-
- python_version: "3.12"
460-
mypy_config: python_version = {{ python_version }}
461381
main: |
462382
from metaflow import FlowSpec, step, kubernetes
463383
@@ -506,14 +426,6 @@
506426
507427
- case: environment_decorator_validity
508428
regex: yes
509-
parametrized:
510-
- python_version: "3.7"
511-
- python_version: "3.8"
512-
- python_version: "3.9"
513-
- python_version: "3.10"
514-
- python_version: "3.11"
515-
- python_version: "3.12"
516-
mypy_config: python_version = {{ python_version }}
517429
main: |
518430
from metaflow import FlowSpec, step, environment
519431
@@ -566,14 +478,6 @@
566478
567479
- case: card_decorator_validity
568480
regex: yes
569-
parametrized:
570-
- python_version: "3.7"
571-
- python_version: "3.8"
572-
- python_version: "3.9"
573-
- python_version: "3.10"
574-
- python_version: "3.11"
575-
- python_version: "3.12"
576-
mypy_config: python_version = {{ python_version }}
577481
main: |
578482
from metaflow import FlowSpec, step, card
579483
@@ -626,14 +530,6 @@
626530
627531
- case: catch_decorator_validity
628532
regex: yes
629-
parametrized:
630-
- python_version: "3.7"
631-
- python_version: "3.8"
632-
- python_version: "3.9"
633-
- python_version: "3.10"
634-
- python_version: "3.11"
635-
- python_version: "3.12"
636-
mypy_config: python_version = {{ python_version }}
637533
main: |
638534
from metaflow import FlowSpec, step, catch
639535
@@ -686,14 +582,6 @@
686582
687583
- case: pypi_decorator_validity
688584
regex: yes
689-
parametrized:
690-
- python_version: "3.7"
691-
- python_version: "3.8"
692-
- python_version: "3.9"
693-
- python_version: "3.10"
694-
- python_version: "3.11"
695-
- python_version: "3.12"
696-
mypy_config: python_version = {{ python_version }}
697585
main: |
698586
from metaflow import FlowSpec, step, pypi
699587
@@ -746,14 +634,6 @@
746634
747635
- case: conda_decorator_validity
748636
regex: yes
749-
parametrized:
750-
- python_version: "3.7"
751-
- python_version: "3.8"
752-
- python_version: "3.9"
753-
- python_version: "3.10"
754-
- python_version: "3.11"
755-
- python_version: "3.12"
756-
mypy_config: python_version = {{ python_version }}
757637
main: |
758638
from metaflow import FlowSpec, step, conda
759639
@@ -806,14 +686,6 @@
806686
807687
- case: resources_decorator_validity
808688
regex: yes
809-
parametrized:
810-
- python_version: "3.7"
811-
- python_version: "3.8"
812-
- python_version: "3.9"
813-
- python_version: "3.10"
814-
- python_version: "3.11"
815-
- python_version: "3.12"
816-
mypy_config: python_version = {{ python_version }}
817689
main: |
818690
from metaflow import FlowSpec, step, resources
819691
@@ -866,14 +738,6 @@
866738
867739
- case: retry_decorator_validity
868740
regex: yes
869-
parametrized:
870-
- python_version: "3.7"
871-
- python_version: "3.8"
872-
- python_version: "3.9"
873-
- python_version: "3.10"
874-
- python_version: "3.11"
875-
- python_version: "3.12"
876-
mypy_config: python_version = {{ python_version }}
877741
main: |
878742
from metaflow import FlowSpec, step, retry
879743
@@ -926,14 +790,6 @@
926790
927791
- case: secrets_decorator_validity
928792
regex: yes
929-
parametrized:
930-
- python_version: "3.7"
931-
- python_version: "3.8"
932-
- python_version: "3.9"
933-
- python_version: "3.10"
934-
- python_version: "3.11"
935-
- python_version: "3.12"
936-
mypy_config: python_version = {{ python_version }}
937793
main: |
938794
from metaflow import FlowSpec, step, secrets
939795
@@ -986,14 +842,6 @@
986842
987843
- case: timeout_decorator_validity
988844
regex: yes
989-
parametrized:
990-
- python_version: "3.7"
991-
- python_version: "3.8"
992-
- python_version: "3.9"
993-
- python_version: "3.10"
994-
- python_version: "3.11"
995-
- python_version: "3.12"
996-
mypy_config: python_version = {{ python_version }}
997845
main: |
998846
from metaflow import FlowSpec, step, timeout
999847
@@ -1045,14 +893,6 @@
1045893
main:22: error: .*incompatible type.*\[arg-type\]
1046894
1047895
- case: client_types
1048-
parametrized:
1049-
- python_version: "3.7"
1050-
- python_version: "3.8"
1051-
- python_version: "3.9"
1052-
- python_version: "3.10"
1053-
- python_version: "3.11"
1054-
- python_version: "3.12"
1055-
mypy_config: python_version = {{ python_version }}
1056896
main: |
1057897
from metaflow import Flow, Run, Step, Task, DataArtifact
1058898
@@ -1076,14 +916,6 @@
1076916
main:11: error: Invalid index type "int" for "Step"; expected type "str" [index]
1077917
1078918
- case: current_object
1079-
parametrized:
1080-
- python_version: "3.7"
1081-
- python_version: "3.8"
1082-
- python_version: "3.9"
1083-
- python_version: "3.10"
1084-
- python_version: "3.11"
1085-
- python_version: "3.12"
1086-
mypy_config: python_version = {{ python_version }}
1087919
main: |
1088920
from metaflow import current
1089921
@@ -1097,14 +929,6 @@
1097929
main:7: error: Property "flow_name" defined in "Current" is read-only [misc]
1098930
1099931
- case: sample_flow
1100-
parametrized:
1101-
- python_version: "3.7"
1102-
- python_version: "3.8"
1103-
- python_version: "3.9"
1104-
- python_version: "3.10"
1105-
- python_version: "3.11"
1106-
- python_version: "3.12"
1107-
mypy_config: python_version = {{ python_version }}
1108932
main: |
1109933
from metaflow import FlowSpec, step, batch, project, schedule
1110934

0 commit comments

Comments
 (0)