Skip to content

Commit

Permalink
Merge branch 'master' into manipulate-operators
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Jul 15, 2024
2 parents 3e2d12a + 38cc28c commit 08c55d3
Show file tree
Hide file tree
Showing 259 changed files with 570,321 additions and 507,699 deletions.
11 changes: 11 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
fi

nix_direnv_watch_file devenv.nix
nix_direnv_watch_file devenv.lock
nix_direnv_watch_file devenv.yaml
if ! use flake . --impure
then
echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2
fi
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"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,4 @@ validation-report.json

# Folders to ignore
node_modules
.devenv
26 changes: 18 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
# See https://pre-commit.com/hooks.html for more hooks
ci:
autofix_prs: false
skip: [fmt] # will be run by a separate CI
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -13,25 +14,25 @@ repos:
- id: check-merge-conflict
- id: debug-statements
- repo: https://github.com/hadialqattan/pycln
rev: v2.1.5
rev: v2.4.0
hooks:
- id: pycln
args: [--config=pyproject.toml]
- repo: https://github.com/psf/black
rev: 23.7.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: 1.15.0
rev: 1.18.0
hooks:
- id: blacken-docs
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.9.0
rev: v3.16.0
hooks:
- id: pyupgrade
- repo: https://github.com/pycqa/pydocstyle
Expand All @@ -42,7 +43,16 @@ repos:
args: ["--add-ignore=D107,D105"]
additional_dependencies:
- toml
- repo: local
hooks:
- id: fmt
name: fmt
description: Format Rust files with cargo fmt.
entry: cargo fmt --
language: system
files: ^crates/.*\.rs$
args: []
- repo: https://github.com/pre-commit/pre-commit
rev: v3.3.3
rev: v3.7.1
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
Loading

0 comments on commit 08c55d3

Please sign in to comment.