Skip to content

Commit 5dd45b0

Browse files
committed
Add support for Python 3.12 and 3.13
1 parent 2c975a1 commit 5dd45b0

File tree

6 files changed

+27
-6
lines changed

6 files changed

+27
-6
lines changed

.github/workflows/python-package.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
os: [ubuntu-20.04, ubuntu-latest, windows-latest, macos-latest]
20-
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
20+
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
2121
exclude:
2222
- os: ubuntu-latest
2323
python-version: '3.6'
@@ -31,6 +31,10 @@ jobs:
3131
python-version: '3.10'
3232
- os: ubuntu-20.04
3333
python-version: '3.11'
34+
- os: ubuntu-20.04
35+
python-version: '3.12'
36+
- os: ubuntu-20.04
37+
python-version: '3.13'
3438

3539
steps:
3640
- uses: actions/checkout@v3

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
CHANGELOG
33
=========
44

5+
1.2.6 (layer_v13)
6+
===================
7+
* Add support for Python 3.12 and 3.13
8+
59
1.2.5 (layer_v12)
610
===================
711
* Fix bug which causes agent to crash if line_no was None.

codeguru_profiler_agent/agent_metadata/agent_metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# NOTE: Please do not alter the value for the following constants without the full knowledge of the use of them.
1010
# These constants are used in several scripts, including setup.py.
1111
__agent_name__ = "CodeGuruProfiler-python"
12-
__agent_version__ = "1.2.5"
12+
__agent_version__ = "1.2.6"
1313

1414

1515
def look_up_fleet_info(

codeguru_profiler_agent/utils/time.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from __future__ import absolute_import
22

33
import time
4-
from datetime import datetime
4+
from datetime import datetime, timezone
55

66

77
def to_iso(epoch_milli):
88
try:
9-
return datetime.utcfromtimestamp(epoch_milli / 1000).isoformat(
10-
timespec='milliseconds') + "Z" # ISO 8601 date-time format
9+
return datetime.fromtimestamp(epoch_milli / 1000, timezone.utc).replace(
10+
tzinfo=None).isoformat(timespec='milliseconds') + "Z" # ISO 8601 date-time format
1111
except ValueError:
1212
return str(epoch_milli)
1313

setup.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ def find_version(*file_paths):
3535
download_url="https://github.com/aws/amazon-codeguru-profiler-python-agent",
3636
classifiers=[
3737
"Programming Language :: Python :: 3",
38+
"Programming Language :: Python :: 3.6",
39+
"Programming Language :: Python :: 3.7",
40+
"Programming Language :: Python :: 3.8",
41+
"Programming Language :: Python :: 3.9",
42+
"Programming Language :: Python :: 3.10",
43+
"Programming Language :: Python :: 3.11",
44+
"Programming Language :: Python :: 3.12",
45+
"Programming Language :: Python :: 3.13",
3846
"Development Status :: 5 - Production/Stable",
3947
"Topic :: Utilities",
4048
"License :: OSI Approved :: Apache Software License"

test/unit/model/test_memory_counter.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,10 @@ def test_sanity_check_it_counts_frame_file_path_line_no_class_name_size(self):
6969
subject.count_create_node(frame="test/frame", file_path="test/file/path", class_name="TestClass")
7070
# [Oct-2020 Python-3.7.7] "test/frame" size: 59 bytes; "test/file/path" size: 63 bytes; "TestClass" size:
7171
# 58 bytes; fixed line_no size: 2 * 32 = 64; sum = 244
72-
expected_size = subject.empty_node_size_bytes + 244
72+
# [Dec-2025 Python-3.13] Internal string memory optimization reduced size by 24 bytes; sum = 220
73+
import sys
74+
if sys.version_info >= (3, 13):
75+
expected_size = subject.empty_node_size_bytes + 220
76+
else:
77+
expected_size = subject.empty_node_size_bytes + 244
7378
assert (subject.get_memory_usage_bytes() == expected_size)

0 commit comments

Comments
 (0)