From 005503db004ad0fbb374dc733df0a6c93e0ca985 Mon Sep 17 00:00:00 2001 From: kota_ishizuka Date: Fri, 23 Jul 2021 09:21:57 +0900 Subject: [PATCH 01/15] fix test.sh --- test.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/test.sh b/test.sh index aa25acc..5cc393c 100644 --- a/test.sh +++ b/test.sh @@ -1,4 +1,3 @@ -clear rm -rf build dist .pytest_cache CXX=/usr/bin/g++ pip install . pytest tests -vv --capture=no From 9098b949c92a2fa8b530c11a1135668abe19f4b1 Mon Sep 17 00:00:00 2001 From: kota_ishizuka Date: Fri, 23 Jul 2021 09:22:11 +0900 Subject: [PATCH 02/15] add arm --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index a11edc3..decd028 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,8 @@ env: - CIBW_MANYLINUX_X86_64_IMAGE="manylinux2014" - CIBW_BUILD="cp3?-*" - CIBW_SKIP="cp27-* *-win32 *-manylinux_i686" + - CIBW_ARCHS_LINUX="x86_64 aarch64" + - CIBW_ARCHS_MACOS="x86_64 arm64 universal2" - TWINE_USERNAME=__token__ - CIBW_BEFORE_BUILD="pip install pybind11" - CIBW_TEST_COMMAND="pytest {project}/tests" From 305f17e45923097eb8dc7c2311e7e2da967f2be7 Mon Sep 17 00:00:00 2001 From: kota_ishizuka Date: Fri, 23 Jul 2021 09:28:26 +0900 Subject: [PATCH 03/15] drop 3.6 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index decd028..2d03ca8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ env: - CIBW_BEFORE_ALL_LINUX="yum install -y cmake3 && ln -s /usr/bin/cmake3 /usr/bin/cmake" - CIBW_MANYLINUX_X86_64_IMAGE="manylinux2014" - CIBW_BUILD="cp3?-*" - - CIBW_SKIP="cp27-* *-win32 *-manylinux_i686" + - CIBW_SKIP="cp27-* cp36-* *-win32 *-manylinux_i686" - CIBW_ARCHS_LINUX="x86_64 aarch64" - CIBW_ARCHS_MACOS="x86_64 arm64 universal2" - TWINE_USERNAME=__token__ From 00a32c7447ce7fa759cc8b9727db3a9fd72f4aab Mon Sep 17 00:00:00 2001 From: kota_ishizuka Date: Fri, 23 Jul 2021 09:33:41 +0900 Subject: [PATCH 04/15] set seed --- tests/test_PRTree.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_PRTree.py b/tests/test_PRTree.py index 74160b9..3d54f5d 100644 --- a/tests/test_PRTree.py +++ b/tests/test_PRTree.py @@ -11,6 +11,7 @@ def has_intersect(x, y, dim): @pytest.mark.parametrize("PRTree, dim", [(PRTree2D, 2), (PRTree3D, 3)]) def test_result(PRTree, dim): + np.random.seed(1) idx = np.arange(100) x = np.random.rand(len(idx), 2 * dim) for i in range(dim): @@ -25,6 +26,7 @@ def test_result(PRTree, dim): @pytest.mark.parametrize("PRTree, dim", [(PRTree2D, 2), (PRTree3D, 3)]) def test_io(PRTree, dim, tmp_path): + np.random.seed(1) idx = np.arange(100) x = np.random.rand(len(idx), 2 * dim) for i in range(dim): @@ -53,6 +55,7 @@ def test_io(PRTree, dim, tmp_path): @pytest.mark.parametrize("PRTree, dim", [(PRTree2D, 2), (PRTree3D, 3)]) def test_insert_erase(PRTree, dim): + np.random.seed(1) N = 10000 idx = np.arange(N) x = np.random.rand(N, 2 * dim) From 29fb03783f75179c707f1a9b0a3e9ed1562ba3a3 Mon Sep 17 00:00:00 2001 From: kota_ishizuka Date: Fri, 23 Jul 2021 09:34:16 +0900 Subject: [PATCH 05/15] update pybind11 --- third/pybind11 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third/pybind11 b/third/pybind11 index f61855b..e58c689 160000 --- a/third/pybind11 +++ b/third/pybind11 @@ -1 +1 @@ -Subproject commit f61855b9d8821e2576960109a2a67379a6c2366f +Subproject commit e58c6897cc7b77b92e1c49df82a3504f777b97c9 From ea6ae54547f613a4ce45db193302b67b81fb78db Mon Sep 17 00:00:00 2001 From: kota_ishizuka Date: Fri, 23 Jul 2021 09:50:07 +0900 Subject: [PATCH 06/15] move to github actions --- .github/workflows/cibuildwheel.yml | 73 ++++++++++++++++++++++++++++++ .travis.yml | 36 --------------- 2 files changed, 73 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/cibuildwheel.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml new file mode 100644 index 0000000..76a451c --- /dev/null +++ b/.github/workflows/cibuildwheel.yml @@ -0,0 +1,73 @@ +name: Build and upload to PyPI + +on: [push, pull_request] + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-20.04, windows-2019, macos-10.15] + python-version: [3.7, 3.8, 3.9] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: ${{ matrix.python-version }} + - name: Set up QEMU + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v1 + with: + platforms: all + - name: Build wheels + uses: pypa/cibuildwheel@v2.0.0 + env: + CIBW_BEFORE_ALL_LINUX: yum install -y cmake3 && ln -s /usr/bin/cmake3 /usr/bin/cmake + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + CIBW_BUILD: cp3?-* + CIBW_SKIP: cp27-* cp36-* *-win32 *-manylinux_i686 + CIBW_ARCHS_LINUX: x86_64 aarch64 ppc64le s390x + CIBW_ARCHS_MACOS: x86_64 arm64 universal2 + CIBW_BEFORE_BUILD: pip install pybind11 + CIBW_TEST_COMMAND: pytest tests + CIBW_TEST_REQUIRES: pytest numpy + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.7, 3.8, 3.9] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: ${{ matrix.python-version }} + - name: Build sdist + run: python setup.py sdist + - uses: actions/upload-artifact@v2 + with: + path: dist/*.tar.gz + + upload_test_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + # upload to PyPI on every tag starting with 'v' + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + - uses: pypa/gh-action-pypi-publish@v1.4.2 + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ # test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2d03ca8..0000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -language: python -jobs: - include: - - os: linux - services: docker - - os: osx - language: shell - osx_image: xcode12.5 - - os: windows - language: shell - before_install: - - choco install python --version 3.8.10 - - export PATH="/c/Python38:/c/Python38/Scripts:$PATH" - - ln -s /c/Python38/python.exe /c/Python38/python3.exe -env: - global: - - CIBW_BEFORE_ALL_LINUX="yum install -y cmake3 && ln -s /usr/bin/cmake3 /usr/bin/cmake" - - CIBW_MANYLINUX_X86_64_IMAGE="manylinux2014" - - CIBW_BUILD="cp3?-*" - - CIBW_SKIP="cp27-* cp36-* *-win32 *-manylinux_i686" - - CIBW_ARCHS_LINUX="x86_64 aarch64" - - CIBW_ARCHS_MACOS="x86_64 arm64 universal2" - - TWINE_USERNAME=__token__ - - CIBW_BEFORE_BUILD="pip install pybind11" - - CIBW_TEST_COMMAND="pytest {project}/tests" - - CIBW_TEST_REQUIRES="pytest numpy" -install: - - python3 -m pip install cibuildwheel -script: - - python3 -m cibuildwheel --output-dir wheelhouse -after_success: - - | - if [[ $TRAVIS_TAG ]]; then - python3 -m pip install twine - python3 -m twine upload wheelhouse/*.whl - fi From 70e815ce4576a8007d77d0cfec01414d9c02faab Mon Sep 17 00:00:00 2001 From: kota_ishizuka Date: Fri, 23 Jul 2021 09:53:31 +0900 Subject: [PATCH 07/15] fix ci --- .github/workflows/cibuildwheel.yml | 4 ++++ setup.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 76a451c..d84ce7c 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -13,6 +13,8 @@ jobs: steps: - uses: actions/checkout@v2 + with: + submodules: recursive - uses: actions/setup-python@v2 name: Install Python with: @@ -46,6 +48,8 @@ jobs: python-version: [3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 + with: + submodules: recursive - uses: actions/setup-python@v2 name: Install Python with: diff --git a/setup.py b/setup.py index db26571..15da2a2 100644 --- a/setup.py +++ b/setup.py @@ -80,7 +80,7 @@ def build_extension(self, ext): setup( name='python_prtree', - version='0.4.0', + version='0.4.2', license='MIT', description='Python implementation of Priority R-Tree', author='atksh', From 4ca4930275e562bdc094c1146412148e6b57d208 Mon Sep 17 00:00:00 2001 From: kota_ishizuka Date: Fri, 23 Jul 2021 09:57:45 +0900 Subject: [PATCH 08/15] fix ci --- .github/workflows/cibuildwheel.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index d84ce7c..942df8c 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -9,7 +9,6 @@ jobs: strategy: matrix: os: [ubuntu-20.04, windows-2019, macos-10.15] - python-version: [3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 @@ -18,7 +17,7 @@ jobs: - uses: actions/setup-python@v2 name: Install Python with: - python-version: ${{ matrix.python-version }} + python-version: 3.8 - name: Set up QEMU if: runner.os == 'Linux' uses: docker/setup-qemu-action@v1 @@ -34,7 +33,7 @@ jobs: CIBW_ARCHS_LINUX: x86_64 aarch64 ppc64le s390x CIBW_ARCHS_MACOS: x86_64 arm64 universal2 CIBW_BEFORE_BUILD: pip install pybind11 - CIBW_TEST_COMMAND: pytest tests + CIBW_TEST_COMMAND: pytest {project}/tests CIBW_TEST_REQUIRES: pytest numpy - uses: actions/upload-artifact@v2 with: @@ -43,9 +42,6 @@ jobs: build_sdist: name: Build source distribution runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 with: @@ -53,7 +49,7 @@ jobs: - uses: actions/setup-python@v2 name: Install Python with: - python-version: ${{ matrix.python-version }} + python-version: 3.8 - name: Build sdist run: python setup.py sdist - uses: actions/upload-artifact@v2 From a73bf6b0ab90662899844dc293c50c9a35ddd279 Mon Sep 17 00:00:00 2001 From: kota_ishizuka Date: Fri, 23 Jul 2021 10:06:26 +0900 Subject: [PATCH 09/15] fix --- .github/workflows/cibuildwheel.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 942df8c..a6bf7b4 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -26,7 +26,6 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.0.0 env: - CIBW_BEFORE_ALL_LINUX: yum install -y cmake3 && ln -s /usr/bin/cmake3 /usr/bin/cmake CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 CIBW_BUILD: cp3?-* CIBW_SKIP: cp27-* cp36-* *-win32 *-manylinux_i686 From e81ae1d62b5b1a7741ad65df78d5781ab4bd199c Mon Sep 17 00:00:00 2001 From: kota_ishizuka Date: Fri, 23 Jul 2021 10:16:56 +0900 Subject: [PATCH 10/15] fix --- .github/workflows/cibuildwheel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index a6bf7b4..ad40047 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -55,11 +55,11 @@ jobs: with: path: dist/*.tar.gz - upload_test_pypi: + upload_pypi: needs: [build_wheels, build_sdist] runs-on: ubuntu-latest # upload to PyPI on every tag starting with 'v' - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') + # if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') steps: - uses: actions/download-artifact@v2 with: From 66061bb005bc138e5d16d4a76e2656fb5d1d84a0 Mon Sep 17 00:00:00 2001 From: kota_ishizuka Date: Fri, 23 Jul 2021 10:20:22 +0900 Subject: [PATCH 11/15] fix readme --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1c0c7fb..a60850f 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,8 @@ print(result) # [[1], [1, 2]] ``` -## New features (`python-prtree>=0.4.0`) +## New features +### `python-prtree>=0.4.0` You can use PRTree3D: ```python @@ -49,8 +50,7 @@ print(result) # [[1], [1, 2]] ``` - -## New features (`python-prtree>=0.3.0`) +### `python-prtree>=0.3.0` You can save and load a binary file as follows: ```python From 8d3bf814c8883a359c85dc3ed559a223ade0693f Mon Sep 17 00:00:00 2001 From: kota_ishizuka Date: Fri, 23 Jul 2021 10:21:55 +0900 Subject: [PATCH 12/15] fix --- .github/workflows/cibuildwheel.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index ad40047..e0d1db9 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -1,6 +1,11 @@ name: Build and upload to PyPI -on: [push, pull_request] +push: + branches: + - master +pull_request: + branches: + - master jobs: build_wheels: From 6cb68d074d85bb6b32f495874f08769fbeeb3427 Mon Sep 17 00:00:00 2001 From: kota_ishizuka Date: Fri, 23 Jul 2021 10:22:34 +0900 Subject: [PATCH 13/15] fix --- .github/workflows/cibuildwheel.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index e0d1db9..5b4edc4 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -1,11 +1,12 @@ name: Build and upload to PyPI -push: - branches: - - master -pull_request: - branches: - - master +on: + push: + branches: + - main + pull_request: + branches: + - main jobs: build_wheels: From 3800d675037f86a8bcd42c03c35c37749f4bf099 Mon Sep 17 00:00:00 2001 From: kota_ishizuka Date: Fri, 23 Jul 2021 10:24:25 +0900 Subject: [PATCH 14/15] fix --- .github/workflows/cibuildwheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 5b4edc4..704793b 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -35,7 +35,7 @@ jobs: CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 CIBW_BUILD: cp3?-* CIBW_SKIP: cp27-* cp36-* *-win32 *-manylinux_i686 - CIBW_ARCHS_LINUX: x86_64 aarch64 ppc64le s390x + CIBW_ARCHS_LINUX: x86_64 aarch64 CIBW_ARCHS_MACOS: x86_64 arm64 universal2 CIBW_BEFORE_BUILD: pip install pybind11 CIBW_TEST_COMMAND: pytest {project}/tests From eee159d59dd89ce345b6d0b545375cb915ce2051 Mon Sep 17 00:00:00 2001 From: kota_ishizuka Date: Fri, 23 Jul 2021 10:24:39 +0900 Subject: [PATCH 15/15] fix --- .github/workflows/cibuildwheel.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 704793b..4e830e6 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -65,7 +65,7 @@ jobs: needs: [build_wheels, build_sdist] runs-on: ubuntu-latest # upload to PyPI on every tag starting with 'v' - # if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') steps: - uses: actions/download-artifact@v2 with: @@ -74,5 +74,4 @@ jobs: - uses: pypa/gh-action-pypi-publish@v1.4.2 with: user: __token__ - password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository_url: https://test.pypi.org/legacy/ # test + password: ${{ secrets.PYPI_API_TOKEN }}