Skip to content

Commit ed9558d

Browse files
use poe
1 parent 71198b6 commit ed9558d

File tree

5 files changed

+65
-18
lines changed

5 files changed

+65
-18
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
tests:
2121
needs: [pre-commit]
22-
name: "pytest"
22+
name: "pytest with uv"
2323
runs-on: ubuntu-latest
2424

2525
strategy:
@@ -43,8 +43,27 @@ jobs:
4343
with:
4444
token: ${{ secrets.CODECOV_TOKEN }}
4545

46+
test_pip_install:
47+
needs: [pre-commit]
48+
name: "pytest with pip install"
49+
runs-on: ubuntu-latest
50+
51+
steps:
52+
- uses: actions/checkout@v5
53+
54+
- name: Set up Python
55+
uses: actions/setup-python@v6
56+
with:
57+
python-version: "3.12"
58+
59+
- name: Install sopa with pip
60+
run: pip install -e . && pip install pytest-cov poethepoet
61+
62+
- name: Run short tests
63+
run: poe test_no_multimodal
64+
4665
deploy-docs:
47-
needs: [tests]
66+
needs: [tests, test_pip_install]
4867
if: contains(github.ref, 'tags')
4968
name: "Deploy documentation"
5069
runs-on: ubuntu-latest
@@ -58,7 +77,7 @@ jobs:
5877
run: uv run mkdocs gh-deploy --force
5978

6079
pypi-release:
61-
needs: [tests]
80+
needs: [tests, test_pip_install]
6281
if: contains(github.ref, 'tags')
6382
name: "PyPI release"
6483
runs-on: ubuntu-latest

CONTRIBUTING.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,8 @@ When create a pull request, tests are run automatically. But you can also run th
6464
To check the coverage of the tests:
6565

6666
```sh
67-
uv run coverage run -m pytest
67+
uv run poe test
6868

69-
# option 1: show the report in the console
70-
uv run coverage report
71-
72-
# option 2: generate and open a html report
73-
uv run coverage html
7469
open htmlcov/index.html
7570
```
7671

@@ -81,5 +76,5 @@ You can update the documentation in the `./docs` directory. Refer to the [mkdocs
8176
To serve the documentation locally:
8277

8378
```sh
84-
uv run mkdocs serve
79+
uv run poe docs
8580
```

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ dev = [
4646
"mkdocs-jupyter>=0.21.0",
4747
"mkdocstrings>=0.19.0",
4848
"mkdocstrings-python>=0.7.1",
49+
"poethepoet>=0.38.0",
4950
]
5051

5152
[project.urls]
@@ -76,6 +77,12 @@ ignore_missing_imports = true
7677
testpaths = ["tests"]
7778
python_files = "test_*.py"
7879

80+
[tool.poe.tasks]
81+
docs = "mkdocs serve"
82+
pre-commit = "pre-commit run --all-files"
83+
test = "pytest --cov --cov-config=pyproject.toml --cov-report=html --disable-warnings"
84+
test_no_multimodal = "pytest -m 'not multimodal' --cov --cov-config=pyproject.toml --cov-report=html --disable-warnings"
85+
7986
[tool.ruff]
8087
target-version = "py39"
8188
line-length = 120

tests/test_he.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import numpy as np
22
import pytest
3-
import sopa
4-
import torch
53

64
import novae
75

86

7+
@pytest.mark.multimodal
98
def test_he_embeddings():
9+
import sopa
10+
import torch
11+
1012
sdata1 = sopa.io.toy_dataset(as_output=True, genes=50)
1113
sdata2 = sopa.io.toy_dataset(as_output=True, genes=50)
1214

uv.lock

Lines changed: 30 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)