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

Re-export errors from distutils #2858

Merged
merged 3 commits into from
Nov 7, 2021
Merged

Re-export errors from distutils #2858

merged 3 commits into from
Nov 7, 2021

Conversation

abravalheri
Copy link
Contributor

Summary of changes

As stated in #2698, exposing distutil.errors via the setuptools module might facilitate people that want to tackle the migration motivated by PEP 632.

These exceptions might appear when customising commands like build_py and build_ext, and there are examples of projects explicitly checking them in the original issue.

This PR re-exports most of these functions via setuptools.errors.

DistutilsGetoptError and DistutilsArgError are left out, since they are related to the deprecated practice of running the setup.py script directly (I think).

I also removed the "Distutils" part of the name of some exceptions and added notes about the migration/replacements in the docs.

Closes #2698

Pull Request Checklist

As mentioned in pypa#2698, exposing distutil errors via setuptools help the
migration stated by PEP 632.
@abravalheri abravalheri marked this pull request as ready for review November 5, 2021 19:52
docs/userguide/extension.rst Outdated Show resolved Hide resolved
@jaraco jaraco merged commit 8af23a4 into pypa:main Nov 7, 2021
@abravalheri
Copy link
Contributor Author

Thank you very much for the review and improvements!

@grlee77
Copy link

grlee77 commented Nov 7, 2021

Thank you for doing this @abravalheri!

multani added a commit to multani/aiokafka that referenced this pull request Dec 31, 2021
aio-libs#810 imports errors from
`setuptools` instead of `distutils`

This is available only starting from `setuptools` v59.0.0
(pypa/setuptools#2858) but RTD currently
defaults to v58.2.0
(https://docs.readthedocs.io/en/stable/builds.html#python)
multani added a commit to multani/aiokafka that referenced this pull request Dec 31, 2021
aio-libs#810 imports errors from
`setuptools` instead of `distutils`

This is available only starting from `setuptools` v59.0.0
(pypa/setuptools#2858) but RTD currently
defaults to v58.2.0
(https://docs.readthedocs.io/en/stable/builds.html#python)
multani added a commit to multani/aiokafka that referenced this pull request Dec 31, 2021
aio-libs#810 imports errors from
`setuptools` instead of `distutils`

This is available only starting from `setuptools` v59.0.0
(pypa/setuptools#2858) but RTD currently
defaults to v58.2.0
(https://docs.readthedocs.io/en/stable/builds.html#python)
multani added a commit to multani/aiokafka that referenced this pull request Dec 31, 2021
aio-libs#810 imports errors from
`setuptools` instead of `distutils`

This is available only starting from `setuptools` v59.0.0
(pypa/setuptools#2858) but RTD currently
defaults to v58.2.0
(https://docs.readthedocs.io/en/stable/builds.html#python)
multani added a commit to multani/aiokafka that referenced this pull request Dec 31, 2021
aio-libs#810 imports errors from
`setuptools` instead of `distutils`

This is available only starting from `setuptools` v59.0.0
(pypa/setuptools#2858) but RTD currently
defaults to v58.2.0
(https://docs.readthedocs.io/en/stable/builds.html#python)
multani added a commit to multani/aiokafka that referenced this pull request Dec 31, 2021
aio-libs#810 imports errors from
`setuptools` instead of `distutils`

This is available only starting from `setuptools` v59.0.0
(pypa/setuptools#2858) but RTD currently
defaults to v58.2.0
(https://docs.readthedocs.io/en/stable/builds.html#python)
ods pushed a commit to aio-libs/aiokafka that referenced this pull request Dec 31, 2021
* Fix doc building

#804 removed the
`aiokafka.protocol.produce` stubs imported from `kafka-python`, this
caused the documentation to fail to build.

* Fix RTD doc compilation

#810 imports errors from
`setuptools` instead of `distutils`

This is available only starting from `setuptools` v59.0.0
(pypa/setuptools#2858) but RTD currently
defaults to v58.2.0
(https://docs.readthedocs.io/en/stable/builds.html#python)
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.

[FR] distutils.errors.* is not fully re-exported
3 participants