Skip to content

Commit f39396a

Browse files
authored
Merge branch 'master' into patch-1
2 parents 411d91b + 2c15b8c commit f39396a

File tree

185 files changed

+4157
-1192
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+4157
-1192
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ ARG VARIANT=3.13-bookworm
33
FROM mcr.microsoft.com/vscode/devcontainers/python:${VARIANT}
44
COPY requirements.txt /tmp/pip-tmp/
55
RUN python3 -m pip install --upgrade pip \
6-
&& python3 -m pip install --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
7-
&& pipx install pre-commit ruff \
8-
&& pre-commit install
6+
&& python3 -m pip install --no-cache-dir -r /tmp/pip-tmp/requirements.txt \
7+
&& pipx install pre-commit ruff

.devcontainer/README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,42 @@
1-
https://code.visualstudio.com/docs/devcontainers/tutorial
1+
# Development Container
2+
3+
This is **Devcontainer** configuration to provide a consistent development environment for all contributors.
4+
5+
## Features
6+
7+
- [x] Pre-configured **Python environment**
8+
- [x] Automatic installation of **pre-commit hooks**
9+
- [x] **Ruff** linter ready to check your code
10+
- [x] **Oh My Zsh** with plugins:
11+
- `zsh-autosuggestions`
12+
- `zsh-syntax-highlighting`
13+
14+
## Usage
15+
16+
1. Install [**Docker** ](https://www.docker.com/get-started/) and [**Visual Studio Code**](https://code.visualstudio.com/)
17+
2. Install the **Remote - Containers** extension in VS Code
18+
19+
- Do `CTRL+P`, paste this command and press `Enter`
20+
21+
```shell
22+
ext install ms-vscode-remote.remote-containers
23+
```
24+
3. Open this repository in VS Code
25+
4. When prompted, click **"Reopen in Container"**
26+
5. Wait for the environment to build and initialize
27+
28+
After setup:
29+
30+
- `pre-commit` hooks are installed
31+
- `ruff` and other tools are available
32+
- The shell uses Zsh by default
33+
34+
## Tips
35+
36+
To manually run checks on all files:
37+
38+
```bash
39+
pre-commit run --all-files
40+
```
41+
42+
> For further information here's [Microsoft tutorial about devcontainers.](https://code.visualstudio.com/docs/devcontainers/tutorial)

.devcontainer/devcontainer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
// Update 'VARIANT' to pick a Python version: 3, 3.11, 3.10, 3.9, 3.8
88
// Append -bullseye or -buster to pin to an OS version.
99
// Use -bullseye variants on local on arm64/Apple Silicon.
10-
"VARIANT": "3.13-bookworm",
10+
"VARIANT": "3.13-bookworm"
1111
}
1212
},
1313

14+
"postCreateCommand": "zsh .devcontainer/post_install",
15+
1416
// Configure tool-specific properties.
1517
"customizations": {
1618
// Configure properties specific to VS Code.
@@ -20,7 +22,8 @@
2022
"python.defaultInterpreterPath": "/usr/local/bin/python",
2123
"python.linting.enabled": true,
2224
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
23-
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy"
25+
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
26+
"terminal.integrated.defaultProfile.linux": "zsh"
2427
},
2528

2629
// Add the IDs of extensions you want installed when the container is created.

.devcontainer/post_install

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
3+
echo "Begin post-installation steps..."
4+
5+
set -e
6+
7+
echo "Installing pre-commit hooks..."
8+
pre-commit install
9+
10+
echo "Installing Oh My Zsh plugins..."
11+
12+
# Install zsh-autosuggestions if not present
13+
if [ ! -d "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions" ]; then
14+
echo "Cloning zsh-autosuggestions..."
15+
git clone https://github.com/zsh-users/zsh-autosuggestions \
16+
"${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions"
17+
fi
18+
19+
# Install zsh-syntax-highlighting if not present
20+
if [ ! -d "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting" ]; then
21+
echo "Cloning zsh-syntax-highlighting..."
22+
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \
23+
"${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting"
24+
fi
25+
26+
echo "Configuring plugins in ~/.zshrc..."
27+
sed -i '/^plugins=/c\plugins=(git zsh-autosuggestions zsh-syntax-highlighting)' ~/.zshrc
28+
29+
echo "Post-installation steps completed successfully. Enjoy!"

