-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from csukuangfj/conda
Support conda install
- Loading branch information
Showing
7 changed files
with
286 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: build_conda_macos | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
branches: | ||
- conda | ||
|
||
concurrency: | ||
group: build_conda_macos-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build_conda_macos: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-10.15] | ||
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] | ||
|
||
steps: | ||
# refer to https://github.com/actions/checkout | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
auto-update-conda: true | ||
python-version: ${{ matrix.python-version }} | ||
activate-environment: kaldialign | ||
|
||
- name: Display Python version | ||
shell: bash -l {0} | ||
run: | | ||
python3 -c "import sys; print(sys.version)" | ||
which python3 | ||
- name: Install conda dependencies | ||
shell: bash -l {0} | ||
run: | | ||
conda install -y -q anaconda-client | ||
conda install -y -q conda-build | ||
- name: Display conda info | ||
shell: bash -l {0} | ||
run: | | ||
which conda | ||
conda env list | ||
conda info | ||
- name: Build kaldialign | ||
shell: bash -l {0} | ||
env: | ||
KALDIALIGN_CONDA_TOKEN: ${{ secrets.KALDIALIGN_CONDA_TOKEN }} | ||
run: | | ||
./scripts/build_conda.sh | ||
- name: Display generated files | ||
run: | | ||
ls -lh /usr/local/miniconda/envs/kaldialign/conda-bld/osx-64 | ||
- name: Upload generated files | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: cpu-python-${{ matrix.python-version }}-${{ matrix.os }} | ||
path: /usr/local/miniconda/envs/kaldialign/conda-bld/osx-64/*.tar.bz2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: build_conda_ubuntu | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
branches: | ||
- conda | ||
|
||
concurrency: | ||
group: build_conda_ubuntu-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build_conda_ubuntu: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-18.04] | ||
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] | ||
|
||
steps: | ||
# refer to https://github.com/actions/checkout | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
auto-update-conda: true | ||
python-version: ${{ matrix.python-version }} | ||
activate-environment: kaldialign | ||
|
||
- name: Display Python version | ||
shell: bash -l {0} | ||
run: | | ||
python3 -c "import sys; print(sys.version)" | ||
which python3 | ||
- name: Install conda dependencies | ||
shell: bash -l {0} | ||
run: | | ||
conda install -y -q anaconda-client | ||
conda install -y -q conda-build | ||
conda install -y -q numpy | ||
- name: Display conda info | ||
shell: bash -l {0} | ||
run: | | ||
which conda | ||
conda env list | ||
conda info | ||
nproc | ||
- name: Build kaldialign | ||
shell: bash -l {0} | ||
env: | ||
KALDIALIGN_CONDA_TOKEN: ${{ secrets.KALDIALIGN_CONDA_TOKEN }} | ||
run: | | ||
./scripts/build_conda.sh | ||
- name: Display generated files | ||
run: | | ||
ls -lh /usr/share/miniconda/envs/kaldialign/conda-bld/linux-64 | ||
- name: Upload generated files | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: python-${{ matrix.python-version }}-${{ matrix.os }} | ||
path: /usr/share/miniconda/envs/kaldialign/conda-bld/linux-64/*.tar.bz2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: build_conda_windows | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
branches: | ||
- conda | ||
|
||
concurrency: | ||
group: build_conda_windows-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build_conda_windows: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [windows-2019] | ||
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] | ||
|
||
steps: | ||
# refer to https://github.com/actions/checkout | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
auto-update-conda: true | ||
python-version: ${{ matrix.python-version }} | ||
activate-environment: kaldialign | ||
|
||
- name: Display Python version | ||
shell: bash -l {0} | ||
run: | | ||
python -c "import sys; print(sys.version)" | ||
which python | ||
- name: Install conda dependencies | ||
shell: bash -l {0} | ||
run: | | ||
conda install -y -q anaconda-client | ||
conda install -y -q conda-build | ||
- name: Display conda info | ||
shell: bash -l {0} | ||
run: | | ||
which conda | ||
conda env list | ||
conda info | ||
which python | ||
- name: Build kaldialign | ||
shell: bash -l {0} | ||
env: | ||
KALDIALIGN_CONDA_TOKEN: ${{ secrets.KALDIALIGN_CONDA_TOKEN }} | ||
run: | | ||
./scripts/build_conda.sh | ||
- name: Display generated files | ||
shell: bash -l {0} | ||
run: | | ||
ls -lh /c/Miniconda/envs/kaldialign/conda-bld | ||
ls -lh /c/Miniconda/envs/kaldialign/conda-bld/*/* | ||
ls -lh /c/Miniconda/envs/kaldialign/conda-bld/win-64/* | ||
- name: Upload generated files | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: python-${{ matrix.python-version }}-windows-2019 | ||
path: c:/Miniconda/envs/kaldialign/conda-bld/win-64/*.tar.bz2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# The following environment variables are supposed to be set by users | ||
# | ||
# - KALDIALIGN_CONDA_TOKEN | ||
# If not set, auto upload to anaconda.org is disabled. | ||
# | ||
# Its value is from https://anaconda.org/kaldialign/settings/access | ||
# (You need to login as user kaldialign to see its value) | ||
# | ||
set -e | ||
export CONDA_BUILD=1 | ||
|
||
cur_dir=$(cd $(dirname $BASH_SOURCE) && pwd) | ||
kaldialign_dir=$(cd $cur_dir/.. && pwd) | ||
|
||
cd $kaldialign_dir | ||
|
||
export KALDIALIGN_ROOT_DIR=$kaldialign_dir | ||
echo "KALDIALIGN_DIR: $KALDIALIGN_ROOT_DIR" | ||
|
||
KALDIALIGN_PYTHON_VERSION=$(python -c "import sys; print('.'.join(sys.version.split('.')[:2]))") | ||
|
||
# Example value: 3.8 | ||
export KALDIALIGN_PYTHON_VERSION | ||
|
||
if [ -z $KALDIALIGN_CONDA_TOKEN ]; then | ||
echo "Auto upload to anaconda.org is disabled since KALDIALIGN_CONDA_TOKEN is not set" | ||
conda build --no-test --no-anaconda-upload ./scripts/conda/kaldialign | ||
else | ||
conda build --no-test --token $KALDIALIGN_CONDA_TOKEN ./scripts/conda/kaldialign | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package: | ||
name: kaldialign | ||
version: "0.4" | ||
|
||
source: | ||
path: "{{ environ.get('KALDIALIGN_ROOT_DIR') }}" | ||
|
||
build: | ||
number: 0 | ||
string: py{{ environ.get('KALDIALIGN_PYTHON_VERSION') }} | ||
script: {{ PYTHON }} setup.py install --single-version-externally-managed --record=record.txt | ||
|
||
requirements: | ||
build: | ||
- {{ compiler('c') }} # [win] | ||
- {{ compiler('cxx') }} # [win] | ||
|
||
host: | ||
- anaconda-client | ||
- conda-build | ||
- cmake | ||
- python | ||
run: | ||
- python | ||
|
||
about: | ||
home: https://github.com/pzelasko/kaldialign | ||
license: Apache V2 | ||
license_file: LICENSE | ||
summary: Python wrappers for Kaldi Levenshtein's distance and alignment code. | ||
description: | | ||
A small package that exposes edit distance computation functions from Kaldi. | ||
It uses the original Kaldi code and wraps it using pybind11. |