Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check API with Pyright #554

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 27 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,14 @@ jobs:
with:
name: Packages
path: dist
- run: tar xf dist/*.tar.gz --strip-components=1 # needed for config files

- run: tar xf dist/*.tar.gz --strip-components=1
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: pip

- run: python -Im pip install tox

- run: python -Im tox run --installpkg dist/*.whl -f py$(echo ${{ matrix.python-version }} | tr -d .)

- name: Upload coverage data
Expand All @@ -76,9 +75,7 @@ jobs:
with:
python-version-file: .python-version-default
cache: pip

- run: python -Im pip install --upgrade coverage[toml]

- uses: actions/download-artifact@v3
with:
name: coverage-data
Expand Down Expand Up @@ -112,18 +109,36 @@ jobs:
with:
name: Packages
path: dist
- run: tar xf dist/*.tar.gz --strip-components=1 # needed for config files
- run: tar xf dist/*.tar.gz --strip-components=1
- uses: actions/setup-python@v4
with:
python-version-file: .python-version-default
allow-prereleases: true
cache: pip
- run: python -Im pip install tox

- run: python -Im tox run --installpkg dist/*.whl -e mypy-pkg

pyright:
name: Pyright
runs-on: ubuntu-latest
needs: build-package

steps:
- name: Download pre-built packages
uses: actions/download-artifact@v3
with:
name: Packages
path: dist
- run: tar xf dist/*.tar.gz --strip-components=1
- uses: actions/setup-python@v4
with:
python-version-file: .python-version-default
allow-prereleases: true
cache: pip
- run: python -Im pip install tox

- name: Prepare & run tox
run: |
python -Im pip install tox
python -Im tox run --installpkg dist/*.whl -e mypy-pkg
- run: python -Im tox run --installpkg dist/*.whl -e pyright

docs:
name: Build docs & run doctests
Expand All @@ -135,8 +150,7 @@ jobs:
with:
name: Packages
path: dist
- run: tar xf dist/*.tar.gz --strip-components=1 # needed for config files

- run: tar xf dist/*.tar.gz --strip-components=1
- uses: actions/setup-python@v4
with:
# Keep in sync with tox.ini/docs & .readthedocs.yaml
Expand Down Expand Up @@ -172,6 +186,7 @@ jobs:
- docs
- install-dev
- mypy-pkg
- pyright

runs-on: ubuntu-latest

Expand Down
6 changes: 6 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ extras = typing
commands = mypy src


[testenv:pyright]
deps = pyright
extras = typing
commands = pyright tests/typing


[testenv:color-force]
help = A visual check that FORCE_COLOR is working.
set_env = FORCE_COLOR=1
Expand Down