mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-09-28 21:45:27 +08:00
* ci: try Python 3.15 release candidate (DRAFT) Point the repo's .python-version at 3.15 so every workflow that reads python-version-file runs on the 3.15 release candidate (allow-prereleases is already enabled across all workflows). Add the 3.15 trove classifier and bump scipy>=1.18.1, which is the first scipy with cp315 manylinux wheels, so uv installs it as a wheel rather than building from source. Rebuilt on current master: the earlier version of this PR edited the per-workflow `python-version: 3.14` lines, but master has since moved the interpreter to a single `.python-version` file, so the change is now a one-line switch there. Purpose is to document which dependencies/tests are not yet 3.15-ready. Must stay DRAFT until Python 3.15 GA (early October). Requested in #15081. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Upgrade to Python 3.15t --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
54 lines
2.7 KiB
YAML
54 lines
2.7 KiB
YAML
# https://docs.astral.sh/ty/
|
|
name: ty
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
jobs:
|
|
ty:
|
|
runs-on: ubuntu-latest
|
|
# Informational only: ty is not yet a required gate. This job surfaces
|
|
# type-check findings in the logs so they can be triaged into gradual
|
|
# [tool.ty] rules without blocking merges. Flip `continue-on-error` to
|
|
# false once the baseline is clean.
|
|
continue-on-error: true
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
persist-credentials: false
|
|
- uses: astral-sh/setup-uv@v7
|
|
with:
|
|
enable-cache: true
|
|
cache-dependency-glob: uv.lock
|
|
# Mirror the `build` job: `uv sync` installs the dependencies without
|
|
# building this flat-layout repo as a wheel. pyproject.toml has no
|
|
# [build-system], so uv treats the project as virtual and installs only
|
|
# its dependencies -- no "Multiple top-level packages discovered in a
|
|
# flat-layout" error and no need for a src-layout. (`uv pip install .`
|
|
# would force that wheel build and fail.) Pin a regular GIL 3.15 so typed
|
|
# third-party dependencies resolve; the free-threaded 3.15t interpreter the
|
|
# test matrix uses lacks wheels for several of them. ty itself is pulled in
|
|
# ephemerally with `--with` so it needn't be added to the lockfile.
|
|
- run: uv sync --python 3.15
|
|
# Pin the *run* to the same regular-GIL 3.15 too. Without `--python 3.15`
|
|
# here, `uv run` re-resolved the project's default interpreter -- the
|
|
# free-threaded 3.15t used by the test matrix -- so ty type-checked against
|
|
# an env where many third-party stubs don't resolve, drowning real findings
|
|
# in `unresolved-import` / `unresolved-attribute` noise. Pinning 3.15 lets
|
|
# ty see the synced dependencies, so the `[tool.ty.rules]` severities in
|
|
# pyproject.toml apply to a meaningful baseline.
|
|
#
|
|
# `--exit-zero` is ty's native advisory switch (the analog of ruff's
|
|
# `ruff check --exit-zero`): the step always exits 0, yet with
|
|
# `--output-format=github` ty still emits ::error annotations that render
|
|
# inline on the diff, so findings stay visible without a red X. Promotion
|
|
# path: `--exit-zero` (informational, always green) -> `--exit-zero-on-warning`
|
|
# (fail only on error-severity, tolerate warnings) -> drop the flag entirely
|
|
# to make ty a required gate once the [tool.ty] baseline is clean.
|
|
# `continue-on-error: true` above stays as a belt-and-suspenders guard so a
|
|
# ty *crash* (not a diagnostic) can never block a merge either.
|
|
- run: uv run --python 3.15 --with ty ty check --output-format=github --exit-zero
|