Skip to content

chore(python): Python 3.14 minimum, CI sur 3.14 uniquement (2.8.0, breaking) - #287

Closed
traoreera wants to merge 2 commits into
mainfrom
chore/python-3.14
Closed

traoreera wants to merge 2 commits into
mainfrom
chore/python-3.14

Conversation

@traoreera

@traoreera traoreera commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Résumé

Passe le minimum supporté de Python 3.12 à 3.14 et la CI sur 3.14 uniquement. Le développement, les mesures GC/reload des 2.6.x et tous les smoke tests de release tournaient déjà sur CPython 3.14, alors que la matrice CI ne testait que 3.12 et 3.13 : les versions annoncées n'étaient pas celles réellement exécutées.

Changements

  • requires-python = ">=3.14,<4.0" (était >=3.12).
  • CI : matrice Tests & Coverage = ["3.14"] ; lint, docs, security, PR et les deux workflows de release passés en 3.14 (ils étaient en 3.12 ou 3.13). Aucune règle de statut requis ne référence les anciens noms de jobs (ruleset sentinel : suppression/non-fast-forward/Copilot review uniquement ; main non protégée).
  • poetry.lock régénéré pour le nouveau plancher : seuls les marqueurs python_version et les métadonnées changent, aucune version de paquet ne bouge.
  • Devcontainer python:3.14, pages d'installation, CLAUDE.md, GEMINI.md.
  • Bump 2.8.0 + entrée dans les deux changelogs (la suppression de versions Python est un breaking change).

À savoir avant de fusionner

  • Breaking pour les utilisateurs de 3.12/3.13 : pip install XCoreRuntime n'y sélectionnera plus la 2.8.0 ni les suivantes (pip retombe sur 2.7.x, XCoreRuntime<2.8).
  • Extra [cpp] : xcorescanner 0.1.0 n'a pas de wheel cp314 sur PyPI (cp312, cp313 + sdist) → compilation depuis les sources en 3.14 tant qu'un wheel cp314 n'est pas publié. Sans l'extra, le scanner AST Python est utilisé.
  • Black reste en py313 : avec py314 il réécrit except (A, B): en except A, B: (PEP 758) dans tout le code.
  • Le step « Upload to Codecov » de ci.yml est toujours gardé par matrix.python-version == '3.11' (reliquat qui n'est plus vrai depuis longtemps) : il ne tourne pas, je n'y ai pas touché.
  • Aucun tag n'est créé par cette PR : v2.8.0 (donc une publication PyPI) reste une décision séparée.

Vérification

  • Suite complète sur 3.14 : 1405 passed, 1 skipped ; mkdocs build --strict OK ; poetry check --lock OK ; flake8/black (xcore) propres.
  • La CI de cette PR exécute pour la première fois les jobs sur 3.14 côté GitHub.

Summary by Sourcery

Adopt Python 3.14 as the minimum supported version, align automation and documentation with it, and release the changes as version 2.8.0.

Bug Fixes:

  • Prevent tests from leaking process resource limits by restoring changed limits and failing tests that modify them.
  • Update resource-limit tests to mock system calls instead of applying irreversible limits to the pytest process.

Enhancements:

  • Raise the minimum supported Python version to 3.14 and align project metadata, development environments, documentation, and dependency markers.
  • Run the full CI, documentation, security, PR, and release workflows on Python 3.14 only.
  • Keep Black targeting Python 3.13 to avoid undesirable formatting changes under Python 3.14.

Build:

  • Regenerate the lockfile for the Python 3.14 support floor without changing package versions.
  • Bump the project version to 2.8.0.

CI:

  • Consolidate the test and coverage matrix to Python 3.14 and update all workflow Python versions accordingly.

Documentation:

  • Document Python 3.14 as the minimum supported version and add the 2.8.0 breaking-change and optional C++ scanner compatibility notes to both changelogs.

Tests:

  • Add coverage to detect process resource-limit leaks and make isolation tests safe for the shared test process.

…reaking)

Le développement, les mesures GC/reload des 2.6.x et tous les smoke tests de
release tournaient déjà sur CPython 3.14, alors que la matrice CI ne testait que
3.12 et 3.13 : les versions annoncées n'étaient pas celles réellement exécutées.

