Skip to content

Python tooling, CI, and docs modernization - #26

Open
JudoWill wants to merge 3 commits into
DamLabResources:mainfrom
JudoWill:modernize
Open

Python tooling, CI, and docs modernization#26
JudoWill wants to merge 3 commits into
DamLabResources:mainfrom
JudoWill:modernize

Conversation

@JudoWill

Copy link
Copy Markdown
Contributor

Summary

This pull request modernizes the outerspace development workflow: standard pyproject.toml tool configuration, Ruff for lint and format, tox for reproducible test and doc builds, GitHub Actions for CI and PyPI publishing, MkDocs + Read the Docs for documentation, a GPL-3.0 license file, and optional pipeline extras so default installs and CI stay lighter. Default test runs and PR CI exercise unit tests only; long integration/functional tests are opt-in.

Motivation

  • Align with common Python packaging and contributor workflows (pip install -e ".[dev]", tox, pre-commit, RTD).
  • Keep CI fast by excluding Snakemake-heavy functional tests from the default path while still making them easy to run locally or in a dedicated tox environment.
  • Document the project and installation on PyPI/RTD and reduce machine-specific makefile usage for core dev tasks.

What changed

Packaging and dependencies

  • requires-python: >=3.9 (consistent with NumPy 2).
  • Optional extras: dev (pytest, coverage, tox, ruff, pre-commit, build, twine), docs (mkdocs, material, pymdown-extensions), pipeline (snakemake, pulp moved out of core dependencies).
  • [project.urls] for Home, Repo, Docs, Issues.
  • Pipeline command: Snakemake and pulp are loaded lazily in outerspace/cli/commands/pipeline.py so importing the CLI does not require the pipeline extra; running outerspace pipeline without the extra raises a clear install hint.

Lint and tests

  • Ruff configuration in pyproject.toml ([tool.ruff], [tool.ruff.lint], isort for outerspace).
  • Pytest markers: integration, functional. Default addopts run not integration and not functional. test_functional_*.py modules use pytestmark = pytest.mark.functional.
  • Coverage config under [tool.coverage.*] for the outerspace package.

Tox (see tox.ini)

  • tox -e ruff: Ruff check + ruff format --check.
  • tox -e py: Default unit suite (same marker filter as pyproject).
  • tox -e functional: integration or functional tests; uses [dev,pipeline] and --override-ini so marker selection works with the default addopts.
  • tox -e docs: mkdocs build --strict.

Continuous integration and release

  • .github/workflows/ci.yml: Ruff job + Python 3.9–3.12 matrix for tox -e py (unit tests only).
  • .github/workflows/publish.yml: Build sdist/wheel and publish to PyPI on release or v* tags (requires trusted publishing / GitHub “pypi” environment to be configured on the repo and PyPI).

Documentation site

  • mkdocs.yml, Material theme, nav over existing docs/*.md plus docs/index.md landing page.
  • .readthedocs.yaml: install package with the docs extra and run MkDocs.

Repository hygiene

  • LICENSE: full GPL-3.0 text (matches license metadata).
  • .pre-commit-config.yaml: Ruff (with fix) and Ruff format.
  • .gitignore: consider adding .tox/, dist/, htmlcov/, .ruff_cache/, .mypy_cache/, and .pytest_cache/ if not already present (keeps venv ignored for local conda envs).
  • makefile: VENV points at repo venv/; make test / make ruff call tox via $(VENV)/bin/python; make venv creates conda env and pip install -e ".[dev,pipeline]" + pre-commit.
  • README.md: Development section (conda venv, tox, pre-commit, RTD link).

How to test this PR

# Editable install with dev (and pipeline if you use pipeline tests)
pip install -e ".[dev,pipeline]"

# Fast path (should match CI)
tox -e ruff
tox -e py

# Optional full pipeline/integration tests
tox -e functional

# Docs
tox -e docs
# or: mkdocs serve

Read the Docs: import the project and point it at this branch; build should use .readthedocs.yaml and the docs extra.

PyPI publish: merge only after OIDC / trusted publishing is configured; dry-run on TestPyPI first is recommended.

Checklist (for maintainers)

  • RTD project created or updated to use the new config and default branch.
  • PyPI trusted publishing linked to this GitHub repo (if publishing is intended soon).
  • Changelog or release notes updated if you maintain a CHANGELOG (not required for this PR unless you add one later).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant