Merge pull request #180 from huggingface/improve-python-release

Improve python release
This commit is contained in:
MOI Anthony
2020-03-02 14:21:33 -05:00
committed by GitHub

View File

@@ -24,12 +24,11 @@ jobs:
working-directory: ./bindings/python
run: sh build-wheels.sh
create_wheels_others:
name: Create wheels for other OSes
runs-on: ${{ matrix.os }}
create_wheels_windows_32bit:
name: Create wheels for windows 32-bit
runs-on: windows-latest
strategy:
matrix:
os: [windows-latest, macos-latest]
python: [3.5, 3.6, 3.7, 3.8]
steps:
- name: Checkout repository
@@ -38,14 +37,19 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2019-11-01
toolchain: nightly-i686-pc-windows-msvc
override: true
- name: Override toolchain
shell: bash
working-directory: ./bindings/python
run: echo "nightly-i686-pc-windows-msvc" > rust-toolchain
- name: Install Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
architecture: 'x64'
architecture: x86
- name: Install dependencies
run: |
@@ -62,6 +66,50 @@ jobs:
pip install awscli
aws s3 sync --exact-timestamps ./bindings/python/dist "s3://tokenizers-releases/python/$GITHUB_SHA"
create_wheels_others_64bit:
name: Create wheels for other OSes
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-10.15]
python: [3.5, 3.6, 3.7, 3.8]
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Install Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
architecture: x64
- name: Install dependencies
run: |
# On old versions of python there is an old version of setuptools already installed
pip install setuptools wheel setuptools-rust --ignore-installed --force-reinstall
- name: Build wheel
working-directory: ./bindings/python
run: python setup.py bdist_wheel
- name: Rename wheels
shell: bash
working-directory: ./bindings/python/dist
run: for file in *.whl ; do mv $file ${file//macosx_10_15/macosx_10_10} ; done
- name: Upload wheels
shell: bash
run: |
pip install awscli
aws s3 sync --exact-timestamps ./bindings/python/dist "s3://tokenizers-releases/python/$GITHUB_SHA"
upload_package:
name: Upload package to PyPi
runs-on: ubuntu-latest