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

Sync latest distutils #4103

Merged
merged 34 commits into from
Nov 18, 2023
Merged

Sync latest distutils #4103

merged 34 commits into from
Nov 18, 2023

Conversation

jaraco
Copy link
Member

@jaraco jaraco commented Nov 8, 2023

  • Rely on pytest as found in fix #10447 - consider marks in reverse mro order to give base classes priority pytest-dev/pytest#11155. Fixes test_bdist_ext tests started failing with pytest 7.2 distutils#186.
  • Clean up docstrings and remove crufty comments. Replace integer literals with booleans.
  • "Refactor to newer_group to utilize higher level constructs ("any"), re-use _newer logic, and avoid complexity in branching."
  • Prefer os.path.getmtime
  • Inline check for target presence.
  • Add test for newer_pairwise, bringing coverage in dep_util to 100%.
  • Replace for/append loop with a filter function (newer_pair).
  • Replace explicit list check with zip(strict=True). Allows inputs to be iterables.
  • Extract a 'starfilter', similar to itertools.starmap, to generalize the concept of filtering results over a sequence of tuples.
  • Replace '_starfilter' with 'jaraco.functools.splat'.
  • Move dep_util to _modified and mark dep_util as deprecated.
  • Extend tests for newer_pairwise and fix failed expectation when no files are newer.
  • Add newer_pairwise_group (inspired by setuptools.dep_util).
  • Added tests for newer_pairwise_group().
  • Modernize test_newer_pairwise_group by using tmp_path and a SimpleNamespace.
  • Remove latent references in docs.
  • Limit sphinxlint jobs to 1. Workaround for AttributeError: Can't get attribute '_check_file' on <module '__main__' (built-in)> sphinx-contrib/sphinx-lint#83.
  • Replace git version with released version. Ref recent windows tests fail (winbot) #186.
  • Disable cygwin tests for now. Ref test_cygwin job failing after adding ruff #3921
  • Disable integration test due to known breakage from deprecation warnings.
  • Allow diffcov to fail also, as it requires the tests to pass on the latest Python to succeed.
  • Remove newsfragment
  • Copy concurrency setting from setuptools
  • Rely on distutils._modified and deprecated setuptools.dep_util.
  • Add news fragment.

Summary of changes

Closes

Pull Request Checklist

jaraco and others added 30 commits July 1, 2023 18:20
…re-use _newer logic, and avoid complexity in branching."
…he concept of filtering results over a sequence of tuples.
@jaraco
Copy link
Member Author

jaraco commented Nov 12, 2023

I don't understand why the pull request tests are failing but the push tests are fine... because they are both based on main so the diff between pull request and push should be zero.

@jaraco jaraco closed this Nov 12, 2023
@jaraco jaraco reopened this Nov 12, 2023
@abravalheri
Copy link
Contributor

abravalheri commented Nov 16, 2023

I don't understand why the pull request tests are failing but the push tests are fine... because they are both based on main so the diff between pull request and push should be zero.

There are some differences in setuptools/command/build_clib.py, setuptools/dep_util.py and setuptools/tests/test_dep_util.py, so probably even if the same code paths are executed, a simple thing like changing the total number of lines in a file might mess with the coverage percentiles1.

Footnotes

  1. Coverage is very useful, but also can be quite tricky and fragile sometimes...

Copy link
Contributor

@abravalheri abravalheri left a comment

Choose a reason for hiding this comment

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

Maybe the following suggestions would help with the diffcov errors?

n_targets.append(targets[i])

return n_sources, n_targets
def __getattr__(name):
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def __getattr__(name):
def __getattr__(name): # pragma: no cover


try:
from distutils._modified import newer_pairwise_group
except ImportError:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
except ImportError:
except ImportError: # pragma: no cover

@jaraco
Copy link
Member Author

jaraco commented Nov 18, 2023

Oh! Good news. The tests that were failing before stopped failing after I closed and re-opened the PR. Now all that's failing is the diffcov tests. I'm happy to ignore those failures.

Thanks for the extra set of eyes!

@jaraco jaraco merged commit 520336e into main Nov 18, 2023
44 of 61 checks passed
@jaraco jaraco deleted the feature/distutils-sync branch November 18, 2023 19:48
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.

test_bdist_ext tests started failing with pytest 7.2
2 participants