-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c673aad
commit 9020d95
Showing
8 changed files
with
134 additions
and
168 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,2 @@ | ||
include Cargo.toml | ||
recursive-include src * |
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 was deleted.
Oops, something went wrong.
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,115 @@ | ||
trigger: | ||
branches: | ||
include: | ||
- master | ||
- releases/* | ||
- refs/tags/* | ||
- refs/heads/* | ||
|
||
jobs: | ||
- job: Windows | ||
pool: | ||
vmImage: 'VS2017-Win2016' | ||
strategy: | ||
maxParallel: 2 | ||
matrix: | ||
Python36: | ||
PYTHON_VERSION: '3.6' | ||
PYTHON_ARCH: 'x64' | ||
RUSTUP_TOOLCHAIN: nightly | ||
TEST_MODE: fast | ||
BITS: 64 | ||
Python37: | ||
PYTHON_VERSION: '3.7' | ||
RUSTUP_TOOLCHAIN: nightly | ||
PYTHON_ARCH: 'x64' | ||
TEST_MODE: fast | ||
BITS: 64 | ||
steps: | ||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: '$(PYTHON_VERSION)' | ||
addToPath: true | ||
architecture: '$(PYTHON_ARCH)' | ||
|
||
- script: | | ||
curl -sSf -o rustup-init.exe https://win.rustup.rs | ||
rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN% | ||
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 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 | ||
|
||
- script: 'twine upload --config-file $(Agent.TempDirectory)\.pypirc --skip-existing .\\dist\*' | ||
displayName: "Publish to PyPI" | ||
condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/')) | ||
|
||
- job: Linux | ||
pool: | ||
vmImage: 'Ubuntu 16.04' | ||
strategy: | ||
maxParallel: 2 | ||
matrix: | ||
Python36: | ||
PYTHON_VERSION: '3.6' | ||
RUSTUP_TOOLCHAIN: nightly | ||
TEST_MODE: fast | ||
Python37: | ||
PYTHON_VERSION: '3.7' | ||
RUSTUP_TOOLCHAIN: nightly | ||
TEST_MODE: fast | ||
steps: | ||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: '$(PYTHON_VERSION)' | ||
addToPath: true | ||
|
||
- script: | | ||
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 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 | ||
|
||
- task: TwineAuthenticate@0 | ||
inputs: | ||
artifactFeeds: 'https://pypi.org/' | ||
|
||
- script: 'twine upload --config-file $(Agent.TempDirectory)/.pypirc --skip-existing ./dist/*-manylinux*.whl' | ||
displayName: "Publish to PyPI" | ||
condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/')) | ||
|
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 |
---|---|---|
@@ -1,69 +1,18 @@ | ||
#!/bin/bash | ||
set -e -x | ||
set -ex | ||
|
||
function install_rust { | ||
curl https://static.rust-lang.org/rustup.sh > /tmp/rustup.sh | ||
chmod +x /tmp/rustup.sh | ||
/tmp/rustup.sh -y --disable-sudo --channel=$1 | ||
} | ||
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y | ||
export PATH="$HOME/.cargo/bin:$PATH" | ||
|
||
cd /io | ||
|
||
if [[ $TRAVIS_OS_NAME == "osx" ]]; then | ||
for PYBIN in /opt/python/{cp35-cp35m,cp36-cp36m,cp37-cp37m}/bin; do | ||
export PYTHON_SYS_EXECUTABLE="$PYBIN/python" | ||
|
||
brew update | ||
curl https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh --output miniconda.sh | ||
bash ./miniconda.sh -bp $HOME/anaconda | ||
export PATH="$HOME/anaconda/bin:$PATH" | ||
echo "Installing python version: ${PYTHON_VERSION}" | ||
conda install -y virtualenv python==$PYTHON_VERSION | ||
virtualenv venv | ||
source ./venv/bin/activate | ||
export PATH=$(pwd)/venv/bin:$PATH | ||
echo "Python version: $(python --version)" | ||
pip install -U pip setuptools setuptools-rust wheel numpy scipy pandas joblib pytest scikit-learn | ||
install_rust nightly | ||
pip wheel . -w ./wheelhouse/ | ||
pip install -v gap-stat --no-index -f ./wheelhouse/ | ||
pip install -r "requirements.txt" | ||
pytest tests -vs | ||
"${PYBIN}/pip" install -U setuptools wheel==0.31.1 setuptools-rust | ||
"${PYBIN}/python" setup.py bdist_wheel | ||
done | ||
|
||
else | ||
|
||
# Build wheels with docker run --rm -v $(pwd):/io quay.io/pypa/manylinux1_x86_64 bash /io/build-wheels.sh linux | ||
echo "Installing rust!" | ||
mkdir ~/rust-installer | ||
curl -sL https://static.rust-lang.org/rustup.sh -o ~/rust-installer/rustup.sh | ||
sh ~/rust-installer/rustup.sh --prefix=~/rust --spec=nightly -y --disable-sudo | ||
export PATH="$HOME/rust/bin:$PATH" | ||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/rust/lib" | ||
|
||
# Compile wheels | ||
for PYBIN in /opt/python/cp{35,36}*/bin; do | ||
export PYTHON_SYS_EXECUTABLE="$PYBIN/python" | ||
export PYTHON_LIB=$(${PYBIN}/python -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))") | ||
export LIBRARY_PATH="$LIBRARY_PATH:$PYTHON_LIB" | ||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PYTHON_LIB" | ||
pushd /io | ||
"${PYBIN}/pip" install -U setuptools setuptools-rust wheel numpy scipy pandas joblib pytest scikit-learn | ||
"${PYBIN}/python" setup.py bdist_wheel --dist-dir /io/wheelhouse/ | ||
popd | ||
done | ||
|
||
# Bundle external shared libraries into the wheels | ||
for whl in /io/wheelhouse/gap*.whl; do | ||
echo "Auditing wheel ${whl}" | ||
auditwheel repair "$whl" -w /io/wheelhouse/ | ||
done | ||
|
||
# Install packages and test | ||
for PYBIN in /opt/python/cp{35,36}*/bin/; do | ||
pushd /io | ||
"${PYBIN}/pip" uninstall gap-stat | ||
"${PYBIN}/pip" install gap-stat --no-index -f /io/wheelhouse | ||
# Actually requires glibc 2.14 which isn't available on Centos 5... | ||
# The tests are ran on OSX and Windows, so this is ok for now. | ||
#"${PYBIN}/python" -m pytest tests -vs | ||
popd | ||
done | ||
|
||
fi | ||
for whl in dist/*.whl; do | ||
auditwheel repair "$whl" -w dist/ | ||
done |
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,2 @@ | ||
[build-system] | ||
requires = ["setuptools", "wheel==0.31.1", "setuptools-rust"] |
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,2 @@ | ||
[pytest] | ||
python_files = "test_*.py" |