From 3c838eb783aa84c3f938ecc109b66393b40ee621 Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Sun, 30 Mar 2025 08:47:57 +0900 Subject: [PATCH 1/3] =?UTF-8?q?chore:=20distutils=E3=82=92=E3=82=84?= =?UTF-8?q?=E3=82=81=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 9 +++++---- setup.py | 11 +++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9accebb..0e19bec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,9 @@ [build-system] requires = [ - "setuptools=1.3.0,<2.0.0", "cython>=0.28.0,<3.0.0", - "cmake<4.0.0", + "cmake", "numpy>=1.25.0; python_version>='3.9'", "oldest-supported-numpy; 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..92d0ee0 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,7 @@ 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 @@ -132,7 +130,7 @@ def test_quoted_arg_change(): file_encoding = "utf8" arg_value = '"ARG"' - spawn( + subprocess.run( [ sys.executable, "-c", @@ -142,13 +140,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 From f3920df066593b849460c1e7eb4a537f00d437e3 Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Sun, 30 Mar 2025 08:48:47 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20cmake=E3=81=AE=E5=A4=89=E6=9B=B4?= =?UTF-8?q?=E3=82=92=E6=88=BB=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0e19bec..b114c7e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = [ "setuptools", "looseversion>=1.3.0,<2.0.0", "cython>=0.28.0,<3.0.0", - "cmake", + "cmake<4.0.0", "numpy>=1.25.0; python_version>='3.9'", "oldest-supported-numpy; python_version<'3.9'", ] From 26e90f513bae948859f70d224c8156668b3691bd Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Sun, 30 Mar 2025 08:49:27 +0900 Subject: [PATCH 3/3] =?UTF-8?q?chore:=20from=20subprocess=20import=20run?= =?UTF-8?q?=E3=82=92=E3=82=84=E3=82=81=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 92d0ee0..e056b9d 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,6 @@ 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 @@ -186,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)