sagemath/sage

sage_setup: Replace imports from distutils by setuptools

mkoeppe opened this issue · 28 comments

... in anticipation of the distutils deprecation (https://www.python.org/dev/peps/pep-0632/)

From https://setuptools.readthedocs.io/en/latest/deprecated/distutils-legacy.html

  • distutils.core.setupsetuptools.setup
  • distutils.cmd.Commandsetuptools.Command
  • distutils.log(no replacement yet)
  • distutils.version.*packaging.version.*

"If a project relies on uses of distutils that do not have a suitable replacement above, please search the Setuptools issue tracker and file a request, describing the use-case so that Setuptools’ maintainers can investigate."

Part of #31295 (Meta-ticket: Replace imports from deprecated distutils)

CC: @jhpalmieri @kiwifb @kliem

Component: build

Author: Frédéric Chapoton, Matthias Koeppe

Branch/Commit: 25b877c

Reviewer: Matthias Koeppe, John Palmieri

Issue created by migration from https://trac.sagemath.org/ticket/30984

Description changed:

--- 
+++ 
@@ -1 +1 @@
-... in anticipation of the `distutils` deprecation 
+... in anticipation of the `distutils` deprecation (https://www.python.org/dev/peps/pep-0632/)

Description changed:

--- 
+++ 
@@ -1 +1,15 @@
 ... in anticipation of the `distutils` deprecation (https://www.python.org/dev/peps/pep-0632/)
+
+From https://setuptools.readthedocs.io/en/latest/deprecated/distutils-legacy.html 
+
+- `distutils.core.setup` → `setuptools.setup`
+
+- `distutils.cmd.Command` → `setuptools.Command`
+
+- `distutils.log` → `(no replacement yet)`
+
+- `distutils.version.*` → `packaging.version.*`
+
+"If a project relies on uses of distutils that do not have a suitable replacement above, please search the Setuptools issue tracker and file a request, describing the use-case so that Setuptools’ maintainers can investigate."
+
+

Commit: 3b4203e

New commits:

3b4203estart replacing distutils by setuptools

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

a29d068start replacing distutils by setuptools

Changed commit from 3b4203e to a29d068

Author: Frédéric Chapoton

Changed commit from a29d068 to 673f99c

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

673f99cstart replacing distutils by setuptools

Changed author from Frédéric Chapoton to Frédéric Chapoton, Matthias Koeppe

Dependencies: #30912

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

2c40179build/pkgs/sagelib/src: Update metadata
2a91862build/pkgs/sagelib/src/README.rst: Add some text
6432727Merge tag '9.3.beta2' into t/30912/sagelib__update_metadata_for_pypi_deployment
4a693f2Move build/pkgs/sagelib/src/setup.cfg to SAGE_ROOT/src, replace by symlink
ea182d7Copy changes from build/pkgs/sagelib/src to src
a1a10b9src/VERSION.txt: New
5697335src/setup.cfg: Add license_file=LICENSE.txt
deb9eb3Merge tag '9.3.beta3' into t/30912/sagelib__update_metadata_for_pypi_deployment
7ad4c0eMerge tag '9.3.beta4' into t/30912/sagelib__update_metadata_for_pypi_deployment
3ab5982Merge branch 't/30912/sagelib__update_metadata_for_pypi_deployment' into t/30984/public/distutils_to_setuptools

Changed commit from 673f99c to 3ab5982

Description changed:

--- 
+++ 
@@ -3,11 +3,8 @@
 From https://setuptools.readthedocs.io/en/latest/deprecated/distutils-legacy.html 
 
 - `distutils.core.setup` → `setuptools.setup`
-
 - `distutils.cmd.Command` → `setuptools.Command`
-
 - `distutils.log` → `(no replacement yet)`
-
 - `distutils.version.*` → `packaging.version.*`
 
 "If a project relies on uses of distutils that do not have a suitable replacement above, please search the Setuptools issue tracker and file a request, describing the use-case so that Setuptools’ maintainers can investigate."

Changed commit from 3ab5982 to b3ea086

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

Changed dependencies from #30912 to none

Branch pushed to git repo; I updated commit sha1. New commits:

25b877csage_setup.command.build_ext: Use class from setuptools.command instead of distutils.command

Changed commit from b3ea086 to 25b877c

Reviewer: Matthias Koeppe, ...

comment:14

This works for me when building Sage and when upgrading sagelib from 9.3.beta6 to 9.3.beta7, or from building the develop branch to building this one. What else should I test?

comment:15

I've used it for a while now, I wouldn't know what else to test either.

comment:16

The title shows that the ticket is very specific, are there other tickets I have missed for:

  • setup.py
  • sage/misc/cython.py
  • sage/env.py
  • documentation mentioning distutils specifically

Description changed:

--- 
+++ 
@@ -9,4 +9,5 @@
 
 "If a project relies on uses of distutils that do not have a suitable replacement above, please search the Setuptools issue tracker and file a request, describing the use-case so that Setuptools’ maintainers can investigate."
 
+Part of #31295 (Meta-ticket: Replace imports from deprecated distutils)
 

Changed reviewer from Matthias Koeppe, ... to Matthias Koeppe, John Palmieri

comment:20

Thank you!