Edgewall Software
Modify

Opened 2 years ago

Last modified 10 months ago

#13456 assigned defect

distutils is deprecated and will be removed in Python 3.12

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.6.1
Component: general Version: 1.5.3
Severity: normal Keywords:
Cc: Branch:
Release Notes:
  • Use sysconfig rather than deprecated distutils.sysconfig since Python 3.10.
API Changes:
Internal Changes:

Description

https://docs.python.org/3/whatsnew/3.10.html#distutils-deprecated

$ git grep -w distutils mirror/trunk
mirror/trunk:.travis.yml:      print_sitelib='from distutils.sysconfig import get_python_lib; print(get_python_lib())'
mirror/trunk:trac/dist.py:`distutils.command.build` and `setuptools.command.install_lib` classes
mirror/trunk:trac/dist.py:from distutils import log as distlog
mirror/trunk:trac/dist.py:from distutils.cmd import Command
mirror/trunk:trac/dist.py:from distutils.command.build import build as _build
mirror/trunk:trac/dist.py:from distutils.errors import DistutilsOptionError

Attachments (0)

Change History (8)

comment:1 by anonymous, 2 years ago

distutils.sysconfig.get_python_lib() should probably be replaceable via sysconfig already in Python 3.2+:

import sysconfig; print(sysconfig.get_path('purelib'))

comment:2 by anonymous, 2 years ago

setuptools has a short guide for porting from distutils:

  • distutils.cmd.Commandsetuptools.Command
  • distutils.command.{build_clib,build_ext,build_py,sdist}setuptools.command.*
  • distutils.log → (no replacement yet)
  • distutils.errors.*setuptools.errors.*

in reply to:  2 ; comment:3 by anonymous, 2 years ago

  • distutils.log → (no replacement yet)

https://github.com/pypa/setuptools/issues/2973

comment:4 by anonymous, 2 years ago

from distutils.command.build import build as _build

https://github.com/pypa/setuptools/issues/2591

in reply to:  3 comment:5 by Jun Omae, 21 months ago

  • distutils.log → (no replacement yet)

https://github.com/pypa/setuptools/issues/2973

Fixed in setuptools 60.2.0.

  • Setuptools now relies on the Python logging infrastructure to log messages. Instead of using distutils.log.*, use logging.getLogger(name).*.

in reply to:  1 comment:6 by Jun Omae, 16 months ago

Release Notes: modified (diff)

distutils.sysconfig.get_python_lib() should probably be replaceable via sysconfig already in Python 3.2+:

import sysconfig; print(sysconfig.get_path('purelib'))

Thanks. Committed in [17644].

comment:7 by Jun Omae, 14 months ago

Milestone: 1.61.6.1

comment:8 by Jun Omae, 14 months ago

Owner: set to Jun Omae
Status: newassigned

Proposed changes in [dfa6c286e/jomae.git] (jomae.git@t13456).

Last edited 10 months ago by Jun Omae (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as assigned The owner will remain Jun Omae.
The ticket will be disowned. Next status will be 'new'.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.