Skip to content

Commit 2b64927

Browse files
authored
Add Free Threading support to CI (boto#3701)
* Add CI for Python 3.14t * Adjust memory limits to handle free-threading builds * Separate memory growth contstants for free threading
1 parent 66c8fa6 commit 2b64927

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

.github/workflows/run-crt-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15-dev']
22+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', '3.15-dev']
2323
os: [ubuntu-latest, macOS-latest, windows-latest]
2424
env:
2525
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: ${{ matrix.python-version == '3.15-dev' && '1' || '' }}

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15-dev']
22+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', '3.15-dev']
2323
os: [ubuntu-latest, macOS-latest, windows-latest]
2424
env:
2525
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: ${{ matrix.python-version == '3.15-dev' && '1' || '' }}

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,6 @@ def find_version(*file_paths):
6363
'Programming Language :: Python :: 3.12',
6464
'Programming Language :: Python :: 3.13',
6565
'Programming Language :: Python :: 3.14',
66+
'Programming Language :: Python :: Free Threading :: 2 - Beta',
6667
],
6768
)

tests/functional/leak/test_resource_leaks.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
13+
import sysconfig
14+
1315
from tests import BaseClientDriverTest
1416

1517

@@ -22,10 +24,15 @@ class TestDoesNotLeakMemory(BaseClientDriverTest):
2224
# a substantial amount of time to the total test run time.
2325
INJECT_DUMMY_CREDS = True
2426
# We're making up numbers here, but let's say arbitrarily
25-
# that the memory can't increase by more than 13MB.
27+
# that the memory can't increase by more than {SCALING_FACTOR} MBs.
2628

27-
# TODO: Attempt to bring this back to 10MB once Python 3.14 releases
28-
MAX_GROWTH_BYTES = 13 * 1024 * 1024
29+
if sysconfig.get_config_var("Py_GIL_DISABLED") == 1:
30+
# Free-threaded Python objects require additional
31+
# memory for per-object locks and synchronization.
32+
SCALING_FACTOR = 16
33+
else:
34+
SCALING_FACTOR = 13
35+
MAX_GROWTH_BYTES = SCALING_FACTOR * 1024 * 1024
2936

3037
def test_create_single_client_memory_constant(self):
3138
self.cmd('create_client', 's3')

0 commit comments

Comments
 (0)