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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
- id: mixed-line-ending
- id: check-case-conflict
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.14 # must match uv.lock
rev: v0.15.11 # must match uv.lock
hooks:
- id: ruff-check
- id: ruff-format
10 changes: 0 additions & 10 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,5 @@
"recommendations": [
"charliermarsh.ruff",
"ms-python.python",
"ms-python.vscode-pylance",
"redhat.vscode-yaml",
],
"unwantedRecommendations": [
// We use ruff instead of these
"ms-python.autopep8",
"ms-python.black-formatter",
"ms-python.flake8",
"ms-python.isort",
"ms-python.pylint",
],
}
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ dev = [
"ruff>=0.14.14",
"pytest>=8.0",
"rich-argparse>=1.6.0",
"mypy>=1.19.1",
"pyright>=1.1.392",
"mypy[native-parser]>=1.20.1",
"pyright>=1.1.408",
{ include-group = "tests" },
]

Expand Down Expand Up @@ -66,6 +66,7 @@ fixable = [
"E741", # ambiguous-variable-name
"F403", # undefined-local-with-import-star
"F405", # undefined-local-with-import-star-usage
"UP042", # replace-str-enum
]
"__init__.pyi" = ["TID252"]

Expand All @@ -84,6 +85,9 @@ warn_unused_ignores = true
disallow_untyped_defs = false
disallow_incomplete_defs = false
enable_error_code = "deprecated"
local_partial_types = true
allow_redefinition_new = true
native_parser = true

[tool.pyright]
# Project settings
Expand Down
2 changes: 1 addition & 1 deletion run.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

def main() -> int:
parser = argparse.ArgumentParser(
description=Markdown(description), # pyright: ignore[reportArgumentType]
description=Markdown(description), # ty:ignore[invalid-argument-type]
epilog="Run [argparse.args]uv sync --frozen[/] to install project dependencies.",
formatter_class=RawTextRichHelpFormatter,
add_help=False,
Expand Down
2 changes: 1 addition & 1 deletion stubs/netfields-stubs/rest_framework.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ from rest_framework.serializers import ModelSerializer

type _IPAddress = IPv4Address | IPv6Address
type _IPNetwork = IPv4Network | IPv6Network
type _InetDefaultInitial = _IPAddress | None | Callable[[], _IPAddress | None] | type[empty] # type: ignore[valid-type] # pyright: ignore[reportInvalidTypeForm]
type _InetDefaultInitial = _IPAddress | None | Callable[[], _IPAddress | None] | type[empty] # pyright: ignore[reportInvalidTypeForm]

class InetAddressField(Field[_IPAddress | None, _IPAddress | int | str | None, str | None, Incomplete]):
store_prefix: bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def point_len(p1, p2): ...
def calc_len_coords(coords): ...
def cut_coords_segment(p1, p2, split_len): ...
def get_section_coords(coords, sec_len, start_len, scale_factor): ...
def segment_buses(net, bus1, bus2, num_sections, line_name) -> Generator[Incomplete, None, None]: ...
def segment_buses(net, bus1, bus2, num_sections, line_name) -> Generator[Incomplete]: ...
def create_line_sections(net, item_list, line, bus1, bus2, coords, parallel, is_unbalanced, **kwargs): ...
def create_line_normal(net, item, bus1, bus2, name, parallel, is_unbalanced): ...
def get_pf_line_results(net, item, lid, is_unbalanced) -> None: ...
Expand Down
4 changes: 2 additions & 2 deletions stubs/pandapower-stubs/topology/graph_searches.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class _BasicGraphCharDict(TypedDict, total=False):
articulation_points: set[int]
notn1_starts: set[int]

def connected_component(mg: nx.Graph[Incomplete], bus: int, notravbuses: Container[int] = []) -> Generator[int, None, None]: ...
def connected_components(mg: nx.Graph[Incomplete], notravbuses: AbstractSet[int] = ...) -> Generator[set[int], None, None]: ...
def connected_component(mg: nx.Graph[Incomplete], bus: int, notravbuses: Container[int] = []) -> Generator[int]: ...
def connected_components(mg: nx.Graph[Incomplete], notravbuses: AbstractSet[int] = ...) -> Generator[set[int]]: ...
def calc_distance_to_bus(
net: pandapowerNet,
bus: int,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from collections.abc import Generator

def postgres_patched_migrations() -> Generator[None, None, None]: ...
def postgres_patched_migrations() -> Generator[None]: ...
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ from collections.abc import Generator
original_from_apps: Incomplete

def project_state_from_apps(apps): ...
def patched_project_state() -> Generator[None, None, None]: ...
def patched_project_state() -> Generator[None]: ...
4 changes: 2 additions & 2 deletions stubs/psqlextra-stubs/partitioning/strategy.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ from psqlextra.partitioning.partition import PostgresPartition

class PostgresPartitioningStrategy(metaclass=ABCMeta):
@abstractmethod
def to_create(self) -> Generator[PostgresPartition, None, None]: ...
def to_create(self) -> Generator[PostgresPartition]: ...
@abstractmethod
def to_delete(self) -> Generator[PostgresPartition, None, None]: ...
def to_delete(self) -> Generator[PostgresPartition]: ...
2 changes: 1 addition & 1 deletion stubs/psqlextra-stubs/schema.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ class PostgresSchema:
@contextmanager
def postgres_temporary_schema(
prefix: str, *, cascade: bool = False, delete_on_throw: bool = False, using: str = "default"
) -> Generator[PostgresSchema, None, None]: ...
) -> Generator[PostgresSchema]: ...
8 changes: 4 additions & 4 deletions stubs/psqlextra-stubs/settings.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ from collections.abc import Generator
from contextlib import contextmanager

@contextmanager
def postgres_set_local(*, using: str = "default", **options: str | float | list[str] | None) -> Generator[None, None, None]: ...
def postgres_set_local(*, using: str = "default", **options: str | float | list[str] | None) -> Generator[None]: ...
@contextmanager
def postgres_set_local_search_path(search_path: list[str], *, using: str = "default") -> Generator[None, None, None]: ...
def postgres_set_local_search_path(search_path: list[str], *, using: str = "default") -> Generator[None]: ...
@contextmanager
def postgres_prepend_local_search_path(search_path: list[str], *, using: str = "default") -> Generator[None, None, None]: ...
def postgres_prepend_local_search_path(search_path: list[str], *, using: str = "default") -> Generator[None]: ...
@contextmanager
def postgres_reset_local_search_path(*, using: str = "default") -> Generator[None, None, None]: ...
def postgres_reset_local_search_path(*, using: str = "default") -> Generator[None]: ...
Loading
Loading