Skip to content

Commit 25b8871

Browse files
committed
GitHub Action to release on PyPI
1 parent a1ac82e commit 25b8871

File tree

4 files changed

+69
-4
lines changed

4 files changed

+69
-4
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Python release
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
env:
9+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN_DIST }}
10+
11+
jobs:
12+
python_release:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: 3.9
21+
- name: Install dependencies
22+
run: |
23+
pip install --upgrade pip
24+
pip install setuptools wheel
25+
26+
- run: setup.py sdist bdist_wheel
27+
- run: |
28+
pip install twine
29+
30+
- name: Upload to PyPi
31+
run: |
32+
twine upload dist/* -u __token__ -p "$PYPI_TOKEN"

.github/workflows/python-tests.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,35 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
python-version: ["3.7", "3.8", "3.9"]
13+
python-version: ["3.6", "3.7", "3.8", "3.9"]
1414

1515
steps:
1616
- uses: actions/checkout@v2
17+
1718
- name: Set up Python ${{ matrix.python-version }}
1819
uses: actions/setup-python@v2
1920
with:
2021
python-version: ${{ matrix.python-version }}
2122

23+
- name: Install dependencies
24+
run: |
25+
pip install --upgrade pip
26+
pip install .[testing]
27+
28+
- pytest -sv ./tests/
29+
30+
31+
tests_lfs:
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
- uses: actions/checkout@v2
36+
37+
- name: Set up Python
38+
uses: actions/setup-python@v2
39+
with:
40+
python-version: 3.9
41+
2242
- run: |
2343
git config --global user.email "[email protected]"
2444
git config --global user.name "ci"
@@ -27,5 +47,5 @@ jobs:
2747
run: |
2848
pip install --upgrade pip
2949
pip install .[testing]
30-
- name: pytest
31-
run: RUN_GIT_LFS_TESTS=1 pytest -sv ./tests/
50+
51+
- run: RUN_GIT_LFS_TESTS=1 pytest -sv ./tests/ -k "HfLargefilesTest"

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## `huggingface_hub`
2+
3+
### Client library to download and publish models and other files on the huggingface.co hub
4+
5+
<p align="center">
6+
<img alt="Build" src="https://github.com/huggingface/huggingface_hub/workflows/Python%20tests/badge.svg">
7+
<a href="https://github.com/huggingface/huggingface_hub/blob/master/LICENSE">
8+
<img alt="GitHub" src="https://img.shields.io/github/license/huggingface/huggingface_hub.svg?color=blue">
9+
</a>
10+
<a href="https://github.com/huggingface/huggingface_hub/releases">
11+
<img alt="GitHub release" src="https://img.shields.io/github/release/huggingface/huggingface_hub.svg">
12+
</a>
13+
</p>

src/huggingface_hub/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# See the License for the specific language governing permissions and
1717
# limitations under the License.
1818

19-
__version__ = "0.1.0"
19+
__version__ = "0.0.1"
2020

2121
from .file_download import HUGGINGFACE_CO_URL_TEMPLATE, cached_download, hf_hub_url
2222
from .hf_api import HfApi, HfFolder

0 commit comments

Comments
 (0)