mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-17 23:34:13 +08:00
Improve path-related type hints for setuptools.Extension() and distutils.CCompiler() (#12958)
Co-authored-by: Avasam <samuel.06@hotmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from _typeshed import BytesPath, StrPath, Unused
|
||||
from collections.abc import Callable, Iterable
|
||||
from collections.abc import Callable, Iterable, Sequence
|
||||
from typing import ClassVar, Literal, TypeVar, overload
|
||||
from typing_extensions import TypeAlias, TypeVarTuple, Unpack
|
||||
|
||||
@@ -67,7 +67,7 @@ class CCompiler:
|
||||
def set_executables(self, **args: str) -> None: ...
|
||||
def compile(
|
||||
self,
|
||||
sources: list[str],
|
||||
sources: Sequence[StrPath],
|
||||
output_dir: str | None = None,
|
||||
macros: list[_Macro] | None = None,
|
||||
include_dirs: list[str] | None = None,
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
from _typeshed import StrPath
|
||||
from os import PathLike
|
||||
from pathlib import Path
|
||||
|
||||
class Extension:
|
||||
name: str
|
||||
sources: list[str]
|
||||
sources: list[str] | list[StrPath]
|
||||
include_dirs: list[str]
|
||||
define_macros: list[tuple[str, str | None]]
|
||||
undef_macros: list[str]
|
||||
@@ -18,7 +22,7 @@ class Extension:
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
sources: list[str],
|
||||
sources: list[str] | list[PathLike[str]] | list[Path] | list[StrPath],
|
||||
include_dirs: list[str] | None = None,
|
||||
define_macros: list[tuple[str, str | None]] | None = None,
|
||||
undef_macros: list[str] | None = None,
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
from _typeshed import StrPath
|
||||
from os import PathLike
|
||||
from pathlib import Path
|
||||
|
||||
from ._distutils.extension import Extension as _Extension
|
||||
|
||||
@@ -9,7 +11,7 @@ class Extension(_Extension):
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
sources: list[StrPath],
|
||||
sources: list[str] | list[PathLike[str]] | list[Path] | list[StrPath],
|
||||
include_dirs: list[str] | None = None,
|
||||
define_macros: list[tuple[str, str | None]] | None = None,
|
||||
undef_macros: list[str] | None = None,
|
||||
|
||||
Reference in New Issue
Block a user