Skip to content

Commit

Permalink
Release 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xia-mc committed Dec 13, 2024
1 parent 7c8f4ee commit 8a7785f
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 2 deletions.
101 changes: 101 additions & 0 deletions .github/workflows/python-package-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Python package

on:
release:
types: [ created ]

jobs:
lint:
name: Lint Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: "3.12"
- name: Install flake8
run: |
python -m pip install --upgrade pip
python -m pip install flake8
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-cov
python -m pip install -r requirements.txt
- name: Build
shell: bash
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
./build.cmd
else
chmod +x ./build.sh && ./build.sh
fi
- name: Find Correct Build
id: findbuild
shell: bash
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
output=__pyfastutil.pyd
else
output=__pyfastutil.so
fi
echo "::set-output name=libname::$output"
- name: Upload Build Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}_py${{ matrix.python-version }}-${{ steps.findbuild.outputs.libname }}
path: pyfastutil/${{ steps.findbuild.outputs.libname }}

- name: Test with pytest and generate coverage report
run: |
pytest --cov=your_package_name --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella

- name: Upload to PyPI
shell: bash
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
./upload.cmd
else
chmod +x ./upload.sh && ./upload.sh
fi
5 changes: 5 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,26 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-cov
python -m pip install -r requirements.txt
- name: Build
shell: bash
run: |
Expand Down Expand Up @@ -81,6 +85,7 @@ jobs:
- name: Test with pytest and generate coverage report
run: |
pytest --cov=your_package_name --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ This project is licensed under the **Apache License 2.0**. For more details, see
- [x] Add Numpy support.
- [x] Provide bindings for SIMD utility functions.
- [x] Provide raw AVX512 bindings.
- [ ] Perform comprehensive testing and benchmarking.
- [x] Perform comprehensive testing and benchmarking.
- [x] Publish to PyPI.

## Contribution
Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ pip install PyFastUtil
- [x] Numpy 支持。
- [x] 提供 SIMD 封装函数的绑定。
- [x] 提供 AVX512 的原始底层绑定。
- [ ] 进行全面的测试和基准测试。
- [x] 进行全面的测试和基准测试。
- [x] 发布到 PyPI。

## 贡献
Expand Down
4 changes: 4 additions & 0 deletions upload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
python ./setup.py clean
python ./setup.py sdist bdist_wheel
twine upload --repository pypi dist/*

0 comments on commit 8a7785f

Please sign in to comment.