Skip to content

Commit 5de04c9

Browse files
authored
chore: adapt to ruff v0.12 (#492)
1 parent 55f5e3e commit 5de04c9

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
@@ -75,7 +75,7 @@ dev = [
7575
"pytest-xdist~=3.8.0",
7676
"pytest~=8.4.0",
7777
"respx~=0.22.0",
78-
"ruff~=0.11.0",
78+
"ruff~=0.12.0",
7979
"setuptools", # setuptools are used by pytest but not explicitly required
8080
]
8181

@@ -138,6 +138,9 @@ indent-style = "space"
138138
"TRY301", # Abstract `raise` to an inner function
139139
"TID252", # Prefer absolute imports over relative imports from parent modules
140140
]
141+
"**/{tests}/{integration}/*" = [
142+
"PLC0415", # `import` should be at the top-level of a file
143+
]
141144
"**/{docs,website}/**" = [
142145
"D", # Everything from the pydocstyle
143146
"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)