Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize tooling #137

Merged
merged 2 commits into from
Sep 6, 2024
Merged

Modernize tooling #137

merged 2 commits into from
Sep 6, 2024

Conversation

daneah
Copy link
Member

@daneah daneah commented Sep 5, 2024

This change is a: (check at least one)

  • Bugfix
  • Feature addition
  • Code style update
  • Refactor
  • Release activity

Is this a breaking change? (check one)

  • Yes
  • No

Is the:

  • Title of this pull request clear, concise, and indicative of the issue number it addresses, if any?
  • Test suite passing?
  • Code coverage maximal?
  • Changelog up to date?

What does this change address?

We want to keep relatively up to date with latest versions of tooling packages, language syntax, and internal practices and preferences.

How does this change work?

  • Replace pyflakes with ruff
  • Add isort to manage import ordering
  • Update versions of pre-commit hooks and make parity with tox envs
  • Run all hooks against all files
    • isort reordered imports
    • pyupgrade replaced primitives like List, Dict, and Set with
      their literals, allowed in Python 3.9+, removing need for imports
    • pyupgrade moved Iterable from typing to collections.abc
    • Fix type checking failures
      • Remove unused settings in docs/conf.py
      • Add Protocol for resolver classes

- Replace `pyflakes` with `ruff`
- Add `isort` to manage import ordering
- Update versions of `pre-commit` hooks and make parity with `tox` envs
- Run all hooks against all files
  - `isort` reordered imports
  - `pyupgrade` replaced primitives like `List`, `Dict`, and `Set` with
    their literals, allowed in Python 3.9+, removing need for imports
  - `pyupgrade` moved `Iterable` from `typing` to `collections.abc`
  - Fix type checking failures
    - Remove unused settings in `docs/conf.py`
    - Add `Protocol` for resolver classes
@daneah daneah added the ⛏ chore Something that's just got to be done! label Sep 5, 2024
@@ -103,10 +103,12 @@ commands =
skip_install = True
deps =
black

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about replacing black with ruff as well? I don't have experience with ruff's formatting, but it looks like it's designed to be able to replace Black.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't had enough experience with it yet, but last I used it it was fairly compliant but the CLI interface was slightly different in a bothersome way. Don't want to do so at this juncture, but definitely something we could align on eventually. Black is generally fast enough not to bother me, but one less tool could be good. I think ruff can handle isort's job too.

@daneah daneah merged commit 1e2b001 into dev Sep 6, 2024
9 checks passed
@daneah daneah deleted the chore/modernize-tooling branch September 6, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⛏ chore Something that's just got to be done!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants