File tree Expand file tree Collapse file tree 6 files changed +110
-3
lines changed Expand file tree Collapse file tree 6 files changed +110
-3
lines changed Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change 1
- call " %VS140COMNTOOLS% \..\..\VC\vcvarsall.bat" x64
1
+ if " %ARCH% " == " 32" (set PLATFORM=x86) else (set PLATFORM=x64)
2
+ call " %VS140COMNTOOLS% \..\..\VC\vcvarsall.bat" %PLATFORM%
2
3
set DISTUTILS_USE_SDK = 1
3
4
set MSSdk = 1
4
5
" %PYTHON% " setup.py install
Original file line number Diff line number Diff line change 1
1
package :
2
2
name : python_example
3
- version : {{ environ.get('GIT_DESCRIBE_TAG', '') }}
3
+ version : {{ environ.get('GIT_DESCRIBE_TAG', 'dev ') }}
4
4
5
5
build :
6
6
number : {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}
7
7
{% if environ.get('GIT_DESCRIBE_NUMBER', '0') == '0' %}string: py{{ environ.get('PY_VER').replace('.', '') }}_0
8
8
{% else %}string: py{{ environ.get('PY_VER').replace('.', '') }}_{{ environ.get('GIT_BUILD_STR', 'GIT_STUB') }}{% endif %}
9
+ script_env :
10
+ - CC
11
+ - CXX
9
12
10
13
source :
11
14
git_url : ../
Original file line number Diff line number Diff line change @@ -78,11 +78,13 @@ class BuildExt(build_ext):
78
78
def build_extensions (self ):
79
79
ct = self .compiler .compiler_type
80
80
opts = self .c_opts .get (ct , [])
81
- opts .append ('-DVERSION_INFO="%s"' % self .distribution .get_version ())
82
81
if ct == 'unix' :
82
+ opts .append ('-DVERSION_INFO="%s"' % self .distribution .get_version ())
83
83
opts .append (cpp_flag (self .compiler ))
84
84
if has_flag (self .compiler , '-fvisibility=hidden' ):
85
85
opts .append ('-fvisibility=hidden' )
86
+ elif ct == 'msvc' :
87
+ opts .append ('/DVERSION_INFO=\\ "%s\\ "' % self .distribution .get_version ())
86
88
for ext in self .extensions :
87
89
ext .extra_compile_args = opts
88
90
build_ext .build_extensions (self )
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments