Skip to content

Commit f99727f

Browse files
Update dependency pyright to ^1.1.398 (#2795)
* Update dependency pyright to ^1.1.398 * resolve lint errors --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Kyle Finley <kyle@finley.sh>
1 parent 495f0a1 commit f99727f

File tree

13 files changed

+29
-43
lines changed

13 files changed

+29
-43
lines changed

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"devDependencies": {
33
"cspell": "^8.18.0",
4-
"pyright": "^1.1.396"
4+
"pyright": "^1.1.398"
55
},
66
"name": "runway",
77
"version": "0.0.0"

runway/core/providers/aws/s3/_helpers/file_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def __init__(
154154
follow_symlinks: bool = True,
155155
page_size: int | None = None,
156156
result_queue: Queue[Any] | None = None,
157-
request_parameters: Any = None,
157+
request_parameters: dict[str, Any] | None = None,
158158
) -> None:
159159
"""Instantiate class.
160160

runway/lookups/handlers/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def format_results(
107107
if isinstance(value, MutableMap):
108108
value = value.find(get)
109109
elif isinstance(value, dict):
110-
value = value.get(get)
110+
value = cast("Any", value.get(get))
111111
else:
112112
raise TypeError(f'value must be dict type to use "get"; got type "{type(value)}"')
113113
if (

tests/conftest.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@
1313
if TYPE_CHECKING:
1414
from collections.abc import Generator, Iterator
1515

16-
from _pytest.config import Config
17-
from _pytest.config.argparsing import Parser
18-
from _pytest.fixtures import SubRequest
1916
from click.testing import CliRunner
2017

2118

22-
def pytest_configure(config: Config) -> None:
19+
def pytest_configure(config: pytest.Config) -> None:
2320
"""Configure pytest."""
2421
config.addinivalue_line( # cspell:ignore addinivalue
2522
"markers",
@@ -28,7 +25,7 @@ def pytest_configure(config: Config) -> None:
2825
)
2926

3027

31-
def pytest_addoption(parser: Parser) -> None:
28+
def pytest_addoption(parser: pytest.Parser) -> None:
3229
"""Add pytest CLI options."""
3330
parser.addoption(
3431
"--functional",
@@ -51,7 +48,7 @@ def pytest_addoption(parser: Parser) -> None:
5148

5249

5350
@pytest.fixture
54-
def cli_runner(request: SubRequest) -> CliRunner:
51+
def cli_runner(request: pytest.FixtureRequest) -> CliRunner:
5552
"""Initialize instance of `click.testing.CliRunner`."""
5653
return cli_runner_factory(request)
5754

tests/factories.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
from click.testing import CliRunner
99

1010
if TYPE_CHECKING:
11-
from _pytest.fixtures import SubRequest
11+
import pytest
1212

1313

14-
def cli_runner_factory(request: SubRequest) -> CliRunner:
14+
def cli_runner_factory(request: pytest.FixtureRequest) -> CliRunner:
1515
"""Initialize instance of `click.testing.CliRunner`."""
1616
kwargs: dict[str, Any] = {
1717
"env": {
@@ -21,7 +21,7 @@ def cli_runner_factory(request: SubRequest) -> CliRunner:
2121
**os.environ,
2222
}
2323
}
24-
mark = request.node.get_closest_marker("cli_runner")
24+
mark = cast("pytest.Function | pytest.Item", request.node).get_closest_marker("cli_runner")
2525
if mark:
2626
kwargs.update(cast("dict[str, Any]", mark.kwargs))
2727
return CliRunner(**kwargs)

tests/functional/cfngin/test_simple_build/test_runner.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
if TYPE_CHECKING:
1515
from collections.abc import Generator
1616

17-
from _pytest.fixtures import SubRequest
1817
from click.testing import CliRunner, Result
1918

2019
from runway.config import RunwayConfig
@@ -25,7 +24,7 @@
2524

2625
@pytest.fixture(scope="module")
2726
def cfngin_config(
28-
request: SubRequest, runway_config: RunwayConfig, runway_context: RunwayContext
27+
request: pytest.FixtureRequest, runway_config: RunwayConfig, runway_context: RunwayContext
2928
) -> CfnginConfig:
3029
"""Find and return the CFNgin config."""
3130
runway_config.deployments[0].resolve(runway_context, variables=runway_config.variables)

tests/functional/conftest.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,16 @@
1919
if TYPE_CHECKING:
2020
from collections.abc import Generator
2121

22-
from _pytest.config import Config
23-
from _pytest.fixtures import SubRequest
2422
from click.testing import CliRunner
2523

2624

27-
def pytest_ignore_collect(path: Any, config: Config) -> bool: # noqa: ARG001
25+
def pytest_ignore_collect(path: Any, config: pytest.Config) -> bool: # noqa: ARG001
2826
"""Determine if this directory should have its tests collected."""
2927
return not config.option.functional
3028

3129

3230
@pytest.fixture(autouse=True, scope="module")
33-
def cd_test_dir(request: SubRequest) -> Generator[Path, None, None]:
31+
def cd_test_dir(request: pytest.FixtureRequest) -> Generator[Path, None, None]:
3432
"""Change directory to test directory."""
3533
test_dir = request.path.parent
3634
original_wd = Path.cwd()
@@ -55,7 +53,7 @@ def cfngin_bucket_alt() -> str:
5553

5654
@pytest.fixture(scope="module")
5755
def cfngin_config(
58-
request: SubRequest, runway_config: RunwayConfig, runway_context: RunwayContext
56+
request: pytest.FixtureRequest, runway_config: RunwayConfig, runway_context: RunwayContext
5957
) -> CfnginConfig:
6058
"""Find and return the CFNgin config."""
6159
runway_config.deployments[0].resolve(runway_context, variables=runway_config.variables)
@@ -82,7 +80,7 @@ def cfngin_context(
8280

8381

8482
@pytest.fixture(scope="module")
85-
def cli_runner(cd_test_dir: Path, request: SubRequest) -> CliRunner: # noqa: ARG001
83+
def cli_runner(cd_test_dir: Path, request: pytest.FixtureRequest) -> CliRunner: # noqa: ARG001
8684
"""Initialize instance of `click.testing.CliRunner`."""
8785
return cli_runner_factory(request)
8886

tests/functional/terraform/conftest.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
if TYPE_CHECKING:
1212
from collections.abc import Generator
1313

14-
from _pytest.fixtures import SubRequest
15-
1614

1715
@pytest.fixture(scope="package")
1816
def fixture_dir() -> Path:
@@ -21,7 +19,7 @@ def fixture_dir() -> Path:
2119

2220

2321
@pytest.fixture
24-
def local_backend(fixture_dir: Path, request: SubRequest) -> Generator[Path, None, None]:
22+
def local_backend(fixture_dir: Path, request: pytest.FixtureRequest) -> Generator[Path, None, None]:
2523
"""Copy local_backend.tf into the test directory."""
2624
file_name = "local_backend.tf"
2725
og_file = fixture_dir / file_name
@@ -32,7 +30,7 @@ def local_backend(fixture_dir: Path, request: SubRequest) -> Generator[Path, Non
3230

3331

3432
@pytest.fixture
35-
def no_backend(fixture_dir: Path, request: SubRequest) -> Generator[Path, None, None]:
33+
def no_backend(fixture_dir: Path, request: pytest.FixtureRequest) -> Generator[Path, None, None]:
3634
"""Copy no_backend.tf into the test directory."""
3735
file_name = "no_backend.tf"
3836
og_file = fixture_dir / file_name
@@ -43,7 +41,7 @@ def no_backend(fixture_dir: Path, request: SubRequest) -> Generator[Path, None,
4341

4442

4543
@pytest.fixture
46-
def s3_backend(fixture_dir: Path, request: SubRequest) -> Generator[Path, None, None]:
44+
def s3_backend(fixture_dir: Path, request: pytest.FixtureRequest) -> Generator[Path, None, None]:
4745
"""Copy s3_backend.tf into the test directory."""
4846
file_name = "s3_backend.tf"
4947
og_file = fixture_dir / file_name

tests/functional/terraform/test_backend_local_2_s3/test_runner.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
if TYPE_CHECKING:
1616
from collections.abc import Iterator
1717

18-
from _pytest.fixtures import SubRequest
1918
from click.testing import CliRunner, Result
2019

2120
CURRENT_DIR = Path(__file__).parent
@@ -35,7 +34,7 @@ def tf_state_bucket(cli_runner: CliRunner) -> Iterator[None]:
3534
params=["0.13.7", "0.14.11", "0.15.5", "1.4.6"],
3635
scope="module",
3736
)
38-
def tf_version(request: SubRequest) -> Iterator[str]:
37+
def tf_version(request: pytest.FixtureRequest) -> Iterator[str]:
3938
"""Set Terraform version."""
4039
file_path = CURRENT_DIR / TF_VERSION_FILENAME
4140
file_path.write_text(

0 commit comments

Comments
 (0)