Skip to content

Commit 81d7c92

Browse files
Replace _PyLong_Format with PyNumber_ToBase (#118)
`_PyLong_Format` is in Python’s internal, private API; `PyNumber_ToBase` belongs to the Stable API, and is a fairly thin wrapper around `_PyLong_Format` with a bit of extra error checking. Fixes #116. Also updates CI action versions and fixes CI issues. --------- Co-authored-by: Fantix King <[email protected]>
1 parent 3ba46f7 commit 81d7c92

File tree

3 files changed

+31
-20
lines changed

3 files changed

+31
-20
lines changed

.github/workflows/release.yml

+17-16
Original file line numberDiff line numberDiff line change
@@ -37,31 +37,31 @@ jobs:
3737
mkdir -p dist/
3838
echo "${VERSION}" > dist/VERSION
3939
40-
- uses: actions/upload-artifact@v2
40+
- uses: actions/upload-artifact@v4
4141
with:
42-
name: dist
42+
name: dist-version
4343
path: dist/
4444

4545
build-sdist:
4646
needs: validate-release-request
4747
runs-on: ubuntu-latest
4848

4949
steps:
50-
- uses: actions/checkout@v3
50+
- uses: actions/checkout@v4
5151
with:
5252
fetch-depth: 50
5353
submodules: true
5454

55-
- uses: actions/setup-python@v4
55+
- uses: actions/setup-python@v5
5656

5757
- name: Build source distribution
5858
run: |
5959
python -m pip install -U setuptools wheel pip
6060
python setup.py sdist
6161
62-
- uses: actions/upload-artifact@v3
62+
- uses: actions/upload-artifact@v4
6363
with:
64-
name: dist
64+
name: dist-sdist
6565
path: dist/*.tar.*
6666

6767
build-wheels-matrix:
@@ -70,11 +70,11 @@ jobs:
7070
outputs:
7171
include: ${{ steps.set-matrix.outputs.include }}
7272
steps:
73-
- uses: actions/checkout@v3
74-
- uses: actions/setup-python@v4
73+
- uses: actions/checkout@v4
74+
- uses: actions/setup-python@v5
7575
with:
7676
python-version: "3.x"
77-
- run: pip install cibuildwheel==2.15.0
77+
- run: pip install cibuildwheel==2.21.3
7878
- id: set-matrix
7979
run: |
8080
MATRIX_INCLUDE=$(
@@ -103,7 +103,7 @@ jobs:
103103
PIP_DISABLE_PIP_VERSION_CHECK: 1
104104

105105
steps:
106-
- uses: actions/checkout@v3
106+
- uses: actions/checkout@v4
107107
with:
108108
fetch-depth: 50
109109
submodules: true
@@ -112,31 +112,32 @@ jobs:
112112
if: runner.os == 'Linux'
113113
uses: docker/setup-qemu-action@v2
114114

115-
- uses: pypa/cibuildwheel@39a63b5912f086dd459cf6fcb13dcdd3fe3bc24d # v2.15.0
115+
- uses: pypa/cibuildwheel@7940a4c0e76eb2030e473a5f864f291f63ee879b # v2.21.3
116116
with:
117117
only: ${{ matrix.only }}
118118
env:
119119
CIBW_BUILD_VERBOSITY: 1
120120
CIBW_ENVIRONMENT: "IMMU_SKIP_MYPY_TESTS=1"
121121

122-
- uses: actions/upload-artifact@v3
122+
- uses: actions/upload-artifact@v4
123123
with:
124-
name: dist
124+
name: dist-${{ matrix.only }}
125125
path: wheelhouse/*.whl
126126

127127
publish:
128128
needs: [build-sdist, build-wheels]
129129
runs-on: ubuntu-latest
130130

131131
steps:
132-
- uses: actions/checkout@v3
132+
- uses: actions/checkout@v4
133133
with:
134134
fetch-depth: 5
135135
submodules: false
136136

137-
- uses: actions/download-artifact@v2
137+
- uses: actions/download-artifact@v4
138138
with:
139-
name: dist
139+
name: dist-*
140+
merge-multiple: true
140141
path: dist/
141142

142143
- name: Extract Release Version

.github/workflows/tests.yml

+13-3
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.8", "3.9", "3.10", "3.11", "3.12.0-beta.4"]
17+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
1818
os: [windows-latest, ubuntu-latest, macos-latest]
1919
arch: [x64, x86]
2020
exclude:
@@ -23,9 +23,19 @@ jobs:
2323
arch: x86
2424
- os: macos-latest
2525
arch: x86
26+
# https://github.com/actions/setup-python/issues/948
27+
- os: macos-latest
28+
arch: x64
29+
python-version: 3.8
30+
- os: macos-latest
31+
arch: x64
32+
python-version: 3.9
33+
- os: macos-latest
34+
arch: x64
35+
python-version: 3.10
2636

2737
steps:
28-
- uses: actions/checkout@v3
38+
- uses: actions/checkout@v4
2939
with:
3040
fetch-depth: 50
3141
submodules: true
@@ -41,7 +51,7 @@ jobs:
4151
__version__\s*=\s*(?:['"])([[:PEP440:]])(?:['"])
4252
4353
- name: Set up Python ${{ matrix.python-version }}
44-
uses: actions/setup-python@v4
54+
uses: actions/setup-python@v5
4555
if: steps.release.outputs.version == 0
4656
env:
4757
PIP_DISABLE_PIP_VERSION_CHECK: 1

immutables/_map.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,7 @@ map_node_bitmap_dump(MapNode_Bitmap *node,
12841284
if (tmp1 == NULL) {
12851285
goto error;
12861286
}
1287-
tmp2 = _PyLong_Format(tmp1, 2);
1287+
tmp2 = PyNumber_ToBase(tmp1, 2);
12881288
Py_DECREF(tmp1);
12891289
if (tmp2 == NULL) {
12901290
goto error;

0 commit comments

Comments
 (0)