From 34a39e63c1ae1612ead76d2af9170267c0c50409 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 14:36:41 -0400 Subject: [PATCH 01/32] MAINT: Fix for NumPy deprecation --- README.rst | 6 +++--- pymeshfix/cython/_meshfix.pyx | 8 ++++---- pymeshfix/meshfix.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index c88eff8..d263377 100644 --- a/README.rst +++ b/README.rst @@ -120,7 +120,7 @@ within memory and wish to repair it using MeshFix. mesh = meshfix.mesh # Or, access the resulting arrays directly from the object - meshfix.v # numpy np.float array + meshfix.v # numpy np.float64 array meshfix.f # numpy np.int32 array # View the repaired mesh (requires vtkInterface) @@ -148,13 +148,13 @@ algorithm. # Fill holes tin.fill_small_boundaries() - print('There are {:d} boundaries'.format(tin.boundaries()) + print('There are {:d} boundaries'.format(tin.boundaries())) # Clean (removes self intersections) tin.clean(max_iters=10, inner_loops=3) # Check mesh for holes again - print('There are {:d} boundaries'.format(tin.boundaries()) + print('There are {:d} boundaries'.format(tin.boundaries())) # Clean again if necessary... diff --git a/pymeshfix/cython/_meshfix.pyx b/pymeshfix/cython/_meshfix.pyx index 6ede602..a36096d 100644 --- a/pymeshfix/cython/_meshfix.pyx +++ b/pymeshfix/cython/_meshfix.pyx @@ -197,12 +197,12 @@ cdef class PyTMesh: raise Exception('Cannot load new arrays once initialized') if not v.flags['C_CONTIGUOUS']: - if v.dtype != np.float: - v = np.ascontiguousarray(v, dtype=np.float) + if v.dtype not in (float, np.float64): + v = np.ascontiguousarray(v, dtype=np.float64) else: v = np.ascontiguousarray(v) - elif v.dtype != np.float: - v = v.astype(np.float) + elif v.dtype not in (float, np.float64): + v = v.astype(np.float64) # Ensure inputs are of the right type assert f.ndim == 2, 'Face array must be 2D numpy array' diff --git a/pymeshfix/meshfix.py b/pymeshfix/meshfix.py index 5f2fa55..2336860 100644 --- a/pymeshfix/meshfix.py +++ b/pymeshfix/meshfix.py @@ -76,7 +76,7 @@ def load_arrays(self, v, f): # Check inputs if not isinstance(v, np.ndarray): try: - v = np.asarray(v, np.float) + v = np.asarray(v, np.float64) if v.ndim != 2 and v.shape[1] != 3: raise Exception('Invalid vertex format. Shape ' + 'should be (npoints, 3)') From 6d4b00337b9a0db32c95fdfef4fd7860c127b618 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 14:46:58 -0400 Subject: [PATCH 02/32] FIX: CIs? --- .ci/build_wheels.sh | 6 +++--- .ci/macos-install-python.sh | 12 ++++++------ .github/workflows/testing-and-deployment.yml | 5 ++++- azure-pipelines.yml | 8 ++++---- setup.py | 2 +- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.ci/build_wheels.sh b/.ci/build_wheels.sh index a387b85..3006128 100755 --- a/.ci/build_wheels.sh +++ b/.ci/build_wheels.sh @@ -6,9 +6,6 @@ set -e -x # build based on python version from args PYTHON_VERSION="$1" case $PYTHON_VERSION in -3.6) - PYBIN="/opt/python/cp36-cp36m/bin" - ;; 3.7) PYBIN="/opt/python/cp37-cp37m/bin" ;; @@ -18,6 +15,9 @@ case $PYTHON_VERSION in 3.9) PYBIN="/opt/python/cp39-cp39/bin" ;; +3.10) + PYBIN="/opt/python/cp310-cp310/bin" + ;; esac # build, don't install diff --git a/.ci/macos-install-python.sh b/.ci/macos-install-python.sh index 55fa403..858a37a 100755 --- a/.ci/macos-install-python.sh +++ b/.ci/macos-install-python.sh @@ -3,18 +3,18 @@ PYTHON_VERSION="$1" case $PYTHON_VERSION in -2.7) - FULL_VERSION=2.7.16 - ;; -3.6) - FULL_VERSION=3.6.8 - ;; 3.7) FULL_VERSION=3.7.7 ;; 3.8) FULL_VERSION=3.8.3 ;; +3.9) + FULL_VERSION=3.9.12 + ;; +3.10) + FULL_VERSION=3.10.4 + ;; esac INSTALLER_NAME=python-$FULL_VERSION-macosx10.9.pkg diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index 3569d6a..c86114e 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -1,4 +1,7 @@ name: Unit Testing +concurrency: + group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }} + cancel-in-progress: true on: push: @@ -13,7 +16,7 @@ jobs: name: Mac OS Unit Testing strategy: matrix: - python-version: ['3.6', '3.7', '3.8', '3.9'] + python-version: ['3.7', '3.8', '3.9', '3.10'] env: SHELLOPTS: 'errexit:pipefail' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0f3e145..3d3bbe2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -15,14 +15,14 @@ jobs: - job: Linux strategy: matrix: - Python36: - python.version: '3.6' Python37: python.version: '3.7' Python38: python.version: '3.8' Python39: python.version: '3.9' + Python39: + python.version: '3.10' pool: vmImage: 'ubuntu-18.04' steps: @@ -52,14 +52,14 @@ jobs: python.architecture: 'x64' strategy: matrix: - Python36: - python.version: '3.6' Python37: python.version: '3.7' Python38: python.version: '3.8' Python39: python.version: '3.9' + Python39: + python.version: '3.10' steps: - template: .ci/azure-setup.yml - template: .ci/azure-steps.yml diff --git a/setup.py b/setup.py index 5fb1024..837febc 100644 --- a/setup.py +++ b/setup.py @@ -102,11 +102,11 @@ def build_extensions(self): classifiers=['Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', ], + python_requires='>=3.7', url='https://github.com/pyvista/pymeshfix', # Build cython modules From dbeda5e89f416dde3674759ea4184bebd84f03eb Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 15:08:57 -0400 Subject: [PATCH 03/32] FIX: Name --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3d3bbe2..a1d57e9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -21,7 +21,7 @@ jobs: python.version: '3.8' Python39: python.version: '3.9' - Python39: + Python310: python.version: '3.10' pool: vmImage: 'ubuntu-18.04' From 4b0db23e1139abe644a2b1fac616b23c54c907e0 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 15:35:33 -0400 Subject: [PATCH 04/32] FIX: Name --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a1d57e9..2a51f9f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -58,7 +58,7 @@ jobs: python.version: '3.8' Python39: python.version: '3.9' - Python39: + Python310: python.version: '3.10' steps: - template: .ci/azure-setup.yml From 4e7508972af8a187e3ad77a1d4c35cd0915aa041 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 17:07:45 -0400 Subject: [PATCH 05/32] 2_24? --- .ci/azure-steps.yml | 4 ++++ .ci/build_wheels.sh | 2 +- azure-pipelines.yml | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.ci/azure-steps.yml b/.ci/azure-steps.yml index 98a795e..09ef985 100644 --- a/.ci/azure-steps.yml +++ b/.ci/azure-steps.yml @@ -1,6 +1,10 @@ # Build wheels on Windows and MacOS steps: +- script: | + python -m pip install --find-links https://wheels.pyvista.org/ pyvista + displayName: 'Work around Python 3.10 VTK wheels missing' + - script: | python -m pip wheel . -w wheelhouse/ displayName: 'Build wheel' diff --git a/.ci/build_wheels.sh b/.ci/build_wheels.sh index 3006128..394ed51 100755 --- a/.ci/build_wheels.sh +++ b/.ci/build_wheels.sh @@ -26,4 +26,4 @@ cd io "${PYBIN}/python" setup.py bdist_wheel auditwheel repair dist/$package_name*.whl rm -f dist/* -mv wheelhouse/*manylinux2010* dist/ +mv wheelhouse/*manylinux_2_24* dist/ diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2a51f9f..9204738 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -32,9 +32,9 @@ jobs: displayName: 'Use Python $(python.version)' - script: | set -ex - docker pull quay.io/pypa/manylinux2010_x86_64 - docker run -e package_name=$(package_name) --rm -v `pwd`:/io quay.io/pypa/manylinux2010_x86_64 /io/.ci/build_wheels.sh $(python.version) - displayName: Build wheel using manylinux2010 + docker pull quay.io/pypa/manylinux_2_24_x86_64 + docker run -e package_name=$(package_name) --rm -v `pwd`:/io quay.io/pypa/manylinux_2_24_x86_64 /io/.ci/build_wheels.sh $(python.version) + displayName: Build wheel using manylinux_2_24 - script: | pip install dist/*.whl displayName: Install wheel From 8fcc16741c29282bf5d9e1aaaed0a4a167f910bf Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 17:09:12 -0400 Subject: [PATCH 06/32] Give 2014 a chance --- .ci/build_wheels.sh | 2 +- azure-pipelines.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.ci/build_wheels.sh b/.ci/build_wheels.sh index 394ed51..72f75ec 100755 --- a/.ci/build_wheels.sh +++ b/.ci/build_wheels.sh @@ -26,4 +26,4 @@ cd io "${PYBIN}/python" setup.py bdist_wheel auditwheel repair dist/$package_name*.whl rm -f dist/* -mv wheelhouse/*manylinux_2_24* dist/ +mv wheelhouse/*manylinux2014* dist/ diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9204738..6104d8a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -32,9 +32,9 @@ jobs: displayName: 'Use Python $(python.version)' - script: | set -ex - docker pull quay.io/pypa/manylinux_2_24_x86_64 - docker run -e package_name=$(package_name) --rm -v `pwd`:/io quay.io/pypa/manylinux_2_24_x86_64 /io/.ci/build_wheels.sh $(python.version) - displayName: Build wheel using manylinux_2_24 + docker pull quay.io/pypa/manylinux2014_x86_64 + docker run -e package_name=$(package_name) --rm -v `pwd`:/io quay.io/pypa/manylinux2014_x86_64 /io/.ci/build_wheels.sh $(python.version) + displayName: Build wheel using manylinux2014 - script: | pip install dist/*.whl displayName: Install wheel From 3db1dda5990e73528738506019574dfb210bb03a Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 17:20:13 -0400 Subject: [PATCH 07/32] FIX: Try --- .ci/azure-steps.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.ci/azure-steps.yml b/.ci/azure-steps.yml index 09ef985..18d1543 100644 --- a/.ci/azure-steps.yml +++ b/.ci/azure-steps.yml @@ -2,12 +2,8 @@ steps: - script: | - python -m pip install --find-links https://wheels.pyvista.org/ pyvista - displayName: 'Work around Python 3.10 VTK wheels missing' - -- script: | - python -m pip wheel . -w wheelhouse/ - displayName: 'Build wheel' + python -m pip wheel . -w wheelhouse/ --find-links https://wheels.pyvista.org/ + displayName: 'Build wheel with 3.10 VTK workaround' - script: | python -m pip install $(package_name) --no-index -f wheelhouse/ --upgrade --ignore-installed From 2653bd82409651de458a7a86b45ffed61fd80d6e Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 17:30:24 -0400 Subject: [PATCH 08/32] FIX: Just Linux and macOS now --- .ci/azure-steps.yml | 2 +- .github/workflows/testing-and-deployment.yml | 2 +- requirements_build.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/azure-steps.yml b/.ci/azure-steps.yml index 18d1543..19ca912 100644 --- a/.ci/azure-steps.yml +++ b/.ci/azure-steps.yml @@ -2,7 +2,7 @@ steps: - script: | - python -m pip wheel . -w wheelhouse/ --find-links https://wheels.pyvista.org/ + python -m pip wheel . -w wheelhouse/ --find-links https://wheels.pyvista.org/ --only-binary="numpy" displayName: 'Build wheel with 3.10 VTK workaround' - script: | diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index c86114e..8085d92 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -31,7 +31,7 @@ jobs: - name: Build package run: | - pip install -r requirements_build.txt + pip install -r requirements_build.txt --only-binary="numpy" python setup.py bdist_wheel pip install dist/* diff --git a/requirements_build.txt b/requirements_build.txt index cf68ff4..e2ab9b6 100644 --- a/requirements_build.txt +++ b/requirements_build.txt @@ -1,4 +1,4 @@ setuptools>=41.0.0 wheel>=0.33.0 -numpy<1.20.0 +numpy<1.21.0 cython>=0.29.0 From 5a4423157f4f7945426d5c0f0c502bbe43d5e9b6 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 17:33:35 -0400 Subject: [PATCH 09/32] FIX: macOS --- requirements_build.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_build.txt b/requirements_build.txt index e2ab9b6..eaec515 100644 --- a/requirements_build.txt +++ b/requirements_build.txt @@ -1,4 +1,4 @@ setuptools>=41.0.0 wheel>=0.33.0 -numpy<1.21.0 +numpy<=1.21.3 cython>=0.29.0 From abac074ac769180e5ddd25c8b7ba132774cc753f Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 17:34:15 -0400 Subject: [PATCH 10/32] FIX: macOS --- requirements_build.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements_build.txt b/requirements_build.txt index eaec515..d43170e 100644 --- a/requirements_build.txt +++ b/requirements_build.txt @@ -1,4 +1,5 @@ setuptools>=41.0.0 wheel>=0.33.0 -numpy<=1.21.3 +numpy<1.20.0; python_version<3.10 +numpy<=1.21.3; python_version>=3.10 cython>=0.29.0 From 803bb22b12819f5dfcc549155b6304689c626b18 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 17:36:45 -0400 Subject: [PATCH 11/32] FIX: Spacing --- requirements_build.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements_build.txt b/requirements_build.txt index d43170e..3f98d77 100644 --- a/requirements_build.txt +++ b/requirements_build.txt @@ -1,5 +1,5 @@ setuptools>=41.0.0 wheel>=0.33.0 -numpy<1.20.0; python_version<3.10 -numpy<=1.21.3; python_version>=3.10 +numpy<1.20.0; python_version < 3.10 +numpy<=1.21.3; python_version >= 3.10 cython>=0.29.0 From 5ede80fab1b73bc2d22c4de912f195150e1ad431 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 17:37:15 -0400 Subject: [PATCH 12/32] FIX: Version parse --- requirements_build.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements_build.txt b/requirements_build.txt index 3f98d77..7f51001 100644 --- a/requirements_build.txt +++ b/requirements_build.txt @@ -1,5 +1,5 @@ setuptools>=41.0.0 wheel>=0.33.0 -numpy<1.20.0; python_version < 3.10 -numpy<=1.21.3; python_version >= 3.10 +numpy<1.20.0; python_version < '3.10' +numpy<=1.21.3; python_version >= '3.10' cython>=0.29.0 From 316c8483f590fb23c2e44e26a82faad1d0f1c79e Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 17:38:02 -0400 Subject: [PATCH 13/32] FIX: Version parse --- requirements_build.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_build.txt b/requirements_build.txt index 7f51001..a721e6a 100644 --- a/requirements_build.txt +++ b/requirements_build.txt @@ -1,5 +1,5 @@ setuptools>=41.0.0 wheel>=0.33.0 -numpy<1.20.0; python_version < '3.10' +numpy<1.20.0; python_version >= '3.7' and python_version <= '3.9' numpy<=1.21.3; python_version >= '3.10' cython>=0.29.0 From b7f0362444cfe14511c3a49d09ee5fe7c8713d0d Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 17:51:01 -0400 Subject: [PATCH 14/32] FIX: 3.10 --- .github/workflows/testing-and-deployment.yml | 2 +- azure-pipelines.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index 8085d92..8bfad51 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -31,7 +31,7 @@ jobs: - name: Build package run: | - pip install -r requirements_build.txt --only-binary="numpy" + pip install -r requirements_build.txt --only-binary="numpy" --find-links https://wheels.pyvista.org/ python setup.py bdist_wheel pip install dist/* diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6104d8a..f42cee1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -36,7 +36,7 @@ jobs: docker run -e package_name=$(package_name) --rm -v `pwd`:/io quay.io/pypa/manylinux2014_x86_64 /io/.ci/build_wheels.sh $(python.version) displayName: Build wheel using manylinux2014 - script: | - pip install dist/*.whl + pip install dist/*.whl --find-links https://wheels.pyvista.org/ displayName: Install wheel - script: | pip install -r requirements_test.txt From 9e757d6ac11b817c70e4b6e2ce20547464b757e7 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 17:56:52 -0400 Subject: [PATCH 15/32] FIX: macOS --- .github/workflows/testing-and-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index 8bfad51..1b6158f 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -33,7 +33,7 @@ jobs: run: | pip install -r requirements_build.txt --only-binary="numpy" --find-links https://wheels.pyvista.org/ python setup.py bdist_wheel - pip install dist/* + pip install dist/* --find-links https://wheels.pyvista.org/ - name: Install package run: | From b9f4d8dcf0b412bc85f069a99dbfc60928446ba3 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 17:59:13 -0400 Subject: [PATCH 16/32] FIX: macOS --- .github/workflows/testing-and-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index 1b6158f..437388f 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -32,7 +32,7 @@ jobs: - name: Build package run: | pip install -r requirements_build.txt --only-binary="numpy" --find-links https://wheels.pyvista.org/ - python setup.py bdist_wheel + python setup.py bdist_wheel --find-links https://wheels.pyvista.org/ pip install dist/* --find-links https://wheels.pyvista.org/ - name: Install package From ea5c29f61b71868a86ef0bbdd11cfbf27a9d0dd1 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 18:03:40 -0400 Subject: [PATCH 17/32] FIX: Missed --- .github/workflows/testing-and-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index 437388f..1b6158f 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -32,7 +32,7 @@ jobs: - name: Build package run: | pip install -r requirements_build.txt --only-binary="numpy" --find-links https://wheels.pyvista.org/ - python setup.py bdist_wheel --find-links https://wheels.pyvista.org/ + python setup.py bdist_wheel pip install dist/* --find-links https://wheels.pyvista.org/ - name: Install package From 0d814ee0e46c00f3639a8ab89cf98e157d8a525b Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 18:08:59 -0400 Subject: [PATCH 18/32] FIX: Lines --- .github/workflows/testing-and-deployment.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index 1b6158f..4761404 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -29,10 +29,16 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Build package + - name: Setup dependencies run: | pip install -r requirements_build.txt --only-binary="numpy" --find-links https://wheels.pyvista.org/ + + - name: Build wheel + run: | python setup.py bdist_wheel + + - name: Install wheel + run: | pip install dist/* --find-links https://wheels.pyvista.org/ - name: Install package From 0b72139cfaa0092c8a1163dc1e13d78649c58e6b Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 18:12:19 -0400 Subject: [PATCH 19/32] FIX: Lines --- .github/workflows/testing-and-deployment.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index 4761404..488a81c 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -37,9 +37,13 @@ jobs: run: | python setup.py bdist_wheel + - name: Install vtk + run: | + pip install --find-links https://wheels.pyvista.org/ vtk + - name: Install wheel run: | - pip install dist/* --find-links https://wheels.pyvista.org/ + pip install dist/* - name: Install package run: | From 0d7311a88496b8b876857e1779e98fea5cda19ca Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 18:12:35 -0400 Subject: [PATCH 20/32] FIX: Lines --- .github/workflows/testing-and-deployment.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index 488a81c..5d34cb3 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -45,9 +45,8 @@ jobs: run: | pip install dist/* - - name: Install package + - name: Check package run: | - pip install dist/* python -c "import pyvista; print(pyvista.Report(gpu=False))" - name: Install test dependencies From 92b1f383417a1e7a1e6d0838353d8a1ff3eb0b91 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 18:21:19 -0400 Subject: [PATCH 21/32] FIX: Try again --- .github/workflows/testing-and-deployment.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index 5d34cb3..37b961f 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -12,12 +12,18 @@ on: jobs: macOS: - runs-on: macos-latest + runs-on: ${{ matrix.os }} name: Mac OS Unit Testing strategy: matrix: python-version: ['3.7', '3.8', '3.9', '3.10'] - + os: ['macos-latest'] + exclude: + - os: macos-latest + python-version: '3.10' + include: + - os: macos-12 + python-version: '3.10' env: SHELLOPTS: 'errexit:pipefail' From a8775125b24070d3343120519febcc2e0f6d69d0 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 18:31:16 -0400 Subject: [PATCH 22/32] FIX: vvverbose --- .github/workflows/testing-and-deployment.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index 37b961f..e607e56 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -17,9 +17,9 @@ jobs: strategy: matrix: python-version: ['3.7', '3.8', '3.9', '3.10'] - os: ['macos-latest'] + os: ['macos-11'] exclude: - - os: macos-latest + - os: macos-11 python-version: '3.10' include: - os: macos-12 @@ -45,7 +45,7 @@ jobs: - name: Install vtk run: | - pip install --find-links https://wheels.pyvista.org/ vtk + pip install --find-links https://wheels.pyvista.org/ vtk -vvv - name: Install wheel run: | From 2c563b6d310cc3ac5eb7fbd8626acb3b3a7a7e6f Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 18:37:20 -0400 Subject: [PATCH 23/32] FIX: pip --- .github/workflows/testing-and-deployment.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index e607e56..edcd29f 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -19,11 +19,12 @@ jobs: python-version: ['3.7', '3.8', '3.9', '3.10'] os: ['macos-11'] exclude: - - os: macos-11 - python-version: '3.10' + - python-version: '3.10' + os: macos-11 include: - - os: macos-12 - python-version: '3.10' + - python-version: '3.10' + os: macos-12 + env: SHELLOPTS: 'errexit:pipefail' @@ -43,6 +44,11 @@ jobs: run: | python setup.py bdist_wheel + - name: Upgrade pip on 3.10 so that wheels can be found + run: | + pip install --upgrade pip + if: ${{ matrix.python_version == '3.10' }} + - name: Install vtk run: | pip install --find-links https://wheels.pyvista.org/ vtk -vvv From 2c640cdf66f181027a8e5e89353de7eeaa13a27c Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 18:50:35 -0400 Subject: [PATCH 24/32] FIX: matrix? --- .github/workflows/testing-and-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index edcd29f..dd5f2d2 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -47,7 +47,7 @@ jobs: - name: Upgrade pip on 3.10 so that wheels can be found run: | pip install --upgrade pip - if: ${{ matrix.python_version == '3.10' }} + if: ${{ matrix.os == 'macos-12' }} - name: Install vtk run: | From 6e9e147392d159edf9c59acd91aa182d7a64aa2e Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 18:59:09 -0400 Subject: [PATCH 25/32] FIX: Debug --- .github/workflows/testing-and-deployment.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index dd5f2d2..045c829 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -47,6 +47,8 @@ jobs: - name: Upgrade pip on 3.10 so that wheels can be found run: | pip install --upgrade pip + pip debug --verbose + pip debug --verbose | grep 310-macosx_12_0 if: ${{ matrix.os == 'macos-12' }} - name: Install vtk From 9e7a6028ec83dbdfed037fac8ce82d8d08d5d9a2 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 19:03:19 -0400 Subject: [PATCH 26/32] FIX: auditwheel --- .github/workflows/testing-and-deployment.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index 045c829..2c50d25 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -45,8 +45,9 @@ jobs: python setup.py bdist_wheel - name: Upgrade pip on 3.10 so that wheels can be found + # https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/#manylinux-compatibility-support run: | - pip install --upgrade pip + pip install --upgrade "pip>=19.3" "auditwheel>=3.0.0" pip debug --verbose pip debug --verbose | grep 310-macosx_12_0 if: ${{ matrix.os == 'macos-12' }} From aab674a669dae2109e2edab60574c00828d0bd5b Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 19:05:32 -0400 Subject: [PATCH 27/32] FIX: wheel --- .github/workflows/testing-and-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index 2c50d25..ac91091 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -47,7 +47,7 @@ jobs: - name: Upgrade pip on 3.10 so that wheels can be found # https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/#manylinux-compatibility-support run: | - pip install --upgrade "pip>=19.3" "auditwheel>=3.0.0" + pip install --upgrade "pip>=19.3" "auditwheel>=3.0.0" wheel pip debug --verbose pip debug --verbose | grep 310-macosx_12_0 if: ${{ matrix.os == 'macos-12' }} From 96c30244c17940c0a8a0eb942954567a5975a48c Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 19:25:01 -0400 Subject: [PATCH 28/32] FIX: Direct --- .github/workflows/testing-and-deployment.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index ac91091..c9d757e 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -44,12 +44,10 @@ jobs: run: | python setup.py bdist_wheel - - name: Upgrade pip on 3.10 so that wheels can be found - # https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/#manylinux-compatibility-support + - name: Manually install VTK wheel on 3.10 since it does not work locally run: | - pip install --upgrade "pip>=19.3" "auditwheel>=3.0.0" wheel - pip debug --verbose - pip debug --verbose | grep 310-macosx_12_0 + pip install --upgrade pip + pip install https://wheels.pyvista.org/vtk-9.1.0.dev0-cp310-cp310-macosx_12_0_x86_64.whl if: ${{ matrix.os == 'macos-12' }} - name: Install vtk From e98e959b0d319d90dcbbfc704161ca34338ee9e9 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 19:26:55 -0400 Subject: [PATCH 29/32] FIX: Whatever --- .github/workflows/testing-and-deployment.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index c9d757e..c07e203 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -47,7 +47,8 @@ jobs: - name: Manually install VTK wheel on 3.10 since it does not work locally run: | pip install --upgrade pip - pip install https://wheels.pyvista.org/vtk-9.1.0.dev0-cp310-cp310-macosx_12_0_x86_64.whl + curl https://wheels.pyvista.org/vtk-9.1.0.dev0-cp310-cp310-macosx_12_0_x86_64.whl -o vtk-9.1.0.dev0-cp310-cp310-macosx_10_16_x86_64.whl + pip install ./vtk-9.1.0.dev0-cp310-cp310-macosx_10_16_x86_64.whl if: ${{ matrix.os == 'macos-12' }} - name: Install vtk From fe966a9fb7c804486c41b3900d91490f8f01b11f Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 3 May 2022 19:36:04 -0400 Subject: [PATCH 30/32] FIX: Simplify --- .github/workflows/testing-and-deployment.yml | 5 +---- setup.py | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index c07e203..84b9bbb 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -16,11 +16,8 @@ jobs: name: Mac OS Unit Testing strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9'] os: ['macos-11'] - exclude: - - python-version: '3.10' - os: macos-11 include: - python-version: '3.10' os: macos-12 diff --git a/setup.py b/setup.py index 837febc..f79fd61 100644 --- a/setup.py +++ b/setup.py @@ -105,6 +105,7 @@ def build_extensions(self): 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', ], python_requires='>=3.7', url='https://github.com/pyvista/pymeshfix', From 9b3fe52b0d43ff936717b2b71e8f4b7f1f57eafc Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Fri, 6 May 2022 05:30:31 -0400 Subject: [PATCH 31/32] FIX: Version --- pymeshfix/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymeshfix/_version.py b/pymeshfix/_version.py index 9808c55..de36afe 100644 --- a/pymeshfix/_version.py +++ b/pymeshfix/_version.py @@ -6,5 +6,5 @@ version_info = 0, 27, 'dev0' """ -version_info = 0, 15, 'dev0' +version_info = 0, 16, 'dev0' __version__ = '.'.join(map(str, version_info)) From 890a092a847e15e8c6686fdde7bcf229545345da Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Fri, 6 May 2022 06:00:14 -0400 Subject: [PATCH 32/32] FIX: Simplify --- pymeshfix/cython/_meshfix.pyx | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/pymeshfix/cython/_meshfix.pyx b/pymeshfix/cython/_meshfix.pyx index a36096d..14d00ef 100644 --- a/pymeshfix/cython/_meshfix.pyx +++ b/pymeshfix/cython/_meshfix.pyx @@ -128,7 +128,7 @@ cdef class PyTMesh: """ if self.n_points: - raise Exception('Cannot load a new file once initialized') + raise RuntimeError('Cannot load a new file once initialized') # Initializes triangulation py_byte_string = filename.encode('UTF-8') @@ -194,26 +194,15 @@ cdef class PyTMesh: """ if self.n_points: - raise Exception('Cannot load new arrays once initialized') + raise RuntimeError('Cannot load new arrays once initialized') - if not v.flags['C_CONTIGUOUS']: - if v.dtype not in (float, np.float64): - v = np.ascontiguousarray(v, dtype=np.float64) - else: - v = np.ascontiguousarray(v) - elif v.dtype not in (float, np.float64): - v = v.astype(np.float64) + v = np.ascontiguousarray(v, dtype=np.float64) # Ensure inputs are of the right type - assert f.ndim == 2, 'Face array must be 2D numpy array' - assert f.shape[1] == 3, 'Face array must contain three columns' - if not f.flags['C_CONTIGUOUS']: - if f.dtype != ctypes.c_int: - f = np.ascontiguousarray(f, dtype=ctypes.c_int) - else: - f = np.ascontiguousarray(f) - elif f.dtype != ctypes.c_int: - f = f.astype(ctypes.c_int) + f = np.ascontiguousarray(f, dtype=ctypes.c_int) + if f.ndim != 2 or f.shape[1] != 3: + raise ValueError( + f'Face array must be 2D with three columns, got {f.shape}') cdef int nv = v.shape[0] cdef double [::1] points = v.ravel()