Skip to content

Commit

Permalink
Feature/models from template (#38)
Browse files Browse the repository at this point in the history
* Templates for models

* Refactored model templates to allow renaming fields

* Set version to prerelease

* Update CI
  • Loading branch information
b-gehrke authored Feb 18, 2025
1 parent b464d8a commit 1ea9e9f
Show file tree
Hide file tree
Showing 30 changed files with 23,746 additions and 2,421 deletions.
82 changes: 62 additions & 20 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is autogenerated by maturin v1.6.0
# This file is autogenerated by maturin v1.8.1
# To update, run
#
# maturin generate-ci github
Expand All @@ -9,43 +9,52 @@ on:
push:
branches:
- main
- master
tags:
- '*'
pull_request:
workflow_dispatch:

permissions:
contents: read
id-token: write

jobs:
linux:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: x86_64
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: x86
# - runner: ubuntu-latest
# target: aarch64
- runner: ubuntu-latest
# - runner: ubuntu-22.04
# target: aarch64
- runner: ubuntu-22.04
target: armv7
- runner: ubuntu-22.04
target: s390x
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: ppc64le
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: 'true'
manylinux: auto
# - name: Build free-threaded wheels
# uses: PyO3/maturin-action@v1
# with:
# target: ${{ matrix.platform.target }}
# args: --release --out dist -i python3.13t
# sccache: 'true'
# manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
Expand All @@ -57,13 +66,13 @@ jobs:
strategy:
matrix:
platform:
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: x86_64
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: x86
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: aarch64
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: armv7
steps:
- uses: actions/checkout@v4
Expand All @@ -77,6 +86,13 @@ jobs:
args: --release --out dist
sccache: 'true'
manylinux: musllinux_1_2
# - name: Build free-threaded wheels
# uses: PyO3/maturin-action@v1
# with:
# target: ${{ matrix.platform.target }}
# args: --release --out dist -i python3.13t
# sccache: 'true'
# manylinux: musllinux_1_2
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
Expand All @@ -90,20 +106,26 @@ jobs:
platform:
- runner: windows-latest
target: x64
# - runner: windows-latest
# target: x86
- runner: windows-latest
target: x86
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: ${{ matrix.target }}
python-version: 3.x
architecture: ${{ matrix.platform.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: 'true'
# - name: Build free-threaded wheels
# uses: PyO3/maturin-action@v1
# with:
# target: ${{ matrix.platform.target }}
# args: --release --out dist -i python3.13t
# sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
Expand All @@ -123,13 +145,19 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: 'true'
# - name: Build free-threaded wheels
# uses: PyO3/maturin-action@v1
# with:
# target: ${{ matrix.platform.target }}
# args: --release --out dist -i python3.13t
# sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
Expand All @@ -154,12 +182,26 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [ linux, musllinux, windows, macos, sdist ]
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
needs: [linux, musllinux, windows, macos, sdist]
permissions:
# Use to sign the release artifacts
id-token: write
# Used to upload release artifacts
contents: write
# Used to generate artifact attestation
attestations: write
steps:
- uses: actions/download-artifact@v4
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: 'wheels-*/*'
- name: Publish to PyPI
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "py-horned-owl"
version = "1.1.0"
version = "1.2.0-dev1"
authors = ["Janna Hastings <[email protected]>"]
edition = "2018"

Expand Down
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
all: lib pyi

dev: mdev pyi

mdev: model docs
venv/bin/maturin develop

pyi: venv
venv/bin/python3 scripts/gen_pyi.py

docs: src/doc.rs

#src/doc.rs: venv
# venv/bin/python3 scripts/build_doc.py

model: venv
venv/bin/python3 scripts/build_model.py

lib: model docs
venv/bin/maturin build --release

venv:
python3 -m venv venv
venv/bin/pip3 install -r requirements.txt
Loading

0 comments on commit 1ea9e9f

Please sign in to comment.