Skip to content

Commit a356dcc

Browse files
committed
Refactor/Format CI Files
- Updates PYTHONWARNINGS - Adds (disabled) embedded tests - appveyor runs and passes on Python2.7, fails on Python3+ - travis runs the tests, fails on all versions. - Removes fast finish. Easier to debug if regression is version specific - Refactor appveyor setup. - Format other CI files and add links to updated resources
1 parent 82a470b commit a356dcc

File tree

5 files changed

+65
-85
lines changed

5 files changed

+65
-85
lines changed

.travis.yml

+7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
sudo: required
22
language: python
3+
34
python:
45
- 2.7
56
- 3.3
67
- 3.4
78
- 3.5
89
- 3.6
10+
911
before_install:
1012
- sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu/ trusty main universe"
1113
- sudo apt-get install software-properties-common
@@ -19,6 +21,11 @@ install:
1921
- pip install six
2022
- pip install pycparser
2123
- python setup.py build_ext --inplace
24+
2225
script:
2326
- export PYTHONPATH=`pwd`:$PYTHONPATH
2427
- python src/tests/runtests.py
28+
# - nunit-console src/embed_tests/bin/x64/ReleaseMono/Python.EmbeddingTest.dll
29+
30+
notifications:
31+
email: false

appveyor.yml

+43-74
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,67 @@
1-
os: Windows Server 2012
1+
version: 2.2.0-build{build}
22

3-
matrix:
4-
fast_finish: true
3+
platform:
4+
- x86
5+
- x64
56

67
environment:
78
global:
8-
PYTHONPATH: c:\testdir
9-
PYTHONWARNINGS: 'ignore:::pip.pep425tags:'
9+
PYTHONPATH: "C:\\testdir"
10+
PYTHONWARNINGS: "ignore:::wheel.pep425tags:"
1011
CONDA_BLD_VERSION: "3.5"
12+
CONDA_BLD: "C:\\conda"
13+
NUNIT: "nunit-console"
1114

1215
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
13-
# /E:ON and /V:ON options are not enabled in the batch script intepreter
16+
# /E:ON and /V:ON options are not enabled in the batch script interpreter
1417
# See: http://stackoverflow.com/a/13751649/163740
1518
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci\\run_with_env.cmd"
1619

17-
1820
matrix:
19-
# http://www.appveyor.com/docs/installed-software#python
20-
- PYTHON: "C:\\Python27"
21-
CONDA_PY: "27"
22-
CONDA_BLD: "C:\\miniconda-32"
23-
CONDA_BLD_ARCH: "32"
24-
25-
- PYTHON: "C:\\Python27-x64"
26-
CONDA_PY: "27"
27-
CONDA_BLD: "C:\\miniconda-64"
28-
CONDA_BLD_ARCH: "64"
29-
30-
- PYTHON: "C:\\Python33"
31-
CONDA_PY: "33"
32-
CONDA_BLD: "C:\\miniconda-32"
33-
CONDA_BLD_ARCH: "32"
34-
35-
- PYTHON: "C:\\Python33-x64"
36-
CONDA_PY: "33"
37-
CONDA_BLD: "C:\\miniconda-64"
38-
CONDA_BLD_ARCH: "64"
39-
40-
- PYTHON: "C:\\Python34"
41-
CONDA_PY: "34"
42-
CONDA_BLD: "C:\\miniconda-32"
43-
CONDA_BLD_ARCH: "32"
44-
45-
- PYTHON: "C:\\Python34-x64"
46-
CONDA_PY: "34"
47-
CONDA_BLD_ARCH: "64"
48-
CONDA_BLD: "C:\\miniconda-64"
49-
50-
- PYTHON: "C:\\Python35"
51-
CONDA_PY: "35"
52-
CONDA_BLD: "C:\\miniconda-32"
53-
CONDA_BLD_ARCH: "32"
54-
55-
- PYTHON: "C:\\Python35-x64"
56-
CONDA_PY: "35"
57-
CONDA_BLD: "C:\\miniconda-64"
58-
CONDA_BLD_ARCH: "64"
59-
60-
- PYTHON: "C:\\Python36"
61-
CONDA_PY: "36"
62-
CONDA_BLD: "C:\\miniconda-32"
63-
CONDA_BLD_ARCH: "32"
64-
65-
- PYTHON: "C:\\Python36-x64"
66-
CONDA_PY: "36"
67-
CONDA_BLD: "C:\\miniconda-64"
68-
CONDA_BLD_ARCH: "64"
21+
- PYTHON_VERSION: "2.7"
22+
- PYTHON_VERSION: "3.3"
23+
- PYTHON_VERSION: "3.4"
24+
- PYTHON_VERSION: "3.5"
25+
- PYTHON_VERSION: "3.6"
26+
27+
init:
28+
# Prepare environment
29+
- mkdir C:\testdir
30+
31+
# Set environment variables depending based on build cfg
32+
- SET CONDA_PY=%PYTHON_VERSION:.=%
33+
- SET CONDA_BLD_ARCH=%PLATFORM:x=%
34+
- SET PYTHON=C:\PYTHON%CONDA_PY%
35+
- IF %PLATFORM%==x86 (SET CONDA_BLD_ARCH=32)
36+
- IF %PLATFORM%==x86 (SET NUNIT=%NUNIT%-x86)
37+
- IF %PLATFORM%==x64 (SET PYTHON=%PYTHON%-x64)
6938

