Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python package restructuring #77

Merged
merged 15 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 0 additions & 140 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,143 +22,3 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: publish

linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Build Wheels
uses: PyO3/maturin-action@v1
with:
manylinux: auto
command: build
args: --release --out dist -m si-units/Cargo.toml
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheel-linux-x86_64
path: dist

macos-x86_64:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
architecture: x64
- name: Build wheels - x86_64
uses: PyO3/maturin-action@v1
with:
target: x86_64
args: --release --out dist -m si-units/Cargo.toml
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheel-macos-x86_64
path: dist

macos-aarch64:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
architecture: arm64
- name: Build wheels - aarch64
uses: PyO3/maturin-action@v1
with:
target: aarch64
args: --release --out dist -m si-units/Cargo.toml
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheel-aarch64-apple-darwin
path: dist

windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
architecture: x64
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: x64
args: --release --out dist -m si-units/Cargo.toml
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheel-windows-x64
path: dist

deploy-pypi:
name: Publish wheels to PyPI and TestPyPI
runs-on: ubuntu-latest
needs: [linux, windows, macos-x86_64, macos-aarch64]
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheel-*
path: wheels
merge-multiple: true
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Publish to PyPi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
pip install --upgrade twine
twine upload --skip-existing wheels/*

build-documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install python dependencies
run: |
pip install sphinx sphinx-rtd-theme numpydoc
- name: Build Wheels
uses: PyO3/maturin-action@v1
with:
manylinux: auto
command: build
args: --release --out dist -m si-units/Cargo.toml
- name: Install module
run: |
pip install si-units --no-index --find-links dist --force-reinstall
- name: Build documentation
run: sphinx-build si-units/docs/ public/ -b html
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: documentation
path: public

release-documentation:
needs: [build-documentation]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: documentation
path: public
- name: Deploy documentation to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
49 changes: 49 additions & 0 deletions .github/workflows/release_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release Documentation

on:
push:
branches: [master]

jobs:
build-documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install python dependencies
run: |
pip install mkdocs-material mkdocstrings-python
- name: Build Wheels
uses: PyO3/maturin-action@v1
with:
manylinux: auto
command: build
args: --release --out dist -m si-units/Cargo.toml
- name: Install module
run: |
pip install si-units --no-index --find-links dist --force-reinstall
- name: Build documentation
run: mkdocs build -f si-units/mkdocs.yml -d ../public
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: documentation
path: public

release-documentation:
needs: [build-documentation]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: documentation
path: public
- name: Deploy documentation to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
90 changes: 90 additions & 0 deletions .github/workflows/release_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Release PyPI

on:
push:
tags: ["s-units-v*"]

jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Build Wheels
uses: PyO3/maturin-action@v1
with:
manylinux: auto
command: build
args: --release --out dist -m si-units/Cargo.toml
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheel-linux-x86_64
path: dist

macos:
strategy:
matrix:
target: [ {arch: x64, target: x86_64}, {arch: arm64, target: aarch64} ]
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
architecture: ${{ matrix.target.arch }}
- name: Build wheels - ${{ matrix.target.target }}
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target.target }}
args: --release --out dist -m si-units/Cargo.toml
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheel-macos-${{ matrix.target.target }}
path: dist

windows:
runs-on: windows-latest
strategy:
matrix:
target: [x64, x86]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
architecture: ${{ matrix.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist -m si-units/Cargo.toml
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheel-windows-${{ matrix.target }}
path: dist

deploy-pypi:
name: Publish wheels to PyPI and TestPyPI
runs-on: ubuntu-latest
needs: [linux, windows, macos]
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheel-*
path: wheels
merge-multiple: true
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Publish to PyPi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
pip install --upgrade twine
twine upload --skip-existing wheels/*
34 changes: 0 additions & 34 deletions .github/workflows/test_documentation.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .github/workflows/test_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
Expand All @@ -30,6 +30,7 @@ jobs:
maturin build --release --out dist
pip install extend_quantity --no-index --find-links dist --force-reinstall
- name: Build wheels for si-units
working-directory: ./si-units
run: |
maturin build --release --out dist
pip install si-units --no-index --find-links dist --force-reinstall
Expand Down
Loading
Loading