From 70e4a3746c24d4008b073d2631b010e8d8ae2224 Mon Sep 17 00:00:00 2001 From: Ryuichi Yamamoto Date: Sun, 7 Aug 2022 21:58:45 +0900 Subject: [PATCH 1/3] Fixees for Python 3.10 --- .github/workflows/ci.yaml | 17 ++++++++++++++--- pyproject.toml | 8 ++++---- setup.py | 5 ++++- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f4b97e3..8b22dcd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,8 +15,19 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest] - python-version: [3.7, 3.8, 3.9] + include: + - os: ubuntu-latest + python-version: 3.7 + - os: ubuntu-latest + python-version: 3.8 + - os: ubuntu-latest + python-version: 3.9 + - os: ubuntu-latest + python-version: '3.10' + - os: macos-latest + python-version: 3.9 + - os: windows-latest + python-version: 3.9 steps: - uses: actions/checkout@v2 @@ -36,4 +47,4 @@ jobs: - name: Test with pytest run: | pip install pytest - pytest \ No newline at end of file + pytest diff --git a/pyproject.toml b/pyproject.toml index 7d72fcf..212e445 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,12 +2,12 @@ requires = [ "wheel", "setuptools=0.21.0", - "numpy=0.28.0", + "numpy>=1.20.0", ] [tool.pysen] -version = "0.9" +version = "0.10.2" [tool.pysen.lint] enable_black = true @@ -18,4 +18,4 @@ mypy_preset = "strict" line_length = 88 py_version = "py37" [[tool.pysen.lint.mypy_targets]] - paths = ["."] \ No newline at end of file + paths = ["."] diff --git a/setup.py b/setup.py index 22646c0..cca74f8 100644 --- a/setup.py +++ b/setup.py @@ -276,7 +276,7 @@ def run(self): ext_modules=ext_modules, cmdclass=cmdclass, install_requires=[ - "numpy >= 1.8.0", + "numpy >= 1.20.0", "cython >= " + min_cython_ver, "six", "tqdm", @@ -296,9 +296,11 @@ def run(self): "types-setuptools", "mypy<=0.910", "black>=19.19b0,<=20.8", + "click<8.1.0", "flake8>=3.7,<4", "flake8-bugbear", "isort>=4.3,<5.2.0", + "types-decorator", ], "test": ["pytest", "scipy"], }, @@ -313,6 +315,7 @@ def run(self): "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "License :: OSI Approved :: MIT License", "Topic :: Scientific/Engineering", "Topic :: Software Development", From b8ead589f75ad06bc0182ce8939cae1396cd3211 Mon Sep 17 00:00:00 2001 From: Ryuichi Yamamoto Date: Sun, 7 Aug 2022 22:13:18 +0900 Subject: [PATCH 2/3] bump version for dev --- docs/changelog.rst | 6 +++++- setup.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 83c3b17..500abd4 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,9 +1,12 @@ Change log ========== -v0.2.1 <2022-xx-xx> +v0.3.0 <2022-xx-xx> ------------------- +Newer numpy (>v1.20.0) is required to avoid ABI compatibility issues. + +* `#35`_: Fixes for Python 3.10. v0.2.0 <2022-02-06> ------------------- @@ -86,3 +89,4 @@ Initial release with OpenJTalk's text processsing functionality .. _#25: https://github.com/r9y9/pyopenjtalk/pull/25 .. _#27: https://github.com/r9y9/pyopenjtalk/issues/27 .. _#29: https://github.com/r9y9/pyopenjtalk/pull/29 +.. _#35: https://github.com/r9y9/pyopenjtalk/pull/35 diff --git a/setup.py b/setup.py index cca74f8..c68db9c 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ platform_is_windows = sys.platform == "win32" -version = "0.2.1" +version = "0.3.0" min_cython_ver = "0.21.0" try: From 09319789f67f2b0d53aaa191035728aa0675a334 Mon Sep 17 00:00:00 2001 From: Ryuichi Yamamoto Date: Sun, 7 Aug 2022 22:54:16 +0900 Subject: [PATCH 3/3] Add a workaround for Numpy's ABI issue --- README.md | 2 +- docs/changelog.rst | 2 +- docs/index.rst | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0d490fc..c69149e 100644 --- a/README.md +++ b/README.md @@ -114,4 +114,4 @@ Out[3]: 'コンニチワ' ## Acknowledgements -HTS Working Group for their dedicated efforts to develop and maintain Open JTalk. \ No newline at end of file +HTS Working Group for their dedicated efforts to develop and maintain Open JTalk. diff --git a/docs/changelog.rst b/docs/changelog.rst index 500abd4..be60a9a 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,7 +4,7 @@ Change log v0.3.0 <2022-xx-xx> ------------------- -Newer numpy (>v1.20.0) is required to avoid ABI compatibility issues. +Newer numpy (>v1.20.0) is required to avoid ABI compatibility issues. Please check the updated installation guide. * `#35`_: Fixes for Python 3.10. diff --git a/docs/index.rst b/docs/index.rst index 441c879..f9040d0 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -24,6 +24,24 @@ The latest release is availabe on pypi. You can install it by: pip install pyopenjtalk + +Workaround for ``ValueError: numpy.ndarray size changed, may indicate binary incompatibility`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This type of errors comes from the Numpys' ABI breaking changes. If you see ``ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject`` or similar, please make sure to install numpy first, and then install pyopenjtalk by: + +.. code:: + + pip install pyopenjtalk --no-build-isolation + +or: + +.. code:: + + pip install git+https://github.com/r9y9/pyopenjtalk --no-build-isolation + +The option ``--no-build-isolation`` tells pip not to create a build environment, so the pre-installed numpy is used to build the packge. Hense there should be no Numpy's ABI issues. + .. toctree:: :maxdepth: 1 :caption: Notebooks