]> khamidou — GitHub mirrors - safetensors.git/commitdiff
Releasing for python 3.12/3.13 and testing on 3.11. (#393)
authorNicolas Patry <patry.nicolas@protonmail.com>
Mon, 27 Nov 2023 14:42:37 +0000 (15:42 +0100)
committerGitHub <noreply@github.com>
Mon, 27 Nov 2023 14:42:37 +0000 (15:42 +0100)
* Releasing for python 3.12/3.13 and testing on 3.11.

No 3.12 yet torch... https://github.com/pytorch/pytorch/issues/110436

* Fix dev version.

* Removing paddlepaddle for default tests. protobuf conflict issue being
too old.

* Skip paddle when not installed.

.github/workflows/python-release.yml
.github/workflows/python.yml
bindings/python/Cargo.toml
bindings/python/tests/test_paddle_comparison.py

index b3264fb07a7228b334d9cb56a06a51e4deeae2ce..70d2a76cd283cacfeb1df89a86e79ed786edb0bb 100644 (file)
@@ -37,24 +37,24 @@ jobs:
             platform: linux
           - os: windows
             ls: dir
-            interpreter: 3.7 3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9 pypy3.10
+            interpreter: 3.7 3.8 3.9 3.10 3.11 3.12 3.13 pypy3.8 pypy3.9 pypy3.10
           - os: windows
             ls: dir
             target: i686
             python-architecture: x86
-            interpreter: 3.7 3.8 3.9 3.10 3.11
+            interpreter: 3.7 3.8 3.9 3.10 3.11 3.12 3.13
           - os: windows
             ls: dir
             target: x86_64
             python-architecture: x64
-            interpreter: 3.7 3.8 3.9 3.10 3.11
+            interpreter: 3.7 3.8 3.9 3.10 3.11 3.12 3.13
               # - os: windows
               #   ls: dir
               #   target: aarch64
               #   interpreter: 3.11 3.12
           - os: macos
             target: aarch64
-            interpreter: 3.7 3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9 pypy3.10
+            interpreter: 3.7 3.8 3.9 3.10 3.11 3.12 3.13 pypy3.8 pypy3.9 pypy3.10
           - os: ubuntu
             platform: linux
             target: i686
@@ -65,7 +65,7 @@ jobs:
           - os: ubuntu
             platform: linux
             target: armv7
-            interpreter: 3.7 3.8 3.9 3.10 3.11 3.12
+            interpreter: 3.7 3.8 3.9 3.10 3.11 3.12 3.13
           # musllinux
           - os: ubuntu
             platform: linux
@@ -78,11 +78,11 @@ jobs:
           - os: ubuntu
             platform: linux
             target: ppc64le
-            interpreter: 3.7 3.8 3.9 3.10 3.11 3.12
+            interpreter: 3.7 3.8 3.9 3.10 3.11 3.12 3.13
           - os: ubuntu
             platform: linux
             target: s390x
-            interpreter: 3.7 3.8 3.9 3.10 3.11 3.12
+            interpreter: 3.7 3.8 3.9 3.10 3.11 3.12 3.13
         exclude:
           # Optimized PGO builds for x86_64 manylinux and windows follow a different matrix,
           # maybe in future maturin-action can support this automatically
@@ -102,7 +102,7 @@ jobs:
       - name: set up python
         uses: actions/setup-python@v4
         with:
-          python-version: '3.11'
+          python-version: '3.12'
           architecture: ${{ matrix.python-architecture || 'x64' }}
 
       - run: pip install -U twine
@@ -114,7 +114,7 @@ jobs:
           working-directory: ./bindings/python
           manylinux: ${{ matrix.manylinux || 'auto' }}
           container: ${{ matrix.container }}
-          args: --release --out dist --interpreter ${{ matrix.interpreter || '3.7 3.8 3.9 3.10 3.11 3.12 pypy3.7 pypy3.8 pypy3.9 pypy3.10' }} ${{ matrix.extra-build-args }}
+          args: --release --out dist --interpreter ${{ matrix.interpreter || '3.7 3.8 3.9 3.10 3.11 3.12 3.13 pypy3.7 pypy3.8 pypy3.9 pypy3.10' }} ${{ matrix.extra-build-args }}
           rust-toolchain: stable
           docker-options: -e CI
 
@@ -165,7 +165,7 @@ jobs:
       - name: Install Python
         uses: actions/setup-python@v4
         with:
-          python-version: "3.10"
+          python-version: "3.12"
           architecture: x64
 
       - name: Retrieve all wheels
index 3edfed1a2bc80704a1705ce663216e124d924637..ba0a1a7a26dbce4e9b02edad4e6ad0d480027e3f 100644 (file)
@@ -12,7 +12,7 @@ jobs:
         os: [ubuntu-latest, macos-latest, windows-latest]
         # Lowest and highest, no version specified so that 
         # new releases get automatically tested against
-        version: [{torch: torch==1.10, python: "3.8"}, {torch: torch, python: "3.10"}]
+        version: [{torch: torch==1.10, python: "3.8"}, {torch: torch, python: "3.11"}]
     defaults:
       run:
         working-directory: ./bindings/python
@@ -49,7 +49,7 @@ jobs:
       - name: Install
         run: |
           pip install -U pip
-          pip install .[numpy,tensorflow,paddlepaddle]
+          pip install .[numpy,tensorflow]
           pip install ${{ matrix.version.torch }}
 
       - name: Install (jax, flax)
index d4e3d862c2cc306171af1b698f2fac7fb8253dc8..5274ae9c4fa2a5d989ca2685f689e5019561e9f7 100644 (file)
@@ -14,5 +14,5 @@ memmap2 = "0.5"
 serde_json = "1.0"
 
 [dependencies.safetensors]
-version = "0.4.1-dev.0"
+version = "0.4.2-dev.0"
 path = "../../safetensors"
index 2b3b7f32e8881ff48304637c6694c592374be766..931486ca4baa716b8a0a959c7d5c44abb982fa45 100644 (file)
@@ -2,10 +2,17 @@ import unittest
 
 import numpy as np
 
-import paddle
-from safetensors.paddle import load_file, save_file
 
+try:
+    import paddle
+    from safetensors.paddle import load_file, save_file
 
+    HAS_PADDLE = True
+except ImportError:
+    HAS_PADDLE = False
+
+
+@unittest.skipIf(not HAS_PADDLE, "Paddle is not available")
 class SafeTestCase(unittest.TestCase):
     def setUp(self):
         data = {