7039
install:
71-
# install conda and deps
72-
- powershell .\ci\install.ps1
73-
- "%CONDA_BLD%\\Scripts\\conda config --set show_channel_urls true --set always_yes true --set changeps1 false"
74-
- "%CONDA_BLD%\\Scripts\\conda update -q conda"
75-
- "%CONDA_BLD%\\Scripts\\conda info -a"
40+
# install conda and deps
41+
- ps: ".\\ci\\install.ps1"
42+
- "%CONDA_BLD%\\Scripts\\conda config --set show_channel_urls true --set always_yes true --set changeps1 false"
43+
- "%CONDA_BLD%\\Scripts\\conda update -q conda"
44+
- "%CONDA_BLD%\\Scripts\\conda info -a"
7645

77-
# install for wheels
78-
- "%PYTHON%\\python.exe -m pip install --upgrade pip"
79-
- "%PYTHON%\\python.exe -m pip install wheel"
80-
- "%PYTHON%\\python.exe -m pip install six"
46+
# install for wheels
47+
- "%PYTHON%\\python.exe -m pip install --upgrade pip"
48+
- "%PYTHON%\\python.exe -m pip install wheel"
49+
- "%PYTHON%\\python.exe -m pip install six"
8150

8251
build_script:
83-
# build wheel
84-
- "%PYTHON%\\python.exe setup.py bdist_wheel"
52+
# build wheel
53+
- "%PYTHON%\\python.exe setup.py bdist_wheel"
8554

86-
# build and dist conda package
87-
- cmd: "%CMD_IN_ENV% %CONDA_BLD%\\Scripts\\conda build conda.recipe"
88-
- ps: $CONDA_PKG=(& "$env:CONDA_BLD\\Scripts\\conda" build conda.recipe --output -q)
89-
- ps: copy-item $CONDA_PKG "$env:APPVEYOR_BUILD_FOLDER\\dist\\"
55+
# build and dist conda package
56+
- cmd: "%CMD_IN_ENV% %CONDA_BLD%\\Scripts\\conda build conda.recipe"
57+
- ps: $CONDA_PKG=(& "$env:CONDA_BLD\\Scripts\\conda" build conda.recipe --output -q)
58+
- ps: copy-item $CONDA_PKG "$env:APPVEYOR_BUILD_FOLDER\\dist\\"
9059

