Skip to content

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Aug 9, 2024
1 parent 8516e2c commit 8738539
Show file tree
Hide file tree
Showing 256 changed files with 6,317 additions and 5,568 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/crates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy Crates

on:
push:
tags:
- "*"
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install and configure Poetry
uses: snok/install-poetry@v1
- name: Install task runner
run: pip install poethepoet
- name: Bump versions
run: |
poetry install --only version
poe bump-version
- name: Publish crates
run: |
jq '.[]' crates/release.json | xargs -I _ cargo publish -p _ --allow-dirty
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
123 changes: 123 additions & 0 deletions .github/workflows/maturin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Deploy Maturin wheels

on:
push:
tags:
- "*"
workflow_dispatch:

permissions:
contents: read

jobs:
linux:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-latest
target: x86_64
- runner: ubuntu-latest
target: x86
- runner: ubuntu-latest
target: aarch64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter -m crates/eko/Cargo.toml
sccache: "true"
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.platform.target }}
path: dist

windows:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: windows-latest
target: x64
- runner: windows-latest
target: x86
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
architecture: ${{ matrix.platform.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter -m crates/eko/Cargo.toml
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-windows-${{ matrix.platform.target }}
path: dist

macos:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: macos-latest
target: x86_64
- runner: macos-14
target: aarch64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter -m crates/eko/Cargo.toml
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.platform.target }}
path: dist

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist -m crates/eko/Cargo.toml
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: dist

release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, windows, macos, sdist]
steps:
- uses: actions/download-artifact@v4
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
publish:
uses: N3PDF/workflows/.github/workflows/python-poetry-pypi.yml@v2
uses: NNPDF/workflows/.github/workflows/python-poetry-pypi.yml@v2
secrets:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
with:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/unittests-rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Rust unit tests

on: push

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install task runner
run: pip install poethepoet
- name: Run fmt
run: |
poe fmtcheck
- name: Run clippy
run: |
poe clippy
- name: Run Rust unit tests
run: |
poe rtest
6 changes: 3 additions & 3 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: tests
name: Python unit tests

on: push

jobs:
test:
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
fail-fast: false

uses: N3PDF/workflows/.github/workflows/python-poetry-tests.yml@v2
uses: NNPDF/workflows/.github/workflows/python-poetry-tests.yml@v2
with:
python-version: ${{ matrix.python-version }}
poetry-extras: "-E mark -E box"
36 changes: 17 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# See https://pre-commit.com/hooks.html for more hooks
ci:
autofix_prs: false
skip: [fmt-eko, fmt-ekore]
skip: [fmt] # will be run by a separate CI
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -19,11 +19,11 @@ repos:
- id: pycln
args: [--config=pyproject.toml]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.12.1
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
rev: 1.18.0
hooks:
- id: blacken-docs
- repo: https://github.com/pycqa/isort
Expand All @@ -32,7 +32,7 @@ repos:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.17.0
hooks:
- id: pyupgrade
- repo: https://github.com/pycqa/pydocstyle
Expand All @@ -43,25 +43,23 @@ repos:
args: ["--add-ignore=D107,D105"]
additional_dependencies:
- toml
- repo: local
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.4.1
hooks:
- id: fmt-eko
name: fmt-eko
description: Format eko files with cargo fmt.
entry: cargo fmt --manifest-path crates/eko/Cargo.toml --
language: system
files: ^crates/eko/.*\.rs$
args: []
- id: mypy
additional_dependencies: [types-PyYAML]
pass_filenames: false
args: ["--ignore-missing-imports", "src/"]
- repo: local
hooks:
- id: fmt-ekore
name: fmt-ekore
description: Format ekore files with cargo fmt.
entry: cargo fmt --manifest-path crates/ekore/Cargo.toml --
- id: fmt
name: fmt
description: Format Rust files with cargo fmt.
entry: cargo fmt --
language: system
files: ^crates/ekore/.*\.rs$
files: ^crates/.*\.rs$
args: []
- repo: https://github.com/pre-commit/pre-commit
rev: v3.6.0
rev: v3.8.0
hooks:
- id: validate_manifest
12 changes: 6 additions & 6 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# for poetry see https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-poetry

# Required
version: 2

build:
Expand All @@ -9,17 +13,13 @@ build:
jobs:
post_create_environment:
- pip install poetry
- poetry config virtualenvs.create false
post_install:
- poetry install --with docs
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with docs

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: doc/source/conf.py

# Optionally build your docs in additional formats such as PDF
# formats:
# - pdf

python:
install:
- method: pip
Expand Down
52 changes: 2 additions & 50 deletions crates/Cargo.lock → Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8738539

Please sign in to comment.