Skip to content

Commit

Permalink
bug: Verify mypy can run on CI (#1650)
Browse files Browse the repository at this point in the history
  • Loading branch information
schloerke authored Aug 28, 2024
1 parent 6ba4cdd commit f643a8f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ jobs:
run: |
make check-format
- name: Verify code can run with mypy (not Windows)
if: steps.install.outcome == 'success' && (success() || failure()) && matrix.os != 'windows-latest'
run: |
make ci-check-mypy-can-run
pypi:
name: "Deploy to PyPI"
runs-on: ubuntu-latest
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,14 @@ ci-install-rsconnect: FORCE
uv pip install "rsconnect-python @ git+https://github.com/rstudio/rsconnect-python.git"


# This is just to check if mypy can run for other users.
# Not added to `make check` or `make check-fix` as all lint errors are supporessed (as we use pyright).
ci-check-mypy-can-run: FORCE
@echo "-------- Checking types with mypy -----------"
uv pip install mypy
mypy shiny


# ## If caching is ever used, we could run:
# install-deps: FORCE ## install latest dependencies
# pip install --editable ".[dev,test]" --upgrade --upgrade-strategy eager
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,10 @@ ignore = ["E302", "E501", "F403", "F405", "W503", "E203", "E701", "E704"]
[tool.isort]
profile = "black"
skip = ["__init__.py", "typings/", "_dev/", ".venv", "venv", ".tox", "build"]

[tool.mypy]
# The goal of our usage of mypy is to make to sure mypy can run, not that it catches any errors (we use pyright to find our errors).
# Therefore, ignore_errors but do not ignore runtime errors while checking
# Note: This setting can not be done via CLI and must be set within a config
ignore_errors = true
exclude = ["shiny/api-examples", "shiny/templates"]
4 changes: 2 additions & 2 deletions shiny/render/_data_frame_utils/_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ def _has_rect(self) -> bool:
# Should only contain a single selection area

# Do not include `BrowserCellSelectionAll` as it should be represented by a row, column, or region with appropriate values.
# class BrowserCellSelectionAll(TypedDict):
# type: Literal["all"]
# # class BrowserCellSelectionAll(TypedDict):
# # type: Literal["all"]


class BrowserCellSelectionNone(TypedDict):
Expand Down

0 comments on commit f643a8f

Please sign in to comment.