Skip to content

Commit e048ef2

Browse files
emmcauleyyfarjoungeoffjentrytfennenh13
committed
Initial commit
Co-authored-by: Yossi Farjoun <[email protected]> Co-authored-by: Jeff Gentry <[email protected]> Co-authored-by: Tim Fennell <[email protected]> Co-authored-by: Nils Homer <[email protected]> Co-authored-by: Erin McAuley <[email protected]> Co-authored-by: Matt Stone <[email protected]>
0 parents  commit e048ef2

File tree

101 files changed

+13460
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+13460
-0
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Default owners: Nils and Tim
2+
* @nh13 @tfenne

.github/workflows/publish.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
tags: '\d+.\d+.\d+'
6+
7+
env:
8+
POETRY_VERSION: 1.8.2
9+
10+
jobs:
11+
on-main-branch-check:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
on_main: ${{ steps.contains_tag.outputs.retval }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- uses: rickstaa/action-contains-tag@v1
21+
id: contains_tag
22+
with:
23+
reference: "main"
24+
tag: "${{ github.ref_name }}"
25+
26+
tests:
27+
name: tests
28+
needs: on-main-branch-check
29+
if: ${{ needs.on-main-branch-check.outputs.on_main == 'true' }}
30+
uses: "./.github/workflows/tests.yml"
31+
32+
build-wheels:
33+
name: build wheels
34+
needs: tests
35+
uses: "./.github/workflows/wheels.yml"
36+
37+
build-sdist:
38+
name: build source distribution
39+
needs: tests
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v4
43+
with:
44+
fetch-depth: 0
45+
submodules: true
46+
47+
- uses: actions/setup-python@v5
48+
with:
49+
python-version: 3.12
50+
51+
- name: Install poetry
52+
run: |
53+
python -m pip install --upgrade pip
54+
python -m pip install poetry==${{env.POETRY_VERSION}}
55+
56+
- name: Configure poetry
57+
shell: bash
58+
run: poetry config virtualenvs.in-project true
59+
60+
- name: Install dependencies
61+
run: poetry install --no-interaction --no-root --without=dev
62+
63+
- name: Install project
64+
run: poetry install --no-interaction --without=dev
65+
66+
- name: Build package
67+
run: poetry build --format=sdist
68+
69+
- uses: actions/upload-artifact@v4
70+
with:
71+
name: prymer-sdist
72+
path: dist/*.tar.gz
73+
74+
publish-to-pypi:
75+
runs-on: ubuntu-latest
76+
needs: [build-wheels, build-sdist]
77+
environment: pypi
78+
permissions:
79+
id-token: write
80+
steps:
81+
- uses: actions/download-artifact@v4
82+
with:
83+
path: packages
84+
pattern: 'prymer-*'
85+
merge-multiple: true
86+
87+
- uses: pypa/gh-action-pypi-publish@release/v1
88+
with:
89+
packages-dir: packages/
90+
skip-existing: true
91+
verbose: true
92+
93+
make-changelog:
94+
runs-on: ubuntu-latest
95+
needs: publish-to-pypi
96+
outputs:
97+
release_body: ${{ steps.git-cliff.outputs.content }}
98+
steps:
99+
- name: Checkout the Repository at the Tagged Commit
100+
uses: actions/checkout@v4
101+
with:
102+
fetch-depth: 0
103+
ref: ${{ github.ref_name }}
104+
105+
- name: Generate a Changelog
106+
uses: orhun/git-cliff-action@v3
107+
id: git-cliff
108+
with:
109+
config: pyproject.toml
110+
args: --latest --verbose
111+
env:
112+
GITHUB_REPO: ${{ github.repository }}
113+
114+
make-github-release:
115+
runs-on: ubuntu-latest
116+
environment: github
117+
permissions:
118+
contents: write
119+
pull-requests: read
120+
needs: make-changelog
121+
steps:
122+
- name: Create Draft Release
123+
id: create_release
124+
uses: softprops/action-gh-release@v2
125+
with:
126+
name: ${{ github.ref_name }}
127+
body: |
128+
${{ needs.draft-changelog.outputs.release_body }}
129+
draft: false
130+
prerelease: false

.github/workflows/tests.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
tags:
8+
- "!**"
9+
workflow_call:
10+
11+
env:
12+
POETRY_VERSION: 1.8.2
13+
14+
jobs:
15+
Tests:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
PYTHON_VERSION: ["3.11", "3.12"]
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Checkout fulcrumgenomics/bwa
23+
uses: actions/checkout@v4
24+
with:
25+
repository: fulcrumgenomics/bwa
26+
ref: interactive_aln
27+
path: bwa
28+
fetch-depth: 0
29+
30+
- name: Set up Python ${{ matrix.PYTHON_VERSION }}
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: ${{ matrix.PYTHON_VERSION }}
34+
35+
- name: Set up miniconda
36+
uses: conda-incubator/setup-miniconda@v3
37+
with:
38+
miniforge-variant: Mambaforge
39+
miniforge-version: latest
40+
channels: conda-forge,bioconda
41+
activate-environment: prymer
42+
environment-file: prymer.yml
43+
channel-priority: true
44+
auto-update-conda: true
45+
auto-activate-base: false
46+
python-version: ${{ matrix.PYTHON_VERSION }}
47+
48+
- name: Install fulcrumgenomics/bwa
49+
shell: bash -l {0}
50+
run: |
51+
conda activate prymer
52+
pushd bwa
53+
make -j $(nproc)
54+
cp bwa ${CONDA_PREFIX}/bin
55+
popd
56+
57+
- name: Configure poetry and check lock file
58+
shell: bash -l {0}
59+
run: |
60+
conda activate prymer
61+
poetry config virtualenvs.in-project false
62+
poetry check --lock
63+
64+
- name: Poetry install
65+
shell: bash -l {0}
66+
run: |
67+
conda activate prymer
68+
poetry lock --no-update
69+
poetry install --with dev
70+
71+
- name: Unit tests (with doctest and coverage)
72+
shell: bash -l {0}
73+
run: |
74+
conda activate prymer
75+
poetry run pytest --cov=prymer --cov-report=xml --cov-branch --doctest-plus --doctest-modules prymer tests
76+
77+
- name: Upload coverage reports to Codecov
78+
uses: codecov/[email protected]
79+
with:
80+
token: ${{ secrets.CODECOV_TOKEN }}
81+
82+
- name: Style checking
83+
shell: bash -l {0}
84+
run: |
85+
conda activate prymer
86+
poetry run ruff format --check
87+
88+
- name: Run lint
89+
shell: bash -l {0}
90+
run: |
91+
conda activate prymer
92+
poetry run ruff check
93+
94+
- name: Run mypy
95+
shell: bash -l {0}
96+
run: |
97+
conda activate prymer
98+
poetry run mypy
99+
100+
- name: Run docs
101+
shell: bash -l {0}
102+
run: |
103+
conda activate prymer
104+
set -euo pipefail
105+
poetry run mkdocs build --strict

.github/workflows/wheels.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: build wheels
2+
3+
on:
4+
pull_request:
5+
workflow_call:
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-wheels:
10+
name: Build wheels for ${{ matrix.python }}
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python: ["3.11", "3.12"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
submodules: "true"
20+
21+
- name: Set up Python ${{ matrix.PYTHON_VERSION }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python }}
25+
26+
- name: Build wheels
27+
run: pip wheel -w wheelhouse .
28+
29+
- name: Upload wheels
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: prymer-wheels-${{ matrix.python }}
33+
path: ./wheelhouse/*.whl
34+
if-no-files-found: error

0 commit comments

Comments
 (0)