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

Restore the tests command and deprecate access to the module. #4522

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

jaraco
Copy link
Member

@jaraco jaraco commented Jul 29, 2024

Summary of changes

As suggested by @hauntsaninja, add a deprecation warning to access of setuptools.command.test and raise an error when running the command.

This approach provides a gentler offboarding for projects still reliant on the presence of the module or the command. Currently, it gives 3 months for projects to cut new releases in response to the change. This deadline can be extended if deemed necessary.

Closes #4520; Closes #4519.

Pull Request Checklist

@jaraco jaraco force-pushed the feature/graceful-drop-tests branch 2 times, most recently from d6dbddc to eadd7a6 Compare July 29, 2024 14:20
@jaraco
Copy link
Member Author

jaraco commented Jul 29, 2024

I've had to move the DeprecationWarning to only trigger on access to setuptools.command.test.test. There are many accesses to attributes of the module by pytest and doctest that are needed to fail, so the DeprecationWarning won't trigger if someone merely imports the module.

@jaraco
Copy link
Member Author

jaraco commented Jul 29, 2024

I can confirm that this change allows previously-failing install of cssbeautifier to succeed:

 🐚 pip-run git+https://github.com/pypa/setuptools@refs/pull/4522/head -- -m pip-run --no-build-isolation --no-binary cssbeautifier --no-cache --no-deps -v cssbeautifier -- -c pass
  WARNING: Did not find branch or tag 'refs/pull/4522/head', assuming revision or ref.
Collecting cssbeautifier
  Downloading cssbeautifier-1.15.1.tar.gz (25 kB)
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: cssbeautifier
  Building wheel for cssbeautifier (pyproject.toml) ... done
  Created wheel for cssbeautifier: filename=cssbeautifier-1.15.1-py3-none-any.whl size=30528 sha256=1d80e111c61927bf5da0f8c769aa05006bc0a5f289c9a6c84756a9e98fc6592b
  Stored in directory: /private/var/folders/f2/2plv6q2n7l932m2x004jlw340000gn/T/pip-ephem-wheel-cache-obs8yfgq/wheels/c8/5a/e4/c2ac980978446ee433fb66088f06b3d35bd66f25bc3e88bd52
Successfully built cssbeautifier
Installing collected packages: cssbeautifier
Successfully installed cssbeautifier-1.15.1

[notice] A new release of pip is available: 24.1.2 -> 24.2
[notice] To update, run: pip3.13 install --upgrade pip

@jaraco jaraco force-pushed the feature/graceful-drop-tests branch from eadd7a6 to c437aaa Compare July 29, 2024 14:45
@jaraco jaraco merged commit 59aff44 into main Jul 29, 2024
28 of 30 checks passed
@jaraco jaraco deleted the feature/graceful-drop-tests branch July 29, 2024 14:50
gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request Jul 29, 2024
In 72.0.0 the test command was finally removed as has been threatened
for a while. It turns out that many people still had referenced it in
their setup.py even if they didn't actually use it, so simply building a
wheel then failed -- the only deprecation warning had been if you
actually attempted to use `setup.py test`.

Setuptools 72.1.0 adds a deprecation shim to allow those packages to
still build wheels successfully, to give projects time and warning that
they need to remove this last remaining trace.

We drop the old version too, as we don't want users to hit the version
that breaks wheel building.

Bug: pypa/setuptools#4520
Bug: pypa/setuptools#4522
Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
jtrobles-cdd added a commit to cordada/lib-cl-sii-python that referenced this pull request Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant