Skip to content

Commit b619010

Browse files
authored
Merge pull request #93 from maxmind/greg/replace-distutils
Replace distutils
2 parents 24b444b + 6a5182e commit b619010

File tree

5 files changed

+24
-13
lines changed

5 files changed

+24
-13
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Python
1818
uses: actions/setup-python@v2
1919
with:
20-
python-version: 3.9
20+
python-version: "3.10"
2121

2222
- name: Install dependencies
2323
run: |

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
# We don't test on Windows and macOS currently due to issues
1515
# build libmaxminddb there.
1616
platform: [ubuntu-latest]
17-
python-version: [3.6, 3.7, 3.8, 3.9]
17+
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
1818

1919
name: Python ${{ matrix.python-version }} on ${{ matrix.platform }}
2020
runs-on: ${{ matrix.platform }}

HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
History
44
-------
55

6+
2.3.0
7+
++++++++++++++++++
8+
9+
* ``distutils`` is no longer used for building the C extension.
10+
611
2.2.0 (2021-09-24)
712
++++++++++++++++++
813

setup.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ python =
1616
3.6: py36
1717
3.7: py37
1818
3.8: py38
19-
3.9: py39, mypy
19+
3.9: py39
20+
"3.10": py310, mypy
21+
2022

2123
[testenv]
2224
deps =

setup.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22
import re
33
import sys
44

5-
# This import is apparently needed for Nose on Red Hat's Python
6-
import multiprocessing
7-
8-
from distutils.command.build_ext import build_ext
9-
from distutils.errors import CCompilerError, DistutilsExecError, DistutilsPlatformError
10-
115
from setuptools import setup, Extension
6+
from setuptools.command.build_ext import build_ext
7+
8+
# These were only added to setuptools in 59.0.1.
9+
try:
10+
from setuptools.errors import CCompilerError
11+
from setuptools.errors import DistutilsExecError
12+
from setuptools.errors import DistutilsPlatformError
13+
except ImportError:
14+
from distutils.errors import CCompilerError
15+
from distutils.errors import DistutilsExecError
16+
from distutils.errors import DistutilsPlatformError
1217

1318
cmdclass = {}
1419
PYPY = hasattr(sys, "pypy_version_info")
@@ -33,7 +38,7 @@
3338

3439
class BuildFailed(Exception):
3540
def __init__(self):
36-
self.cause = sys.exc_info()[1] # work around py 2/3 different syntax
41+
self.cause = sys.exc_info()[1]
3742

3843

3944
class ve_build_ext(build_ext):
@@ -52,7 +57,7 @@ def build_extension(self, ext):
5257
raise BuildFailed()
5358
except ValueError:
5459
# this can happen on Windows 64 bit, see Python issue 7511
55-
if "'path'" in str(sys.exc_info()[1]): # works with both py 2/3
60+
if "'path'" in str(sys.exc_info()[1]):
5661
raise BuildFailed()
5762
raise
5863

@@ -112,8 +117,6 @@ def run_setup(with_cext):
112117
python_requires=">=3.6",
113118
include_package_data=True,
114119
install_requires=requirements,
115-
tests_require=["nose"],
116-
test_suite="nose.collector",
117120
license=LICENSE,
118121
cmdclass=cmdclass,
119122
classifiers=[
@@ -127,6 +130,7 @@ def run_setup(with_cext):
127130
"Programming Language :: Python :: 3.7",
128131
"Programming Language :: Python :: 3.8",
129132
"Programming Language :: Python :: 3.9",
133+
"Programming Language :: Python :: 3.10",
130134
"Programming Language :: Python",
131135
"Topic :: Internet :: Proxy Servers",
132136
"Topic :: Internet",

0 commit comments

Comments
 (0)