Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding hf-transfer #28926

Merged
merged 12 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions recipes/hf-transfer/001-cargo.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From 8df707113be195c61c170b3991df22f1feb3c03d Mon Sep 17 00:00:00 2001
From: Zac Bowling <[email protected]>
Date: Fri, 24 Jan 2025 16:23:56 -0800
Subject: [PATCH] Don't vendor openssl

---
Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Cargo.toml b/Cargo.toml
index 29f9d8a..c5df2ef 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,7 +10,7 @@ crate-type = ["cdylib"]

[dependencies]
futures = "0.3"
-openssl = { version = "0.10", features = ["vendored"] }
+openssl = { version = "0.10" }
pyo3 = { version = "0.23", features = ["extension-module", "abi3-py38"] }
rand = "0.8.5"
reqwest = { version = "0.12", features = ["stream"] }
64 changes: 64 additions & 0 deletions recipes/hf-transfer/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
context:
name: hf-transfer
version: 0.1.9

package:
name: ${{ name|lower }}
version: ${{ version }}

source:
url: https://pypi.org/packages/source/${{ name[0] }}/${{ name }}/hf_transfer-${{ version }}.tar.gz
sha256: 035572865dab29d17e783fbf1e84cf1cb24f3fcf8f1b17db1cfc7fdf139f02bf
patches:
# unvendor openssl
- 001-cargo.patch

build:
number: 0
script:
- if: unix
then:
- export OPENSSL_DIR="$PREFIX"
- export OPENSSL_NO_VENDOR=1
else:
- set OPENSSL_DIR=%LIBRARY_PREFIX%
- set OPENSSL_NO_VENDOR=1
- cargo-bundle-licenses --format yaml --output THIRDPARTY.yml
- ${{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation

requirements:
build:
- ${{ stdlib('c') }}
- ${{ compiler('rust') }}
- pkg-config
- cargo-bundle-licenses
host:
- python
- maturin >=1.4,<2
- pip
- openssl
run:
- python

tests:
- python:
imports:
- hf_transfer
- requirements:
zbowling marked this conversation as resolved.
Show resolved Hide resolved
run:
- pip
script:
- pip check

about:
summary: Speed up file transfers with the Hugging Face Hub.
license: Apache-2.0
license_file:
- LICENSE
- THIRDPARTY.yml
homepage: https://github.com/huggingface/hf_transfer
repository: https://github.com/huggingface/hf_transfer

extra:
recipe-maintainers:
- zbowling
Loading