DO NOT MERGE: Test Python 3.14

This commit is contained in:
Christian Clauss 2025-05-07 20:10:05 +01:00
parent d9d56b1046
commit 25a5908dfe
26 changed files with 58 additions and 23 deletions

View File

@ -9,6 +9,13 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- run:
sudo apt-get update && sudo apt-get install -y libtiff5-dev libjpeg8-dev libopenjp2-7-dev
zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk
libharfbuzz-dev libfribidi-dev libxcb1-dev
libxml2-dev libxslt-dev
libhdf5-dev
libopenblas-dev
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
@ -16,7 +23,7 @@ jobs:
cache-dependency-glob: uv.lock
- uses: actions/setup-python@v5
with:
python-version: 3.13
python-version: 3.14
allow-prereleases: true
- run: uv sync --group=test
- name: Run tests

View File

@ -11,7 +11,8 @@ jobs:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3.x
python-version: 3.14
allow-prereleases: true
- name: Write DIRECTORY.md
run: |
scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md

View File

@ -14,21 +14,37 @@ jobs:
project-euler:
runs-on: ubuntu-latest
steps:
- run:
sudo apt-get update && sudo apt-get install -y libtiff5-dev libjpeg8-dev libopenjp2-7-dev
zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk
libharfbuzz-dev libfribidi-dev libxcb1-dev
libxml2-dev libxslt-dev
libhdf5-dev
libopenblas-dev
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
- uses: actions/setup-python@v5
with:
python-version: 3.x
python-version: 3.14
allow-prereleases: true
- run: uv sync --group=euler-validate --group=test
- run: uv run pytest --doctest-modules --cov-report=term-missing:skip-covered --cov=project_euler/ project_euler/
validate-solutions:
runs-on: ubuntu-latest
steps:
- run:
sudo apt-get update && sudo apt-get install -y libtiff5-dev libjpeg8-dev libopenjp2-7-dev
zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk
libharfbuzz-dev libfribidi-dev libxcb1-dev
libxml2-dev libxslt-dev
libhdf5-dev
libopenblas-dev
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
- uses: actions/setup-python@v5
with:
python-version: 3.x
python-version: 3.14
allow-prereleases: true
- run: uv sync --group=euler-validate --group=test
- run: uv run pytest scripts/validate_solutions.py
env:

View File

@ -25,11 +25,18 @@ jobs:
build_docs:
runs-on: ubuntu-24.04-arm
steps:
- run:
sudo apt-get update && sudo apt-get install -y libtiff5-dev libjpeg8-dev libopenjp2-7-dev
zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk
libharfbuzz-dev libfribidi-dev libxcb1-dev
libxml2-dev libxslt-dev
libhdf5-dev
libopenblas-dev
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
- uses: actions/setup-python@v5
with:
python-version: 3.13
python-version: 3.14
allow-prereleases: true
- run: uv sync --group=docs
- uses: actions/configure-pages@v5

View File

@ -128,15 +128,6 @@
* [Vigenere Cipher](ciphers/vigenere_cipher.py)
* [Xor Cipher](ciphers/xor_cipher.py)
## Compression
* [Burrows Wheeler](compression/burrows_wheeler.py)
* [Huffman](compression/huffman.py)
* [Lempel Ziv](compression/lempel_ziv.py)
* [Lempel Ziv Decompress](compression/lempel_ziv_decompress.py)
* [Lz77](compression/lz77.py)
* [Peak Signal To Noise Ratio](compression/peak_signal_to_noise_ratio.py)
* [Run Length Encoding](compression/run_length_encoding.py)
## Computer Vision
* [Cnn Classification](computer_vision/cnn_classification.py)
* [Flip Augmentation](computer_vision/flip_augmentation.py)
@ -181,6 +172,15 @@
* [Volume Conversions](conversions/volume_conversions.py)
* [Weight Conversion](conversions/weight_conversion.py)
## Data Compression
* [Burrows Wheeler](data_compression/burrows_wheeler.py)
* [Huffman](data_compression/huffman.py)
* [Lempel Ziv](data_compression/lempel_ziv.py)
* [Lempel Ziv Decompress](data_compression/lempel_ziv_decompress.py)
* [Lz77](data_compression/lz77.py)
* [Peak Signal To Noise Ratio](data_compression/peak_signal_to_noise_ratio.py)
* [Run Length Encoding](data_compression/run_length_encoding.py)
## Data Structures
* Arrays
* [Equilibrium Index In Array](data_structures/arrays/equilibrium_index_in_array.py)
@ -1202,6 +1202,8 @@
* [Sol1](project_euler/problem_234/sol1.py)
* Problem 301
* [Sol1](project_euler/problem_301/sol1.py)
* Problem 345
* [Sol1](project_euler/problem_345/sol1.py)
* Problem 493
* [Sol1](project_euler/problem_493/sol1.py)
* Problem 551