- requires-python >=3.14,<4.0 (était >=3.12) — breaking : pip sur 3.12/3.13 ne
  sélectionnera plus cette version ni les suivantes (reste sur XCoreRuntime<2.8)
- CI : matrice Tests & Coverage ["3.14"] ; lint, docs, security, PR et les deux
  workflows de release passés en 3.14 (étaient 3.12 ou 3.13)
- poetry.lock régénéré pour le nouveau plancher : seuls les marqueurs de version
  Python et les métadonnées changent, aucune version de paquet ne bouge
- devcontainer python:3.14 ; pages d'installation, CLAUDE.md et GEMINI.md à jour
- black reste en target-version py313 : avec py314 il réécrit `except (A, B):` en
  `except A, B:` (PEP 758) sur tout le code
- limitation connue : l'extra [cpp] (xcorescanner 0.1.0) n'a pas de wheel cp314
  (cp312/cp313 + sdist) — compilation depuis les sources en 3.14
- bump 2.8.0, entrée CHANGELOG dans les deux fichiers
@sourcery-ai

sourcery-ai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

This breaking release raises the minimum supported Python from 3.12 to 3.14 and standardizes CI, development, documentation, and release workflows on CPython 3.14, with a regenerated lockfile and 2.8.0 metadata/changelog updates; optional C++ installations may build xcorescanner from source until cp314 wheels are available.

Sequence diagram for installing XCoreRuntime 2.8.0

sequenceDiagram
    actor User
    participant Pip
    participant PyPI
    participant XCoreRuntime
    participant XCoreScanner

    User->>Pip: install XCoreRuntime 2.8.0
    Pip->>PyPI: Resolve Requires-Python >=3.14
    alt Python 3.14+
        PyPI-->>Pip: XCoreRuntime 2.8.0
        Pip->>XCoreRuntime: Install
        opt cpp extra requested
            Pip->>PyPI: Resolve xcorescanner 0.1.0
            PyPI-->>Pip: Source distribution
            Pip->>XCoreScanner: Build from source
        end
    else Python 3.12 or 3.13
        PyPI-->>Pip: XCoreRuntime 2.7.x
    end
Loading

File-Level Changes

Change Details Files
Raise the package’s supported Python floor and release version to 3.14/2.8.0.
  • Set requires-python to >=3.14,<4.0.
  • Bump project and runtime version metadata from 2.7.0 to 2.8.0.
  • Regenerate the lockfile for the new Python markers without changing package versions.
pyproject.toml
poetry.lock
xcore/__version__.py
Align all development, validation, documentation, and release environments with Python 3.14.
  • Run the main test matrix on 3.14 only and update lint, docs, security, PR, and release workflow interpreters.
  • Update the devcontainer image and documented prerequisites.
  • Preserve Black’s py313 target to avoid PEP 758 formatting changes.
.github/workflows/ci.yml
.github/workflows/docs.yml
.github/workflows/pr.yml
.github/workflows/release-manual.yml
.github/workflows/release.yml
.github/workflows/security.yml
.devcontainer/Dockerfile
doc/cli/getting-started/install.md
doc/installation.md
doc/plugins/trusted-plugins.md
doc/sdk/installation.md
CLAUDE.md
GEMINI.md
Document the breaking support change and Python 3.14 adoption in both changelogs.
  • Add the 2.8.0 release entry and explicitly describe the incompatibility for Python 3.12/3.13 users.
  • Document the [cpp] extra’s fallback to source builds until a cp314 xcorescanner wheel exists.
  • Record the unchanged Codecov guard and Black compatibility rationale.
CHANGELOG.md
doc/changelog.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions github-actions Bot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file core ci config labels Oct 1, 2026

@sourcery-ai sourcery-ai Bot 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.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. The new requires-python floor and release/CI configuration make Python 3.14 support the package-wide policy, preventing Python 3.12 and 3.13 users from installing 2.8.0 or later. If that policy is wrong, the impact begins for every affected user at release time and reverting the source cannot undo the already-published package metadata.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

…rt new thread en 3.14)

