Skip to content

Clean up dependency and tooling configuration - #92

Merged
AndGem merged 2 commits into
mainfrom
chore/pyproject-cleanup
May 21, 2026
Merged

AndGem merged 2 commits into
mainfrom
chore/pyproject-cleanup

Conversation

@AndGem

@AndGem AndGem commented May 21, 2026

Copy link
Copy Markdown
Owner
  • Consolidate dev dependencies into a single [dependency-groups] dev group (pytest, ruff, mypy). Previously pytest sat in [project.optional-dependencies] while ruff/black were in [dependency-groups] -- two groups both named "dev" with split contents. mypy is added since CI relies on it.
  • Declare networkx as a proper optional dependency ([project.optional-dependencies] networkx) so it can be installed via OsmToRoadGraph[networkx] instead of a manual side install.
  • Remove the duplicate "SIM" entry from the ruff lint select list.
  • Drop black in favour of ruff's built-in formatter: remove [tool.black] and add [tool.ruff] with line-length = 120 and target-version = "py313" (the old black target-version py311 also contradicted requires-python >= 3.13). CI now runs ruff format --check instead of black --check. One f-string whitespace normalization in algorithms.py results from the formatter switch.
  • README: document networkx as an optional dependency installable via the OsmToRoadGraph[networkx] extra.

Note: CI still lints with flake8; switching it to ruff check is left out because ruff currently reports pre-existing findings that would need to be resolved first.

AndGem and others added 2 commits May 20, 2026 20:30
- Consolidate dev dependencies into a single [dependency-groups] dev
  group (pytest, ruff, mypy). Previously pytest sat in
  [project.optional-dependencies] while ruff/black were in
  [dependency-groups] -- two groups both named "dev" with split
  contents. mypy is added since CI relies on it.
- Declare networkx as a proper optional dependency
  ([project.optional-dependencies] networkx) so it can be installed
  via OsmToRoadGraph[networkx] instead of a manual side install.
- Remove the duplicate "SIM" entry from the ruff lint select list.
- Drop black in favour of ruff's built-in formatter: remove [tool.black]
  and add [tool.ruff] with line-length = 120 and target-version =
  "py313" (the old black target-version py311 also contradicted
  requires-python >= 3.13). CI now runs `ruff format --check` instead
  of `black --check`. One f-string whitespace normalization in
  algorithms.py results from the formatter switch.
- README: document networkx as an optional dependency installable via
  the OsmToRoadGraph[networkx] extra.

Note: CI still lints with flake8; switching it to `ruff check` is left
out because ruff currently reports pre-existing findings that would
need to be resolved first.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CI now lints with `ruff check` instead of flake8, so the [tool.ruff.lint]
configuration in pyproject.toml is actually enforced. flake8 is dropped
from the workflow dependencies.

Also bumped the deprecated action versions: actions/checkout@v1 -> v4 and
actions/setup-python@v1 -> v5 (both v1 releases run on long-EOL Node).

Resolved the 5 pre-existing lint findings that ruff reports but flake8
did not, so the build stays green:
- way_parser_helper.is_way_acceptable: return the condition directly (SIM103)
- xml_handler indoor branch: collapse the nested if into the elif (SIM102)
- xml_handler PercentageFile: SIM115 silenced with a noqa + rationale;
  the handle is intentionally owned for the wrapper's lifetime
- shortest-distances-drawing example: two if/else blocks turned into
  ternary expressions (SIM108)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@AndGem
AndGem merged commit 06b9015 into main May 21, 2026
2 checks passed
@AndGem
AndGem deleted the chore/pyproject-cleanup branch May 21, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant