Skip to content

Commit abefcb2

Browse files
authored
Remove using of distutils (#1964)
* Remove using of distutils * Upgrade setuptools to fix CI * Use Python 3.7 in build_wheel.sh
1 parent c39e802 commit abefcb2

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

.github/workflows/PyPI-publishing.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
110110
- name: '🛠️ pip dependencies'
111111
run: |
112-
pip install setuptools wheel
112+
pip install --upgrade setuptools wheel
113113
114114
- name: '🚧 Build distribution'
115115
shell: bash

bindings/python/build_wheel.sh

+2-6
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,12 @@ set -e -x
44
cd bindings/python
55

66
# Compile wheels
7-
if [ -f /opt/python/cp36-cp36m/bin/python ];then
8-
/opt/python/cp36-cp36m/bin/python setup.py bdist_wheel $@
9-
else
10-
python3 setup.py bdist_wheel $@
11-
fi
7+
python3.7 setup.py bdist_wheel $@
128
cd dist
139

1410
# We can't repair an aarch64 wheel on x64 hosts
1511
# https://github.com/pypa/auditwheel/issues/244
1612
if [[ ! "$*" =~ "aarch64" ]];then
1713
auditwheel repair *.whl
1814
mv -f wheelhouse/*.whl .
19-
fi
15+
fi

bindings/python/setup.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,22 @@
33

44
from __future__ import print_function
55
import glob
6+
import logging
67
import os
78
import subprocess
89
import shutil
910
import sys
1011
import platform
1112
import setuptools
1213

13-
from distutils import log
14-
from distutils.core import setup
15-
from distutils.util import get_platform
16-
from distutils.command.build import build
17-
from distutils.command.sdist import sdist
14+
from setuptools import setup
15+
from sysconfig import get_platform
16+
from setuptools.command.build import build
17+
from setuptools.command.sdist import sdist
1818
from setuptools.command.bdist_egg import bdist_egg
1919

20+
log = logging.getLogger(__name__)
21+
2022
SYSTEM = sys.platform
2123

2224
# sys.maxint is 2**31 - 1 on both 32 and 64 bit mingw

0 commit comments

Comments
 (0)