From 551afbeabd1e72295b329d3734d5a7a69afc05ec Mon Sep 17 00:00:00 2001 From: Alex Kaszynski Date: Mon, 19 Jul 2021 16:15:24 -0600 Subject: [PATCH 1/4] build for python 3.9 --- .ci/build_wheels.sh | 9 +++------ azure-pipelines.yml | 14 ++++++++------ requirements_build.txt | 3 +-- setup.py | 4 ++-- tests/test_pyx_meshfix.py | 1 + tests/test_withvtk.py | 6 +++--- 6 files changed, 18 insertions(+), 19 deletions(-) diff --git a/.ci/build_wheels.sh b/.ci/build_wheels.sh index f08f4af..a387b85 100755 --- a/.ci/build_wheels.sh +++ b/.ci/build_wheels.sh @@ -6,12 +6,6 @@ set -e -x # build based on python version from args PYTHON_VERSION="$1" case $PYTHON_VERSION in -2.7) - PYBIN="/opt/python/cp27-cp27m/bin" - ;; -3.5) - PYBIN="/opt/python/cp35-cp35m/bin" - ;; 3.6) PYBIN="/opt/python/cp36-cp36m/bin" ;; @@ -21,6 +15,9 @@ case $PYTHON_VERSION in 3.8) PYBIN="/opt/python/cp38-cp38/bin" ;; +3.9) + PYBIN="/opt/python/cp39-cp39/bin" + ;; esac # build, don't install diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e0a66ea..9962014 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -15,14 +15,14 @@ jobs: - job: Linux strategy: matrix: - Python35: - python.version: '3.5' Python36: python.version: '3.6' Python37: python.version: '3.7' Python38: python.version: '3.8' + Python39: + python.version: '3.9' pool: vmImage: 'ubuntu-18.04' steps: @@ -55,8 +55,10 @@ jobs: python.version: '3.7' Python38: python.version: '3.8' + Python38: + python.version: '3.9' pool: - vmImage: 'macOS-10.14' + vmImage: 'macOS-10.15' steps: - script: .ci/macos-install-python.sh '$(python.version)' displayName: Install Python @@ -67,19 +69,19 @@ jobs: - job: Windows pool: - vmIMage: 'VS2017-Win2016' + vmIMage: 'windows-2019' variables: python.architecture: 'x64' strategy: matrix: - Python35: - python.version: '3.5' Python36: python.version: '3.6' Python37: python.version: '3.7' Python38: python.version: '3.8' + Python39: + python.version: '3.9' steps: - template: .ci/azure-setup.yml - template: .ci/azure-steps.yml diff --git a/requirements_build.txt b/requirements_build.txt index 2a3a053..cf68ff4 100644 --- a/requirements_build.txt +++ b/requirements_build.txt @@ -1,5 +1,4 @@ setuptools>=41.0.0 wheel>=0.33.0 -numpy>=1.15.0 +numpy<1.20.0 cython>=0.29.0 -vtk>=8.0.0 diff --git a/setup.py b/setup.py index aeb0d00..9d1db25 100644 --- a/setup.py +++ b/setup.py @@ -101,10 +101,10 @@ def build_extensions(self): classifiers=['Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8' + 'Programming Language :: Python :: 3.9', ], url='https://github.com/pyvista/pymeshfix', @@ -139,6 +139,6 @@ def build_extensions(self): package_data={'pymeshfix/examples': ['StanfordBunny.ply', 'planar_mesh.ply']}, install_requires=['numpy>1.11.0', - 'pyvista>=0.23.0'], + 'pyvista>=0.30.0'], setup_requires=setup_requires, ) diff --git a/tests/test_pyx_meshfix.py b/tests/test_pyx_meshfix.py index c1e67b6..2a4d3bf 100644 --- a/tests/test_pyx_meshfix.py +++ b/tests/test_pyx_meshfix.py @@ -23,6 +23,7 @@ def test_load_and_save_file(tmpdir): new_bunny = pv.PolyData(filename) assert new_bunny.points.shape == v.shape + def test_load_array(): meshfix = _meshfix.PyTMesh() v = bunny.points diff --git a/tests/test_withvtk.py b/tests/test_withvtk.py index 2297214..f96523d 100644 --- a/tests/test_withvtk.py +++ b/tests/test_withvtk.py @@ -5,7 +5,6 @@ from pymeshfix.examples import bunny_scan - def test_repair_vtk(): meshin = pv.PolyData(bunny_scan) meshfix = pymeshfix.MeshFix(meshin) @@ -18,6 +17,7 @@ def test_repair_vtk(): assert meshfix.mesh.n_points # test for any holes - pdata = meshout.extract_edges(non_manifold_edges=False, feature_edges=False, - manifold_edges=False) + pdata = meshout.extract_feature_edges(non_manifold_edges=False, + feature_edges=False, + manifold_edges=False) assert pdata.n_points == 0 From 9e3490250f85afa77ef57697fc332c9f419ec4a2 Mon Sep 17 00:00:00 2001 From: Alex Kaszynski Date: Mon, 19 Jul 2021 17:04:11 -0600 Subject: [PATCH 2/4] fix pipeline --- azure-pipelines.yml | 2 +- pymeshfix/_version.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9962014..80c9686 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -55,7 +55,7 @@ jobs: python.version: '3.7' Python38: python.version: '3.8' - Python38: + Python39: python.version: '3.9' pool: vmImage: 'macOS-10.15' diff --git a/pymeshfix/_version.py b/pymeshfix/_version.py index f8a3b70..afa087d 100644 --- a/pymeshfix/_version.py +++ b/pymeshfix/_version.py @@ -1,3 +1,10 @@ -"""pymeshfix version""" -version_info = 0, 14, 2 +"""pymeshfix version + +On the ``master`` branch, use 'dev0' to denote a development version. +For example: + +version_info = 0, 27, 'dev0' + +""" +version_info = 0, 14, 'dev0' __version__ = '.'.join(map(str, version_info)) From 724c6dac91bb8a4b3456ccf9095fde4c049e06d0 Mon Sep 17 00:00:00 2001 From: Alex Kaszynski Date: Mon, 19 Jul 2021 17:06:59 -0600 Subject: [PATCH 3/4] move mac CI/CD to github --- azure-pipelines.yml | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 80c9686..0f3e145 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -44,28 +44,6 @@ jobs: (cd tests && pytest --cov $(package_name) --cov-report html) - template: .ci/azure-publish-dist.yml -- job: macOS - variables: - 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' - pool: - vmImage: 'macOS-10.15' - steps: - - script: .ci/macos-install-python.sh '$(python.version)' - displayName: Install Python - - template: .ci/azure-setup.yml - - template: .ci/azure-steps.yml - - template: .ci/azure-publish-dist.yml - - job: Windows pool: From 419a504f8eeaf70dea180030beb79287399973d5 Mon Sep 17 00:00:00 2001 From: Alex Kaszynski Date: Mon, 19 Jul 2021 17:07:13 -0600 Subject: [PATCH 4/4] add gh action --- .github/workflows/testing-and-deployment.yml | 58 ++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/testing-and-deployment.yml diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml new file mode 100644 index 0000000..3569d6a --- /dev/null +++ b/.github/workflows/testing-and-deployment.yml @@ -0,0 +1,58 @@ +name: Unit Testing + +on: + push: + branches: "*" + tags: "*" + pull_request: + branches: "**" + +jobs: + macOS: + runs-on: macos-latest + name: Mac OS Unit Testing + strategy: + matrix: + python-version: ['3.6', '3.7', '3.8', '3.9'] + + env: + SHELLOPTS: 'errexit:pipefail' + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + + - name: Build package + run: | + pip install -r requirements_build.txt + python setup.py bdist_wheel + pip install dist/* + + - name: Install package + run: | + pip install dist/* + python -c "import pyvista; print(pyvista.Report(gpu=False))" + + - name: Install test dependencies + run: | + pip install -r requirements_test.txt + + - name: Unit testing + run: | + pytest -v + + - name: Validate package + run: | + pip install twine + twine check dist/* + + - name: Upload to PyPi + if: startsWith(github.event.ref, 'refs/tags') + run: | + twine upload -u __token__ --skip-existing dist/* + env: + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}