Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Run CI

on:
push:
branches: [master]
pull_request:

jobs:
tests:
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
name: Run tests
steps:
- name: Checkout repo
uses: actions/checkout@v5.0.0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6.0.0
with:
python-version: ${{ matrix.python-version }}

- name: Install Crossflow and its testing dependencies
run: pip install -e .[testing]

- name: Run test suite
run: pytest --cov crossflow --cov-report term-missing --cov-append .

- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v2.3.6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

docs:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v5.0.0
- name: Set up Python 3.13
uses: actions/setup-python@v6.0.0
with:
python-version: 3.13
- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -e .[docs]
- name: Build docs
run: cd docs && make

pre-commit:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v5.0.0
- name: Set up Python 3.13
uses: actions/setup-python@v6.0.0
with:
python-version: 3.13
- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -e .[pre-commit,docs,testing]
- name: Run pre-commit
run: |
pre-commit install
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
41 changes: 0 additions & 41 deletions .github/workflows/python-package.yml

This file was deleted.

140 changes: 140 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@

name: release

on:
workflow_dispatch:
inputs:
version:
required: true
default: 'x.y.z'

permissions:
contents: write
pull-requests: write

jobs:
checks:
name: Version check
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
id: repo
uses: actions/checkout@v5.0.0

- name: Set up Python
uses: actions/setup-python@v6.0.0
with:
python-version: 3.13

- name: Get latest release from pip
id: latestreleased
run: |
PREVIOUS_VERSION=$(python -m pip index versions crossflow | grep "crossflow" | cut -d "(" -f2 | cut -d ")" -f1)
echo "pip_tag=$PREVIOUS_VERSION" >> "$GITHUB_OUTPUT"
echo $PREVIOUS_VERSION

- name: version comparison
id: compare
run: |
pip3 install semver
output=$(pysemver compare ${{ steps.latestreleased.outputs.pip_tag }} ${{ github.event.inputs.version }})
if [ $output -ge 0 ]; then exit 1; fi

version:
name: prepare ${{ github.event.inputs.version }}
needs: checks
runs-on: ubuntu-24.04
steps:

- name: checkout
uses: actions/checkout@v5.0.0

- name: Change version in repo
run: sed -i "s/__version__ =.*/__version__ = \"${{ github.event.inputs.version }}\"/g" crossflow/__init__.py

- name: send PR
id: pr_id
uses: peter-evans/create-pull-request@v7.0.8
with:
commit-message: Update version to ${{ github.event.inputs.version }}
branch: version-update
title: "Update to version ${{ github.event.inputs.version }}"
body: |
Update version
- Update the __init__.py with new release
- Auto-generated by [CI]
committer: version-updater <vu.bot@users.noreply.github.com>
author: version-updater <vu.bot@users.noreply.github.com>
base: main
signoff: false
draft: false

- name: auto approve review
uses: hmarr/auto-approve-action@v4.0.0
with:
pull-request-number: ${{ steps.pr_id.outputs.pull-request-number }}
review-message: "Auto approved version bump PR"
github-token: ${{ secrets.AUTO_PR_MERGE }}

- name: merge PR
run: gh pr merge --merge --delete-branch --auto "${{ steps.pr_id.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

tag:
name: tag release
needs: version
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v5.0.0
with:
ref: main

- name: tag v${{ github.event.inputs.version }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git tag ${{ github.event.inputs.version }}
git push origin tag ${{ github.event.inputs.version }}

release:
name: make github release
needs: tag
runs-on: ubuntu-24.04
steps:

- name: create release
uses: softprops/action-gh-release@v2.3.3
with:
name: v${{ github.event.inputs.version }}
generate_release_notes: true
tag_name: ${{ github.event.inputs.version }}

pypi:
name: make pypi release
needs: [tag, release]
runs-on: ubuntu-24.04
steps:

- name: checkout
uses: actions/checkout@v5.0.0
with:
ref: main

- name: Set up Python
uses: actions/setup-python@v6.0.0
with:
python-version: 3.13

- name: Install flit
run: |
python -m pip install --upgrade pip
python -m pip install flit~=3.9

- name: Build and publish
run: |
flit publish
env:
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
133 changes: 129 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,133 @@
# Byte-compiled / optimized / DLL files
__pycache__/
.vscode
.idea
*.egg_info/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
.pytest_cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/
docs/autosummary/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# result and temp file
*.out
*.obj
*.npz
*.pkl
*.csv
Example_output/
Example/data/*.csv

# profraw files from LLVM? Unclear exactly what triggers this
# There are reports this comes from LLVM profiling, but also Xcode 9.
*profraw
# trajectory file too big
Example/data/1AKI_prod.trr
Example/data/1AKI_prod.tpr

# output directories, log file and outputs
job*
*.json
*.err
*.com
*.txt
.idea

# dask
dask-worker-space
.ipynb_checkpoints/

# visual studio
.vscode
Loading