Skip to content

ci: run pre-commit via pre-commit/action and lite-action - #8904

Open
fstagni wants to merge 9 commits into
DIRACGrid:integrationfrom
fstagni:precommit-lite
Open

fstagni wants to merge 9 commits into
DIRACGrid:integrationfrom
fstagni:precommit-lite

Conversation

@fstagni

@fstagni fstagni commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Part of DIRACGrid/.github#5.

Aligns DIRAC with the org-standard pre-commit CI pattern used by intercede, signurlarity, diracx-charts and diracx (#1193): pre-commit/action runs the hooks and pre-commit-ci/lite-action pushes auto-fixes to PR branches. Hook rev updates come from Renovate's pre-commit manager, enabled org-wide in DIRACGrid/.github#8 (the pinned hooks here — black 23.1.0, flynt 0.77, pyupgrade v3.3.1 — are from 2023 and will start getting update PRs; they need Python 3.11 until then, hence the pin stays with a comment).

Stacked on #8903 (pilot wrapper pixi), which is stacked on #8900 (pixi check jobs) and #8891 (zizmor).

The CI check jobs now run in the locked pixi environment (pixi.toml +
committed pixi.lock), so make pixi the recommended way to create a
development environment:
- new 'Creating a development environment with pixi' section
  (install, pixi install/shell/run, the py314 environment, and the
  dependency-update policy: pixi.toml + Renovate-managed pixi.lock,
  exclude-newer cooldown)
- note in the conda section that environment.yml now mirrors pixi.toml
  and is still used by readthedocs
- generalize references to 'the conda environment' in the docs-building
  and installation-check pages
…ion workflow

- pixi.lock was still ignored by .gitignore, so it never made it into
  the branch: setup-pixi (cache: true) fails with "Failed to generate
  cache key" on every check/check-py314 job, and the environments were
  not actually locked. Remove it from .gitignore and commit the
  generated lockfile.
- the integration workflow quoted $MATRIX_ARGS, merging all KEY=VALUE
  pairs of matrix.ARGS into a single argument that
  integration_tests.py cannot split, breaking e.g.
  MYSQL_VER=mariadb:11.4.3 ES_VER=... (invalid docker reference) and
  the backward-compatibility job (mangled installation branch). Restore
  the word-splitting.
The plain $COMMAND expansion loses the single quotes around the pytest
-k expression, so pytest tried to open 'test_BaseType_Unicode' as a file
(ERROR: file or directory not found). Use eval, like the conda-based
job did.
Replace the ad-hoc conda environments (created with setup-miniconda at
run time) with the locked pixi environments from pixi.toml, consistent
with the check jobs. A new bare-bones py36 environment (no-default-feature,
python only - like the previous conda env that excluded pip) is added for
the Python 3.6 leg, solving to python 3.6.15 on conda-forge.

Stacked on DIRACGrid#8900.
…e the pixi-spawned shell

- pixi.toml has no 'py311' environment (the py311 one is the 'default'),
  so the py311 matrix legs failed with "unknown environment 'py311'".
- the test exports INVALID_UTF8_VAR=$'\xff' on purpose (the pilot
  wrapper has to cope with invalid UTF-8 in the environment), but pixi
  is now the parent process and panics on non-UTF-8 env vars
  (env::var().unwrap() on "\xFF"). Set the variable inside the
  pixi-spawned shell instead, so only python sees it.
Same pattern as the other DIRACGrid repositories (intercede,
signurlarity, diracx-charts, diracx): pre-commit/action runs the hooks
and pre-commit-ci/lite-action pushes auto-fixes to PR branches. Hook
rev updates come from Renovate's pre-commit manager (DIRACGrid/.github#8).

Python stays pinned to 3.11 until the pinned hooks (flynt 0.77,
pyupgrade v3.3.1, black 23.1.0) are updated, as they predate the removal
of ast.Str in Python 3.12.

Part of DIRACGrid/.github#5.

This branch has not been deployed

No deployments
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