Skip to content

Commit f797822

Browse files
elpransarkamarantonagestam
authored
Python 3.12 compatibility (#105)
Also, drop 3.6 and 3.7 as unsupported. Fixes: #104 Closes: #97 Closes: #100 Closes: #103 Co-authored-by: Petr Vaněk <[email protected]> Co-authored-by: Anton Agestam <[email protected]>
1 parent 765e4ee commit f797822

File tree

4 files changed

+18
-25
lines changed

4 files changed

+18
-25
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,16 @@ jobs:
7272
os: [ubuntu-latest, macos-latest, windows-latest]
7373
cibw_arch: ["auto64", "aarch64", "universal2"]
7474
cibw_python:
75-
- "cp36-*"
76-
- "cp37-*"
7775
- "cp38-*"
7876
- "cp39-*"
7977
- "cp310-*"
8078
- "cp311-*"
79+
- "cp312-*"
8180
exclude:
8281
- os: ubuntu-latest
8382
cibw_arch: universal2
8483
- os: macos-latest
8584
cibw_arch: aarch64
86-
- os: macos-latest
87-
cibw_python: "cp36-*"
88-
cibw_arch: universal2
89-
- os: macos-latest
90-
cibw_python: "cp37-*"
91-
cibw_arch: universal2
9285
- os: windows-latest
9386
cibw_arch: universal2
9487
- os: windows-latest

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
17-
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
17+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12.0-beta.4"]
1818
os: [windows-latest, ubuntu-latest, macos-latest]
1919
arch: [x64, x86]
2020
exclude:

immutables/_map.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -529,10 +529,10 @@ _map_dump_format(_PyUnicodeWriter *writer, const char *format, ...)
529529
int ret;
530530

531531
va_list vargs;
532-
#ifdef HAVE_STDARG_PROTOTYPES
533-
va_start(vargs, format);
534-
#else
532+
#if PY_VERSION_HEX < 0x030C00A1 && !defined(HAVE_STDARG_PROTOTYPES)
535533
va_start(vargs);
534+
#else
535+
va_start(vargs, format);
536536
#endif
537537
msg = PyUnicode_FromFormatV(format, vargs);
538538
va_end(vargs);
@@ -1247,7 +1247,7 @@ map_node_bitmap_dealloc(MapNode_Bitmap *self)
12471247
Py_ssize_t i;
12481248

12491249
PyObject_GC_UnTrack(self);
1250-
Py_TRASHCAN_SAFE_BEGIN(self)
1250+
Py_TRASHCAN_BEGIN(self, map_node_bitmap_dealloc)
12511251

12521252
if (len > 0) {
12531253
i = len;
@@ -1257,7 +1257,7 @@ map_node_bitmap_dealloc(MapNode_Bitmap *self)
12571257
}
12581258

12591259
Py_TYPE(self)->tp_free((PyObject *)self);
1260-
Py_TRASHCAN_SAFE_END(self)
1260+
Py_TRASHCAN_END
12611261
}
12621262

12631263
static int
@@ -1664,7 +1664,7 @@ map_node_collision_dealloc(MapNode_Collision *self)
16641664
Py_ssize_t len = Py_SIZE(self);
16651665

16661666
PyObject_GC_UnTrack(self);
1667-
Py_TRASHCAN_SAFE_BEGIN(self)
1667+
Py_TRASHCAN_BEGIN(self, map_node_collision_dealloc)
16681668

16691669
if (len > 0) {
16701670

@@ -1674,7 +1674,7 @@ map_node_collision_dealloc(MapNode_Collision *self)
16741674
}
16751675

16761676
Py_TYPE(self)->tp_free((PyObject *)self);
1677-
Py_TRASHCAN_SAFE_END(self)
1677+
Py_TRASHCAN_END
16781678
}
16791679

16801680
static int
@@ -2083,14 +2083,14 @@ map_node_array_dealloc(MapNode_Array *self)
20832083
Py_ssize_t i;
20842084

20852085
PyObject_GC_UnTrack(self);
2086-
Py_TRASHCAN_SAFE_BEGIN(self)
2086+
Py_TRASHCAN_BEGIN(self, map_node_array_dealloc)
20872087

20882088
for (i = 0; i < HAMT_ARRAY_NODE_SIZE; i++) {
20892089
Py_XDECREF(self->a_array[i]);
20902090
}
20912091

20922092
Py_TYPE(self)->tp_free((PyObject *)self);
2093-
Py_TRASHCAN_SAFE_END(self)
2093+
Py_TRASHCAN_END
20942094
}
20952095

20962096
static int

setup.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
# pycodestyle is a dependency of flake8, but it must be frozen because
99
# their combination breaks too often
1010
# (example breakage: https://gitlab.com/pycqa/flake8/issues/427)
11-
'flake8~=5.0.4',
12-
'pycodestyle~=2.9.1',
13-
'mypy==0.971',
14-
'pytest~=6.2.4',
11+
'flake8~=5.0',
12+
'pycodestyle~=2.9',
13+
'mypy~=1.4',
14+
'pytest~=7.4',
1515
]
1616

1717
EXTRA_DEPENDENCIES = {
@@ -71,16 +71,16 @@
7171
version=VERSION,
7272
description='Immutable Collections',
7373
long_description=readme,
74-
python_requires='>=3.6',
74+
python_requires='>=3.7',
7575
classifiers=[
7676
'License :: OSI Approved :: Apache Software License',
7777
'Intended Audience :: Developers',
7878
'Programming Language :: Python :: 3 :: Only',
79-
'Programming Language :: Python :: 3.6',
80-
'Programming Language :: Python :: 3.7',
8179
'Programming Language :: Python :: 3.8',
8280
'Programming Language :: Python :: 3.9',
8381
'Programming Language :: Python :: 3.10',
82+
'Programming Language :: Python :: 3.11',
83+
'Programming Language :: Python :: 3.12',
8484
'Operating System :: POSIX',
8585
'Operating System :: MacOS :: MacOS X',
8686
'Operating System :: Microsoft :: Windows',

0 commit comments

Comments
 (0)