From d7a50815c39a938ab07a50e50d8d361f6ddd1147 Mon Sep 17 00:00:00 2001 From: Krish Date: Tue, 23 Dec 2025 06:21:19 +0000 Subject: [PATCH 1/4] Python 3.13 Compatibility Testing --- .github/workflows/automation.yml | 5 ++--- .github/workflows/ci.yml | 2 +- pyproject.toml | 3 ++- setup.py | 1 + tests/benchmark_313.py | 33 ++++++++++++++++++++++++++++++++ 5 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 tests/benchmark_313.py diff --git a/.github/workflows/automation.yml b/.github/workflows/automation.yml index bc7bd104..85e08a31 100644 --- a/.github/workflows/automation.yml +++ b/.github/workflows/automation.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.10', '3.11', '3.12'] + python-version: ['3.10', '3.11', '3.12','3.13'] steps: - uses: actions/checkout@v4 @@ -32,8 +32,7 @@ jobs: pip install pytest pytest-cov pytest-mock pytest-asyncio - name: Run tests - run: | - python -m pytest tests/ -v --cov=cortex --cov-report=xml --cov-report=term-missing + run: | python -m pytest tests/ -v --cov=cortex --cov-report=xml --cov-report=term-missing - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83dc6e9a..b3008f38 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12","3.13"] steps: - name: Checkout diff --git a/pyproject.toml b/pyproject.toml index e59f5b83..efcd3cb1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,6 +37,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Operating System :: POSIX :: Linux", "Typing :: Typed", ] @@ -93,7 +94,7 @@ cortex = ["py.typed"] [tool.black] line-length = 100 -target-version = ["py310", "py311", "py312"] +target-version = ["py310", "py311", "py312","py313"] exclude = ''' /( \.eggs diff --git a/setup.py b/setup.py index 3a218042..750b0629 100644 --- a/setup.py +++ b/setup.py @@ -41,6 +41,7 @@ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Operating System :: POSIX :: Linux", ], python_requires=">=3.10", diff --git a/tests/benchmark_313.py b/tests/benchmark_313.py new file mode 100644 index 00000000..618f85da --- /dev/null +++ b/tests/benchmark_313.py @@ -0,0 +1,33 @@ +"""Cortex Python 3.13 Benchmark - Issue #272 +TO run benchmarks: +# Install PyYAML (only dep needed) +pip install pyyaml +# Test both versions +python3.11 benchmark_313.py +python3.13 benchmark_313.py +""" + +import sys +import timeit + +print(f"=== Cortex Python {sys.version_info.major}.{sys.version_info.minor} Benchmark ===\n") + +yaml_ops = """ +import yaml +data = {'test': i for i in range(100)} +yaml.dump(data) +""" +time_yaml = timeit.timeit(yaml_ops, number=1000) +print(f"āœ“ YAML Dump (1000x): {time_yaml:.4f}s") + +# Dict operations (common Cortex patterns) +dict_ops = """ +d = {i: i*2 for i in range(100)} +result = [v for k,v in d.items() if v > 50] +""" +time_dicts = timeit.timeit(dict_ops, number=1000) +print(f"āœ“ Dict Operations (1000x): {time_dicts:.4f}s") + +total = time_yaml + time_dicts +print(f"\nāœ… Total Time: {total:.4f}s") +print(f"āœ… Python {sys.version_info.major}.{sys.version_info.minor} = COMPATIBLE!") From ee72c6c716d1e3daea624d31d60960b26899bf2d Mon Sep 17 00:00:00 2001 From: Krish Date: Tue, 23 Dec 2025 07:23:10 +0000 Subject: [PATCH 2/4] fix - syntax --- .github/workflows/automation.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/automation.yml b/.github/workflows/automation.yml index 85e08a31..e76aae8e 100644 --- a/.github/workflows/automation.yml +++ b/.github/workflows/automation.yml @@ -32,7 +32,8 @@ jobs: pip install pytest pytest-cov pytest-mock pytest-asyncio - name: Run tests - run: | python -m pytest tests/ -v --cov=cortex --cov-report=xml --cov-report=term-missing + run: | + python -m pytest tests/ -v --cov=cortex --cov-report=xml --cov-report=term-missing - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 From 767d73b95b51dbd1b0b864a363433455b5d30e38 Mon Sep 17 00:00:00 2001 From: Krish Date: Tue, 23 Dec 2025 09:28:21 +0000 Subject: [PATCH 3/4] fix - spacing --- .github/workflows/automation.yml | 2 +- .github/workflows/ci.yml | 2 +- pyproject.toml | 2 +- tests/benchmark_313.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/automation.yml b/.github/workflows/automation.yml index 85dcb5e9..7206e728 100644 --- a/.github/workflows/automation.yml +++ b/.github/workflows/automation.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.10', '3.11', '3.12','3.13'] + python-version: ['3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3354aa81..1fb666c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11", "3.12","3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - name: Checkout diff --git a/pyproject.toml b/pyproject.toml index efcd3cb1..1de32865 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,7 +94,7 @@ cortex = ["py.typed"] [tool.black] line-length = 100 -target-version = ["py310", "py311", "py312","py313"] +target-version = ["py310", "py311", "py312", "py313"] exclude = ''' /( \.eggs diff --git a/tests/benchmark_313.py b/tests/benchmark_313.py index 618f85da..79e2d293 100644 --- a/tests/benchmark_313.py +++ b/tests/benchmark_313.py @@ -1,5 +1,5 @@ """Cortex Python 3.13 Benchmark - Issue #272 -TO run benchmarks: +To run benchmarks: # Install PyYAML (only dep needed) pip install pyyaml # Test both versions From 08de887919257618ac141e7e0bda0d0732b80228 Mon Sep 17 00:00:00 2001 From: Krish Date: Tue, 23 Dec 2025 09:48:43 +0000 Subject: [PATCH 4/4] fix - minor-bug --- tests/benchmark_313.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/benchmark_313.py b/tests/benchmark_313.py index 79e2d293..15464c74 100644 --- a/tests/benchmark_313.py +++ b/tests/benchmark_313.py @@ -14,7 +14,7 @@ yaml_ops = """ import yaml -data = {'test': i for i in range(100)} +data = {f'test_{i}': i for i in range(100)} yaml.dump(data) """ time_yaml = timeit.timeit(yaml_ops, number=1000)