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

Handle wave of overdue deprecations #4066

Merged
merged 20 commits into from
Nov 20, 2023
Merged

Conversation

abravalheri
Copy link
Contributor

@abravalheri abravalheri commented Sep 28, 2023

Some deprecation warnings have been marked as due. Note that they were announced as deprecated at least a year ago (likely more than 1).

Summary of changes

  • Post-pone deprecations for fields in setup.cfg that have hyphens instead of underscores or are upper-cased.
    • I did not feel confident that this would be a smooth transition in terms of backwards compatibility with old sdists published to PyPI so I postponed this change for another year...
  • Remove deprecation warnings for invalid versions.
    • Let the exception to be handled by the user.
    • In some scenarios setuptools._normalization.best_effort_version can be used internally (this function will try very hard to sanitise the given version string).
  • Remove egg_base option from dist_info.
    • dist_info is kind of an internal command that was created for the PEP 517 implementation, so we don't have much commitment in providing a public API for it.
  • Remove metadata.requires from setup.cfg.
    • Users should be using options.install_requires
    • A search on grep.app suggests that metadata.requires is not utilised in setup.cfg, so it should be safe to remove.
  • Remove metadata.license_file from setup.cfg.
    • Not parsing license_file is not going to break core functionality of files, so it is low stakes.
  • Remove deprecation warning for config_settings --global-option
    • To be honest the way we handle config_settings is not very stable/usable. We still have lots of work on that regards...
  • Removed deprecated namespace-packages from pyproject.toml.
    • Users are asked to use :doc:implicit namespace packages <PyPUG:guides/packaging-namespace-packages> (as defined in :pep:420).
  • Added strict enforcement for project.dynamic in pyproject.toml.
    • This removes the transitional ability of users configuring certain parameters via setup.py without making the necessary changes to pyproject.toml (as mandated by :pep:612).

@jaraco please let me know if you have any objection/suggestion regarding this.

Pull Request Checklist

A search in
[`grep.app`](https://grep.app/search?q=%5Erequires%5Cs%2A%3D&regexp=true&filter%5Bpath.pattern%5D%5B0%5D=setup.cfg)
suggests that `requires` is not utilised in `setup.cfg`, so it should be safe to remove.

`license_file` is not fundamental to make distributions work, so it
should be safe to remove.
This interface is not super stable/usable yet, so it should be fine
to remove.
… and post-pone deprecations for `setup.cfg` regarding hifens instead of
underscores and upper-cased fields.
This way we don't have to see `DistutilsOptionError` in the error
message.
@abravalheri
Copy link
Contributor Author

Updated to include more overdue deprecations for Oct 2023.

setuptools/build_meta.py Outdated Show resolved Hide resolved
In `pip` docs, the following example is mentioned:

> python -m pip wheel --global-option bdist_ext --global-option -DFOO wheel

Since both `--global-option` and `--build-option` are supposed to be
compatible with `pip` options, we should not prevent this abuse...
(Although it is still error prone and the user is responsible for
understanding in detail what is going on how this accidentally works).
@abravalheri abravalheri merged commit 30b8a88 into pypa:main Nov 20, 2023
23 checks passed
@abravalheri abravalheri deleted the deprecations branch November 20, 2023 15:18
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.

1 participant