Skip to content

Commit 4d1d386

Browse files
committed
Chore: update and freeze ruff version
1 parent 3209697 commit 4d1d386

File tree

7 files changed

+14
-17
lines changed

7 files changed

+14
-17
lines changed

.github/workflows/lint.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- uses: actions/checkout@v4
21-
- uses: jpetrucciani/ruff-check@main
21+
- uses: astral-sh/ruff-action@v3
22+
with:
23+
version: "0.9.4"

.github/workflows/release.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v4
19-
- uses: jpetrucciani/ruff-check@main
19+
- uses: astral-sh/ruff-action@v3
20+
with:
21+
version: "0.9.4
2022
2123
# Tests
2224
api-tests:

.pre-commit-config.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ repos:
77
- id: check-case-conflict
88
- id: check-merge-conflict
99
- id: check-symlinks
10-
- id: check-yaml
1110
- id: debug-statements
1211
- id: mixed-line-ending
1312
- id: requirements-txt-fixer
@@ -18,7 +17,7 @@ repos:
1817
- id: black
1918

2019
- repo: https://github.com/charliermarsh/ruff-pre-commit
21-
rev: 'v0.7.4'
20+
rev: 'v0.9.4'
2221
hooks:
2322
- id: ruff
2423
args: [ "--fix", "." ]

dp3/database/snapshots.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ def _prepare_latest_query(
246246
query["latest"] = True
247247

248248
# Process fulltext filters
249-
for attr in fulltext_filters:
250-
fulltext_filter = {"$regex": fulltext_filters[attr], "$options": "i"}
249+
for attr, attr_filter in fulltext_filters:
250+
fulltext_filter = {"$regex": attr_filter, "$options": "i"}
251251

252252
# EID filter
253253
if attr == "eid":

tests/test_api/test_get_distinct_attr_values.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ def setUpClass(cls) -> None:
2222
}
2323

2424
# Push datapoints
25-
for attr in dps_attr_value:
25+
for attr, attr_val in dps_attr_value.items():
2626
res = cls.push_datapoints(
2727
[
2828
{
2929
"type": "test_entity_type",
3030
"id": "test_entity_id",
3131
"attr": attr,
32-
"v": dps_attr_value[attr],
32+
"v": attr_val,
3333
}
3434
]
3535
)

tests/test_example/dps_gen.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ def random_passenger_counts_3():
5858
"S20": {"label": "School bus 20", "location": random_initial_location()},
5959
}
6060

61-
for n in bus_lines:
62-
bus_line = bus_lines[n]
63-
61+
for n, bus_line in bus_lines.items():
6462
dps.append(
6563
{
6664
"type": "bus",

tests/test_example/dps_gen_realtime.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ def random_passenger_counts_3():
7070
dps = []
7171

7272
# One-time datapoints
73-
for n in bus_lines:
74-
bus_line = bus_lines[n]
75-
73+
for n, bus_line in bus_lines.items():
7674
dps.append(
7775
{
7876
"type": "bus",
@@ -87,9 +85,7 @@ def random_passenger_counts_3():
8785

8886
# Realtime datapoints
8987
while True:
90-
for n in bus_lines:
91-
bus_line = bus_lines[n]
92-
88+
for n, bus_line in bus_lines.items():
9389
dps.append(
9490
{
9591
"type": "bus",

0 commit comments

Comments
 (0)