Skip to content

Commit

Permalink
update workflow stuff (#43)
Browse files Browse the repository at this point in the history
* update workflow stuff

* deprecate <3.11

* Update Cargo.toml
  • Loading branch information
diceroll123 authored Nov 10, 2024
1 parent 54c050a commit 11ffc52
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 44 deletions.
109 changes: 79 additions & 30 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,70 +17,92 @@ jobs:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ github.token }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: "Build wheels - x86_64"
uses: PyO3/maturin-action@v1
with:
target: x86_64
args: --release --find-interpreter --out dist
args: --release -i python${{ matrix.python-version }} --out dist
- name: Upload wheels
uses: actions/upload-artifact@v3
id: upload-macos-x86_64
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-macos-x86_64-${{ matrix.python-version }}
path: dist

macos-universal:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ github.token }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: "Build wheels - universal"
uses: PyO3/maturin-action@v1
with:
args: --release --find-interpreter --target universal2-apple-darwin --out dist
args: --release -i python${{ matrix.python-version }} --target universal2-apple-darwin --out dist
- name: Upload wheels
uses: actions/upload-artifact@v3
id: upload-macos-universal
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-macos-universal-${{ matrix.python-version }}
path: dist

windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
platform:
- target: x86_64-pc-windows-msvc
- target: i686-pc-windows-msvc
arch: x64
- target: aarch64-pc-windows-msvc
arch: x64
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ github.token }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.platform.arch }}
- name: "Build wheels - windows"
uses: PyO3/maturin-action@v1
with:
args: --release --find-interpreter --out dist --target ${{ matrix.platform.target }}
args: --release -i python${{ matrix.python-version }} --out dist
- name: Upload wheels
uses: actions/upload-artifact@v3
id: upload-windows
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-windows-${{ matrix.python-version }}-${{ matrix.platform.target }}
path: dist

linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
target:
- x86_64-unknown-linux-gnu
- i686-unknown-linux-gnu
Expand All @@ -89,24 +111,30 @@ jobs:
with:
submodules: recursive
token: ${{ github.token }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: "Build wheels - linux"
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: auto
command: build
args: --release --find-interpreter -o dist
args: --release -i python${{ matrix.python-version }} -o dist
- name: Upload wheels
uses: actions/upload-artifact@v3
id: upload-linux
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-linux-${{ matrix.python-version }}-${{ matrix.target }}
path: dist

linux-cross:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
platform:
- target: aarch64-unknown-linux-gnu
arch: aarch64
Expand All @@ -124,24 +152,30 @@ jobs:
with:
submodules: recursive
token: ${{ github.token }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: "Build wheels - linux-cross"
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
manylinux: auto
docker-options: ${{ matrix.platform.maturin_docker_options }}
args: --release --find-interpreter -o dist
args: --release -i python${{ matrix.python-version }} -o dist
- name: Upload wheels
uses: actions/upload-artifact@v3
id: upload-linux-cross
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-linux-cross-${{ matrix.python-version }}-${{ matrix.platform.target }}
path: dist

musllinux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
target:
- x86_64-unknown-linux-musl
- i686-unknown-linux-musl
Expand All @@ -150,23 +184,29 @@ jobs:
with:
submodules: recursive
token: ${{ github.token }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: "Build wheels - musllinux"
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: musllinux_1_2
args: --release --find-interpreter -o dist
args: --release -i python${{ matrix.python-version }} -o dist
- name: Upload wheels
uses: actions/upload-artifact@v3
id: upload-musllinux
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-musllinux-${{ matrix.python-version }}-${{ matrix.target }}
path: dist

musllinux-cross:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
platform:
- target: aarch64-unknown-linux-musl
arch: aarch64
Expand All @@ -178,22 +218,28 @@ jobs:
with:
submodules: recursive
token: ${{ github.token }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: "Build wheels - musllinux-cross"
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
manylinux: musllinux_1_2
args: --release --find-interpreter -o dist
args: --release -i python${{ matrix.python-version }} -o dist
docker-options: ${{ matrix.platform.maturin_docker_options }}
- name: Upload wheels
uses: actions/upload-artifact@v3
id: upload-musllinux-cross
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-musllinux-cross-${{ matrix.python-version }}-${{ matrix.platform.target }}
path: dist

release:
name: Release
runs-on: ubuntu-latest
permissions:
id-token: write
needs:
- linux
- linux-cross
Expand All @@ -204,13 +250,16 @@ jobs:
- windows
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v3
- name: "Install uv"
uses: astral-sh/setup-uv@v3
with:
name: wheels
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
version: "0.5.1"
- uses: actions/download-artifact@v4
with:
command: upload
args: --skip-existing *
pattern: wheels-*
path: wheels
merge-multiple: true
- name: Publish to PyPi
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: uv publish -v wheels/*
5 changes: 1 addition & 4 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.27"

- name: Set up Python
run: uv python install 3.13
version: "0.5.1"

- name: Run tests
shell: bash
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
Expand All @@ -29,7 +27,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.27"
version: "0.5.1"

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name = "neofoodclub"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.22.5", features = ["extension-module", "abi3-py39", "chrono", "chrono-tz"] }
pyo3 = { version = "0.22.6", features = ["extension-module", "abi3-py311", "chrono", "chrono-tz"] }
neofoodclub = { path = "./neofoodclub_rs" }
chrono = "0.4.38"
chrono-tz = "0.10.0"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Notes:

## Installing

**Python 3.9 or higher is suggested**
**Python 3.11 or higher is required**

```sh
pip install neofoodclub
Expand Down
8 changes: 3 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ name = "neofoodclub.py"
version = "1.0.12"
description = "A Python implementation of functionality used in https://neofood.club"
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.11"
dependencies = []
classifiers=[
"Programming Language :: Rust",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
Expand Down Expand Up @@ -40,12 +38,12 @@ exclude = [
]
reportUnnecessaryTypeIgnoreComment = "warning"
reportUnusedImport = "error"
pythonVersion = "3.9"
pythonVersion = "3.11"
typeCheckingMode = "basic"

[tool.ruff]
show-fixes = true
target-version = "py39"
target-version = "py311"

[tool.ruff.lint]
extend-select = [
Expand Down

0 comments on commit 11ffc52

Please sign in to comment.