TestMemoryLimiter.test_apply_positive appelait MemoryLimiter.apply(512) pour de
bon dans le process pytest : setrlimit(RLIMIT_AS, 512 Mo) est irréversible (la
limite dure baisse) et valable pour toute la session. Chaque thread créé ensuite
réserve ~72 Mo d'espace d'adressage (pile + arène glibc) : après 8 threads,
RuntimeError « can't start new thread » — reproduit en local. Les tests placés
plus loin dans la session (TestClient de test_xcore_plugin_routes) échouaient
selon l'empreinte mémoire de l'interpréteur : jamais en 3.12/3.13, systématiquement
sur le runner en 3.14 (Quick Test : « can't start new thread » puis abort dans
pydantic-core sur un thread de portail).

- le test vérifie l'appel (resource.setrlimit patché) au lieu de l'exécuter, plus un
  test du cas d'échec (journalisé, pas levé)
- tests/conftest.py : fixture autouse qui échoue si un test modifie RLIMIT_AS /
  RLIMIT_DATA / RLIMIT_CPU du process pytest
@traoreera

Copy link
Copy Markdown
Owner Author

Abandonnée : on garde requires-python >=3.12 (pas de breaking change). Le correctif de test et l'ajout de 3.14 à la matrice CI continuent dans #288.

@traoreera traoreera closed this Oct 2, 2026
traoreera added a commit that referenced this pull request Oct 2, 2026
…hreads (#288)

## Résumé

Garde `requires-python = ">=3.12,<4.0"` (pas de breaking change, pas de
release) et corrige ce qui empêchait de tester sérieusement sur 3.14.
Remplace la PR #287 (plancher Python 3.14), abandonnée au profit de «
3.12 et supérieur ».

## Changements

- **CI : 3.14 ajouté à la matrice** (`3.12`, `3.13`, `3.14`). 3.14 est
dans la plage supportée et c'est la version utilisée en développement,
mais la matrice ne testait que 3.12 et 3.13.
- **Test corrigé** : `TestMemoryLimiter.test_apply_positive` appelait
`MemoryLimiter.apply(512)` pour de bon dans le process pytest.
`setrlimit(RLIMIT_AS, 512 Mo)` est irréversible (la limite dure baisse)
et valable pour toute la session : chaque thread créé ensuite réserve
~72 Mo d'espace d'adressage (pile + arène glibc) et, après 8 threads,
`RuntimeError: can't start new thread` (reproduit en local). Les tests
placés plus loin (les `TestClient` de `test_xcore_plugin_routes`)
échouaient selon l'empreinte mémoire de l'interpréteur : jamais en
3.12/3.13, systématiquement sur le runner en 3.14 (dans `Quick Test`,
avec en plus un abort dans pydantic-core sur un thread de portail). Le
test vérifie maintenant l'appel avec `resource.setrlimit` patché.
- **Garde-fou** dans `tests/conftest.py` : fixture autouse qui fait
échouer tout test modifiant `RLIMIT_AS` / `RLIMIT_DATA` / `RLIMIT_CPU`
du process pytest.

## À savoir

- Les jobs `Tests & Coverage` lancent `make test-cov STRICT=0 || echo
"Tests échoués"` sur toutes les branches sauf `main` : ils sont verts
même quand un test échoue. Seul `Quick Test` (strict) bloque sur une PR.
Politique inchangée ici ; vérifier les logs (`passed`/`FAILED`) plutôt
que la coche.
- Pas de bump de version ni de tag : aucun code du paquet ne change.

## Vérification

Suite complète en local sur 3.14 : **1406 passed, 1 skipped** (avec un
Redis local comme dans `Quick Test`).

## Summary by Sourcery

Test the project on Python 3.14 and isolate process-wide resource-limit
tests to keep the suite reliable.

Bug Fixes:
- Prevent resource-limit tests from altering the pytest process and
causing later thread creation failures.
- Add coverage for handling resource-limit application failures without
raising.

Enhancements:
- Add an automatic test guard that detects and reports process-wide
resource-limit leaks.

CI:
- Expand the CI Python test matrix to include Python 3.14.

Tests:
- Update memory limiter tests to mock resource-limit changes and verify
the expected calls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci config core dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant