Skip to content

Commit 31627a5

Browse files
committed
chore: adapt to ruff v0.12
1 parent d989ad0 commit 31627a5

File tree

4 files changed

+29
-28
lines changed

4 files changed

+29
-28
lines changed

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ dev = [
7171
"pytest-xdist~=3.8.0",
7272
"pytest~=8.4.0",
7373
"respx~=0.22.0",
74-
"ruff~=0.11.0",
74+
"ruff~=0.12.0",
7575
"setuptools", # setuptools are used by pytest but not explicitly required
7676
]
7777

@@ -134,6 +134,9 @@ indent-style = "space"
134134
"TRY301", # Abstract `raise` to an inner function
135135
"TID252", # Prefer absolute imports over relative imports from parent modules
136136
]
137+
"**/{tests}/{integration}/*" = [
138+
"PLC0415", # `import` should be at the top-level of a file
139+
]
137140
"**/{docs,website}/**" = [
138141
"D", # Everything from the pydocstyle
139142
"INP001", # File {filename} is part of an implicit namespace package, add an __init__.py

src/apify/_actor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ def _get_default_exit_process(self) -> bool:
11871187

11881188
# Check if running in Scrapy by attempting to import it.
11891189
with suppress(ImportError):
1190-
import scrapy # noqa: F401
1190+
import scrapy # noqa: F401 PLC0415
11911191

11921192
self.log.debug('Running in Scrapy, setting default `exit_process` to False.')
11931193
return False

src/apify/_charging.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,7 @@ def calculate_chargeable() -> dict[str, int | None]:
216216
PricingInfoItem(
217217
price=Decimal()
218218
if self._is_at_home
219-
else Decimal(
220-
'1'
221-
), # Use a nonzero price for local development so that the maximum budget can be reached,
219+
else Decimal(1), # Use a nonzero price for local development so that the maximum budget can be reached,
222220
title=f"Unknown event '{event_name}'",
223221
),
224222
)
@@ -282,7 +280,7 @@ def calculate_max_event_charge_count_within_limit(self, event_name: str) -> int
282280
if pricing_info is not None:
283281
price = pricing_info.price
284282
elif not self._is_at_home:
285-
price = Decimal('1') # Use a nonzero price for local development so that the maximum budget can be reached
283+
price = Decimal(1) # Use a nonzero price for local development so that the maximum budget can be reached
286284
else:
287285
price = Decimal()
288286

uv.lock

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

0 commit comments

Comments
 (0)