.github/workflows/build.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,32 @@ jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v4
13-
- uses: astral-sh/setup-uv@v5
12+
- run: sudo apt-get update && sudo apt-get install -y libhdf5-dev
13+
- uses: actions/checkout@v6
14+
- uses: astral-sh/setup-uv@v7
1415
with:
1516
enable-cache: true
1617
cache-dependency-glob: uv.lock
17-
- uses: actions/setup-python@v5
18+
- uses: actions/setup-python@v6
1819
with:
19-
python-version: 3.13
20+
python-version: 3.14
2021
allow-prereleases: true
2122
- run: uv sync --group=test
2223
- name: Run tests
2324
# TODO: #8818 Re-enable quantum tests
24-
run: uv run pytest
25+
run: uv run --with=pytest-run-parallel pytest
26+
--iterations=8 --parallel-threads=auto
2527
--ignore=computer_vision/cnn_classification.py
2628
--ignore=docs/conf.py
2729
--ignore=dynamic_programming/k_means_clustering_tensorflow.py
30+
--ignore=machine_learning/local_weighted_learning/local_weighted_learning.py
2831
--ignore=machine_learning/lstm/lstm_prediction.py
2932
--ignore=neural_network/input_data.py
3033
--ignore=project_euler/
3134
--ignore=quantum/q_fourier_transform.py
3235
--ignore=scripts/validate_solutions.py
36+
--ignore=web_programming/current_stock_price.py
37+
--ignore=web_programming/fetch_anime_and_play.py
3338
--cov-report=term-missing:skip-covered
3439
--cov=. .
3540
- if: ${{ success() }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Test DevContainer Build
2+
3+
on:
4+
push:
5+
paths:
6+
- ".devcontainer/**"
7+
pull_request:
8+
paths:
9+
- ".devcontainer/**"
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v6
16+
- uses: devcontainers/ci@v0.3
17+
with:
18+
push: never
19+
runCmd: "true"

.github/workflows/directory_writer.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
name: directory_writer
44
on: [push]
55
jobs:
6-
build:
6+
directory_writer:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v4
9+
- uses: actions/checkout@v6
1010
with:
1111
fetch-depth: 0
12-
- uses: actions/setup-python@v5
12+
- uses: actions/setup-python@v6
1313
with:
14-
python-version: 3.x
14+
python-version: 3.14
15+
allow-prereleases: true
1516
- name: Write DIRECTORY.md
1617
run: |
1718
scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md

.github/workflows/project_euler.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,37 @@ jobs:
1414
project-euler:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v4
18-
- uses: astral-sh/setup-uv@v5
19-
- uses: actions/setup-python@v5
17+
- run:
18+
sudo apt-get update && sudo apt-get install -y libtiff5-dev libjpeg8-dev libopenjp2-7-dev
19+
zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk
20+
libharfbuzz-dev libfribidi-dev libxcb1-dev
21+
libxml2-dev libxslt-dev
22+
libhdf5-dev
23+
libopenblas-dev
24+
- uses: actions/checkout@v6
25+
- uses: astral-sh/setup-uv@v7
26+
- uses: actions/setup-python@v6
2027
with:
21-
python-version: 3.x
28+
python-version: 3.14
29+
allow-prereleases: true
2230
- run: uv sync --group=euler-validate --group=test
2331
- run: uv run pytest --doctest-modules --cov-report=term-missing:skip-covered --cov=project_euler/ project_euler/
2432
validate-solutions:
2533
runs-on: ubuntu-latest
2634
steps:
27-
- uses: actions/checkout@v4
28-
- uses: astral-sh/setup-uv@v5
29-
- uses: actions/setup-python@v5
35+
- run:
36+
sudo apt-get update && sudo apt-get install -y libtiff5-dev libjpeg8-dev libopenjp2-7-dev
37+
zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk
38+
libharfbuzz-dev libfribidi-dev libxcb1-dev
39+
libxml2-dev libxslt-dev
40+
libhdf5-dev
41+
libopenblas-dev
42+
- uses: actions/checkout@v6
43+
- uses: astral-sh/setup-uv@v7
44+
- uses: actions/setup-python@v6
3045
with:
31-
python-version: 3.x
46+
python-version: 3.14
47+
allow-prereleases: true
3248
- run: uv sync --group=euler-validate --group=test
3349
- run: uv run pytest scripts/validate_solutions.py
3450
env:

.github/workflows/ruff.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ jobs:
1111
ruff:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
15-
- uses: astral-sh/setup-uv@v5
14+
- uses: actions/checkout@v6
15+
- uses: astral-sh/setup-uv@v7
1616
- run: uvx ruff check --output-format=github .

.github/workflows/sphinx.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,23 @@ jobs:
2525
build_docs:
2626
runs-on: ubuntu-24.04-arm
2727
steps:
28-
- uses: actions/checkout@v4
29-
- uses: astral-sh/setup-uv@v5
30-
- uses: actions/setup-python@v5
28+
- run:
29+
sudo apt-get update && sudo apt-get install -y libtiff5-dev libjpeg8-dev libopenjp2-7-dev
30+
zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk
31+
libharfbuzz-dev libfribidi-dev libxcb1-dev
32+
libxml2-dev libxslt-dev
33+
libhdf5-dev
34+
libopenblas-dev
35+
- uses: actions/checkout@v6
36+
- uses: astral-sh/setup-uv@v7
37+
- uses: actions/setup-python@v6
3138
with:
32-
python-version: 3.13
39+
python-version: 3.14
3340
allow-prereleases: true
3441
- run: uv sync --group=docs
3542
- uses: actions/configure-pages@v5
3643
- run: uv run sphinx-build -c docs . docs/_build/html
37-
- uses: actions/upload-pages-artifact@v3
44+
- uses: actions/upload-pages-artifact@v4
3845
with:
3946
path: docs/_build/html
4047

0 commit comments

Comments
 (0)