-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stage Release v0.5.0
- Loading branch information
Showing
59 changed files
with
1,314 additions
and
488 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,112 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
contents: read | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
Validate: | ||
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
Validate: | ||
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: ['3.8', '3.9', '3.10', '3.11'] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install | ||
if: startsWith(matrix.os, 'macos-') | ||
run: | | ||
brew install libomp llvm && | ||
brew link llvm && | ||
echo $(brew info llvm) && | ||
echo $(arch) | ||
- name: Install llvm | ||
if: startsWith(matrix.os, 'macos-') | ||
run: | | ||
brew cleanup | ||
brew update -f | ||
rm -rf /usr/local/bin/2to3* | ||
rm -rf /usr/local/bin/idle3* | ||
rm -rf /usr/local/bin/pydoc3* | ||
rm -rf /usr/local/bin/python* | ||
brew install libomp | ||
brew install llvm | ||
echo " | ||
export PATH=\"/usr/local/opt/llvm/bin:\$PATH\" | ||
export LDFLAGS=\"-L/usr/local/opt/llvm/lib\" | ||
export CPPFLAGS=\"-I/usr/local/opt/llvm/include\" | ||
export LD=ld.lld | ||
export AR=llvm-ar | ||
export RANLIB=llvm-ranlib | ||
" >> $HOME/.bash_profile | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
architecture: "x64" | ||
python-version: ${{ matrix.python-version }} | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
architecture: x64 | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Hatch | ||
run: pip install --upgrade hatch | ||
- name: Install Hatch | ||
run: pip install --upgrade hatch | ||
|
||
- name: Run tests | ||
run: hatch run cov | ||
- name: Run tests | ||
run: hatch run cov | ||
|
||
- name: Test Compile | ||
shell: bash | ||
run: | | ||
cd example | ||
echo "os: $RUNNER_OS" | ||
hatch build | ||
hatch run test | ||
- name: Test src lib compilation | ||
shell: bash | ||
run: | | ||
cd test_libraries/src_structure | ||
echo "os: $RUNNER_OS" | ||
hatch --verbose build --clean | ||
hatch run test | ||
- name: Test simple lib compilation | ||
shell: bash | ||
run: | | ||
cd test_libraries/simple_structure | ||
echo "os: $RUNNER_OS" | ||
cp -r ../src_structure/src/example_lib/* ./example_lib/ | ||
cp -r ../src_structure/tests/* ./tests/ | ||
hatch --verbose build --clean | ||
hatch run test | ||
Build: | ||
needs: Validate | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/tags/') | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/hatch-cython | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install hatch | ||
- name: Build package | ||
run: hatch build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
Build: | ||
needs: [Validate] | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/tags/') | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/hatch-cython | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install hatch | ||
- name: Build package | ||
run: hatch build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
name: Coverage | ||
on: [push, pull_request] | ||
jobs: | ||
cov: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
- name: Install dependencies | ||
run: pip install '.[test]' | ||
- name: Run tests and collect coverage | ||
run: pytest --cov --ignore=example | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
cov: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- name: Install dependencies | ||
run: pip install '.[test]' | ||
- name: Run tests and collect coverage | ||
run: pytest --cov --ignore=test_libraries | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
name: Ruff | ||
on: [push, pull_request] | ||
jobs: | ||
ruff: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: chartboost/ruff-action@v1 | ||
with: | ||
src: "./src" | ||
ruff: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: chartboost/ruff-action@v1 | ||
with: | ||
src: ./src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,78 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
branches: [main, v*] | ||
pull_request: | ||
branches: [main, v*] | ||
push: | ||
branches: [main, v*] | ||
pull_request: | ||
branches: [main, v*] | ||
|
||
concurrency: | ||
group: test-${{ github.head_ref }} | ||
cancel-in-progress: true | ||
group: test-${{ github.head_ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
PYTHONUNBUFFERED: "1" | ||
FORCE_COLOR: "1" | ||
PYTHONUNBUFFERED: '1' | ||
FORCE_COLOR: '1' | ||
|
||
jobs: | ||
run: | ||
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install | ||
if: startsWith(matrix.os, 'macos-') | ||
run: | | ||
brew install libomp llvm && | ||
brew link llvm && | ||
echo $(brew info llvm) && | ||
echo $(arch) | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
architecture: 'x64' | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Hatch | ||
run: pip install --upgrade hatch | ||
|
||
- name: Run tests | ||
run: hatch run cov | ||
|
||
- name: Test Compile | ||
shell: bash | ||
run: | | ||
cd example | ||
echo "os: $RUNNER_OS" | ||
hatch build | ||
hatch run test | ||
run: | ||
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: ['3.8', '3.9', '3.10', '3.11'] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install llvm | ||
if: startsWith(matrix.os, 'macos-') | ||
run: | | ||
brew cleanup | ||
brew update -f | ||
rm -rf /usr/local/bin/2to3* | ||
rm -rf /usr/local/bin/idle3* | ||
rm -rf /usr/local/bin/pydoc3* | ||
rm -rf /usr/local/bin/python* | ||
brew install libomp | ||
brew install llvm | ||
echo " | ||
export PATH=\"/usr/local/opt/llvm/bin:\$PATH\" | ||
export LDFLAGS=\"-L/usr/local/opt/llvm/lib\" | ||
export CPPFLAGS=\"-I/usr/local/opt/llvm/include\" | ||
export LD=ld.lld | ||
export AR=llvm-ar | ||
export RANLIB=llvm-ranlib | ||
" >> $HOME/.bash_profile | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
architecture: x64 | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Hatch | ||
run: pip install --upgrade hatch | ||
|
||
- name: Run tests | ||
run: hatch run cov | ||
|
||
- name: Test src lib compilation | ||
shell: bash | ||
run: | | ||
cd test_libraries/src_structure | ||
echo "os: $RUNNER_OS" | ||
hatch --verbose build --clean | ||
hatch run test | ||
- name: Test simple lib compilation | ||
shell: bash | ||
run: | | ||
cd test_libraries/simple_structure | ||
echo "os: $RUNNER_OS" | ||
cp -r ../src_structure/src/example_lib/* ./example_lib/ | ||
cp -r ../src_structure/tests/* ./tests/ | ||
hatch --verbose build --clean | ||
hatch run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,5 @@ dist/ | |
*.ipynb | ||
.vscode/settings.json | ||
.vscode/ | ||
.ruff_cache | ||
.pytest_cache |
Oops, something went wrong.