pelican: install lint deps from pyproject.toml#717
Merged
Conversation
The lint job tried `pip install -r requirements.txt --no-deps` but pelican no longer has a requirements.txt — it ships a PEP 621 pyproject.toml. Replace the missing-file install with `pip install ./pelican`, which picks up the runtime dependencies declared in pelican/pyproject.toml. The mypy / pylint type-stub install line is unchanged; those tools are still needed on top of the runtime deps for the type-checking and pylint steps.
Move mypy, pylint and the types-* stubs into
`pelican/pyproject.toml`'s PEP 735 `dev` dependency group so they
are declared alongside ruff / pytest rather than hard-coded in the
workflow.
In `.github/workflows/linting.yml`, set up uv via
`astral-sh/setup-uv` (pinned to the same SHA used elsewhere in the
repo) and replace the `pip install ./pelican` flow with:
cd pelican
uv sync --no-install-project --group dev
`--no-install-project` drops installing `apache-pelican-action`
itself — we only need the runtime deps plus the dev group. mypy and
pylint then run via `uv run --no-sync` so `uv run` does not
implicitly rebuild and install the project before the check.
Locally verified with `uv sync --no-install-project --group dev`
followed by `uv run --no-sync mypy` and `uv run --no-sync pylint`
against a clean copy of pelican/ — both pass and
`apache-pelican-action` is absent from the resulting venv.
`uv run` implicitly creates the venv, installs the project's runtime dependencies and the default `dev` group on its first invocation, so the separate `uv sync --no-install-project --group dev` step is redundant. Drop that step and call `uv run mypy` / `uv run pylint` directly. Subsequent `uv run` calls reuse the same venv.
Turn on `astral-sh/setup-uv`'s built-in CI cache and key it on `pelican/uv.lock`. With the cache enabled, the implicit sync that `uv run` performs on first invocation restores from cache instead of redownloading the runtime deps and the `dev` group on every run.
Hoist the `cd pelican` from each run step into a job-level `defaults.run.working-directory: pelican`. Every `run:` step now executes from pelican/; `uses:` steps are unaffected, so setup-uv's `cache-dependency-glob` still resolves `pelican/uv.lock` from the repository root.
Add `>=` floors to the four `types-*` stub packages in the `dev`
dependency group so every entry in pelican/pyproject.toml has an
explicit minimum version (matching the style of the rest of the
project and dev dependencies):
types-PyYAML>=6.0
types-requests>=2.33
types-beautifulsoup4>=4.12
types-markdown>=3.10
Floors track the runtime deps the stubs cover. `uv lock` still
resolves to the same concrete versions.
Recent pylint versions no longer recognize `suggestion-mode=yes` and emit `E0015: Unrecognized option found: suggestion-mode` at the top of every run. Remove the option (and its now-orphaned comment) so pylint output is clean.
GitHub Actions log output is not a TTY, so mypy and pylint autodetect that and emit plain text. Force colors on via both env vars (`FORCE_COLOR=1`, `PY_COLORS=1` — the common conventions honored by pylint, rich, uv etc.) and the explicit per-tool flags: mypy gets `--color-output --pretty`, pylint gets `--output-format=colorized`. GitHub's log viewer renders ANSI color escapes, so the output is readable and much easier to scan.
5 tasks
3 tasks
bugraoz93
approved these changes
Apr 15, 2026
Member
Author
|
I'd love to merge it - just linting issue :) |
Member
Author
|
(why we need it) That will actually help us in Airflow to get rid of some flaky tests - this one blocks the #716 (and that one I would love to merge too). |
dave2wave
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The `Linting and MyPy (Pelican)` workflow fails on every run because its Install dependencies step does:
```
cd pelican
pip install -r requirements.txt --no-deps
```
but `pelican/requirements.txt` no longer exists — pelican is declared via PEP 621 `pelican/pyproject.toml` these days. Replace the broken install with `pip install ./pelican`, which pulls in the runtime deps declared under `[project.dependencies]`. The mypy / pylint type-stub install line is unchanged; those are still needed on top of the runtime deps for the type-checking and pylint steps that follow.
Test plan
Generated-by: Claude Opus 4.6 (1M context)