From 880dde7e1a702ceabba12ed098d20f07eaa4b17f Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Mon, 27 Nov 2023 15:02:32 +0100 Subject: [PATCH 1/4] Releasing for python 3.12/3.13 and testing on 3.11. No 3.12 yet torch... https://github.com/pytorch/pytorch/issues/110436 --- .github/workflows/python-release.yml | 20 ++++++++++---------- .github/workflows/python.yml | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/python-release.yml b/.github/workflows/python-release.yml index b3264fb0..70d2a76c 100644 --- a/.github/workflows/python-release.yml +++ b/.github/workflows/python-release.yml @@ -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 diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 3edfed1a..82a0a50c 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -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 From 3b5277be304da66a63c8819856ee063de98b1850 Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Mon, 27 Nov 2023 15:04:42 +0100 Subject: [PATCH 2/4] Fix dev version. --- bindings/python/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python/Cargo.toml b/bindings/python/Cargo.toml index d4e3d862..5274ae9c 100644 --- a/bindings/python/Cargo.toml +++ b/bindings/python/Cargo.toml @@ -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" From f54d20e5f9fcbeed78f775782ad32a54b600ca05 Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Mon, 27 Nov 2023 15:24:39 +0100 Subject: [PATCH 3/4] Removing paddlepaddle for default tests. protobuf conflict issue being too old. --- .github/workflows/python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 82a0a50c..ba0a1a7a 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -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) From 6dafb271e1f6c882cc07ba61c4e8dcdf12545725 Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Mon, 27 Nov 2023 15:32:40 +0100 Subject: [PATCH 4/4] Skip paddle when not installed. --- bindings/python/tests/test_paddle_comparison.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bindings/python/tests/test_paddle_comparison.py b/bindings/python/tests/test_paddle_comparison.py index 2b3b7f32..931486ca 100644 --- a/bindings/python/tests/test_paddle_comparison.py +++ b/bindings/python/tests/test_paddle_comparison.py @@ -2,10 +2,17 @@ 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 = {