Skip to content

Commit

Permalink
*/py-{gdbm,sqlite3,tkinter}: switch from distutils to setuptools
Browse files Browse the repository at this point in the history
For python modules which come from python itself, switch from
distutils (no longer present in python 3.12) to setuptools, fixing
these mudules for python 3.12.

PR:		268283
Approved by:	vishwin (python@)
  • Loading branch information
AMDmi3 committed Dec 15, 2022
1 parent 8719ba0 commit 7446740
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
12 changes: 7 additions & 5 deletions databases/py-gdbm/files/setup3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
# python setup.py install
#

import os
import sys

try:
import distutils
from distutils import sysconfig
from distutils.command.install import install
from distutils.core import setup, Extension
import setuptools
from setuptools.command.install import install
from setuptools import setup, Extension
except:
raise SystemExit("Distutils problem")

install.sub_commands = [x for x in install.sub_commands if 'egg' not in x[0]]

prefix = sysconfig.PREFIX
prefix = os.path.normpath(sys.prefix)
inc_dirs = [prefix + "/include"]
lib_dirs = [prefix + "/lib"]
libs = ["gdbm"]
Expand Down
13 changes: 7 additions & 6 deletions databases/py-sqlite3/files/setup3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
# python setup.py install
#

import os
import platform
import sys

try:
import distutils
from distutils import sysconfig
from distutils.command.install import install
from distutils.core import setup, Extension
import setuptools
from setuptools.command.install import install
from setuptools import setup, Extension
except:
raise SystemExit("Distutils problem")
raise SystemExit("Setuptools problem")

install.sub_commands = [x for x in install.sub_commands if 'egg' not in x[0]]

prefix = sysconfig.PREFIX
prefix = os.path.normpath(sys.prefix)
inc_dirs = [prefix + "/include", "Modules/_sqlite"]
lib_dirs = [prefix + "/lib"]
libs = ["sqlite3"]
Expand Down
12 changes: 6 additions & 6 deletions x11-toolkits/py-tkinter/files/setup3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
# python setup.py install
#

import os, string
import os
import sys

try:
import distutils
from distutils import sysconfig
from distutils.command.install import install
from distutils.core import setup, Extension
import setuptools
from setuptools.command.install import install
from setuptools import setup, Extension
except:
raise SystemExit("Distutils problem")

install.sub_commands = [x for x in install.sub_commands if 'egg' not in x[0]]

tkversion = "%%TK_VER%%"
prefix = sysconfig.PREFIX
prefix = os.path.normpath(sys.prefix)
# Python 1.5 doesn't have os.getenv()?
x11base = os.environ['LOCALBASE'] or '/usr/X11R6'
inc_dirs = [prefix + "/include",
Expand Down

0 comments on commit 7446740

Please sign in to comment.