Skip to content

Commit

Permalink
use version specific testing
Browse files Browse the repository at this point in the history
  • Loading branch information
madhur-ob committed Feb 28, 2025
1 parent 5661ff2 commit 0c6be56
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 177 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/test-stubs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,17 @@ jobs:
- name: Install metaflow-stubs
run: metaflow develop stubs install --force

- name: Create version-specific mypy config
run: |
# Copy the existing setup.cfg
cp ./stubs/test/setup.cfg ./stubs/test/mypy_${{ matrix.ver }}.cfg
# Add Python version setting
echo "python_version = ${{ matrix.ver }}" >> ./stubs/test/mypy_${{ matrix.ver }}.cfg
- name: Run mypy tests
uses: nick-fields/retry@v2
with:
max_attempts: 2
timeout_minutes: 3
retry_on: error
command: cd ./stubs && pytest --mypy-ini-file test/setup.cfg --mypy-only-local-stub && cd -
command: cd ./stubs && pytest --mypy-ini-file test/mypy_${{ matrix.ver }}.cfg --mypy-only-local-stub && cd -
176 changes: 0 additions & 176 deletions stubs/test/test_stubs.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
- case: project_decorator_validity
regex: yes
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import FlowSpec, project
Expand Down Expand Up @@ -48,14 +40,6 @@
- case: pypi_base_decorator_validity
regex: yes
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import FlowSpec, pypi_base
Expand Down Expand Up @@ -96,14 +80,6 @@
- case: conda_base_decorator_validity
regex: yes
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import FlowSpec, conda_base
Expand Down Expand Up @@ -144,14 +120,6 @@
- case: schedule_decorator_validity
regex: yes
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import FlowSpec, schedule
Expand Down Expand Up @@ -192,14 +160,6 @@
- case: trigger_decorator_validity
regex: yes
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import FlowSpec, trigger
Expand Down Expand Up @@ -240,14 +200,6 @@
- case: trigger_on_finish_decorator_validity
regex: yes
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import FlowSpec, trigger_on_finish
Expand Down Expand Up @@ -288,14 +240,6 @@
- case: step_decorator_validity
regex: yes
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import FlowSpec, step
Expand Down Expand Up @@ -352,14 +296,6 @@
- case: decorator_order
regex: yes
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import FlowSpec, step, retry, catch
Expand Down Expand Up @@ -390,14 +326,6 @@
- case: batch_decorator_validity
regex: yes
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import FlowSpec, step, batch
Expand Down Expand Up @@ -450,14 +378,6 @@
- case: kubernetes_decorator_validity
regex: yes
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import FlowSpec, step, kubernetes
Expand Down Expand Up @@ -506,14 +426,6 @@
- case: environment_decorator_validity
regex: yes
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import FlowSpec, step, environment
Expand Down Expand Up @@ -566,14 +478,6 @@
- case: card_decorator_validity
regex: yes
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import FlowSpec, step, card
Expand Down Expand Up @@ -626,14 +530,6 @@
- case: catch_decorator_validity
regex: yes
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import FlowSpec, step, catch
Expand Down Expand Up @@ -686,14 +582,6 @@
- case: pypi_decorator_validity
regex: yes
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import FlowSpec, step, pypi
Expand Down Expand Up @@ -746,14 +634,6 @@
- case: conda_decorator_validity
regex: yes
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import FlowSpec, step, conda
Expand Down Expand Up @@ -806,14 +686,6 @@
- case: resources_decorator_validity
regex: yes
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import FlowSpec, step, resources
Expand Down Expand Up @@ -866,14 +738,6 @@
- case: retry_decorator_validity
regex: yes
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import FlowSpec, step, retry
Expand Down Expand Up @@ -926,14 +790,6 @@
- case: secrets_decorator_validity
regex: yes
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import FlowSpec, step, secrets
Expand Down Expand Up @@ -986,14 +842,6 @@
- case: timeout_decorator_validity
regex: yes
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import FlowSpec, step, timeout
Expand Down Expand Up @@ -1045,14 +893,6 @@
main:22: error: .*incompatible type.*\[arg-type\]
- case: client_types
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import Flow, Run, Step, Task, DataArtifact
Expand All @@ -1076,14 +916,6 @@
main:11: error: Invalid index type "int" for "Step"; expected type "str" [index]
- case: current_object
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import current
Expand All @@ -1097,14 +929,6 @@
main:7: error: Property "flow_name" defined in "Current" is read-only [misc]
- case: sample_flow
parametrized:
- python_version: "3.7"
- python_version: "3.8"
- python_version: "3.9"
- python_version: "3.10"
- python_version: "3.11"
- python_version: "3.12"
mypy_config: python_version = {{ python_version }}
main: |
from metaflow import FlowSpec, step, batch, project, schedule
Expand Down

0 comments on commit 0c6be56

Please sign in to comment.