8000 Configure tests on Travis and AppVeyor · TanDro/python_example@b6d1cd6 · GitHub
[go: up one dir, main page]

Skip to content

Commit b6d1cd6

Browse files
committed
Configure tests on Travis and AppVeyor
1 parent 28381e3 commit b6d1cd6

File tree

3 files changed

+101
-0
lines changed

3 files changed

+101
-0
lines changed

.appveyor.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
version: '{build}'
2+
image: Visual Studio 2015
3+
platform:
4+
- x86
5+
- x64
6+
environment:
7+
global:
8+
DISTUTILS_USE_SDK: 1
9+
MSSdk: 1
10+
matrix:
11+
- PYTHON: 27
12+
- PYTHON: 35
13+
- CONDA: 27
14+
- CONDA: 35
15+
matrix:
16+
allow_failures:
17+
- platform: x86
18+
CONDA: 27
19+
install:
20+
- cmd: '"%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" %PLATFORM%'
21+
- ps: |
22+
if ($env:PYTHON) {
23+
if ($env:PLATFORM -eq "x64") { $env:PYTHON = "$env:PYTHON-x64" }
24+
$env:PATH = "C:\Python$env:PYTHON\;C:\Python$env:PYTHON\Scripts\;$env:PATH"
25+
pip install --disable-pip-version-check --user --upgrade pip
26+
} elseif ($env:CONDA) {
27+
if ($env:CONDA -eq "27") { $env:CONDA = "" }
28+
if ($env:PLATFORM -eq "x64") { $env:CONDA = "$env:CONDA-x64" }
29+
$env:PATH = "C:\Miniconda$env:CONDA\;C:\Miniconda$env:CONDA\Scripts\;$env:PATH"
30+
conda config --set always_yes yes --set changeps1 no
31+
conda config --add channels conda-forge
32+
conda update -q conda
33+
conda install -q conda-build
34+
}
35+
build_script:
36+
- ps: |
37+
if ($env:PYTHON) {
38+
python setup.py sdist
39+
pip install --verbose dist\python_example-0.0.1.zip
40+
} elseif ($env:CONDA) {
41+
conda build conda.recipe
42+
conda install --use-local python_example
43+
}
44+
test_script:
45+
- ps: python tests\test.py

.travis.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
language: cpp
2+
os:
3+
- linux
4+
- osx
5+
env:
6+
- PYTHON=2.7
7+
- PYTHON=3.5
8+
- CONDA=2.7
9+
- CONDA=3.5
10+
addons:
11+
apt:
12+
sources:
13+
- ubuntu-toolchain-r-test
14+
- deadsnakes
15+
packages:
16+
- g++-4.8
17+
- python3.5
18+
- python3.5-dev
19+
before_install:
20+
- |
21+
if [ "$TRAVIS_OS_NAME" = "linux" ]; then export CXX=g++-4.8 CC=gcc-4.8; fi
22+
if [ -n "$PYTHON" ]; then
23+
if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$PYTHON" = "3.5" ]; then
24+
brew update; brew install python3;
25+
fi
26+
pip install --user --upgrade pip virtualenv
27+
virtualenv -p python$PYTHON venv
28+
source venv/bin/activate
29+
elif [ -n "$CONDA" ]; then
30+
if [ "$TRAVIS_OS_NAME" = "linux" ]; then OS=Linux-x86_64; else OS=MacOSX-x86_64; fi
31+
wget -O miniconda.sh https://repo.continuum.io/miniconda/Miniconda${CONDA:0:1}-latest-$OS.sh
32+
bash miniconda.sh -b -p $HOME/miniconda
33+
export PATH="$HOME/miniconda/bin:$PATH"
34+
conda config --set always_yes yes --set changeps1 no
35+
conda config --add channels conda-forge
36+
conda update -q conda
37+
conda install -q conda-build
38+
conda create -q -n test-environment python=$CONDA
39+
source activate test-environment
40+
fi
41+
install:
42+
- |
43+
if [ -n "$PYTHON" ]; then
44+
python setup.py sdist
45+
pip install --verbose dist/*.tar.gz
46+
elif [ -n "$CONDA" ]; then
47+
conda build conda.recipe
48+
conda install --use-local python_example
49+
fi
50+
script:
51+
- python tests/test.py

tests/test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import python_example as m
2+
3+
assert m.__version__ == '0.0.1'
4+
assert m.add(1, 2) == 3
5+
assert m.subtract(1, 2) == -1

0 commit comments

Comments
 (0)
0