From bd04738a6caa7b091a4f3047d010e327f93a42be Mon Sep 17 00:00:00 2001 From: davebulaval Date: Tue, 9 Jul 2024 08:48:32 -0400 Subject: [PATCH] fix pypi workflow problem --- .github/workflows/python-publish.yml | 21 +++++++++++++++++---- deepparse/download_tools.py | 4 ++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 1faf672d..4c1bd4ef 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -15,9 +15,22 @@ jobs: name: pypi url: https://pypi.org/project/deepparse/ permissions: - id-token: write + id-token: write + steps: - # retrieve your distributions here + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel + + - name: Build and publish + run: + RISC_RELEASE_BUILD=1 python setup.py sdist bdist_wheel - - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file diff --git a/deepparse/download_tools.py b/deepparse/download_tools.py index 035c3a47..ca1f0a64 100644 --- a/deepparse/download_tools.py +++ b/deepparse/download_tools.py @@ -8,11 +8,11 @@ from urllib.request import urlopen import requests -from bpemb import BPEmb from fasttext.FastText import _FastText from requests import HTTPError from urllib3.exceptions import MaxRetryError +from .embeddings_models import BPEmbBaseURLWrapperBugFix from .errors.server_error import ServerError BASE_URL = "https://graal.ift.ulaval.ca/public/deepparse/{}.{}" @@ -127,7 +127,7 @@ def download_model( elif model_type == "fasttext-light": download_fasttext_magnitude_embeddings(cache_dir=saving_cache_path) elif "bpemb" in model_type: - BPEmb( + BPEmbBaseURLWrapperBugFix( lang="multi", vs=100000, dim=300, cache_dir=saving_cache_path ) # The class manages the download of the pretrained words embedding