forked from pmacosta/putil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
150 lines (143 loc) · 5.29 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# appveyor.yml
# Copyright (c) 2013-2016 Pablo Acosta-Serafini
# See LICENSE for details
environment:
matrix:
- JOB: "2.6"
INTERP: "py26"
PYVER: "2.6"
- JOB: "2.7"
INTERP: "py27"
PYVER: "2.7"
- JOB: "3.3"
INTERP: "py33"
PYVER: "3.3"
- JOB: "3.4"
INTERP: "py34"
PYVER: "3.4"
- JOB: "3.5"
INTERP: "py35"
PYVER: "3.5"
init:
- echo "PYVER=%PYVER%"
install:
###
# sbin/winsetup1.bat file
###
# Set up environment variables
###
- set
- set PYTHONCMD=python
- set PIPCMD=pip
- set REPO_DIR=%CD%
- set RESULTS_DIR=%REPO_DIR%\results
- set PKG_NAME=putil
- set VIRTUALENV_DIR=C:\Anaconda\envs\%INTERP%
- set PYTHON_SITE_PACKAGES=%VIRTUALENV_DIR%\lib\site-packages
- set BIN_DIR=%VIRTUALENV_DIR%\Scripts
- set SOURCE_DIR=%PYTHON_SITE_PACKAGES%\%PKG_NAME%
- set EXTRA_DIR=%VIRTUALENV_DIR%\share\%PKG_NAME%
- set PYTHONPATH=%PYTHONPATH%;%PYTHON_SITE_PACKAGES%;%EXTRA_DIR%;%EXTRA_DIR%\tests;%EXTRA_DIR%\docs;%EXTRA_DIR%\docs\support
- set TRACER_DIR=%EXTRA_DIR%\docs\support
- set PYTESTCMD=py.test
- set COV_FILE=%SOURCE_DIR%\.coveragerc_ci_%INTERP%
- set MAIN_REQUIREMENTS_FILE=%REPO_DIR%\requirements\main_%INTERP%.pip
- set TESTS_REQUIREMENTS_FILE=%REPO_DIR%\requirements\tests_%INTERP%.pip
- set CITMP=%REPO_DIR%\CITMP
- set PYTHONWARNINGS="ignore:a true SSLContext object"
- if not exist "%CITMP%" mkdir %CITMP%
- echo "PYTHONCMD=%PYTHONCMD%"
- echo "PIPCMD=%PIPCMD%"
- echo "PYTESTCMD=%PYTESTCMD%"
- echo "INTERP=%INTERP%"
- echo "PKG_NAME=%PKG_NAME%"
- echo "PYTHON_SITE_PACKAGES=%PYTHON_SITE_PACKAGES%"
- echo "REPO_DIR=%REPO_DIR%"
- echo "VIRTUALENV_DIR=%VIRTUALENV_DIR%"
- echo "BIN_DIR=%BINDIR%"
- echo "EXTRA_DIR=%EXTRA_DIR%"
- echo "RESULTS_DIR=%RESULTS_DIR%"
- echo "SOURCE_DIR=%SOURCE_DIR%"
- echo "TRACER_DIR=%TRACER_DIR%"
- echo "PYTHONPATH=%PYTHONPATH%"
- echo "COV_FILE=%COV_FILE%"
- echo "MAIN_REQUIREMENTS_FILE=%MAIN_REQUIREMENTS_FILE%"
- echo "TESTS_REQUIREMENTS_FILE=%TESTS_REQUIREMENTS_FILE%"
###
# Install tools and dependencies of package dependencies
###
- ps: wget https://repo.continuum.io/archive/.winzip/Anaconda2-2.4.0-Windows-x86.zip -OutFile anaconda.zip
- 7z x anaconda.zip -o".\anaconda\" -y > nul
- ls .\anaconda\
- .\anaconda\Anaconda2-2.4.0-Windows-x86.exe /S /D=C:\Anaconda
- set PATH=C:\\Anaconda;C:\\Anaconda\\Scripts;%PATH%
- conda update -y conda
- conda create -y --name %INTERP% python=%PYVER% numpy scipy matplotlib
- activate %INTERP%
###
# sbin/winsetup2.bat file
###
- pip install --disable-pip-version-check --user --upgrade pip setuptools wheel
###
# Install package dependencies
###
- python %REPO_DIR%\sbin\gen_req_files.py freeze
- pip install --upgrade -r%MAIN_REQUIREMENTS_FILE%
- pip install --upgrade -r%TESTS_REQUIREMENTS_FILE%
- pip install --upgrade -r%REPO_DIR%\\requirements\docs.pip
- pip freeze
###
# Create directories for reports and images
###
- if not exist "%RESULTS_DIR%\\testresults" mkdir %RESULTS_DIR%\testresults
- if not exist "%RESULTS_DIR%\\codecoverage" mkdir %RESULTS_DIR%\codecoverage
- if not exist "%RESULTS_DIR%\\images" mkdir %RESULTS_DIR%\images
build_script:
###
# Install package
###
- type %REPO_DIR%\MANIFEST.in
# Fix Git symbolik links
- python .\sbin\fix_windows_symlinks.py
- python setup.py sdist
# Change directory away from repository, otherwise pip does not install package
- cd %REPO_DIR%
- python -c "import sys; sys.path.append(['./putil']);import putil.version; print(putil.version.__version__)" > version.txt
- set /p PKG_VERSION=<version.txt
- echo "PKG_VERSION=%PKG_VERSION%"
- cd %PYTHON_SITE_PACKAGES%
- pip install %REPO_DIR%\dist\%PKG_NAME%-%PKG_VERSION%.zip
###
# sbin/wintest.bat file
###
# Write coverage configuration file
###
- python %EXTRA_DIR%\sbin\coveragerc_manager.py 'ci' 1 %INTERP% %PYTHON_SITE_PACKAGES%
- type %COV_FILE%
# - if "%INTERP%" == "py26" python %EXTRA_DIR%\sbin\patch_pylint.py %PYTHON_SITE_PACKAGES%
###
# Change to tests sub-directory to mimic Tox conditions
###
- cd %EXTRA_DIR%\tests
test_script:
###
# Run tests
###
# Omitted tests are not Windows-specific and are handled by Travis-CI
# - python %EXTRA_DIR%\sbin\check_files_compliance.py -tps -d %SOURCE_DIR% -m %EXTRA_DIR%
# - pylint --rcfile=%EXTRA_DIR%\.pylintrc -f colorized -r no %SOURCE_DIR%
# - pylint --rcfile=%EXTRA_DIR%\.pylintrc -f colorized -r no %EXTRA_DIR%\sbin
# - pylint --rcfile=%EXTRA_DIR%\.pylintrc -f colorized -r no %EXTRA_DIR%\tests
# - pylint --rcfile=%EXTRA_DIR%\.pylintrc -f colorized -r no %EXTRA_DIR%\docs\support
- py.test --doctest-glob='*.rst' %EXTRA_DIR%\docs
- py.test --doctest-modules %SOURCE_DIR%
# Coverage tests runs all the unit tests, no need to run the non-coverage
# tests since the report is not being used
# - py.test -s -vv --junitxml=%RESULTS_DIR%\testresults\pytest.xml
- py.test --cov-config %COV_FILE% --cov %SOURCE_DIR% --cov-report term
# Re-building exceptions auto-documentation takes a long time in Appveyor.
# They have (and should be) spot-checked every now and then
# - python %EXTRA_DIR%\sbin\build_docs.py -r -t -d %SOURCE_DIR%
on_failure:
- 7z a %EXTRA_DIR%\actual_images.zip %EXTRA_DIR%\artifacts\*.png
- appveyor PushArtifact %EXTRA_DIR%\actual_images.zip