Skip to content

Version 1.6.1: install the numpy and MeshPy the package works with - #120

Open
rimoli wants to merge 1 commit into
developfrom
release-1.6.1
Open

rimoli wants to merge 1 commit into
developfrom
release-1.6.1

Conversation

@rimoli

@rimoli rimoli commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

1.6.0 on PyPI asks for numpy>=1.22.2 and meshpy>=2018.2.1, so a plain pip install microstructpy gets numpy 2.5 and MeshPy 2026.1. CI never sees that combination, because it installs the pins of requirements.txt. Installed that way, 13 of the 224 tests fail:

Cause Failing tests
numpy 2 writes integers as np.int64(4) in the mesh text files, so they cannot be read back, CLI runs included 7
MeshPy 2026: TetGen lets 3D elements exceed max_volume 3
numpy 2: tangent_sphere fails in np.linalg.solve 2
numpy 2 removed np.trapz, which one test uses 1

With numpy below 2, MeshPy 2026.1.1 still fails the three max_volume tests, and MeshPy 2025.1.1 passes them all. So this PR does two things:

  • setup.py caps numpy<2 and meshpy<2026, the versions the package works with.
  • The version is 1.6.1, with a changelog section, and EXAMPLES_DIGEST is updated.

Installed from the built source distribution with no pins, pip now takes numpy 1.26.4 and MeshPy 2025.1.1, or 2022.1.3 on Python 3.9, which MeshPy 2025 no longer supports. All 224 tests pass that way. numpy below 2 has no releases for Python 3.13 and later, which the package does not list as supported.

The numpy 2 and MeshPy 2026 problems deserve proper fixes, and a CI job that installs without the pins would catch this kind of drift. I would do those after this release.

Once this is merged, I'll open the develop-to-master PR, and then the v1.6.1 release is yours to tag, as before.

🤖 Generated with Claude Code

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 releases for Python 3.13 and
later, which MicroStructPy does not support yet.

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 <noreply@anthropic.com>
@rimoli
rimoli requested a review from kip-hart October 19, 2026 15:58
Comment thread setup.py
'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

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ceilings are right and I confirmed the problem they fix. A clean
pip install microstructpy==1.6.0 on Python 3.12 resolves numpy 2.5.4 and
MeshPy 2026.1.1, and the 1.6.0 tests against that install give 13 failed,
211 passed. The four causes in your table account for all thirteen, test
for test.

Worth saying out loud how visible the first group is. Three of the seven
are test_periodic_cli, so the command line itself breaks. Anyone who
installs from PyPI and runs microstructpy --demo=periodic_2D.xml writes
mesh files that cannot be read back. That is the main path, not a corner.

I also checked that both ceilings are needed. With numpy held below 2,
MeshPy 2026.1.1 still fails the three max_volume tests, so capping numpy
alone would have left a quieter version of the same release.

One thing to add while you are here. This package has no
python_requires, and the classifiers stop at 3.12:

$ grep python_requires setup.py
(no output)

numpy below 2 has no releases for Python 3.13 or later, as you note. With
the new ceiling and no python_requires, a user on 3.13 gets a resolution
failure with a wall of candidate versions instead of being told the package
does not support their Python. Adding

    python_requires='>=3.9,<3.13',

turns that into one readable line, and it matches the classifiers. It also
stops pip from installing 1.6.1 on a Python where it cannot work.

Comment thread setup.py
'matplotlib>=3.4.0',
'meshpy>=2018.2.1',
'numpy>=1.22.2',
'meshpy>=2018.2.1,<2026', # TetGen of 2026 exceeds max_volume

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the unpinned CI job you suggest doing after this release: I would land
it with this PR instead.

The argument is this release itself. 1.6.0 went to PyPI with 224 tests
passing and was broken for every user who installed it the normal way.
Nothing in the pipeline was capable of noticing, because every job installs
requirements.txt first and the pins there hide what install_requires
resolves to. The ceilings in this PR fix the versions we know about today.
They do not give CI the ability to see the next pair.

The gap is narrow and so is the job. One matrix entry that skips
requirements.txt:

    - name: Install package requirements
      if: matrix.unpinned != true
      run: pip install -r requirements.txt
    - name: Install package
      run: pip install -e .

with an unpinned: true entry added to the matrix, and continue-on-error
if you would rather it warns than blocks at first. Even as a warning it
would have caught this one, since the failure is 13 tests and not a
subtlety.

The reason I would not defer it is that the cost of the miss is already
known. A broken release is public, it needs a second release to undo, and
the people who hit it are the ones who installed the package for the first
time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants