Skip to content

refactor: move docs/requirements.txt into pyproject.toml [docs] extra…#191

Open
jonathanhhb wants to merge 3 commits into
mainfrom
refactor/docs-deps-in-pyproject
Open

refactor: move docs/requirements.txt into pyproject.toml [docs] extra…#191
jonathanhhb wants to merge 3 commits into
mainfrom
refactor/docs-deps-in-pyproject

Conversation

@jonathanhhb

Copy link
Copy Markdown
Collaborator

… (#180)

Brings laser-generic in line with peer projects (laser-core, laser-measles), which already expose docs deps as a [project.optional-dependencies] extra.

Changes:

  • pyproject.toml: add docs extra containing the 14 mkdocs-ecosystem packages from the old requirements.txt, plus matplotlib (needed for notebook execution during docs build; not otherwise a runtime dep). Runtime deps (numpy, scipy, pandas, laser-core) are not duplicated because they're already in the main dependencies list.
  • Three workflows (mkdocs-ghp.yml, mkdocs-pr.yml, release-publish.yml): replace the three-line pip install -e . + pip install mkdocs ...
    • pip install -r docs/requirements.txt block with a single pip install --index-url <IDM Artifactory> -e ".[docs]". The IDM index URL is preserved from the requirements.txt header (--index-url, not --extra-index-url, since the original file made IDM the sole source).
  • docs/requirements.txt: deleted.

CHANGELOG.md still mentions docs/requirements.txt in a historical entry; that's intentional — historical changelog entries stay accurate to what shipped at the time.

…#180)

Brings laser-generic in line with peer projects (laser-core, laser-measles),
which already expose docs deps as a [project.optional-dependencies] extra.

Changes:
- pyproject.toml: add `docs` extra containing the 14 mkdocs-ecosystem
  packages from the old requirements.txt, plus `matplotlib` (needed for
  notebook execution during docs build; not otherwise a runtime dep).
  Runtime deps (numpy, scipy, pandas, laser-core) are not duplicated
  because they're already in the main `dependencies` list.
- Three workflows (mkdocs-ghp.yml, mkdocs-pr.yml, release-publish.yml):
  replace the three-line `pip install -e .` + `pip install mkdocs ...`
  + `pip install -r docs/requirements.txt` block with a single
  `pip install --index-url <IDM Artifactory> -e ".[docs]"`. The IDM
  index URL is preserved from the requirements.txt header (--index-url,
  not --extra-index-url, since the original file made IDM the sole
  source).
- docs/requirements.txt: deleted.

CHANGELOG.md still mentions docs/requirements.txt in a historical
entry; that's intentional — historical changelog entries stay accurate
to what shipped at the time.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@jonathanhhb

Copy link
Copy Markdown
Collaborator Author

Note on the workflow filename: On origin/main, the PR-build workflow is mkdocs-pr.yml. The mkdocs-pr-notebooks.yml version (path-gated with notebook execution) only exists on your ci/pr-notebook-execution branch and isn't yet on main. So this refactor PR updates mkdocs-pr.yml. When you merge ci/pr-notebook-execution, that PR's workflow rename will need to either come after this refactor (and pick up [docs]) or be reconciled at merge time. Worth flagging in the PR description so the order-of-operations is clear.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors documentation dependency management by moving docs/requirements.txt into a docs optional-dependency extra in pyproject.toml, and updates CI workflows to install docs dependencies via pip install -e ".[docs]".

Changes:

  • Added a docs extra under [project.optional-dependencies] containing the MkDocs ecosystem dependencies (plus matplotlib).
  • Updated MkDocs build/deploy workflows to install with -e ".[docs]" instead of installing from docs/requirements.txt.
  • Removed docs/requirements.txt.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pyproject.toml Adds docs optional-dependency extra for documentation build dependencies.
.github/workflows/release-publish.yml Switches docs install step to use -e ".[docs]" from the IDM index.
.github/workflows/mkdocs-pr.yml Switches docs install step to use -e ".[docs]" (but currently contains a YAML indentation bug).
.github/workflows/mkdocs-ghp.yml Switches docs install step to use -e ".[docs]" from the IDM index.
docs/requirements.txt Deleted; docs deps are now sourced from pyproject.toml.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml
Comment thread .github/workflows/mkdocs-pr.yml
Jonathan Bloedow and others added 2 commits June 2, 2026 12:30
…180)

The tox docs env still referenced the deleted docs/requirements.txt,
which broke the GitHub Actions tox -e docs job:

    docs: failed with Could not open requirements file
    /home/runner/work/laser-generic/laser-generic/docs/requirements.txt

Replace `deps = -r{toxinidir}/docs/requirements.txt` with
`extras = docs` so tox installs the project with the new [docs] extra
declared in pyproject.toml. Add `setenv = PIP_INDEX_URL=...` to
preserve the IDM Artifactory index that was previously declared at the
top of requirements.txt — necessary so PIP_INDEX_URL flows through
even though tox 4's per-env passenv doesn't always inherit.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

3 participants