Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Build and upload to PyPI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-10.15]

steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: 3.8
- 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_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
CIBW_BEFORE_BUILD: pip install pybind11
CIBW_TEST_COMMAND: pytest {project}/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
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: 3.8
- name: Build sdist
run: python setup.py sdist
- uses: actions/upload-artifact@v2
with:
path: dist/*.tar.gz

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')
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.PYPI_API_TOKEN }}
34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 0 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
clear
rm -rf build dist .pytest_cache
CXX=/usr/bin/g++ pip install .
pytest tests -vv --capture=no
Expand Down
3 changes: 3 additions & 0 deletions tests/test_PRTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion third/pybind11
Submodule pybind11 updated 105 files