Skip to content

Commit

Permalink
Fix Azure Pipelines integrations
Browse files Browse the repository at this point in the history
  • Loading branch information
milesgranger committed May 16, 2019
1 parent 9020d95 commit db030ee
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

### Python implementation of the [Gap Statistic](http://www.web.stanford.edu/~hastie/Papers/gap.pdf)

[![Build Status](https://milesgranger.visualstudio.com/builds/_apis/build/status/gap_stat?branchName=master)](https://milesgranger.visualstudio.com/builds/_build/latest?definitionId=5&branchName=master)
[![Build Status](https://milesgranger.visualstudio.com/builds/_apis/build/status/gap_statistic-CI?branchName=master)](https://milesgranger.visualstudio.com/builds/_build/latest?definitionId=11&branchName=master)

[![Downloads](http://pepy.tech/badge/gap-stat)](http://pepy.tech/project/gap-stat)
[![Coverage Status](https://coveralls.io/repos/github/milesgranger/gap_statistic/badge.svg)](https://coveralls.io/github/milesgranger/gap_statistic)
Expand Down
13 changes: 13 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,33 @@ jobs:
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
displayName: Install rust (windows)
- script: cargo test --verbose
displayName: 'Cargo Test'

- script: |
cargo clean
pip install -r requirements.txt
pip install setuptools-rust setuptools pytest wheel
python setup.py test
displayName: "Python Test"
- script: |
cargo clean
pip install twine
python setup.py build_ext
python -m pip -v wheel . -w .\\dist
dir dist
displayName: "Build wheels"
- task: DownloadSecureFile@1
inputs:
secureFile: .pypirc

- task: TwineAuthenticate@0
inputs:
artifactFeeds: 'https://pypi.org/'

- script: 'twine upload --config-file $(Agent.TempDirectory)\.pypirc --skip-existing .\\dist\*'
displayName: "Publish to PyPI"
condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'))
Expand Down Expand Up @@ -85,22 +93,27 @@ jobs:
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $(RUSTUP_TOOLCHAIN)
export PATH=$PATH:$HOME/.cargo/bin
displayName: 'Install rustc'
- script: |
export PATH=$PATH:$HOME/.cargo/bin
cargo test --verbose
displayName: 'Cargo Test'
- script: |
export PATH=$PATH:$HOME/.cargo/bin
cargo clean
pip install -r requirements.txt
pip install setuptools-rust setuptools pytest wheel==0.31.1
python setup.py test
displayName: "Python Test"
- script: |
export PATH=$PATH:$HOME/.cargo/bin
pip install twine
cargo clean
docker run --rm -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 bash /io/build-wheels.sh
displayName: "Build wheels"
- task: DownloadSecureFile@1
inputs:
secureFile: .pypirc
Expand Down
1 change: 1 addition & 0 deletions build-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ for PYBIN in /opt/python/{cp35-cp35m,cp36-cp36m,cp37-cp37m}/bin; do
export PYTHON_SYS_EXECUTABLE="$PYBIN/python"

"${PYBIN}/pip" install -U setuptools wheel==0.31.1 setuptools-rust
"${PYBIN}/pip" install -r requirements.txt
"${PYBIN}/python" setup.py bdist_wheel
done

Expand Down
11 changes: 7 additions & 4 deletions tests/test_optimalK.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

@pytest.mark.parametrize(
"parallel_backend, n_jobs, n_clusters", [
pytest.param('joblib', -1, 3, id="parallel_backend='joblib', n_jobs=-1, n_clusters=2"),
pytest.param('multiprocessing', -1, 3, id="parallel_backend='multiprocessing', n_jobs=-1, n_clusters=2"),
pytest.param(None, -1, 3, id="parallel_backend=None, n_jobs=-1, n_clusters=2"),
pytest.param('rust', -1, 3, id="parallel_backend='rust', n_jobs=-1, n_clusters=2")
pytest.param('joblib', 1, 3, id="parallel_backend='joblib', n_jobs=1, n_clusters=3"),
pytest.param(None, 1, 3, id="parallel_backend=None, n_jobs=1, n_clusters=3"),
pytest.param('rust', 1, 3, id="parallel_backend='rust', n_jobs=1, n_clusters=3")
]
)
def test_optimalk(parallel_backend, n_jobs, n_clusters):
Expand Down Expand Up @@ -94,3 +93,7 @@ def test_dunders():
optimalK.__str__()
optimalK.__repr__()
optimalK._repr_html_()

def test_std():
# TODO:
pass

0 comments on commit db030ee

Please sign in to comment.