From 64b0ee69502d69d013b0ac79af3166a1478e04e2 Mon Sep 17 00:00:00 2001 From: Ivo Maceira Date: Thu, 11 Sep 2025 13:04:42 +0200 Subject: [PATCH 1/5] Add python 3.13 to github build workflow straight copy of 3.12 jobs --- .github/workflows/build.yml | 153 ++++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d25810255..0dfc16de8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -373,6 +373,59 @@ jobs: - name: Uninstall wheel run: python -m pip uninstall -y $DT_WHEEL + linux-313: + name: Linux / Python 3.13 + runs-on: ubuntu-latest + needs: setup + if: ${{ needs.setup.outputs.DT_RELEASE == 'True' }} + + env: + DT_HARNESS: ${{ needs.setup.outputs.DT_HARNESS }} + DT_BUILD_ID: ${{ needs.setup.outputs.DT_BUILD_ID }} + DT_RELEASE: ${{ needs.setup.outputs.DT_RELEASE }} + DT_BUILD_SUFFIX: ${{ needs.setup.outputs.DT_BUILD_SUFFIX }} + DT_BUILD_NUMBER: ${{ needs.setup.outputs.DT_BUILD_NUMBER }} + DT_CHANGE_BRANCH: ${{ needs.setup.outputs.DT_CHANGE_BRANCH }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python 3.13 + uses: actions/setup-python@v3 + with: + python-version: "3.13" + + - name: Build datatable wheel + run: | + python -V + python -m pip install --upgrade pip + # Update to normal install when they publish the next version > 5.4.0 + # Current version fails on 3.13 because of distutils + python -m pip install git+https://github.com/pypa/auditwheel + python ci/ext.py wheel --audit + echo "DT_WHEEL=$(ls dist/*-cp313-*.whl)" >> $GITHUB_ENV + + - name: Print build information + run: | + echo "DT_WHEEL = $DT_WHEEL" + cat src/datatable/_build_info.py + + - name: Save wheel artifact + uses: actions/upload-artifact@v3 + with: + name: wheel-ubuntu-3.13 + path: ${{ env.DT_WHEEL }} + + - name: Install and test + run: | + python -m pip install $DT_WHEEL + python -m pip install pytest docutils pandas pyarrow + python -m pytest -ra --maxfail=10 -Werror -vv --showlocals ./tests/ + + - name: Uninstall wheel + run: python -m pip uninstall -y $DT_WHEEL + #------------------------------------------------------------------------------------- # MacOS #------------------------------------------------------------------------------------- @@ -626,6 +679,56 @@ jobs: - name: Uninstall wheel run: python -m pip uninstall -y $DT_WHEEL + macos-313: + name: MacOS / Python 3.13 + runs-on: macos-latest + needs: setup + if: ${{ needs.setup.outputs.DT_RELEASE == 'True' }} + + env: + DT_HARNESS: ${{ needs.setup.outputs.DT_HARNESS }} + DT_BUILD_ID: ${{ needs.setup.outputs.DT_BUILD_ID }} + DT_RELEASE: ${{ needs.setup.outputs.DT_RELEASE }} + DT_BUILD_SUFFIX: ${{ needs.setup.outputs.DT_BUILD_SUFFIX }} + DT_BUILD_NUMBER: ${{ needs.setup.outputs.DT_BUILD_NUMBER }} + DT_CHANGE_BRANCH: ${{ needs.setup.outputs.DT_CHANGE_BRANCH }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python 3.13 + uses: actions/setup-python@v3 + with: + python-version: "3.13" + + - name: Build datatable wheel + run: | + python -V + python -m pip install --upgrade pip + python ci/ext.py wheel + echo "DT_WHEEL=$(ls dist/*-cp313-*.whl)" >> $GITHUB_ENV + + - name: Print build information + run: | + echo "DT_WHEEL = $DT_WHEEL" + cat src/datatable/_build_info.py + + - name: Save wheel artifact + uses: actions/upload-artifact@v3 + with: + name: wheel-macos-3.13 + path: ${{ env.DT_WHEEL }} + + - name: Install and test + run: | + python -m pip install $DT_WHEEL + python -m pip install pytest docutils pandas pyarrow + python -m pytest -ra --maxfail=10 -Werror -vv --showlocals ./tests/ + + - name: Uninstall wheel + run: python -m pip uninstall -y $DT_WHEEL + #------------------------------------------------------------------------------------- # Windows #------------------------------------------------------------------------------------- @@ -878,3 +981,53 @@ jobs: - name: Uninstall wheel run: python -m pip uninstall -y $env:DT_WHEEL + + win-313: + name: Windows / Python 3.13 + runs-on: windows-latest + needs: setup + if: ${{ needs.setup.outputs.DT_RELEASE == '(disabled)' }} + + env: + DT_HARNESS: ${{ needs.setup.outputs.DT_HARNESS }} + DT_BUILD_ID: ${{ needs.setup.outputs.DT_BUILD_ID }} + DT_RELEASE: ${{ needs.setup.outputs.DT_RELEASE }} + DT_BUILD_SUFFIX: ${{ needs.setup.outputs.DT_BUILD_SUFFIX }} + DT_BUILD_NUMBER: ${{ needs.setup.outputs.DT_BUILD_NUMBER }} + DT_CHANGE_BRANCH: ${{ needs.setup.outputs.DT_CHANGE_BRANCH }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python 3.13 + uses: actions/setup-python@v3 + with: + python-version: "3.13" + + - name: Build datatable wheel + run: | + python -V + python -m pip install --upgrade pip + python ci/ext.py wheel + echo "DT_WHEEL=$(ls dist/*-cp313-*.whl)" >> $env:GITHUB_ENV + + - name: Print build information + run: | + echo "DT_WHEEL = $env:DT_WHEEL" + cat src/datatable/_build_info.py + + - name: Save wheel artifact + uses: actions/upload-artifact@v3 + with: + name: wheel-windows-3.13 + path: ${{ env.DT_WHEEL }} + + - name: Install and test + run: | + python -m pip install $env:DT_WHEEL + python -m pip install pytest docutils pandas pyarrow + python -m pytest -ra --maxfail=10 -Werror -vv --showlocals ./tests/ + + - name: Uninstall wheel + run: python -m pip uninstall -y $env:DT_WHEEL From 0e0fdab0554f178014d5f1252ed092b352e5c203 Mon Sep 17 00:00:00 2001 From: Ivo Maceira Date: Thu, 11 Sep 2025 13:11:36 +0200 Subject: [PATCH 2/5] update upload artifact action to v4 v3 is now unavailable on GitHub --- .github/workflows/build.yml | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0dfc16de8..10f30fe57 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -108,7 +108,7 @@ jobs: echo "DT_SDIST=$(ls dist/*.tar.gz)" >> $GITHUB_ENV - name: Save sdist artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: sdist path: ${{ env.DT_SDIST }} @@ -153,7 +153,7 @@ jobs: cat src/datatable/_build_info.py - name: Save wheel artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-ubuntu-3.8 path: ${{ env.DT_WHEEL }} @@ -204,7 +204,7 @@ jobs: cat src/datatable/_build_info.py - name: Save wheel artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-ubuntu-3.9 path: ${{ env.DT_WHEEL }} @@ -255,7 +255,7 @@ jobs: cat src/datatable/_build_info.py - name: Save wheel artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-ubuntu-3.10 path: ${{ env.DT_WHEEL }} @@ -306,7 +306,7 @@ jobs: cat src/datatable/_build_info.py - name: Save wheel artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-ubuntu-3.11 path: ${{ env.DT_WHEEL }} @@ -359,7 +359,7 @@ jobs: cat src/datatable/_build_info.py - name: Save wheel artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-ubuntu-3.12 path: ${{ env.DT_WHEEL }} @@ -412,7 +412,7 @@ jobs: cat src/datatable/_build_info.py - name: Save wheel artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-ubuntu-3.13 path: ${{ env.DT_WHEEL }} @@ -466,7 +466,7 @@ jobs: cat src/datatable/_build_info.py - name: Save wheel artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-macos-3.8 path: ${{ env.DT_WHEEL }} @@ -516,7 +516,7 @@ jobs: cat src/datatable/_build_info.py - name: Save wheel artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-macos-3.9 path: ${{ env.DT_WHEEL }} @@ -566,7 +566,7 @@ jobs: cat src/datatable/_build_info.py - name: Save wheel artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-macos-3.10 path: ${{ env.DT_WHEEL }} @@ -615,7 +615,7 @@ jobs: cat src/datatable/_build_info.py - name: Save wheel artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-macos-3.11 path: ${{ env.DT_WHEEL }} @@ -665,7 +665,7 @@ jobs: cat src/datatable/_build_info.py - name: Save wheel artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-macos-3.12 path: ${{ env.DT_WHEEL }} @@ -715,7 +715,7 @@ jobs: cat src/datatable/_build_info.py - name: Save wheel artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-macos-3.13 path: ${{ env.DT_WHEEL }} @@ -768,7 +768,7 @@ jobs: cat src/datatable/_build_info.py - name: Save wheel artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-windows-3.8 path: ${{ env.DT_WHEEL }} @@ -818,7 +818,7 @@ jobs: cat src/datatable/_build_info.py - name: Save wheel artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-windows-3.9 path: ${{ env.DT_WHEEL }} @@ -868,7 +868,7 @@ jobs: cat src/datatable/_build_info.py - name: Save wheel artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-windows-3.10 path: ${{ env.DT_WHEEL }} @@ -918,7 +918,7 @@ jobs: cat src/datatable/_build_info.py - name: Save wheel artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-windows-3.11 path: ${{ env.DT_WHEEL }} @@ -968,7 +968,7 @@ jobs: cat src/datatable/_build_info.py - name: Save wheel artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-windows-3.12 path: ${{ env.DT_WHEEL }} @@ -1018,7 +1018,7 @@ jobs: cat src/datatable/_build_info.py - name: Save wheel artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-windows-3.13 path: ${{ env.DT_WHEEL }} From 4348f8d607b1795204c39d950105015ce9fd21b3 Mon Sep 17 00:00:00 2001 From: Ivo Maceira Date: Thu, 11 Sep 2025 01:59:34 +0200 Subject: [PATCH 3/5] Use np.nan instead of np.NaN np.NaN, alias of np.nan, was removed in numpy 2.0 --- tests/ijby/test-sort.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 tests/ijby/test-sort.py diff --git a/tests/ijby/test-sort.py b/tests/ijby/test-sort.py old mode 100644 new mode 100755 index 6a21c5a4a..de05e98a3 --- a/tests/ijby/test-sort.py +++ b/tests/ijby/test-sort.py @@ -1021,7 +1021,7 @@ def test_sort_with_reverse_list_false_true(numpy): { 'A': ['o1','o2','o3','o4','o5'], 'B': ['c1','c1','c2','c2','c3'], - 'C': [5, 1, 3, numpy.NaN, numpy.NaN] + 'C': [5, 1, 3, numpy.nan, numpy.nan] }) EXP = DT[:, :, dt.sort(f.B, -f.A)] RES1 = DT[:, :, dt.sort("B", "A", reverse=[False, True])] @@ -1037,7 +1037,7 @@ def test_sort_with_reverse_list_true_true(numpy): { 'A': ['o1', 'o2', 'o3', 'o4', 'o5'], 'B': ['c1', 'c1', 'c2', 'c2', 'c3'], - 'C': [5,1,3, numpy.NaN,numpy.NaN] + 'C': [5,1,3, numpy.nan,numpy.nan] }) EXP = DT[:, :, dt.sort(-f.A, -f.B)] RES1 = DT[:, :, dt.sort("B", "A", reverse=[True, True])] @@ -1055,7 +1055,7 @@ def test_reverse_list_error(numpy): { 'A': ['o1', 'o2', 'o3', 'o4', 'o5']*25, 'B': ['c1', 'c1', 'c2', 'c2', 'c3']*25, - 'C': [5, 1, 3, numpy.NaN, numpy.NaN]*25 + 'C': [5, 1, 3, numpy.nan, numpy.nan]*25 }) with pytest.raises(ValueError, match=msg): DT[:, :, dt.sort(0, 1, reverse=[True])] From 011fc7d0d02182c1ddd8085aa48aae0931660531 Mon Sep 17 00:00:00 2001 From: Ivo Maceira Date: Wed, 10 Sep 2025 21:40:25 +0200 Subject: [PATCH 4/5] Remove datatable itself from requirements datatable being in the docs requirements seems like a bug --- requirements_docs.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements_docs.txt b/requirements_docs.txt index 778267ae9..7408acdad 100644 --- a/requirements_docs.txt +++ b/requirements_docs.txt @@ -3,4 +3,3 @@ pygments>=2.6 sphinx>=4.0, <5.0 sphinx_rtd_theme>=0.5 nbsphinx>=0.5 -datatable From ba34b0c74fd8c34cb9eeb17a4ac15532499cdd6f Mon Sep 17 00:00:00 2001 From: Ivo Maceira Date: Wed, 10 Sep 2025 21:50:18 +0200 Subject: [PATCH 5/5] Use PyObject_Size on python>=3.9 _PySys_GetSizeOf is now removed in python 3.13 --- src/core/python/obj.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/python/obj.cc b/src/core/python/obj.cc index 6e9a22895..24aaba96e 100644 --- a/src/core/python/obj.cc +++ b/src/core/python/obj.cc @@ -1191,7 +1191,12 @@ std::string _obj::typestr() const { size_t _obj::get_sizeof() const { +#if PY_VERSION_HEX < 0x03090000 return _PySys_GetSizeOf(v); +#else + // Python 3.9+ + return PyObject_Size(v); +#endif } size_t _obj::get_refcount() const {