From 6f0ce9e6cf2a26962352ec6eaaa8283f22fbd255 Mon Sep 17 00:00:00 2001 From: "Julian J. Rimoli" Date: Thu, 22 Oct 2026 00:27:14 -0700 Subject: [PATCH] Version 1.6.1: install the numpy and MeshPy the package works with (#120) setup.py asked for numpy>=1.22.2 and meshpy>=2018.2.1, so pip installed microstructpy 1.6.0 with numpy 2.5 and MeshPy 2026.1, while the continuous integration installs requirements.txt, which pins numpy below 2 and MeshPy 2022.1.3. With those newest versions, 13 of the 224 tests fail. With numpy 2, the text files of the meshes cannot be read back (numpy writes integers as np.int64(4)) and tangent_sphere fails. With MeshPy 2026, TetGen lets 3D elements exceed max_volume. setup.py now asks for numpy<2 and meshpy<2026. Installed that way, pip takes numpy 1.26.4 and MeshPy 2025.1.1 (2022.1.3 on Python 3.9), and all 224 tests pass. numpy below 2 has no wheels for Python 3.13 and later, but pip builds it from source there; on Python 3.14 that takes under a minute, and all the tests pass. One more CI job, Python 3.12 on Ubuntu, skips requirements.txt and installs the package alone, as pip install microstructpy does, so that the tests see the dependency versions that users get. It does not upload coverage, which the pinned job of the same Python and system already reports. Suggested by Kip Hart in the review. The changelog has a 1.6.1 section, __version__ is 1.6.1, and the example digest of the documentation is updated. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/python_package.yaml | 12 +++++++++++- CHANGELOG.rst | 21 ++++++++++++++++++++- docs/source/sphinx_gallery/plot_demos.py | 2 +- setup.py | 4 ++-- src/microstructpy/__init__.py | 2 +- 5 files changed, 35 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python_package.yaml b/.github/workflows/python_package.yaml index dd6f9b0..ed6a7b1 100644 --- a/.github/workflows/python_package.yaml +++ b/.github/workflows/python_package.yaml @@ -4,7 +4,7 @@ on: [push] jobs: pytest: - name: pytest for py${{ matrix.python-version }} on ${{ matrix.os }} + name: pytest for py${{ matrix.python-version }} on ${{ matrix.os }}${{ matrix.unpinned && ', unpinned' || '' }} runs-on: ${{ matrix.os }} strategy: @@ -12,6 +12,14 @@ jobs: matrix: python-version: [3.9, '3.10', '3.11', '3.12'] os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] + unpinned: [false] + include: + # One job installs the package without the pins of + # requirements.txt, as pip install microstructpy does, so that the + # tests see the dependency versions that users get. + - python-version: '3.12' + os: 'ubuntu-latest' + unpinned: true steps: - uses: actions/checkout@main @@ -33,6 +41,7 @@ jobs: pip install setuptools wheel pip install flake8 pytest pytest-cov coveralls - name: Install package requirements + if: ${{ !matrix.unpinned }} run: pip install -r requirements.txt - name: Install package run: pip install -e . @@ -47,6 +56,7 @@ jobs: run: pytest --cov=src tests/ - name: Coveralls + if: ${{ !matrix.unpinned }} env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} COVERALLS_FLAG_NAME: py${{ matrix.python-version }} on ${{ matrix.os }} diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 9a6437b..aaa85a2 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,24 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog`_, and this project adheres to `Semantic Versioning`_. +`1.6.1`_ - 2026-10-19 +-------------------------- +Fixed +''''' +- ``pip install microstructpy`` installs versions of numpy and MeshPy that + the package works with: numpy below 2 and MeshPy below 2026. With numpy 2, + the text files of the meshes cannot be read back, since numpy writes + integers as ``np.int64(4)``, and ``tangent_sphere`` fails. With MeshPy + 2026, TetGen no longer keeps the elements of 3D meshes under + ``max_volume``. numpy below 2 has no wheels for Python 3.13 and later, so + pip builds it from source there, which needs a compiler. + +Changed +''''''' +- The continuous integration also runs the tests on an installation without + the pins of ``requirements.txt``, as ``pip install microstructpy`` does, so + that it sees the dependency versions that users get. + `1.6.0`_ - 2026-10-18 -------------------------- Added @@ -508,7 +526,8 @@ Added .. LINKS -.. _`Unreleased`: https://github.com/kip-hart/MicroStructPy/compare/v1.6.0...HEAD +.. _`Unreleased`: https://github.com/kip-hart/MicroStructPy/compare/v1.6.1...HEAD +.. _`1.6.1`: https://github.com/kip-hart/MicroStructPy/compare/v1.6.0...v1.6.1 .. _`1.6.0`: https://github.com/kip-hart/MicroStructPy/compare/v1.5.9...v1.6.0 .. _`1.5.9`: https://github.com/kip-hart/MicroStructPy/compare/v1.5.8...v1.5.9 .. _`1.5.8`: https://github.com/kip-hart/MicroStructPy/compare/v1.5.7...v1.5.8 diff --git a/docs/source/sphinx_gallery/plot_demos.py b/docs/source/sphinx_gallery/plot_demos.py index b34a9b5..cb78bbc 100644 --- a/docs/source/sphinx_gallery/plot_demos.py +++ b/docs/source/sphinx_gallery/plot_demos.py @@ -24,7 +24,7 @@ # them is edited, and the build would serve stale figures. # # Managed by docs/example_digest.py. Do not edit by hand. -EXAMPLES_DIGEST = 'e16a7babf54a2cfe' +EXAMPLES_DIGEST = '1cc876c00916b073' example_dir = '../../../src/microstructpy/examples' diff --git a/setup.py b/setup.py index 12e16d2..672805f 100644 --- a/setup.py +++ b/setup.py @@ -81,8 +81,8 @@ def find_version(*fname): 'pybind11', # must come before meshpy for successful install 'lsq-ellipse', 'matplotlib>=3.4.0', - 'meshpy>=2018.2.1', - 'numpy>=1.22.2', + 'meshpy>=2018.2.1,<2026', # TetGen of 2026 exceeds max_volume + 'numpy>=1.22.2,<2', # numpy 2 breaks the mesh text files 'pygmsh>=7.0.2', 'pyquaternion', 'pyvoro-rimoli>=1.4.0', # pyvoro with the current Voro++ diff --git a/src/microstructpy/__init__.py b/src/microstructpy/__init__.py index a42448a..f383ffd 100644 --- a/src/microstructpy/__init__.py +++ b/src/microstructpy/__init__.py @@ -4,4 +4,4 @@ import microstructpy.seeding import microstructpy.verification -__version__ = '1.6.0' +__version__ = '1.6.1'