From 419bda5cac9a833a40a5889a46d81f32fb65babf Mon Sep 17 00:00:00 2001 From: Akshay Ballal Date: Mon, 15 Apr 2024 17:09:40 +0200 Subject: [PATCH 1/4] Update CI workflow to remove --find-interpreter argument --- .github/workflows/CI.yml | 8 ++-- .github/workflows/python-publish.yml | 39 ------------------ python/embed_anything/__init__.py | 1 - .../embed_anything/{lib => }/libiomp5md.dll | Bin 4 files changed, 4 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/python-publish.yml rename python/embed_anything/{lib => }/libiomp5md.dll (100%) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f8847112..1ed2bbc9 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -45,7 +45,7 @@ jobs: uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter + args: --release --out dist sccache: 'true' manylinux: auto - name: Upload wheels @@ -73,7 +73,7 @@ jobs: uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter + args: --release --out dist sccache: 'true' - name: Upload wheels uses: actions/upload-artifact@v4 @@ -99,7 +99,7 @@ jobs: uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter + args: --release --out dist sccache: 'true' - name: Upload wheels uses: actions/upload-artifact@v4 @@ -125,7 +125,7 @@ jobs: release: name: Release runs-on: ubuntu-latest - if: "startsWith(github.ref, 'refs/tags/')" + if: 'startsWith(github.ref, "refs/tags/")' needs: [linux, windows, macos, sdist] steps: - uses: actions/download-artifact@v4 diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml deleted file mode 100644 index bdaab28a..00000000 --- a/.github/workflows/python-publish.yml +++ /dev/null @@ -1,39 +0,0 @@ -# This workflow will upload a Python Package using Twine when a release is created -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries - -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: Upload Python Package - -on: - release: - types: [published] - -permissions: - contents: read - -jobs: - deploy: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install build - - name: Build package - run: python -m build - - name: Publish package - uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/python/embed_anything/__init__.py b/python/embed_anything/__init__.py index 6d179070..b1b538b0 100644 --- a/python/embed_anything/__init__.py +++ b/python/embed_anything/__init__.py @@ -1,5 +1,4 @@ import os -os.add_dll_directory(os.path.dirname(__file__)+os.path.sep + "lib") from .embed_anything import * __doc__ = embed_anything.__doc__ diff --git a/python/embed_anything/lib/libiomp5md.dll b/python/embed_anything/libiomp5md.dll similarity index 100% rename from python/embed_anything/lib/libiomp5md.dll rename to python/embed_anything/libiomp5md.dll From b95509020f5f421654911e75dc69f191adcde46b Mon Sep 17 00:00:00 2001 From: Akshay Ballal Date: Mon, 15 Apr 2024 17:12:23 +0200 Subject: [PATCH 2/4] Update CI workflow to fix if condition in release job --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1ed2bbc9..fcc0738d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -125,7 +125,7 @@ jobs: release: name: Release runs-on: ubuntu-latest - if: 'startsWith(github.ref, "refs/tags/")' + if: "startsWith(github.ref, 'refs/tags/')" needs: [linux, windows, macos, sdist] steps: - uses: actions/download-artifact@v4 From b544962aafca0692525fb3bbd6e9ace2dd292ae3 Mon Sep 17 00:00:00 2001 From: Akshay Ballal Date: Mon, 15 Apr 2024 17:23:23 +0200 Subject: [PATCH 3/4] Update CI workflow to remove x86 target in windows-latest runner --- .github/workflows/CI.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index fcc0738d..34de5afe 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -61,8 +61,6 @@ jobs: platform: - runner: windows-latest target: x64 - - runner: windows-latest - target: x86 steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 From de4e09b467dbca70cb117c98c4cbf4b91d2de405 Mon Sep 17 00:00:00 2001 From: Akshay Ballal Date: Mon, 15 Apr 2024 20:07:44 +0200 Subject: [PATCH 4/4] Update dependencies for candle-pyo3 package --- Cargo.lock | 13 ------------- Cargo.toml | 1 - pyproject.toml | 1 + 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ce5a212d..a81950e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -330,18 +330,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "candle-pyo3" -version = "0.5.0" -source = "git+https://github.com/huggingface/candle.git#7f354473cf495db4554e08f84be44ed498f1aa5e" -dependencies = [ - "candle-core", - "candle-nn", - "half", - "pyo3", - "pyo3-build-config", -] - [[package]] name = "candle-transformers" version = "0.5.0" @@ -721,7 +709,6 @@ dependencies = [ "anyhow", "candle-core", "candle-nn", - "candle-pyo3", "candle-transformers", "futures", "hf-hub", diff --git a/Cargo.toml b/Cargo.toml index d7b83c4a..0dc215f2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,6 @@ candle-transformers = { git = "https://github.com/huggingface/candle.git", versi candle-core = { git = "https://github.com/huggingface/candle.git", version = "0.5.0", features = ["mkl"] } anyhow = "1.0.81" intel-mkl-src = "0.8.1" -candle-pyo3 = { git = "https://github.com/huggingface/candle.git", version = "0.5.0" } tokio = {version = "1.37.0", features=["rt-multi-thread"]} pyo3 = { version = "0.21" } diff --git a/pyproject.toml b/pyproject.toml index 844a0cc7..8f412bf5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,5 +21,6 @@ license = {file = "LICENSE"} features = ["pyo3/extension-module"] include = [{path = "lib/*.dll", format = ["sdist", "wheel"]}] python-source = "python" + [project.urls] Homepage = "https://github.com/StarlightSearch/EmbedAnything/tree/main" \ No newline at end of file