Skip to content

Commit d75fcd8

Browse files
authored
Merge pull request #5 from TianFengshou/main
Main
2 parents 9018395 + aba7e78 commit d75fcd8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1852
-23790
lines changed

.circleci/config.yml

Lines changed: 0 additions & 214 deletions
This file was deleted.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Build Wheel and Publish for Releases
2+
on:
3+
workflow_dispatch:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build_wheels:
9+
name: Build wheels on ${{ matrix.os }}
10+
runs-on: ${{ matrix.os }}
11+
env:
12+
CIBW_ARCHS_MACOS: "x86_64 arm64"
13+
14+
strategy:
15+
matrix:
16+
os: [ubuntu-20.04, windows-2019, macos-12]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- run: |
22+
git fetch --prune --unshallow
23+
24+
- name: Build wheels
25+
uses: pypa/[email protected]
26+
27+
- uses: actions/upload-artifact@v4
28+
with:
29+
name: artifact-${{ matrix.os }}
30+
path: ./wheelhouse/*.whl
31+
32+
build_sdist:
33+
name: Build source distribution
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- run: |
39+
git fetch --prune --unshallow
40+
41+
- name: Build sdist
42+
run: pipx run build --sdist
43+
44+
- uses: actions/upload-artifact@v4
45+
with:
46+
name: artifact-sdist
47+
path: dist/*.tar.gz
48+
49+
upload_pypi:
50+
needs: [build_wheels, build_sdist]
51+
runs-on: ubuntu-latest
52+
# upload to PyPI on every tag starting with 'v'
53+
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
54+
# alternatively, to publish when a GitHub Release is created, use the following rule:
55+
if: github.event_name == 'release' && github.event.action == 'published'
56+
steps:
57+
- uses: actions/download-artifact@v4
58+
with:
59+
pattern: artifact-*
60+
path: dist
61+
merge-multiple: true
62+
63+
- name: Check dist
64+
run: ls dist
65+
66+
- uses: pypa/[email protected]
67+
with:
68+
user: __token__
69+
password: ${{ secrets.PYPI_TOKEN }}
70+
To test: repository_url: https://test.pypi.org/legacy/

.github/workflows/test.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Unit Tests
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
7+
jobs:
8+
test_x86_64:
9+
name: "Build ${{ matrix.pyver }} on ${{ matrix.os }}"
10+
strategy:
11+
matrix:
12+
pyver: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
13+
os: [ubuntu-latest, windows-latest]
14+
runs-on: ${{ matrix.os }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Setting up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: ${{ matrix.pyver }}
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --disable-pip-version-check --upgrade pip
24+
pip install -U -r requirements.txt -r requirements-dev.txt
25+
#Install locally to support tests
26+
pip install -e .
27+
- name: Test with pytest
28+
run: pytest
29+
30+
test_aarch64:
31+
name: "Build aarch64 ${{ matrix.pyver }}"
32+
strategy:
33+
matrix:
34+
pyver: [cp37-cp37m, cp38-cp38, cp39-cp39, cp310-cp310, cp311-cp311, cp312-cp312]
35+
fail-fast: false
36+
runs-on: ubuntu-latest
37+
env:
38+
py: /opt/python/${{ matrix.pyver }}/bin/python
39+
img: quay.io/pypa/manylinux2014_aarch64
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v4
43+
- run: |
44+
docker run --rm --privileged hypriot/qemu-register
45+
- uses: docker://quay.io/pypa/manylinux2014_aarch64
46+
with:
47+
args: |
48+
bash -c "${{ env.py }} -m pip install virtualenv && ${{ env.py }} -m venv .env && \
49+
source .env/bin/activate && \
50+
pip install --upgrade setuptools && \
51+
python -m pip install --disable-pip-version-check --upgrade pip && \
52+
pip install -U -r requirements.txt -r requirements-dev.txt && \
53+
pip install -e . && \
54+
pytest && \
55+
deactivate"

0 commit comments

Comments
 (0)