Skip to content

Commit

Permalink
Test typing in pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco-Sulla committed Oct 13, 2024
1 parent bdeef91 commit 8d813f5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/build_primary_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ jobs:
env:
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_SKIP: "cp311-* cp312-* pp*"
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_REQUIRES: pytest typing_extensions
CIBW_TEST_COMMAND: >
python -X faulthandler {package}/test/debug.py &&
python -X faulthandler -m pytest -p no:faulthandler -s {package}
python -X faulthandler -m pytest -p no:faulthandler -s {package} &&
python {package}/test/typed.py
- uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -61,7 +62,7 @@ jobs:
python-version: "${{ matrix.version }}"

- name: Install dependencies
run: pip install -U pip setuptools wheel pytest pytest-cov
run: pip install -U pip setuptools wheel pytest pytest-cov typing_extensions

- name: Build module
run: FROZENDICT_PURE_PY=1 python setup.py bdist_wheel
Expand All @@ -72,8 +73,9 @@ jobs:
- name: Install module
run: pip install dist/*

- name: Test with pytest
run: pytest --cov=frozendict --cov-report=term-missing --cov-branch --cov-fail-under=100
- name: Run tests
run: pytest --cov=frozendict --cov-report=term-missing --cov-branch --cov-fail-under=100 &&
python test/typed.py

- uses: actions/upload-artifact@v3
with:
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/build_secondary_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ jobs:
env:
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_SKIP: "cp311-* cp312-* pp*"
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_REQUIRES: pytest typing_extensions
CIBW_TEST_COMMAND: >
python -X faulthandler {package}/test/debug.py &&
python -X faulthandler -m pytest -p no:faulthandler -s {package}
python -X faulthandler -m pytest -p no:faulthandler -s {package} &&
python {package}/test/typed.py
- uses: actions/upload-artifact@v3
with:
Expand All @@ -67,10 +68,11 @@ jobs:
CIBW_ARCHS: native
CIBW_BUILD: "cp310-*"
CIBW_SKIP: "*-musllinux_*"
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_REQUIRES: pytest typing_extensions
CIBW_TEST_COMMAND: >
python -X faulthandler {package}/test/debug.py &&
python -X faulthandler -m pytest -p no:faulthandler -s {package}
python -X faulthandler -m pytest -p no:faulthandler -s {package} &&
python {package}/test/typed.py
with:
package-dir: dist/frozendict.tar.gz

Expand Down
5 changes: 5 additions & 0 deletions test/typed.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#!/usr/bin/env python3

import copy
import sys
from collections.abc import Hashable
from typing import ItemsView, Iterator, KeysView, Mapping, ValuesView, \
Union

from frozendict import frozendict

if sys.version_info.major == 3 and sys.version_info.minor < 9:
sys.exit(0)

from typing_extensions import assert_type

fd = frozendict(a=1, b=2)
Expand Down

0 comments on commit 8d813f5

Please sign in to comment.