Skip to content

pelican: install lint deps from pyproject.toml#717

Merged
dave2wave merged 11 commits intomainfrom
fix-pelican-lint-install
Apr 16, 2026
Merged

pelican: install lint deps from pyproject.toml#717
dave2wave merged 11 commits intomainfrom
fix-pelican-lint-install

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented Apr 14, 2026

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

  • Push triggers the lint workflow and it reaches the `Type testing with mypy` and `Code linting with pylint` steps (no install-step failure).
  • `mypy --ignore-missing-imports .` and `pylint **/*.py` still run against the pelican tree as before.

Generated-by: Claude Opus 4.6 (1M context)

potiuk added 11 commits April 15, 2026 00:47
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.
@raboof raboof added the pelican the pelican action label Apr 15, 2026
@potiuk
Copy link
Copy Markdown
Member Author

potiuk commented Apr 16, 2026

I'd love to merge it - just linting issue :)

@potiuk
Copy link
Copy Markdown
Member Author

potiuk commented Apr 16, 2026

(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 dave2wave merged commit 8a059be into main Apr 16, 2026
7 checks passed
@dave2wave dave2wave deleted the fix-pelican-lint-install branch April 16, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pelican the pelican action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants