Skip to content

Handle wave of overdue deprecations#4066

Merged
abravalheri merged 20 commits into
pypa:mainfrom
abravalheri:deprecations
Nov 20, 2023
Merged

Handle wave of overdue deprecations#4066
abravalheri merged 20 commits into
pypa:mainfrom
abravalheri:deprecations

Conversation

@abravalheri

@abravalheri abravalheri commented Sep 28, 2023

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

Updated to include more overdue deprecations for Oct 2023.

Comment thread setuptools/build_meta.py Outdated
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
@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