]> khamidou — GitHub mirrors - safetensors.git/commitdiff
Update workflow. (#109)
authorNicolas Patry <patry.nicolas@protonmail.com>
Wed, 23 Nov 2022 19:27:02 +0000 (20:27 +0100)
committerGitHub <noreply@github.com>
Wed, 23 Nov 2022 19:27:02 +0000 (20:27 +0100)
.github/workflows/python-release.yml
bindings/python/build-sdist.sh
bindings/python/setup.py

index b6e4ed796b1dae5e54781188f9d839b7032ea5b6..2908cd88ff11c1f4863a31ec10bc11886131b9e3 100644 (file)
@@ -158,6 +158,9 @@ jobs:
 
       - name: Install Python
         uses: actions/setup-python@v4
+        with:
+          python-version: 3.10
+          architecture: x64
 
       - name: Retrieve all wheels
         shell: bash
index 0e63021af7f6a10734d3ee7196a583d2174c93c9..c8a29d81a47e3e2a66b2a3eb6401f33a0a9728a7 100755 (executable)
@@ -1,9 +1,9 @@
 #!/bin/bash
 set -ex
 
-# Create a symlink for tokenizers-lib
-ln -sf ../../tokenizers tokenizers-lib
+# Create a symlink for safetensors-lib
+ln -sf ../../safetensors safetensors-lib
 # Modify cargo.toml to include this symlink
-sed -i 's/\.\.\/\.\.\/tokenizers/\.\/tokenizers-lib/' Cargo.toml
+sed -i 's/\.\.\/\.\.\/safetensors/\.\/safetensors-lib/' Cargo.toml
 # Build the source distribution
 python setup.py sdist
index d13d4ffa7dd33f3344a73daaea361e412bcd7d7b..eed0e2c6aba33b0bb5fdd7f8b26ea028af84ebe6 100644 (file)
@@ -1,4 +1,5 @@
 import re
+
 from setuptools import setup
 from setuptools_rust import Binding, RustExtension
 
@@ -23,12 +24,6 @@ _deps = [
 ]
 
 
-# this is a lookup table with items like:
-#
-# tokenizers: "tokenizers==0.9.4"
-# packaging: "packaging"
-#
-# some of the values are versioned whereas others aren't.
 deps = {b: a for a, b in (re.findall(r"^(([^!=<>~ ]+)(?:[!=<>~ ].*)?$)", x)[0] for x in _deps)}
 
 
@@ -36,15 +31,18 @@ def deps_list(*pkgs):
     return [deps[pkg] for pkg in pkgs]
 
 
-
 extras = {}
 extras["torch"] = deps_list("torch")
 extras["numpy"] = deps_list("numpy")
 extras["tensorflow"] = deps_list("tensorflow")
 extras["jax"] = deps_list("jax", "flax")
 extras["quality"] = deps_list("black", "isort", "flake8", "click")
-extras["testing"] = deps_list("setuptools_rust", "huggingface_hub", "pytest", "pytest-benchmark", "h5py") + extras["numpy"]
-extras["all"] = extras["torch"] + extras["numpy"] + extras["tensorflow"] + extras["jax"] + extras["quality"] + extras["testing"]
+extras["testing"] = (
+    deps_list("setuptools_rust", "huggingface_hub", "pytest", "pytest-benchmark", "h5py") + extras["numpy"]
+)
+extras["all"] = (
+    extras["torch"] + extras["numpy"] + extras["tensorflow"] + extras["jax"] + extras["quality"] + extras["testing"]
+)
 extras["dev"] = extras["all"]
 
 with open("py_src/safetensors/__init__.py", "r") as f: