Skip to content

Commit

Permalink
feat: add python testing
Browse files Browse the repository at this point in the history
  • Loading branch information
zietzm committed Aug 27, 2024
1 parent 3b85a93 commit 475744f
Show file tree
Hide file tree
Showing 4 changed files with 429 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,17 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test
test-python:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
- run: source $HOME/.cargo/env
- run: uv venv --python ${{ matrix.python-version }}
- run: uv pip install ruff pytest
- run: uv sync
- run: uv run ruff check
- run: uv run pytest -v
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies = [
"zstandard>=0.23.0",
]
readme = "README.md"
requires-python = ">= 3.8"
requires-python = ">= 3.10"

[build-system]
requires = ["maturin>=1.2,<2.0"]
Expand All @@ -21,9 +21,16 @@ build-backend = "maturin"
managed = true
dev-dependencies = [
"pytest>=8.3.2",
"ruff>=0.6.2",
]

[tool.maturin]
python-source = "python"
module-name = "igwas._lowlevel"
features = ["pyo3/extension-module"]

[tool.uv]
dev-dependencies = [
"ruff>=0.6.2",
"pytest>=8.3.2",
]
1 change: 1 addition & 0 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ mod tests {
"plink.glm.linear.zst",
"plink.glm.linear.gz",
"plink.glm.linear.zst.gz",
"here/is/a/path/plink.glm.linear.zst.gz",
];
for path in paths.iter() {
let result = crate::util::gwas_path_to_phenotype(path);
Expand Down
Loading

0 comments on commit 475744f

Please sign in to comment.