Skip to content

Commit

Permalink
Fix CI, use GitHub workflow to release to pypi (#6)
Browse files Browse the repository at this point in the history
* import docs from polyline-ruler

* update docs

* update CI

* update

* update version

* fix win build
  • Loading branch information
district10 authored Mar 5, 2023
1 parent c31409c commit 0a32f66
Show file tree
Hide file tree
Showing 16 changed files with 137 additions and 41 deletions.
27 changes: 0 additions & 27 deletions .appveyor.yml

This file was deleted.

5 changes: 3 additions & 2 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [windows-latest, macos-latest, ubuntu-latest]
python-version: ["3.6", "3.8", "3.11-dev"]
platform: [ubuntu-20.04, windows-2019, macos-11]
python-version: ["3.8", "3.9", "3.10"]

runs-on: ${{ matrix.platform }}

Expand All @@ -33,4 +33,5 @@ jobs:
run: pip install --verbose .[test]

- name: Test
if: ${{ startsWith(matrix.platform, 'ubuntu') }}
run: python -m pytest
21 changes: 16 additions & 5 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,22 @@ jobs:
with:
submodules: true

- uses: pypa/cibuildwheel@v2.11.1
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all

- uses: pypa/cibuildwheel@v2.12.0
env:
CIBW_ARCHS_MACOS: auto universal2
# CIBW_ARCHS: auto64
CIBW_ARCHS_LINUX: x86_64 aarch64
CIBW_ARCHS_WINDOWS: AMD64 # ARM64
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_BEFORE_BUILD: pip install numpy scipy fire --prefer-binary
# https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip
CIBW_SKIP: pp*
CIBW_SKIP: pp* *i686 *musllinux*
CIBW_TEST_SKIP: "*macosx* *win* *aarch64"

- name: Verify clean directory
run: git diff --exit-code
Expand Down Expand Up @@ -75,6 +86,6 @@ jobs:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@v1.5.1
- uses: pypa/gh-action-pypi-publish@v1.6.4
with:
password: ${{ secrets.pypi_password }}
password: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ repos:

# Sort your imports in a standard form
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.11.5
hooks:
- id: isort

Expand All @@ -61,7 +61,7 @@ repos:
- id: remove-tabs
exclude: ^(docs|Makefile)

- repo: https://gitlab.com/pycqa/flake8
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
hooks:
- id: flake8
Expand Down
7 changes: 7 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
formats: all
mkdocs:
fail_on_warning: false
python:
install:
- requirements: docs/requirements.txt
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
PROJECT_SOURCE_DIR ?= $(abspath ./)
PROJECT_NAME ?= $(shell basename $(PROJECT_SOURCE_DIR))

all:
@echo nothing special

Expand All @@ -17,6 +20,11 @@ build:
cmake .. && make
.PHONY: build

docs_build:
mkdocs build
docs_serve:
mkdocs serve -a 0.0.0.0:8088

DOCKER_TAG_WINDOWS ?= ghcr.io/cubao/build-env-windows-x64:v0.0.1
DOCKER_TAG_LINUX ?= ghcr.io/cubao/build-env-manylinux2014-x64:v0.0.1
DOCKER_TAG_MACOS ?= ghcr.io/cubao/build-env-macos-arm64:v0.0.1
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# fast crossing

<!--intro-start-->

## Installation

### via pip

```
pip install fast-crossing
```bash
pip install -U fast-crossing
```

### from source
Expand All @@ -17,12 +19,14 @@ pip install ./fast-crossing

Or

```
```bash
pip install git+https://github.com/cubao/fast-crossing.git
```

(you can build wheels for later reuse by ` pip wheel git+https://github.com/cubao/fast-crossing.git`)

<!--intro-end-->

## Usage & Tests

See [`tests/test_basic.py`](tests/test_basic.py):
Expand Down Expand Up @@ -205,5 +209,4 @@ def test_fast_crossing_dedup():
# for idx, row in enumerate(ret):
# print(idx, row)
assert len(ret) == 4

```
14 changes: 14 additions & 0 deletions docs/about/license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# License

The legal stuff.

---

## Included projects

* [pybind/pybind11](https://github.com/pybind/pybind11/blob/master/LICENSE) (BSD)
* [pybind/cmake_example](https://github.com/pybind/cmake_example/blob/master/LICENSE) (BSD)

## License (BSD)

See <https://github.com/cubao/fast-crossing/blob/master/LICENSE>.
31 changes: 31 additions & 0 deletions docs/about/release-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Release Notes

---

## Upgrading

To upgrade `fast-crossing` to the latest version, use pip:

```bash
pip install -U fast-crossing
```

## Version 0.0.3 (2023-03-05)

* Fix CI
* Use GitHub workflow to release to pypi

## Version 0.0.2 (2023-01-22)

*

## Version 0.0.1 (2023-01-22)

* First release

---

You can also checkout releases on:

- GitHub: <https://github.com/cubao/polyline-ruler/releases>
- PyPi: <https://pypi.org/project/polyline-ruler>
1 change: 1 addition & 0 deletions docs/css/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* add your css here */
12 changes: 12 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# fast-crossing

{%
include-markdown "../README.md"
start="<!--intro-start-->"
end="<!--intro-end-->"
%}

<div class="text-center">
<a href="https://github.com/cubao/fast-crossing" class="btn btn-primary" role="button">Code on GitHub</a>
<a href="https://pypi.org/project/fast-crossing" class="btn btn-primary" role="button">Package on PyPi</a>
</div>
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mkdocs==1.4.2
mkdocs-include-markdown-plugin==4.0.3
10 changes: 10 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Usage

## test_basic.py

```python
{%
include-markdown "../tests/test_basic.py"
comments=false
%}
```
18 changes: 18 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
site_name: fast-crossing
site_url: https://fast-crossing.readthedocs.io
site_description: Fast polyline (line segments) intersection (fast version of bentley-ottmann)
site_author: district10

repo_url: https://github.com/cubao/fast-crossing
edit_uri: blob/master/docs/

theme: readthedocs
nav:
- Home: index.md
- Usage: usage.md
- About:
- Release Notes: about/release-notes.md
- License: about/license.md
plugins:
- include-markdown
copyright: Copyright &copy; 2023 <a href="https://github.com/cubao">cubao team</a>.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def build_extension(self, ext):
# logic and declaration, and simpler if you include description/version in a file.
setup(
name="fast_crossing",
version="0.0.2",
version="0.0.3",
author="tzx",
author_email="dvorak4tzx@gmail.com",
url="https://github.com/cubao/fast-crossing",
Expand Down
5 changes: 5 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
#undef __ARM_NEON
#undef __ARM_NEON__
#endif
#define _USE_MATH_DEFINES
#include <cmath>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

#include <Eigen/Core>

Expand Down

0 comments on commit 0a32f66

Please sign in to comment.