Print

Print


In CPython 3.10 distutils was formally marked as deprecated and it will be removed from CPython in 3.12. To avoid complications, deprecate use of distutils moving forward in favor of using setuptools as recommended. This means that in a few years anything that relies on distutils will be fundamentally broken in new CPython versions. It is much easier to fix in advance then when things are already broken.

For Python 3.7+ (which should by default have `pip` `v22.0.0+` and `setuptools` `v57.5.0+`) use:
* `setuptools._distutils.core` over `distutils.core`
* CPython's sysconfig library over `distutils.sysconfig`

If `setuptools._distutils` is not available in the Python 3 environment (`setuptools._distutils` was added in `setuptools` `v48.0.0`), fall back to using `distutils.core` and `distutils.sysconfig`.

Additional supporting advice given in:
* https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html
* https://peps.python.org/pep-0632/#migration-advice

This was already discussed a bit in Issue #1579 and was attempted originally in PR #1585, but there were difficulties in supporting all Python versions:

> This PR was meant to also change:
>
> * `distutils.setup` -> `setuptools.setup`
> * `distutils.sysconfig` -> CPython's `sysconfig`
> 
> but it seems that these are still required given the current state of the build and will need to be revised in a later PR.

These issues are now understood and once PR #1691 is merged I can open up a PR from a branch on my fork which is passing CI that will add this support.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/xrootd/xrootd/issues/1698
You are receiving this because you are subscribed to this thread.

Message ID: <[log in to unmask]>

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1