Skip to content
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
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ jobs:
build_py_project_in_venv
run_pylint $(get_proj_name)

mypy:
name: Mypy
basedpyright:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -74,8 +73,8 @@ jobs:
curl -L -O https://tiker.net/ci-support-v0
. ci-support-v0
build_py_project_in_venv
pip install mypy
mypy "$(get_proj_name)"
pip install basedpyright
basedpyright

pytest:
name: Pytest on Py${{ matrix.python-version }} ${{ matrix.os }}
Expand Down
6 changes: 3 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ Ruff:
except:
- tags

Mypy:
basedpyright:
script: |
curl -L -O https://tiker.net/ci-support-v0
. ci-support-v0
build_py_project_in_venv
pip install mypy
mypy "$(get_proj_name)"
pip install basedpyright
basedpyright
tags:
- python3
except:
Expand Down
5 changes: 3 additions & 2 deletions namedisl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
"""

import re
from collections.abc import Mapping
from dataclasses import dataclass
from importlib import metadata
from typing import TypeAlias, TypeVar, overload

from constantdict import constantdict
from typing_extensions import override

import islpy as isl

Expand All @@ -54,7 +54,7 @@


def _strip_names(obj: IslObject) -> tuple[IslObject, NameToDim]:
name_to_dim = {}
name_to_dim: dict[str, tuple[isl.dim_type, int]] = {}
for tp in isl._CHECK_DIM_TYPES:
for i in range(obj.dim(tp)):
name = obj.get_dim_name(tp, i)
Expand Down Expand Up @@ -82,6 +82,7 @@ class BasicSet:
_obj: isl.BasicSet
_name_to_dim: NameToDim

@override
def __str__(self) -> str:
return str(_restore_names(self._obj, self._name_to_dim))

Expand Down
37 changes: 31 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,38 @@ lines-after-imports = 2
required-imports = ["from __future__ import annotations"]


[tool.mypy]
python_version = "3.10"
ignore_missing_imports = true
warn_unused_ignores = true
strict = true

[tool.typos.default]
extend-ignore-re = [
"(?Rm)^.*(#|//)\\s*spellchecker:\\s*disable-line$"
]


[tool.basedpyright]
reportImplicitStringConcatenation = "none"
reportUnnecessaryIsInstance = "none"
reportUnusedCallResult = "none"
reportExplicitAny = "none"
reportPrivateUsage = "none"
reportPrivateImportUsage = "none"

reportUnreachable = "hint"
reportUnnecessaryComparison = "hint"

# This reports even cycles that are qualified by 'if TYPE_CHECKING'. Not what
# we care about at this moment.
# https://github.com/microsoft/pyright/issues/746
reportImportCycles = "none"

pythonVersion = "3.10"
pythonPlatform = "All"

exclude = [
"proto-tests/*.py",
"contrib/mem-pattern-explorer/*.py",
"loopy/ipython_ext.py",
"loopy/frontend/fortran/*.py",
"doc",
".conda-root",
".env",
]

Loading