Skip to content

Commit adc533a

Browse files
committed
make formats
1 parent d652bdd commit adc533a

File tree

18 files changed

+67
-133
lines changed

18 files changed

+67
-133
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ jobs:
7171
- os: macos
7272
target: aarch64
7373
interpreter: 3.9 3.10 3.11 3.12 3.13 pypy3.8 pypy3.9 pypy3.10
74-
75-
74+
75+
7676

7777
runs-on: ${{ matrix.os }}-latest
7878
steps:

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
run: pip install pre-commit
2626
- name: "Install Rust toolchain"
2727
run: rustup component add rustfmt clippy
28-
- run: pre-commit run --all-files
28+
- run: make lint
2929

3030
Tests:
3131
name: ${{ matrix.os }} / ${{ matrix.python-version }}

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ dev:
2323

2424
lint:
2525
poetry run mypy
26+
pre-commit run --all-files
2627

2728
test:
2829
PENDULUM_EXTENSIONS=0 poetry run pytest -q tests
29-
poetry run pytest -q tests
30+
poetry run pytest -q tests

clock

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,11 @@ translations = {{}}
190190
def format_dict(self, d, tab=1):
191191
s = ["{\n"]
192192
for k, v in d.items():
193-
if isinstance(v, (dict, LocaleDataDict)):
194-
v = self.format_dict(v, tab + 1)
195-
else:
196-
v = repr(v)
193+
v = (
194+
self.format_dict(v, tab + 1)
195+
if isinstance(v, (dict, LocaleDataDict))
196+
else repr(v)
197+
)
197198

198199
s.append(f"{' ' * tab}{k!r}: {v},\n")
199200
s.append(f'{" " * (tab - 1)}}}')

poetry.lock

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

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ ruff = "^0.7.3"
8080

8181
[tool.poetry.group.build.dependencies]
8282
maturin = ">=1.0,<2.0"
83-
patchelf = ">=0.17"
8483

8584
[tool.poetry.extras]
8685
test = ["time-machine"]
@@ -95,7 +94,7 @@ unfixable = [
9594
"ERA", # do not autoremove commented out code
9695
]
9796
target-version = "py39"
98-
line-length = 88
97+
line-length = 100
9998
extend-select = [
10099
"B", # flake8-bugbear
101100
"C4", # flake8-comprehensions

src/pendulum/__init__.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,18 @@
5959

6060

6161
@overload
62-
def timezone(name: int) -> FixedTimezone: ...
62+
def timezone(name: int) -> FixedTimezone:
63+
...
6364

6465

6566
@overload
66-
def timezone(name: str) -> Timezone: ...
67+
def timezone(name: str) -> Timezone:
68+
...
6769

6870

6971
@overload
70-
def timezone(name: str | int) -> Timezone | FixedTimezone: ...
72+
def timezone(name: str | int) -> Timezone | FixedTimezone:
73+
...
7174

7275

7376
def timezone(name: str | int) -> Timezone | FixedTimezone:
@@ -202,21 +205,24 @@ def time(hour: int, minute: int = 0, second: int = 0, microsecond: int = 0) -> T
202205
def instance(
203206
obj: _datetime.datetime,
204207
tz: str | Timezone | FixedTimezone | _datetime.tzinfo | None = UTC,
205-
) -> DateTime: ...
208+
) -> DateTime:
209+
...
206210

207211

208212
@overload
209213
def instance(
210214
obj: _datetime.date,
211215
tz: str | Timezone | FixedTimezone | _datetime.tzinfo | None = UTC,
212-
) -> Date: ...
216+
) -> Date:
217+
...
213218

214219

215220
@overload
216221
def instance(
217222
obj: _datetime.time,
218223
tz: str | Timezone | FixedTimezone | _datetime.tzinfo | None = UTC,
219-
) -> Time: ...
224+
) -> Time:
225+
...
220226

221227

222228
def instance(

src/pendulum/date.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,12 @@ def __add__(self, other: timedelta) -> Self:
257257
return self._add_timedelta(other)
258258

259259
@overload # type: ignore[override] # this is only needed because of Python 3.7
260-
def __sub__(self, __delta: timedelta) -> Self: ...
260+
def __sub__(self, __delta: timedelta) -> Self:
261+
...
261262

262263
@overload
263-
def __sub__(self, __dt: datetime) -> NoReturn: ...
264+
def __sub__(self, __dt: datetime) -> NoReturn:
265+
...
264266

265267
@overload
266268
def __sub__(self, __dt: Self) -> Interval[Date]:

src/pendulum/datetime.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,13 @@ def instance(
146146

147147
@overload
148148
@classmethod
149-
def now(cls, tz: datetime.tzinfo | None = None) -> Self: ...
149+
def now(cls, tz: datetime.tzinfo | None = None) -> Self:
150+
...
150151

151152
@overload
152153
@classmethod
153-
def now(cls, tz: str | Timezone | FixedTimezone | None = None) -> Self: ...
154+
def now(cls, tz: str | Timezone | FixedTimezone | None = None) -> Self:
155+
...
154156

155157
@classmethod
156158
def now(
@@ -1184,7 +1186,8 @@ def average( # type: ignore[override]
11841186
)
11851187

11861188
@overload # type: ignore[override]
1187-
def __sub__(self, other: datetime.timedelta) -> Self: ...
1189+
def __sub__(self, other: datetime.timedelta) -> Self:
1190+
...
11881191

11891192
@overload
11901193
def __sub__(self, other: DateTime) -> Interval[datetime.datetime]:

src/pendulum/duration.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,12 @@ def __mul__(self, other: int | float) -> Self:
375375
__rmul__ = __mul__
376376

377377
@overload
378-
def __floordiv__(self, other: timedelta) -> int: ...
378+
def __floordiv__(self, other: timedelta) -> int:
379+
...
379380

380381
@overload
381-
def __floordiv__(self, other: int) -> Self: ...
382+
def __floordiv__(self, other: int) -> Self:
383+
...
382384

383385
def __floordiv__(self, other: int | timedelta) -> int | Duration:
384386
if not isinstance(other, (int, timedelta)):
@@ -401,10 +403,12 @@ def __floordiv__(self, other: int | timedelta) -> int | Duration:
401403
)
402404

403405
@overload
404-
def __truediv__(self, other: timedelta) -> float: ...
406+
def __truediv__(self, other: timedelta) -> float:
407+
...
405408

406409
@overload
407-
def __truediv__(self, other: float) -> Self: ...
410+
def __truediv__(self, other: float) -> Self:
411+
...
408412

409413
def __truediv__(self, other: int | float | timedelta) -> Self | float:
410414
if not isinstance(other, (int, float, timedelta)):

0 commit comments

Comments
 (0)