From be64be3d845382c02ecb66943d8865a2dda339c2 Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Mon, 5 Aug 2024 09:38:31 +0200 Subject: [PATCH 1/3] Rc0 version + Lock. --- bindings/python/Cargo.lock | 234 +++++++++++++++++++++++++++++++++++++ bindings/python/Cargo.toml | 2 +- safetensors/Cargo.toml | 2 +- 3 files changed, 236 insertions(+), 2 deletions(-) create mode 100644 bindings/python/Cargo.lock diff --git a/bindings/python/Cargo.lock b/bindings/python/Cargo.lock new file mode 100644 index 00000000..3119dfb2 --- /dev/null +++ b/bindings/python/Cargo.lock @@ -0,0 +1,234 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "indoc" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "memmap2" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + +[[package]] +name = "proc-macro2" +version = "1.0.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "pyo3" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831e8e819a138c36e212f3af3fd9eeffed6bf1510a805af35b0edee5ffa59433" +dependencies = [ + "cfg-if", + "indoc", + "libc", + "memoffset", + "once_cell", + "portable-atomic", + "pyo3-build-config", + "pyo3-ffi", + "pyo3-macros", + "unindent", +] + +[[package]] +name = "pyo3-build-config" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e8730e591b14492a8945cdff32f089250b05f5accecf74aeddf9e8272ce1fa8" +dependencies = [ + "once_cell", + "target-lexicon", +] + +[[package]] +name = "pyo3-ffi" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e97e919d2df92eb88ca80a037969f44e5e70356559654962cbb3316d00300c6" +dependencies = [ + "libc", + "pyo3-build-config", +] + +[[package]] +name = "pyo3-macros" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb57983022ad41f9e683a599f2fd13c3664d7063a3ac5714cae4b7bee7d3f206" +dependencies = [ + "proc-macro2", + "pyo3-macros-backend", + "quote", + "syn", +] + +[[package]] +name = "pyo3-macros-backend" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec480c0c51ddec81019531705acac51bcdbeae563557c982aa8263bb96880372" +dependencies = [ + "heck", + "proc-macro2", + "pyo3-build-config", + "quote", + "syn", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "safetensors" +version = "0.4.4-rc.0" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "safetensors-python" +version = "0.4.4-rc.0" +dependencies = [ + "memmap2", + "pyo3", + "safetensors", + "serde_json", +] + +[[package]] +name = "serde" +version = "1.0.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "syn" +version = "2.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "target-lexicon" +version = "0.12.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unindent" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce" diff --git a/bindings/python/Cargo.toml b/bindings/python/Cargo.toml index 89649ad3..4119ba69 100644 --- a/bindings/python/Cargo.toml +++ b/bindings/python/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "safetensors-python" -version = "0.4.5-dev.0" +version = "0.4.4-rc.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/safetensors/Cargo.toml b/safetensors/Cargo.toml index 6ef17233..eb123368 100644 --- a/safetensors/Cargo.toml +++ b/safetensors/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "safetensors" -version = "0.4.5-dev.0" +version = "0.4.4-rc.0" edition = "2021" homepage = "https://github.com/huggingface/safetensors" repository = "https://github.com/huggingface/safetensors" From 6933fcd1fcaf7ad6141439cb9dae7465e41be4a5 Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Mon, 5 Aug 2024 10:09:50 +0200 Subject: [PATCH 2/3] Attempting to repare release script. --- .github/workflows/python-release.yml | 56 ++++++++++++++++------------ 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/.github/workflows/python-release.yml b/.github/workflows/python-release.yml index ba11dc74..34c2f214 100644 --- a/.github/workflows/python-release.yml +++ b/.github/workflows/python-release.yml @@ -1,8 +1,8 @@ name: Python Release on: push: - tags: - - v* + # tags: + # - v* env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} @@ -124,17 +124,17 @@ jobs: - run: twine check --strict dist/* working-directory: ./bindings/python - - name: Upload wheels - shell: bash - run: | - pip install awscli - aws s3 sync --exact-timestamps ./bindings/python/dist "s3://safetensors-releases/python/$DIST_DIR" - - # - uses: actions/upload-artifact@v3 - # working-directory: ./bindings/python/ - # with: - # name: pypi_files - # path: dist + # - name: Upload wheels + # shell: bash + # run: | + # pip install awscli + # aws s3 sync --exact-timestamps ./bindings/python/dist "s3://safetensors-releases/python/$DIST_DIR" + + - uses: actions/upload-artifact@v4 + working-directory: ./bindings/python/ + with: + name: pypi_files + path: dist build-sdist: name: build sdist needs: [lock_exists] @@ -147,11 +147,16 @@ jobs: command: sdist args: --out dist rust-toolchain: stable - - name: Upload wheels - shell: bash - run: | - pip install awscli - aws s3 sync --exact-timestamps ./bindings/python/dist "s3://safetensors-releases/python/$DIST_DIR" + # - name: Upload wheels + # shell: bash + # run: | + # pip install awscli + # aws s3 sync --exact-timestamps ./bindings/python/dist "s3://safetensors-releases/python/$DIST_DIR" + - uses: actions/upload-artifact@v4 + working-directory: ./bindings/python/ + with: + name: pypi_files + path: dist upload_package: @@ -168,11 +173,16 @@ jobs: python-version: "3.12" architecture: x64 - - name: Retrieve all wheels - shell: bash - run: | - pip install awscli - aws s3 sync "s3://safetensors-releases/python/$DIST_DIR" ./bindings/python/dist + # - name: Retrieve all wheels + # shell: bash + # run: | + # pip install awscli + # aws s3 sync "s3://safetensors-releases/python/$DIST_DIR" ./bindings/python/dist + - uses: actions/download-artifact@v4 + working-directory: ./bindings/python/ + with: + name: pypi_files + path: dist - name: Upload to PyPi working-directory: ./bindings/python From a2aabb275e6816aa80b3a2ad196cf6bdd9a4af0b Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Mon, 5 Aug 2024 10:17:32 +0200 Subject: [PATCH 3/3] Deving gh action is always a pleasure. --- .github/workflows/python-release.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-release.yml b/.github/workflows/python-release.yml index 34c2f214..524641cb 100644 --- a/.github/workflows/python-release.yml +++ b/.github/workflows/python-release.yml @@ -131,10 +131,9 @@ jobs: # aws s3 sync --exact-timestamps ./bindings/python/dist "s3://safetensors-releases/python/$DIST_DIR" - uses: actions/upload-artifact@v4 - working-directory: ./bindings/python/ with: name: pypi_files - path: dist + path: ./bindings/python/dist build-sdist: name: build sdist needs: [lock_exists] @@ -153,10 +152,9 @@ jobs: # pip install awscli # aws s3 sync --exact-timestamps ./bindings/python/dist "s3://safetensors-releases/python/$DIST_DIR" - uses: actions/upload-artifact@v4 - working-directory: ./bindings/python/ with: name: pypi_files - path: dist + path: ./bindings/python/dist upload_package: @@ -179,10 +177,9 @@ jobs: # pip install awscli # aws s3 sync "s3://safetensors-releases/python/$DIST_DIR" ./bindings/python/dist - uses: actions/download-artifact@v4 - working-directory: ./bindings/python/ with: name: pypi_files - path: dist + path: ./bindings/python/dist - name: Upload to PyPi working-directory: ./bindings/python