* ci: daily Hacktoberfest 2026 prep tracker refresh (cron 11:50 UTC)
Adds .github/workflows/hacktoberfest_prep.yml (schedule: 50 11 * * *) and
scripts/hacktoberfest_prep_update.py. Each run:
- ticks tracked PR rows in docs/hacktober_2026_prep.md that are now
merged/closed (`[ ]` -> `[x]`),
- rewrites an 'Automated statistics' section with the current open issue and
open PR counts plus the top three directories with the most open
'awaiting reviews' PRs,
- exits non-zero once Hacktoberfest 2026 has begun (>= 2026-10-01), so the
prep window closing is loud and the job gets retired.
Standard library only; uses the Actions GITHUB_TOKEN. Refs #15081.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* style: wrap implicit string concatenations (ISC004)
* refactor: use httpx2 for API calls, drop unneeded future import
Address review feedback on the Hacktoberfest prep cron:
- Switch the tracker script from urllib to httpx2, the repo's standard
HTTP client, and add an install step to the workflow.
- Drop 'from __future__ import annotations' (unnecessary on Python >= 3.14t).
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Per maintainer request on #15081: the new-pull-request skill now reminds the
coder to consider `typing.NamedTuple` / `dataclasses.dataclass` for simple
classes, and the code-review skill adds an OPTIONAL reviewer hint to suggest
them where they simplify the code (never a blocker).
* Skill: New pull request for TheAlgorithms/Python
@priya-sundaram-dev, please review and suggest any changes. We want to make sure that the keeper does not close new PRs as invalid.
* updating DIRECTORY.md
* Update pull request instructions in SKILL.md
Clarified instructions for creating a new pull request and emphasized the importance of branch naming.
* Clarify Markdown checkbox requirement for PRs
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Skill: fix uv.lock wording; add DIRECTORY.md/README.md auto-gen note (#15216)
- Clarify that uv.lock is regenerated by the uv-lock pre-commit hook when a
legitimate dependency is added; only hand-edits/reverts break the keeper.
- Add a checklist item: DIRECTORY.md and README.md are bot-generated, don't
hand-edit them.
---------
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: priya-sundaram-dev <oc-409d01@agentmail.to>
* ci: add informational (non-blocking) ty type-check job
* ci: pin ty environment python-version to 3.14
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* pyproject.toml: Ignore some ty rules
* Refactor ty.yml for dependency installation and checks
Updated ty.yml to install test dependencies and modify ty check command.
* Add virtual environment setup to workflow
* ci(ty): install deps with 'uv sync' instead of 'uv pip install .'
The previous 'uv pip install ".[test]"' step failed because this repo is a
flat-layout collection of algorithms, not an installable package: setuptools'
legacy backend errors with 'Multiple top-level packages discovered in a
flat-layout'. Rather than restructuring into a src-layout, mirror the existing
'build' job and use 'uv sync' -- pyproject.toml has no [build-system], so uv
treats the project as virtual and installs only its dependencies. Pin a regular
GIL 3.14 so typed third-party deps resolve, and pull ty in ephemerally with
'uv run --with ty' so it needn't touch the lockfile. Also drop the stray
per-step 'source .venv/bin/activate' (each run: is its own shell, so it was a
no-op). Job stays continue-on-error (informational).
* ci(ty): keep the advisory job green with inline annotations
ty emits ::error annotations via --output-format=github; those render on
the PR diff regardless of the step's exit code. Add '|| true' so the check
stays green (it's informational, not a gate) while findings remain visible
as inline annotations -- avoids a permanent red X on every commit. Remove
'|| true' and continue-on-error to promote ty to a required gate later.
* ci(ty): keep ty's real exit status (drop || true), rely on continue-on-error for non-blocking
* ci(ty): pin the ty run to regular 3.14 and use native --exit-zero
The ty step ran 'uv run --with ty' without --python, so uv re-resolved the
project default (free-threaded 3.14t), where many third-party stubs don't
resolve -- that env-resolution failure, not real type errors, produced the
unresolved-import/unresolved-attribute noise and masked whether [tool.ty.rules]
severities apply. Pin the run to regular 3.14 so ty sees the synced deps.
Replace the continue-on-error/real-status juggling with ty's native --exit-zero
(the analog of 'ruff check --exit-zero'): always exit 0 while --output-format=github
still surfaces findings as inline annotations. continue-on-error stays only as a
crash guard. Documents the --exit-zero -> --exit-zero-on-warning -> gate path.
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Follow-up to #15157. h5py ships self-contained manylinux/musllinux
wheels (aarch64 included) that bundle their own HDF5, so no system
libhdf5 is needed to import or use it. Removing the apt-get step
speeds up CI and removes a network dependency; CI will confirm.
Modern wheels (pillow, lxml, h5py, numpy/scipy, matplotlib) ship
self-contained manylinux/musllinux wheels, so the long lists of -dev
system libraries (libtiff/libjpeg/libopenjp2/freetype/harfbuzz/xml/
xslt/openblas/tk, etc.) are no longer needed to install or import the
project's dependencies. Reduce each apt-get step to libhdf5-dev only
(kept for now as a first step) and switch the deprecated -y flag to
--yes. If CI stays green a follow-up can drop libhdf5-dev too, since
h5py 3.16 ships wheels with a bundled HDF5 and nothing imports h5py
directly.
* ci: switch default Python to free-threaded 3.14t
Change the interpreter used across CI workflows from 3.14 to the
free-threaded build 3.14t to surface which dependencies and tests are
not yet free-threading compatible. Opened as DRAFT for documentation
purposes per maintainer request (#15081).
* ci(3.14t): gate opencv-python into optional 'cv' group + skip cv2 files
opencv-python has no cp314t wheel yet and fails to build from source under
free-threaded 3.14t (CMake), blocking uv sync for every job. Move it to an
optional [dependency-groups] cv group so the ft CI installs everything else
and runs pytest-run-parallel on the pure-Python algorithms. Skip the 20 files
that import cv2 (computer_vision augmentations, data_compression PSNR, and the
mostly-cv2 digital_image_processing/ tree). Re-fold once a cp314t wheel ships
(upstream: opencv/opencv#27933).
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* ci(3.14t): add --ignore-gil-enabled so sklearn/xgboost imports don't abort the run
* ci(3.14t): gate qiskit into an optional group like opencv
qiskit re-enables the GIL under free-threaded CPython and the team is still scoping free-threading support (Qiskit/qiskit#16893), so move it out of the core deps into an optional 'quantum' group and ignore the one algorithm that imports it (quantum/q_fourier_transform.py) in the 3.14t test run. Mirrors the existing opencv 'cv' carve-out. Per cclauss: default all workflows to 3.14t except tests depending on OpenCV or Qiskit.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* ci: single-source 3.14t via .python-version; declare Free Threading :: 2 - Beta
Un-ignore .python-version and pin it to 3.14t, then point all four
workflows at python-version-file: .python-version so the free-threaded
interpreter is selected from one place. Also add the
'Programming Language :: Python :: Free Threading :: 2 - Beta' trove
classifier to document our free-threaded support status per
https://py-free-threading.github.io/porting/#define-and-document-thread-safety-guarantees
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* quantum: modernize QFT to Qiskit 2.x + re-enable its test
quantum/q_fourier_transform.py used the Aer and execute symbols that were
removed from qiskit in the 1.0 API break, so it could never run and was on
the pytest --ignore list. Port it to the current API:
- Drop 'from qiskit import Aer, execute'. Build the circuit unchanged, then
simulate with the pure-Python BasicSimulator via transpile() + backend.run(),
so no compiled qiskit-aer backend is needed (qiskit-aer has no Python 3.14
wheels yet; BasicSimulator ships inside qiskit core).
- Seed the run (seed_simulator=42) and rewrite the doctest to assert the
reproducible, shot-noise-independent facts (the four outcomes appear and the
counts sum to the shot total) instead of exact per-state counts, which random
sampling can never hit.
- Add 'qiskit>=2' to project dependencies and drop the quantum ignore + the
stale '# TODO: #8818 Re-enable quantum tests' comment in build.yml.
Draft until CI confirms qiskit installs and imports on the repo's Python 3.14.
* Update quantum/q_fourier_transform.py
---------
Co-authored-by: Christian Clauss <cclauss@me.com>
* ci: un-ignore local_weighted_learning doctests in build.yml
machine_learning/local_weighted_learning/local_weighted_learning.py only
imports numpy and matplotlib (both already project dependencies) and its
5 doctests pass headlessly. Removing it from the pytest --ignore list so
the module is covered by CI again.
* fix(local_weighted_learning): use a well-conditioned bandwidth in doctests
The doctests used tau=0.6 on data with feature values ~17-25, so the
Gaussian weights underflowed to ~0 (e.g. 8e-118, 1e-177). That made
X\u1d40WX numerically singular (cond ~5.6e18), so its inverse - and the
resulting predictions - were nondeterministic across numpy/BLAS builds.
That is why the module was on the pytest --ignore list; on the CI numpy
the first prediction came out 0.0 instead of the documented 1.07.
Switch the doctests to tau=5 (cond ~2e2), matching the bandwidth the
module's own main() already uses, and round the outputs so they are
stable across platforms. Deterministic now; removed from --ignore.
- Add astral-sh/uv-pre-commit (uv-lock) so uv.lock stays in sync with
pyproject.toml automatically instead of relying on manual relocks.
- Replace 'python-version: 3.14' with 'python-version-file: pyproject.toml'
in every workflow that uses actions/setup-python (build, project_euler,
sphinx, directory_writer), making requires-python the single source of
truth for the interpreter version.
* add post-installation script
* set zsh as default terminal and make post-install execution on postcreate
* rename file
* rename script
* Create devcontainers_ci.yml
* Update devcontainer.json
* Update devcontainers_ci.yml
Never push image built here. It's for build testing purpose only.
* postCreateCommand update to reflect that the shell script has been renamed.
* update devcontainer readme file
* trigger workflow only on devcontainer/** changes
* prettier refactor
2025-07-09 14:25:18 +02:00
Christian Claussandpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* maths/radix2_fft.py: Fix calculation for Python 3.14
As suggested at:
* https://github.com/TheAlgorithms/Python/issues/12729#issuecomment-2878608477
* https://github.com/TheAlgorithms/Python/pull/12710#discussion_r2080117333
@MaximSmolskiy @KirilBangachev @skirpichev Careful review, please. I am just implementing the suggestion, but I do not have any expertise in this area.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Change test results
* GitHub Actions: Rename job from build to directory_writer
It is confusing to have two jobs named `build`.
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Use Astral uv
* uvx vs uv run
* uv sync --group=euler-validate,test
* uv sync --group=euler-validate --group=test
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* --group=test
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Rename .github/.github/dependabot.yml to .github/dependabot.yml
* runs-on: macos-14 # ubuntu-latest
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update build.yml
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Use compiled black as the pre-commit formatter
* ruff-format
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Keep GitHub Actions up to date with Dependabot
---------
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* style: use proper indentation in `ruff.yml`
* chore: run `prettier` on `yml` files
* Update .pre-commit-config.yaml
* Update .pre-commit-config.yaml
* Update .pre-commit-config.yaml
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update .pre-commit-config.yaml
* chore: run prettier on workflow files
---------
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>