Skip to content

Commit 1ef32a0

Browse files
authored
Merge pull request #22 from vighneshbirodkar/appv
[MRG] Adding Appveyor CI
2 parents 4273901 + 01c3ba8 commit 1ef32a0

File tree

10 files changed

+240
-9
lines changed

10 files changed

+240
-9
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ env:
1818
- DISTRIB="conda" PYTHON_VERSION="3.5" COVERAGE="true"
1919
NUMPY_VERSION="1.10.4" SCIPY_VERSION="0.17.0" CYTHON_VERSION="0.23.4"
2020

21-
install: source ci_scripts/install.sh
22-
script: bash ci_scripts/test.sh
23-
after_success: source ci_scripts/success.sh
21+
install: source ci_scripts/travis/install.sh
22+
script: bash ci_scripts/travis/test.sh
23+
after_success: source ci_scripts/travis/success.sh

README.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,30 @@ Coveralls can start monitoring it. The project already contains the required
130130
configuration for Coveralls to work. All subsequent builds after adding your
131131
project will generate a coverage report.
132132

133-
### 6. Setting up Circle CI
133+
### 6. Setting up Appveyor
134+
[Appveyor](https://www.appveyor.com/) provides continuous intergration on the
135+
windows platform. Currently, Appveyor can also be used to build platform
136+
specific Windows wheels, which can be uploaded to a Cloud Service provider and
137+
be made available via a Content Delivery Network (CDN). To setup Appveyor to
138+
build your project you need to sign up on Appveyor and authorize it. Appveyor
139+
configaration is governed by the `appveyor.yml` file. You have to change the
140+
following variables in it to match the requirements of your project.
141+
142+
| Variable | Value|
143+
|----------|------|
144+
| `PROJECT_NAME` | The name of your project. This should be the same as the `name` field in `setup.py` |
145+
| `MODULE` | The name of the module you want to be tested |
146+
| `CLOUD_STORAGE` | A constant which indicates which Cloud Storage service provider to use. It should be one among the [Supported Providers](https://libcloud.readthedocs.io/en/latest/storage/supported_providers.html) |
147+
| `CLOUD_CONTAINER` | The name of a container with your Cloud Storage service provider where the built files will be uploaded.|
148+
| `WHEELHOUSE_UPLOADER_USERNAME` | The username you have used to register with your Cloud Storage procider |
149+
| `WHEELHOUSE_UPLOADER_SECRET` | An API key you have obtained from your Cloud Storage provider, which will authenticate you to upload files to it. This should **never** be stored in plain text. To make Appveyor encrypt your API key, use Appveyor's [Encrypt Tool](https://ci.appveyor.com/tools/encrypt) and store the returned value using a `secure:` prefix. |
150+
151+
Maintainers of an official [scikit-learn contrib](
152+
https://contrib.scikit-learn.org) repository can request [Rackspace]
153+
(https://mycloud.rackspace.com/) credentials from the scikit-learn developers.
154+
155+
156+
### 7. Setting up Circle CI
134157
The project uses [CircleCI](https://circleci.com/) to build its documentation
135158
from the `master` branch and host it using [Github Pages](https://pages.github.com/).
136159
Again, you will need to Sign Up and authorize CircleCI. The configuration
@@ -157,14 +180,14 @@ on
157180
https://github.com/USERNAME/DOC_REPO/DOC_URL
158181
```
159182

160-
### 7. Adding Badges
183+
### 8. Adding Badges
161184

162185
Follow the instructions to add a [Travis Badge](https://docs.travis-ci.com/user/status-images/),
163186
[Coveralls Badge](https://coveralls.io) and
164187
[CircleCI Badge](https://circleci.com/docs/status-badges) to your repository's
165188
`README`.
166189

167-
### 8. Advertising your package
190+
### 9. Advertising your package
168191

169192
Once your work is mature enough for the general public to use it, you should
170193
submit a Pull Request to modify scikit-learn's
@@ -174,7 +197,7 @@ repository or PyPI page.
174197
You may also wish to announce your work on the
175198
[`scikit-learn-general` mailing list](https://lists.sourceforge.net/lists/listinfo/scikit-learn-general).
176199

177-
### 9. Uploading your package to PyPI
200+
### 10. Uploading your package to PyPI
178201

179202
Uploading your package to [PyPI](https://pypi.python.org/pypi) allows users to
180203
install your package through `pip`. Python provides two repositories to upload

appveyor.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# AppVeyor.com is a Continuous Integration service to build and run tests under
2+
# Windows
3+
4+
5+
environment:
6+
global:
7+
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
8+
# /E:ON and /V:ON options are not enabled in the batch script interpreter
9+
# See: http://stackoverflow.com/a/13751649/163740
10+
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci_scripts\\appveyor\\run_with_env.cmd"
11+
WHEELHOUSE_UPLOADER_USERNAME: sklearn
12+
WHEELHOUSE_UPLOADER_SECRET:
13+
secure: XzK+Mi6Ba5frV2B/jHq7h4aD8/nox9SsI3T8Kub1L2XNevRSIurUEry3PdWESzRY
14+
MODULE: skltemplate
15+
PROJECT_NAME: sklearn-template
16+
CLOUD_STORAGE: CLOUDFILES
17+
CLOUD_CONTATINER: sklearn-template-trial
18+
19+
matrix:
20+
- PYTHON: "C:\\Python27"
21+
PYTHON_VERSION: "2.7.8"
22+
PYTHON_ARCH: "32"
23+
MINICONDA: "C:\\Miniconda"
24+
25+
- PYTHON: "C:\\Python27-x64"
26+
PYTHON_VERSION: "2.7.8"
27+
PYTHON_ARCH: "64"
28+
MINICONDA: "C:\\Miniconda-x64"
29+
30+
- PYTHON: "C:\\Python35"
31+
PYTHON_VERSION: "3.5.0"
32+
PYTHON_ARCH: "32"
33+
MINICONDA: "C:\\Miniconda35"
34+
35+
- PYTHON: "C:\\Python35-x64"
36+
PYTHON_VERSION: "3.5.0"
37+
PYTHON_ARCH: "64"
38+
MINICONDA: "C:\\Miniconda35-x64"
39+
40+
install:
41+
# Miniconda is pre-installed in the worker build
42+
- "SET PATH=%MINICONDA%;%MINICONDA%\\Scripts;%PATH%"
43+
- "python -m pip install -U pip"
44+
45+
# Check that we have the expected version and architecture for Python
46+
- "python --version"
47+
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
48+
- "pip --version"
49+
50+
# Remove cygwin because it clashes with conda
51+
# see http://help.appveyor.com/discussions/problems/3712-git-remote-https-seems-to-be-broken
52+
- rmdir C:\\cygwin /s /q
53+
54+
# Install the build and runtime dependencies of the project.
55+
- conda install --quiet --yes numpy scipy cython nose scikit-learn wheel
56+
- pip install wheelhouse_uploader nose-timer
57+
- "%CMD_IN_ENV% python setup.py bdist_wheel bdist_wininst"
58+
- ps: "ls dist"
59+
60+
# Install the generated wheel package to test it
61+
- "pip install --pre --no-index --find-links dist %PROJECT_NAME%"
62+
63+
64+
# Not a .NET project, we build scikit-learn in the install step instead
65+
build: false
66+
67+
68+
artifacts:
69+
# Archive the generated wheel package in the ci.appveyor.com build report.
70+
- path: dist\*
71+
72+
73+
on_success:
74+
# Upload the generated wheel package to Rackspace
75+
# On Windows, Apache Libcloud cannot find a standard CA cert bundle so we
76+
# disable the ssl checks.
77+
- "python -m wheelhouse_uploader upload provider=%CLOUD_STORAGE% --no-ssl-check --local-folder=dist %CLOUD_CONTAINER%"
78+
79+
80+
test_script:
81+
# Change to a non-source folder to make sure we run the tests on the
82+
# installed library.
83+
- "mkdir empty_folder"
84+
- "cd empty_folder"
85+
86+
- "python -c \"import nose; nose.main()\" --with-timer --timer-top-n 20 -s -v %MODULE%"
87+
88+
# Move back to the project folder
89+
- "cd .."
90+
91+
92+
cache:
93+
# Use the appveyor cache to avoid re-downloading large archives such
94+
# the MKL numpy and scipy wheels mirrored on a rackspace cloud
95+
# container, speed up the appveyor jobs and reduce bandwidth
96+
# usage on our rackspace account.
97+
- '%APPDATA%\pip\Cache'

ci_scripts/appveyor/run_with_env.cmd

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
:: To build extensions for 64 bit Python 3, we need to configure environment
2+
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
3+
:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1)
4+
::
5+
:: To build extensions for 64 bit Python 2, we need to configure environment
6+
:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of:
7+
:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0)
8+
::
9+
:: 32 bit builds, and 64-bit builds for 3.5 and beyond, do not require specific
10+
:: environment configurations.
11+
::
12+
:: Note: this script needs to be run with the /E:ON and /V:ON flags for the
13+
:: cmd interpreter, at least for (SDK v7.0)
14+
::
15+
:: More details at:
16+
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
17+
:: http://stackoverflow.com/a/13751649/163740
18+
::
19+
:: Author: Olivier Grisel
20+
:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
21+
::
22+
:: Notes about batch files for Python people:
23+
::
24+
:: Quotes in values are literally part of the values:
25+
:: SET FOO="bar"
26+
:: FOO is now five characters long: " b a r "
27+
:: If you don't want quotes, don't include them on the right-hand side.
28+
::
29+
:: The CALL lines at the end of this file look redundant, but if you move them
30+
:: outside of the IF clauses, they do not run properly in the SET_SDK_64==Y
31+
:: case, I don't know why.
32+
@ECHO OFF
33+
34+
SET COMMAND_TO_RUN=%*
35+
SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
36+
SET WIN_WDK=c:\Program Files (x86)\Windows Kits\10\Include\wdf
37+
38+
:: Extract the major and minor versions, and allow for the minor version to be
39+
:: more than 9. This requires the version number to have two dots in it.
40+
SET MAJOR_PYTHON_VERSION=%PYTHON_VERSION:~0,1%
41+
IF "%PYTHON_VERSION:~3,1%" == "." (
42+
SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,1%
43+
) ELSE (
44+
SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,2%
45+
)
46+
47+
:: Based on the Python version, determine what SDK version to use, and whether
48+
:: to set the SDK for 64-bit.
49+
IF %MAJOR_PYTHON_VERSION% == 2 (
50+
SET WINDOWS_SDK_VERSION="v7.0"
51+
SET SET_SDK_64=Y
52+
) ELSE (
53+
IF %MAJOR_PYTHON_VERSION% == 3 (
54+
SET WINDOWS_SDK_VERSION="v7.1"
55+
IF %MINOR_PYTHON_VERSION% LEQ 4 (
56+
SET SET_SDK_64=Y
57+
) ELSE (
58+
SET SET_SDK_64=N
59+
IF EXIST "%WIN_WDK%" (
60+
:: See: https://connect.microsoft.com/VisualStudio/feedback/details/1610302/
61+
REN "%WIN_WDK%" 0wdf
62+
)
63+
)
64+
) ELSE (
65+
ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
66+
EXIT 1
67+
)
68+
)
69+
70+
IF %PYTHON_ARCH% == 64 (
71+
IF %SET_SDK_64% == Y (
72+
ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture
73+
SET DISTUTILS_USE_SDK=1
74+
SET MSSdk=1
75+
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%
76+
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
77+
ECHO Executing: %COMMAND_TO_RUN%
78+
call %COMMAND_TO_RUN% || EXIT 1
79+
) ELSE (
80+
ECHO Using default MSVC build environment for 64 bit architecture
81+
ECHO Executing: %COMMAND_TO_RUN%
82+
call %COMMAND_TO_RUN% || EXIT 1
83+
)
84+
) ELSE (
85+
ECHO Using default MSVC build environment for 32 bit architecture
86+
ECHO Executing: %COMMAND_TO_RUN%
87+
call %COMMAND_TO_RUN% || EXIT 1
88+
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

circle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ deployment:
4444
push:
4545
branch: master
4646
commands:
47-
- bash ci_scripts/push_doc.sh
47+
- bash ci_scripts/circleci/push_doc.sh
4848
general:
4949
# Open the doc to the API
5050
artifacts:

setup.cfg

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,25 @@
11
[metadata]
2-
description-file = README.md
2+
description-file = README.md
3+
4+
[aliases]
5+
# python2.7 has upgraded unittest and it is no longer compatible with some
6+
# of our tests, so we run all through nose
7+
test = nosetests
8+
9+
[nosetests]
10+
# nosetests skips test files with the executable bit by default
11+
# which can silently hide failing tests.
12+
# There are no executable scripts within the scikit-learn project
13+
# so let's turn the --exe flag on to avoid skipping tests by
14+
# mistake.
15+
exe = 1
16+
cover-html = 1
17+
cover-html-dir = coverage
18+
cover-package = sklearn
19+
20+
detailed-errors = 1
21+
with-doctest = 1
22+
doctest-tests = 1
23+
doctest-extension = rst
24+
doctest-fixtures = _fixture
25+
ignore-files=^setup\.py$

0 commit comments

Comments
 (0)