Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
33 changes: 33 additions & 0 deletions tests/benchmark_313.py
Original file line number Diff line number Diff line change
@@ -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_setup = """
import yaml
data = {f'test_{i}': i for i in range(100)}
"""
yaml_stmt = "yaml.dump(data)"
time_yaml = timeit.timeit(stmt=yaml_stmt, setup=yaml_setup, 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)
Comment on lines +24 to +28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to the YAML benchmark, the dictionary creation is happening inside the timed loop. If the intention is to benchmark the list comprehension that filters the dictionary, it would be more accurate to create the dictionary d in the setup argument of timeit.timeit. This isolates the operation you want to measure.

dict_setup = "d = {i: i*2 for i in range(100)}"
dict_stmt = "result = [v for k,v in d.items() if v > 50]"
time_dicts = timeit.timeit(stmt=dict_stmt, setup=dict_setup, 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!")
Loading