Skip to content

Commit

Permalink
Merge branch 'main' into add_consume_file
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamtaranto committed Oct 2, 2024
2 parents 556e6b5 + e5aac64 commit 5d31c76
Show file tree
Hide file tree
Showing 23 changed files with 484 additions and 93 deletions.
111 changes: 81 additions & 30 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is autogenerated by maturin v1.4.0
# This file is autogenerated by maturin v1.7.1
# To update, run
#
# maturin generate-ci github
Expand All @@ -9,7 +9,6 @@ on:
push:
branches:
- main
- master
tags:
- '*'
pull_request:
Expand All @@ -20,71 +19,122 @@ permissions:

jobs:
linux:
runs-on: ubuntu-latest
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
platform:
- runner: ubuntu-latest
target: x86_64
- runner: ubuntu-latest
target: x86
- runner: ubuntu-latest
target: aarch64
- runner: ubuntu-latest
target: armv7
- runner: ubuntu-latest
target: s390x
- runner: ubuntu-latest
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.target }}
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-linux-${{ matrix.platform.target }}
path: dist

musllinux:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-latest
target: x86_64
- runner: ubuntu-latest
target: x86
- runner: ubuntu-latest
target: aarch64
- runner: ubuntu-latest
target: armv7
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
manylinux: musllinux_1_2
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-musllinux-${{ matrix.platform.target }}
path: dist

windows:
runs-on: windows-latest
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
target: [x64, x86]
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.target }}
python-version: 3.x
architecture: ${{ matrix.platform.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-windows-${{ matrix.platform.target }}
path: dist

macos:
runs-on: macos-latest
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
target: [x86_64, aarch64]
platform:
- runner: macos-12
target: x86_64
- runner: macos-14
target: aarch64
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.target }}
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-macos-${{ matrix.platform.target }}
path: dist

sdist:
Expand All @@ -97,24 +147,25 @@ jobs:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-sdist
path: dist

release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, windows, macos, sdist]
if: "startsWith(github.ref, 'refs/tags/v')"
needs: [linux, musllinux, windows, macos, sdist]
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: wheels
- 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 *
args: --non-interactive --skip-existing wheels-*/*
34 changes: 34 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Python Tests

on: [pull_request]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"] # Test with Python 3.10 to the latest available version

steps:
# Checkout the latest commit associated with the PR
- uses: actions/checkout@v4

- name: Debug matrix value
run: echo "Python version is ${{ matrix.python-version }}"

# Set up Python based on the matrix version
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

# Install dependencies, including test dependencies from pyproject.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install '.[test]' # Install all dependencies, including test-specific ones
# Run pytest on the specified directory
- name: Run tests
run: pytest src/python/tests
3 changes: 2 additions & 1 deletion .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Ruff Formatting
on: [push, pull_request]
on: [pull_request]
jobs:
ruff:
runs-on: ubuntu-latest
Expand All @@ -10,6 +10,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
token: ${{ secrets.ACTION_TOKEN }}
- uses: chartboost/ruff-action@v1
with:
src: './src/python'
Expand Down
34 changes: 34 additions & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Image source code: https://github.com/axonasif/workspace-images/tree/tmp
# Also see https://github.com/gitpod-io/workspace-images/issues/1071
FROM axonasif/workspace-base@sha256:8c057b1d13bdfe8c279c68aef8242d32110c8d5310f9a393f9c0417bc61367d9

# Set user
USER gitpod

# Install Miniconda
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py311_24.1.2-0-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p $HOME/miniconda && \
rm ~/miniconda.sh

# Add Miniconda to PATH
ENV PATH="$HOME/miniconda/bin:$PATH"

# Initialize conda in bash config files:
RUN conda init bash

# Set up Conda channels
RUN conda config --add channels conda-forge && \
conda config --add channels bioconda && \
conda config --set channel_priority strict

# Set libmamba as solver
RUN conda config --set solver libmamba

# Persist ~/ (HOME) and lib
RUN echo 'create-overlay $HOME /lib' > "$HOME/.runonce/1-home-lib_persist"

# Referenced in `.vscode/settings.json`
ENV PYTHON_INTERPRETER="$HOME/miniconda/bin/python"

# Pycharm recognizes this variables
ENV PYCHARM_PYTHON_PATH="${PYTHON_INTERPRETER}"
25 changes: 25 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
image:
file: .gitpod.Dockerfile

tasks:
- name: Init Gitpod Workspace
init: |
conda install --yes --solver=libmamba -c conda-forge -c bioconda "compilers" "maturin>=1,<2" "pytest" "rust" "scipy" "toml"
conda clean --all --yes
command: |
echo "Running: $GITPOD_WORKSPACE_URL"
ports:
- name: Jupyter Notebook
port: 8888
onOpen: open-browser

vscode:
extensions:
- eamodio.gitlens
- github.vscode-pull-request-github
- janisdd.vscode-edit-csv
- mechatroner.rainbow-csv
- ms-python.debugpy
- ms-python.python

2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oxli"
version = "0.2.3"
version = "0.3.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
Loading

0 comments on commit 5d31c76

Please sign in to comment.