9160
test_script:
9261
- ps: '& "$env:PYTHON\\Scripts\\pip.exe" install --no-cache-dir --force-reinstall --ignore-installed ("dist\\" + (gci dist\*.whl)[0].Name)'
93-
- mkdir c:\testdir
94-
- ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName c:\testdir
62+
- ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName C:\testdir
9563
- "%PYTHON%\\python.exe src\\tests\\runtests.py"
64+
# - "%NUNIT% src/embed_tests/bin/%PLATFORM%/ReleaseWin/Python.EmbeddingTest.dll"
9665

9766
artifacts:
9867
# bdist_wheel puts your built wheel in the dist directory

ci/install.ps1

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ function InstallCondaPackages ($python_home, $spec) {
7474
Start-Process -FilePath "$conda_path" -ArgumentList $args -Wait -Passthru
7575
}
7676

77+
7778
function UpdateConda ($python_home) {
7879
$conda_path = $python_home + "\Scripts\conda.exe"
7980
Write-Host "Updating conda..."

ci/run_with_env.cmd

+5-2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
:: outside of the IF clauses, they do not run properly in the SET_SDK_64==Y
3636
:: case, I don't know why.
3737
:: originally from https://github.com/pelson/Obvious-CI/blob/master/scripts/obvci_appveyor_python_build_env.cmd
38+
:: https://github.com/alimanfoo/zarr/blob/master/build.cmd
39+
:: https://github.com/cython/cython/blob/master/appveyor/run_with_env.cmd
40+
:: https://github.com/cjrh/easycython/blob/master/appveyor/setup_build_env.cmd
3841
@ECHO OFF
3942

4043
SET COMMAND_TO_RUN=%*
@@ -49,9 +52,9 @@ IF "%CONDA_PY:~2,1%" == "" (
4952
SET MINOR_PYTHON_VERSION=%CONDA_PY:~1,1%
5053
) ELSE (
5154
IF "%CONDA_PY:~3,1%" == "." (
52-
SET MINOR_PYTHON_VERSION=%CONDA_PY:~2,1%
55+
SET MINOR_PYTHON_VERSION=%CONDA_PY:~2,1%
5356
) ELSE (
54-
SET MINOR_PYTHON_VERSION=%CONDA_PY:~2,2%
57+
SET MINOR_PYTHON_VERSION=%CONDA_PY:~2,2%
5558
)
5659
)
5760

conda.recipe/meta.yaml

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package:
2-
name: pythonnet
3-
version: {{ environ.get('GIT_DESCRIBE_TAG', '').replace('-dev', '.dev') }}
2+
name: pythonnet
3+
version: {{ environ.get('GIT_DESCRIBE_TAG', '').replace('-dev', '.dev') }}
44

55
build:
6-
skip: True # [not win]
7-
number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}
8-
{% if environ.get('GIT_DESCRIBE_NUMBER', '0') == '0' %}string: py{{ environ.get('PY_VER').replace('.', '') }}_0
9-
{% else %}string: py{{ environ.get('PY_VER').replace('.', '') }}_{{ environ.get('GIT_BUILD_STR', 'GIT_STUB') }}{% endif %}
6+
skip: True # [not win]
7+
number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}
8+
{% if environ.get('GIT_DESCRIBE_NUMBER', '0') == '0' %}string: py{{ environ.get('PY_VER').replace('.', '') }}_0
9+
{% else %}string: py{{ environ.get('PY_VER').replace('.', '') }}_{{ environ.get('GIT_BUILD_STR', 'GIT_STUB') }}{% endif %}
1010

1111
source:
12-
git_url: ../
12+
git_url: ../
1313

1414
requirements:
1515
build:
@@ -24,5 +24,5 @@ test:
2424
- clr
2525

2626
about:
27-
home: https://github.com/pythonnet/pythonnet
28-
license: MIT
27+
home: https://github.com/pythonnet/pythonnet
28+
license: MIT

0 commit comments

Comments
 (0)