diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21fa4ab8..824f22f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,13 @@ jobs: run: python -m sphinx -E -W --keep-going -b html ./docs/source ./docs/build/html - name: Test code and coverage - run: python -m pytest --verbose --maxfail=1 --typeguard-packages=osmnx --cov=osmnx --cov-report=xml + run: > + python -m pytest + --verbose + --maxfail=1 + --typeguard-packages=osmnx + --cov=osmnx + --cov-report=xml - name: Upload coverage report uses: codecov/codecov-action@v5 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fd3f57e9..8d6ae3c2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,24 +19,18 @@ repos: - id: fix-byte-order-marker - id: mixed-line-ending - id: no-commit-to-branch - args: [--branch, main] + - id: pretty-format-json + args: [--autofix] - id: trailing-whitespace - repo: https://github.com/adrienverge/yamllint rev: v1.35.1 hooks: - id: yamllint - args: - - --strict - - > - -d={extends: default, rules: { - document-start: disable, - line-length: {max: 110}, - quoted-strings: {quote-type: single, required: only-when-needed}, - truthy: {check-keys: false}}} + args: [--strict, --config-file=./tests/.yamllint.yml] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.6 + rev: v0.9.1 hooks: - id: ruff args: [--fix] diff --git a/environments/requirements/environments.json b/environments/requirements/environments.json index aca993ae..5968358e 100644 --- a/environments/requirements/environments.json +++ b/environments/requirements/environments.json @@ -1,39 +1,39 @@ [ { - "output_path": "./environments/tests/env-ci.yml", - "needs_dependencies": true, - "pin_exact": false, "extras": [ "./environments/requirements/requirements-docs.txt", "./environments/requirements/requirements-packaging.txt", "./environments/requirements/requirements-tests.txt" - ] + ], + "needs_dependencies": true, + "output_path": "./environments/tests/env-ci.yml", + "pin_exact": false }, { - "output_path": "./environments/tests/env-test-minimum-deps.yml", - "needs_dependencies": true, - "pin_exact": true, "extras": [ "./environments/requirements/requirements-tests.txt" - ] + ], + "needs_dependencies": true, + "output_path": "./environments/tests/env-test-minimum-deps.yml", + "pin_exact": true }, { - "output_path": "./environments/tests/requirements-test-latest-deps.txt", - "needs_dependencies": true, - "pin_exact": false, "extras": [ "./environments/requirements/requirements-tests.txt" - ] + ], + "needs_dependencies": true, + "output_path": "./environments/tests/requirements-test-latest-deps.txt", + "pin_exact": false }, { - "output_path": "./environments/requirements/requirements-all.txt", - "needs_dependencies": true, - "pin_exact": false, "extras": [ "./environments/requirements/requirements-docs.txt", "./environments/requirements/requirements-extras.txt", "./environments/requirements/requirements-packaging.txt", "./environments/requirements/requirements-tests.txt" - ] + ], + "needs_dependencies": true, + "output_path": "./environments/requirements/requirements-all.txt", + "pin_exact": false } ] diff --git a/osmnx/io.py b/osmnx/io.py index b456f2b8..45c66719 100644 --- a/osmnx/io.py +++ b/osmnx/io.py @@ -1,3 +1,4 @@ +# ruff: noqa: A005 """File I/O functions to save/load graphs to/from files on disk.""" from __future__ import annotations diff --git a/tests/.yamllint.yml b/tests/.yamllint.yml new file mode 100644 index 00000000..e1effbeb --- /dev/null +++ b/tests/.yamllint.yml @@ -0,0 +1,10 @@ +extends: default +rules: + document-start: disable + line-length: + max: 100 + quoted-strings: + quote-type: single + required: only-when-needed + truthy: + check-keys: false diff --git a/tests/test_osmnx.py b/tests/test_osmnx.py index 8edca370..0a0c9bfe 100644 --- a/tests/test_osmnx.py +++ b/tests/test_osmnx.py @@ -44,7 +44,7 @@ address = "600 Montgomery St, San Francisco, California, USA" place1 = {"city": "Piedmont", "state": "California", "country": "USA"} polygon_wkt = ( - "POLYGON ((-122.262 37.869, -122.255 37.869, -122.255 37.874," + "POLYGON ((-122.262 37.869, -122.255 37.869, -122.255 37.874, " "-122.262 37.874, -122.262 37.869))" ) polygon = ox.utils_geo.buffer_geometry(geom=wkt.loads(polygon_wkt), dist=1)