Skip to content

Commit a021123

Browse files
committed
Fix pyright config
Use correct syntax for ignoring directories, add some ignores for missing module sources, and configure the environment so pyright can find the modules.
1 parent 65079c7 commit a021123

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

obstore/python/obstore/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import TYPE_CHECKING
22

3-
from . import _obstore, store
4-
from ._obstore import * # noqa: F403
3+
from . import _obstore, store # pyright:ignore[reportMissingModuleSource]
4+
from ._obstore import * # noqa: F403 # pyright:ignore[reportMissingModuleSource]
55

66
if TYPE_CHECKING:
77
from . import exceptions # noqa: TC004

obstore/python/obstore/store.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from typing import TYPE_CHECKING, Union, overload
66

77
import obstore as obs
8-
from obstore._obstore import _store
9-
from obstore._obstore import parse_scheme as _parse_scheme
8+
from obstore._obstore import _store # pyright:ignore[reportMissingModuleSource]
9+
from obstore._obstore import parse_scheme as _parse_scheme # pyright:ignore[reportMissingModuleSource]
1010
from obstore.exceptions import BaseError
1111

1212
if TYPE_CHECKING:
@@ -32,7 +32,7 @@
3232
PutMode,
3333
PutResult,
3434
)
35-
from obstore._obstore import Bytes, GetResult
35+
from obstore._obstore import Bytes, GetResult # pyright:ignore[reportMissingModuleSource]
3636
from obstore._store import (
3737
AzureAccessKey, # noqa: TC004
3838
AzureBearerToken, # noqa: TC004

pyproject.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,15 @@ ignore = [
9393
]
9494

9595
[tool.pyright]
96-
exclude = ["examples/**"]
96+
exclude = [
97+
"**/__pycache__",
98+
"examples",
99+
".venv",
100+
]
101+
executionEnvironments = [
102+
{ root = "./", extraPaths = ["./obstore/python"] }, # Tests.
103+
{ root = "./obstore/python" }
104+
]
97105

98106
[tool.pytest.ini_options]
99107
addopts = "-v --mypy-only-local-stub"

0 commit comments

Comments
 (0)