From 2084aec340395a311dd9f9ee91110b87f8ce1949 Mon Sep 17 00:00:00 2001 From: Zachary Mueller Date: Tue, 21 Dec 2021 15:52:43 -0500 Subject: [PATCH 1/5] Update python-tests.yml --- .github/workflows/python-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index a20739d994..a6b0f121fa 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -13,6 +13,7 @@ on: paths-ignore: - "widgets/**" - "api-inference-community/**" + workflow_dispatch: env: HUGGINGFACE_CO_STAGING: yes From 21b6e677a8bb96e77177b98cef41eb78b9aa41e7 Mon Sep 17 00:00:00 2001 From: Zachary Mueller Date: Tue, 4 Jan 2022 16:21:06 -0500 Subject: [PATCH 2/5] Update and rename python-tests.yml to python-tests-windows.yml --- .../{python-tests.yml => python-tests-windows.yml} | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) rename .github/workflows/{python-tests.yml => python-tests-windows.yml} (86%) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests-windows.yml similarity index 86% rename from .github/workflows/python-tests.yml rename to .github/workflows/python-tests-windows.yml index a6b0f121fa..b2208b51d4 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests-windows.yml @@ -1,18 +1,6 @@ name: Python tests on: - push: - branches: - - main - - ci_* - paths-ignore: - - "widgets/**" - - "api-inference-community/**" - pull_request: - types: [assigned, opened, synchronize, reopened] - paths-ignore: - - "widgets/**" - - "api-inference-community/**" workflow_dispatch: env: @@ -20,7 +8,7 @@ env: jobs: build: - runs-on: ubuntu-latest + runs-on: windows-latest strategy: matrix: python-version: ["3.6", "3.9"] From 5700d469f774c00c9b5b011d6c0173eeb5e7d450 Mon Sep 17 00:00:00 2001 From: Zach Mueller Date: Thu, 6 Jan 2022 11:07:10 -0500 Subject: [PATCH 3/5] Fix typo in example --- .github/workflows/python-tests-windows.yml | 87 ---------------------- src/huggingface_hub/hf_api.py | 2 +- 2 files changed, 1 insertion(+), 88 deletions(-) delete mode 100644 .github/workflows/python-tests-windows.yml diff --git a/.github/workflows/python-tests-windows.yml b/.github/workflows/python-tests-windows.yml deleted file mode 100644 index b2208b51d4..0000000000 --- a/.github/workflows/python-tests-windows.yml +++ /dev/null @@ -1,87 +0,0 @@ -name: Python tests - -on: - workflow_dispatch: - -env: - HUGGINGFACE_CO_STAGING: yes - -jobs: - build: - runs-on: windows-latest - strategy: - matrix: - python-version: ["3.6", "3.9"] - - steps: - - uses: actions/checkout@v2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - pip install --upgrade pip - pip install .[testing] - - - run: pytest -sv ./tests/ - - build_pytorch: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - pip install --upgrade pip - pip install .[testing,torch] - - - run: pytest -sv ./tests/test_hubmixin* - - build_tensorflow: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - pip install --upgrade pip - pip install .[testing,tensorflow] - - - run: pytest -sv ./tests/test_keras* - - tests_lfs: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - - run: | - git config --global user.email "ci@dummy.com" - git config --global user.name "ci" - - - name: Install dependencies - run: | - pip install --upgrade pip - pip install .[testing] - - - run: RUN_GIT_LFS_TESTS=1 pytest -sv ./tests/ -k "HfLargefilesTest" diff --git a/src/huggingface_hub/hf_api.py b/src/huggingface_hub/hf_api.py index e33aa00754..0ec2bc5f3d 100644 --- a/src/huggingface_hub/hf_api.py +++ b/src/huggingface_hub/hf_api.py @@ -278,7 +278,7 @@ class ModelSearchArguments(AttributeDictionary): models currently hosted in the Hub with tab-completion. If a value starts with a number, it will only exist in the dictionary Example: - >>> args = ModelSearchArgs() + >>> args = ModelSearchArguments() >>> args.author_or_organization.huggingface >>> args.language.en """ From a6dffad41145dc55c678a40fcb9b51f6ed237e65 Mon Sep 17 00:00:00 2001 From: Zach Mueller Date: Thu, 6 Jan 2022 11:07:54 -0500 Subject: [PATCH 4/5] Workflow --- .github/workflows/python-tests.yml | 87 ++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .github/workflows/python-tests.yml diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml new file mode 100644 index 0000000000..0414ab8083 --- /dev/null +++ b/.github/workflows/python-tests.yml @@ -0,0 +1,87 @@ +name: Python tests + +on: + workflow_dispatch: + +env: + HUGGINGFACE_CO_STAGING: yes + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.6", "3.9"] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + pip install --upgrade pip + pip install .[testing] + + - run: pytest -sv ./tests/ + + build_pytorch: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + pip install --upgrade pip + pip install .[testing,torch] + + - run: pytest -sv ./tests/test_hubmixin* + + build_tensorflow: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + pip install --upgrade pip + pip install .[testing,tensorflow] + + - run: pytest -sv ./tests/test_keras* + + tests_lfs: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - run: | + git config --global user.email "ci@dummy.com" + git config --global user.name "ci" + + - name: Install dependencies + run: | + pip install --upgrade pip + pip install .[testing] + + - run: RUN_GIT_LFS_TESTS=1 pytest -sv ./tests/ -k "HfLargefilesTest" From a590df1cb38cdb1d159a8dbf10ccd3761d1cf64a Mon Sep 17 00:00:00 2001 From: Zach Mueller Date: Thu, 6 Jan 2022 11:08:36 -0500 Subject: [PATCH 5/5] Keep workflow same --- .github/workflows/python-tests.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 0414ab8083..a20739d994 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -1,7 +1,18 @@ name: Python tests on: - workflow_dispatch: + push: + branches: + - main + - ci_* + paths-ignore: + - "widgets/**" + - "api-inference-community/**" + pull_request: + types: [assigned, opened, synchronize, reopened] + paths-ignore: + - "widgets/**" + - "api-inference-community/**" env: HUGGINGFACE_CO_STAGING: yes