Skip to content

Commit 5cc4b75

Browse files
committed
fix hook for stubtest - make it work on Windows. remove combine from nattype.pyi
1 parent 949265b commit 5cc4b75

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ repos:
140140
pass_filenames: false
141141
types: [python]
142142
stages: [manual]
143-
- id: mypy
143+
- id: stubtest
144144
# note: assumes python env is setup and activated
145145
# note: requires pandas dev to be installed
146146
name: mypy (stubtest)

pandas/_libs/tslibs/nattype.pyi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from datetime import (
2-
date as date_,
32
datetime,
4-
time as time_,
53
timedelta,
64
tzinfo as _tzinfo,
75
)
@@ -99,8 +97,6 @@ class NaTType:
9997
ambiguous: bool | Literal["raise"] | NaTType = ...,
10098
nonexistent: TimestampNonexistent = ...,
10199
) -> NaTType: ...
102-
@classmethod
103-
def combine(cls, date: date_, time: time_) -> NoReturn: ...
104100
@property
105101
def tzinfo(self) -> None: ...
106102
@property

scripts/run_stubtest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,11 @@
8585
]
8686

8787
# create allowlist
88-
with tempfile.NamedTemporaryFile(mode="w+t") as allow:
89-
allow.write("\n".join(_ALLOWLIST))
90-
allow.flush()
88+
with tempfile.TemporaryDirectory() as td:
89+
allow = os.path.join(td, "test")
90+
with open(allow, "w+t") as allow:
91+
allow.write("\n".join(_ALLOWLIST))
92+
allow.flush()
9193

9294
args = pyi_modules + [
9395
"--ignore-missing-stub",

0 commit comments

Comments
 (0)