diff --git a/pyproject.toml b/pyproject.toml index 9accebb..b114c7e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,7 @@ [build-system] requires = [ - "setuptools=1.3.0,<2.0.0", "cython>=0.28.0,<3.0.0", "cmake<4.0.0", "numpy>=1.25.0; python_version>='3.9'", @@ -15,9 +16,9 @@ version = "0.10.2" enable_black = true enable_flake8 = true enable_isort = true -enable_mypy = false # TODO: enable mypy in the future +enable_mypy = false # TODO: enable mypy in the future mypy_preset = "strict" line_length = 88 py_version = "py37" [[tool.pysen.lint.mypy_targets]] - paths = ["."] +paths = ["."] diff --git a/setup.py b/setup.py index 9563649..e056b9d 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,10 @@ import os import subprocess import sys -from distutils.errors import DistutilsExecError -from distutils.spawn import spawn -from distutils.version import LooseVersion +from looseversion import LooseVersion from glob import glob from itertools import chain from os.path import exists, join -from subprocess import run import numpy as np import setuptools.command.build_py @@ -132,7 +129,7 @@ def test_quoted_arg_change(): file_encoding = "utf8" arg_value = '"ARG"' - spawn( + subprocess.run( [ sys.executable, "-c", @@ -142,13 +139,14 @@ def test_quoted_arg_change(): output_mode, file_encoding, arg_value, - ] + ], + check=True, ) # read with open(file_name, mode="r", encoding=file_encoding) as fd: return fd.readline() != arg_value - except (DistutilsExecError, TypeError): + except (TypeError, subprocess.CalledProcessError): return False @@ -187,7 +185,7 @@ def escape_macros(macros): # NOTE: The wrapped OpenJTalk does not depend on HTS_Engine, # but since HTSEngine is included in CMake's dependencies, it refers to a dummy path. - r = run(["cmake", "..", "-DHTS_ENGINE_INCLUDE_DIR=.", "-DHTS_ENGINE_LIB=dummy"]) + r = subprocess.run(["cmake", "..", "-DHTS_ENGINE_INCLUDE_DIR=.", "-DHTS_ENGINE_LIB=dummy"]) r.check_returncode() os.chdir(cwd)