Skip to content

Adequate to newly introduced Ruff checks #5042

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

Merged
merged 1 commit into from
Jun 17, 2025
Merged

Conversation

abravalheri
Copy link
Contributor

Summary of changes

This should avoid the CI failing on unrelated changes.

Closes

Pull Request Checklist

@abravalheri abravalheri merged commit e704a1f into pypa:main Jun 17, 2025
23 of 25 checks passed
@abravalheri abravalheri deleted the fix-ruff branch June 17, 2025 16:49
@cclauss
Copy link
Contributor

cclauss commented Jun 17, 2025

test_cygwin (39, windows-latest) failure is the first item in the coverage changelog...

@@ -165,7 +165,7 @@ def test_excluded_subpackages(tmpdir_cwd):
build_py = dist.get_command_obj("build_py")

msg = r"Python recognizes 'mypkg\.tests' as an importable package"
with pytest.warns(SetuptoolsDeprecationWarning, match=msg):
with pytest.warns(SetuptoolsDeprecationWarning, match=msg): # noqa: PT031
Copy link
Contributor

Choose a reason for hiding this comment

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

Given the TODO comment I find this acceptable

@@ -73,6 +73,7 @@ ignore = [
# Suppress nuisance warnings about module-import-not-at-top-of-file (E402) due to workaround for #4476
"setuptools/__init__.py" = ["E402"]
"pkg_resources/__init__.py" = ["E402", "ANN204"]
"pkg_resources/tests/test_resources.py" = ["PT031"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Given pkg_resources is planned for removal, I'm not even gonna bother checking what this triggered on ^^

@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.9
rev: v0.12.0
Copy link
Contributor

Choose a reason for hiding this comment

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

I understand pre-commit (the tool) can be useful to some devs to install git pre-commit hooks. But considering we don't use it on the CI, we should really consider just making it run a "tox autofix" command to avoid having to duplicate versions here.

Then if we want CI autofixes, https://autofix.ci/ and https://pre-commit.ci/lite both do more or less the same job (pushes any local changes during a CI run)

At that point, .pre-commit-config.yaml would only be provided out of convenience for those who enjoy pre-commit hooks and don,t want to manually setup a hook to run said "tox autofix" command.

Ref: jaraco/skeleton#109 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, I added reported this to skeleton and added a note to the PR saying that I don't have many strong opinions about it.

@abravalheri
Copy link
Contributor Author

abravalheri commented Jun 17, 2025

test_cygwin (39, windows-latest) failure is the first item in the coverage changelog...

@cclauss Interesting this is yet another case of dependency updates in the last days...

I suppose what is happening is that there are no pre-build ctracers available for Cygwin so it fails with an exception? Not sure is there something we can do in the short term. Let me try to ignore the warning in the pytest.ini file to see if it goes away.

(I believe that the cygwin failure is not blocking ATM)

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.

3 participants