View File

@ -20,7 +20,7 @@ def gronsfeld(text: str, key: str) -> str:
>>> gronsfeld('yes, ¥€$ - _!@#%?', '')
Traceback (most recent call last):
...
ZeroDivisionError: integer modulo by zero
ZeroDivisionError: division by zero
"""
ascii_len = len(ascii_uppercase)
key_len = len(key)

View File

Before

Width:  |  Height:  |  Size: 4.3 MiB

After

Width:  |  Height:  |  Size: 4.3 MiB

View File

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 104 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 476 KiB

After

Width:  |  Height:  |  Size: 476 KiB

View File

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 82 KiB

View File

@ -42,8 +42,6 @@ def xgboost(features: np.ndarray, target: np.ndarray) -> XGBClassifier:
def main() -> None:
"""
>>> main()
Url for the algorithm:
https://xgboost.readthedocs.io/en/stable/
Iris type dataset is used to demonstrate algorithm.

View File

@ -15,7 +15,7 @@ def res(x, y):
>>> res(-1, 5)
Traceback (most recent call last):
...
ValueError: math domain error
ValueError: expected a positive input
"""
if 0 not in (x, y):
# We use the relation x^y = y*log10(x), where 10 is the base.

View File

@ -40,13 +40,13 @@ class FFT:
Print product
>>> x.product # 2x + 3x^2 + 8x^3 + 4x^4 + 6x^5
[(-0+0j), (2+0j), (3+0j), (8+0j), (6+0j), (8+0j)]
[(-0-0j), (2+0j), (3-0j), (8-0j), (6+0j), (8+0j)]
__str__ test
>>> print(x)
A = 0*x^0 + 1*x^1 + 2*x^0 + 3*x^2
B = 0*x^2 + 1*x^3 + 2*x^4
A*B = 0*x^(-0+0j) + 1*x^(2+0j) + 2*x^(3+0j) + 3*x^(8+0j) + 4*x^(6+0j) + 5*x^(8+0j)
A*B = 0*x^(-0-0j) + 1*x^(2+0j) + 2*x^(3-0j) + 3*x^(8-0j) + 4*x^(6+0j) + 5*x^(8+0j)
"""
def __init__(self, poly_a=None, poly_b=None):

View File

@ -10,18 +10,22 @@ classifiers = [
]
dependencies = [
"beautifulsoup4>=4.12.3",
"cython>=3.1.0rc2", # For lxml on Python 3.14 pre-release
"fake-useragent>=1.5.1",
"imageio>=2.36.1",
"keras>=3.7",
"lxml>=5.3",
# "lxml>=5.4",
"lxml @ git+https://github.com/lxml/lxml",
"matplotlib>=3.9.3",
"numpy>=2.1.3",
"opencv-python>=4.10.0.84",
"pandas>=2.2.3",
"pillow>=11",
# "pillow>=11",
"pillow @ git+https://github.com/python-pillow/pillow",
"requests>=2.32.3",
"rich>=13.9.4",
"scikit-learn>=1.5.2",
"setuptools",
"sphinx-pyproject>=0.3",
"statsmodels>=0.14.4",
"sympy>=1.13.3",
@ -187,9 +191,9 @@ autoapi_dirs = [
"boolean_algebra",
"cellular_automata",
"ciphers",
"compression",
"computer_vision",
"conversions",
"data_compression",
"data_structures",
"digital_image_processing",
"divide_and_conquer",