Skip to content

Commit 8a7785f

Browse files
committed
Release 0.1.0
1 parent 7c8f4ee commit 8a7785f

5 files changed

Lines changed: 112 additions & 2 deletions

File tree

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Python package
2+
3+
on:
4+
release:
5+
types: [ created ]
6+
7+
jobs:
8+
lint:
9+
name: Lint Code
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up Python 3.12
14+
uses: actions/setup-python@v3
15+
with:
16+
python-version: "3.12"
17+
- name: Install flake8
18+
run: |
19+
python -m pip install --upgrade pip
20+
python -m pip install flake8
21+
- name: Lint with flake8
22+
run: |
23+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
24+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
25+
26+
build:
27+
name: Build
28+
runs-on: ${{ matrix.os }}
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
os: [ ubuntu-latest, windows-latest, macos-latest ]
33+
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
34+
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- name: Set up Python ${{ matrix.python-version }}
39+
uses: actions/setup-python@v3
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
43+
- name: Cache pip
44+
uses: actions/cache@v3
45+
with:
46+
path: ~/.cache/pip
47+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
48+
restore-keys: |
49+
${{ runner.os }}-pip-
50+
51+
- name: Install dependencies
52+
run: |
53+
python -m pip install --upgrade pip
54+
python -m pip install flake8 pytest pytest-cov
55+
python -m pip install -r requirements.txt
56+
57+
- name: Build
58+
shell: bash
59+
run: |
60+
if [[ "$RUNNER_OS" == "Windows" ]]; then
61+
./build.cmd
62+
else
63+
chmod +x ./build.sh && ./build.sh
64+
fi
65+
66+
- name: Find Correct Build
67+
id: findbuild
68+
shell: bash
69+
run: |
70+
if [[ "$RUNNER_OS" == "Windows" ]]; then
71+
output=__pyfastutil.pyd
72+
else
73+
output=__pyfastutil.so
74+
fi
75+
echo "::set-output name=libname::$output"
76+
77+
- name: Upload Build Artifacts
78+
uses: actions/upload-artifact@v3
79+
with:
80+
name: ${{ matrix.os }}_py${{ matrix.python-version }}-${{ steps.findbuild.outputs.libname }}
81+
path: pyfastutil/${{ steps.findbuild.outputs.libname }}
82+
83+
- name: Test with pytest and generate coverage report
84+
run: |
85+
pytest --cov=your_package_name --cov-report=xml
86+
87+
- name: Upload coverage to Codecov
88+
uses: codecov/codecov-action@v3
89+
with:
90+
file: ./coverage.xml
91+
flags: unittests
92+
name: codecov-umbrella
93+
94+
- name: Upload to PyPI
95+
shell: bash
96+
run: |
97+
if [[ "$RUNNER_OS" == "Windows" ]]; then
98+
./upload.cmd
99+
else
100+
chmod +x ./upload.sh && ./upload.sh
101+
fi

.github/workflows/python-package.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,26 @@ jobs:
3636

3737
steps:
3838
- uses: actions/checkout@v4
39+
3940
- name: Set up Python ${{ matrix.python-version }}
4041
uses: actions/setup-python@v3
4142
with:
4243
python-version: ${{ matrix.python-version }}
44+
4345
- name: Cache pip
4446
uses: actions/cache@v3
4547
with:
4648
path: ~/.cache/pip
4749
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
4850
restore-keys: |
4951
${{ runner.os }}-pip-
52+
5053
- name: Install dependencies
5154
run: |
5255
python -m pip install --upgrade pip
5356
python -m pip install flake8 pytest pytest-cov
5457
python -m pip install -r requirements.txt
58+
5559
- name: Build
5660
shell: bash
5761
run: |
@@ -81,6 +85,7 @@ jobs:
8185
- name: Test with pytest and generate coverage report
8286
run: |
8387
pytest --cov=your_package_name --cov-report=xml
88+
8489
- name: Upload coverage to Codecov
8590
uses: codecov/codecov-action@v3
8691
with:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ This project is licensed under the **Apache License 2.0**. For more details, see
211211
- [x] Add Numpy support.
212212
- [x] Provide bindings for SIMD utility functions.
213213
- [x] Provide raw AVX512 bindings.
214-
- [ ] Perform comprehensive testing and benchmarking.
214+
- [x] Perform comprehensive testing and benchmarking.
215215
- [x] Publish to PyPI.
216216

217217
## Contribution

README_CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ pip install PyFastUtil
211211
- [x] Numpy 支持。
212212
- [x] 提供 SIMD 封装函数的绑定。
213213
- [x] 提供 AVX512 的原始底层绑定。
214-
- [ ] 进行全面的测试和基准测试。
214+
- [x] 进行全面的测试和基准测试。
215215
- [x] 发布到 PyPI。
216216

217217
## 贡献

upload.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
python ./setup.py clean
3+
python ./setup.py sdist bdist_wheel
4+
twine upload --repository pypi dist/*

0 commit comments

Comments
 (0)