Skip to content

chore: test with old python version #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
15 changes: 13 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
uses: prefix-dev/[email protected]
with:
environments: dev
pixi-version: v0.42.1

- name: Ruff Format
if: always()
Expand Down Expand Up @@ -53,7 +52,19 @@ jobs:
uses: prefix-dev/[email protected]
with:
environments: dev
pixi-version: v0.42.1

- name: Run tests
run: pixi run --environment dev test --show-capture=all -s -vv

test-min-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Pixi
uses: prefix-dev/[email protected]
with:
environments: minpyver

- name: Run tests with min python
run: pixi run --environment minpyver test-min-python -v
19 changes: 18 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ dependencies = ["argparse-dataclass>=2.0.0", "ConfigArgParse>=1.7", "packaging >
name = "Johannes Koester"
email = "[email protected]"

[tool.pytest.ini_options]
pythonpath = [
"src"
]

[tool.coverage.run]
omit = ["**/tests.py"]

Expand All @@ -33,6 +38,7 @@ platforms = ["osx-arm64", "linux-64"]

[tool.pixi.environments]
dev = { features = ["dev"] }
minpyver = { features = ["minpyver"]}
publish = { features = ["publish"] }

[tool.pixi.feature.dev.dependencies]
Expand Down Expand Up @@ -71,16 +77,27 @@ cmd = [
"--cov=snakemake_interface_common",
"--cov-report=xml:coverage-report/coverage.xml",
"--cov-report=term-missing",
"tests/tests.py"
"tests/tests.py",
"tests/test_snakemake_dependent.py"
]
description = "Run tests and generate coverage report"

[tool.pixi.feature.minpyver.tasks.test-min-python]
cmd = [
"pytest",
"tests/tests.py"
]

[tool.pixi.feature.dev.tasks]
format = "ruff format src"
lint = "ruff check"
type-check = "mypy src/"
qc = { depends-on = ["format", "lint", "type-check"] }

[tool.pixi.feature.minpyver.dependencies]
python = "3.8.*"
pytest = "*"

# Publish
[tool.pixi.feature.publish.dependencies]
twine = ">=6.1.0,<7"
Expand Down
6 changes: 6 additions & 0 deletions tests/test_snakemake_dependent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from snakemake_interface_common import at_least_snakemake_version


def test_snakemake_version():
assert at_least_snakemake_version("8.1.0")
assert not at_least_snakemake_version("100.0.0")
8 changes: 1 addition & 7 deletions tests/tests.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from dataclasses import dataclass
import pytest

from snakemake_interface_common import at_least_snakemake_version
from snakemake_interface_common.exceptions import ApiError, WorkflowError
from snakemake_interface_common.plugin_registry.plugin import TaggedSettings
from snakemake_interface_common.rules import RuleInterface
Expand Down Expand Up @@ -70,9 +69,4 @@ def test_tagged_settings():
ts.register_settings(object())
ts.register_settings(object(), tag="foo")
ts.get_settings(tag="foo")
ts.get_settings()


def test_snakemake_version():
assert at_least_snakemake_version("8.1.0")
assert not at_least_snakemake_version("100.0.0")
ts.get_settings()