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

Update pre-commit versions and contributing doc #67

Merged
merged 2 commits into from
Mar 22, 2024
Merged

Conversation

grovduck
Copy link
Member

Per changes made in sknnr-spatial, update the pre-commit versions to latest versions.

  • ruff: v0.3.2
  • mypy: v1.9.0

In addition, remove the use of black as a pre-commit hook and instead rely on ruff-format. Also, update contributing.md to show command use with hatch and to align it with the contributing guide for sknnr-spatial.

@grovduck grovduck self-assigned this Mar 22, 2024
@grovduck grovduck added documentation Improvements or additions to documentation dx Developer experience, tools, efficiency, etc. labels Mar 22, 2024
@grovduck grovduck requested a review from aazuspan March 22, 2024 17:45
@grovduck
Copy link
Member Author

@aazuspan, a few notes on this implications of this commit:

  • My editor did a lot of reformatting of the pyproject.toml file which I attribute to the swap of black for ruff-format? The reformatting looks correct to me based on black formatting rules, but hopefully it doesn't cause you grief.
  • There were warnings from ruff that configuration associated with select and isort now need to be under ruff.lint headings rather than ruff itself.
  • mypy brought out what it considered to be a type inconsistency on sknnr.datasets._base._open_text. I've changed this to return IO[str] rather than TextIO. Some discussion of this here.

Copy link
Contributor

@aazuspan aazuspan left a comment

Choose a reason for hiding this comment

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

Looks great @grovduck, thanks for updating the pre-commits and getting everything back in order!

I think I had omitted the hatch run from the pre-commit instructions with the thought that it's not needed if you've activated the shell, but now it looks like the instructions will work whether or not the shell is activated, so definitely an improvement!

My editor did a lot of reformatting of the pyproject.toml file which I attribute to the swap of black for ruff-format?

I'm not sure that ruff-format will work on toml files - I tried manually running ruff-format on the file and it just skipped it. But whatever made the changes, they look better to me!

I've changed this to return IO[str] rather than TextIO. Some discussion of this python/typeshed#283.

Good to know, thanks for the reference!

@grovduck
Copy link
Member Author

I'm not sure that ruff-format will work on toml files - I tried manually running ruff-format on the file and it just skipped it

Ah, thanks for that clarification. Then I'm guessing it must be a VSCode TOML extension I'm using (Even Better TOML). As long as you don't mind, I'll keep the changes.

@aazuspan
Copy link
Contributor

That makes sense - yeah, I'd say keep the changes! We could add a TOML formatter to the pre-commit, but it changes so infrequently I'm not sure it's the effort.

@grovduck grovduck merged commit 8cde040 into main Mar 22, 2024
13 checks passed
@grovduck grovduck deleted the update-pre-commit branch March 22, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation dx Developer experience, tools, efficiency, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants