-
-
Notifications
You must be signed in to change notification settings - Fork 168
chore: remove isort and old setup.cfg #1625
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
chore: remove isort and old setup.cfg #1625
Conversation
- Remove isort from pre-commit config - Use builtin isort rules within ruff - Select F and most E class rules in ruff explicitly - Remove `setup.cfg` and move most of its configuration into `pyproject.toml` - Remove Python 3.8 hack in `version.py`
known_first_party = Alerters,Loggers,Monitors,envconfig,util,simplemonitor | ||
line_length=88 | ||
multi_line_output=3 | ||
include_trailing_comma=True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not all of these have config equivalents in ruff, but doesn't seem to cause any complaints in terms of existing formatting.
@@ -1,21 +0,0 @@ | |||
[metadata] | |||
version = attr: simplemonitor.__version__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this I'm not 100% sure on - I think the static version in pyproject.toml
[project]
will be sufficient here?
From a quick look, I don't think that one is supposed to be dynamic, but should be hard-coded? I assume everything that needs to get updated already does as part of how it's released?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, but from memory this is also one of those things where I was trying a bunch of stuff out to see what worked for me and what didn't :)
[tool.ruff.lint] | ||
ignore = ["F401"] | ||
# Ruff defaults (F + some E), as well as I (isort) and W. | ||
# Maybe consider adding some subset of "D" here as well | ||
select = ["E4", "E7", "E9", "F", "I", "W"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not 100% sure if select
overrides defaults or is additive, but seemed best to just be explicit here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Explicit is better than implicit." :)
@@ -1,4 +1,4 @@ | |||
from importlib_metadata import version # compat lib for < 3.8 | |||
from importlib.metadata import version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think switching to .
from _
is what that 3.8
comment was about? Not sure what should really be in this file. Seemed like this line was needed, but not sure if line 3 should be removed or left there commented out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that maybe goes with my earlier comment about trying a bunch of things to see what stuck - possibly in combination with supporting older Pythons at the time.
Should also see if this resolves issues with dependabot not being able to parse pyproject.toml -- if not, I can take a look and try to figure out why. |
Thanks again for the effort on this :) |
Followup to #1611
setup.cfg
and move most of its configuration intopyproject.toml
version.py