Skip to content

Commit 16a7f35

Browse files
authored
Merge pull request ydataai#9 from nparley/travis
Add CI tests
2 parents 3aeeeba + e10930c commit 16a7f35

File tree

4 files changed

+163
-0
lines changed

4 files changed

+163
-0
lines changed

.travis.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Based on http://conda.pydata.org/docs/travis.html
2+
language: python
3+
python:
4+
- "2.7"
5+
- "3.3"
6+
- "3.4"
7+
install:
8+
- sudo apt-get update
9+
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
10+
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
11+
else
12+
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
13+
fi
14+
- bash miniconda.sh -b -p $HOME/miniconda
15+
- export PATH="$HOME/miniconda/bin:$PATH"
16+
- hash -r
17+
- conda config --set always_yes yes --set changeps1 no
18+
- conda update -q conda
19+
- conda info -a
20+
21+
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION pandas matplotlib
22+
- source activate test-environment
23+
- python setup.py install
24+
25+
script:
26+
- python -m unittest -v pandas_profiling.tests
27+
28+
notifications:
29+
email:
30+
on_success: change
31+
on_failure: change

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ for information about options and arguments.
6262
## Dependencies
6363

6464
* **An internet connection.** Pandas-profiling requires an internet connection to download the Bootstrap and JQuery libraries. I might change this in the future, let me know if you want that sooner than later.
65+
* python (>= 2.7)
6566
* pandas (>=0.16)
6667
* matplotlib (>=1.4)
6768

appveyor.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# CI on Windows via appveyor
2+
# This file was based on Olivier Grisel's python-appveyor-demo
3+
4+
environment:
5+
6+
matrix:
7+
- PYTHON: "C:\\Python27-conda32"
8+
PYTHON_VERSION: "2.7"
9+
PYTHON_ARCH: "32"
10+
11+
- PYTHON: "C:\\Python34-conda64"
12+
PYTHON_VERSION: "3.4"
13+
PYTHON_ARCH: "64"
14+
15+
install:
16+
# Install miniconda Python
17+
- "powershell ./appveyor_install.ps1"
18+
19+
# Prepend newly installed Python to the PATH of this build (this cannot be
20+
# done from inside the powershell script as it would require to restart
21+
# the parent CMD process).
22+
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
23+
24+
# Check that we have the expected version and architecture for Python
25+
- "python --version"
26+
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
27+
28+
# install xarray and depenencies
29+
- "conda install --yes --quiet pandas matplotlib"
30+
- "python setup.py install"
31+
32+
build: false
33+
34+
test_script:
35+
- "python -m unittest -v pandas_profiling.tests"

appveyor_install.ps1

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Sample script to install Miniconda under Windows
2+
# Authors: Olivier Grisel, Jonathan Helmus and Kyle Kastner, Robert McGibbon
3+
# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
4+
5+
$MINICONDA_URL = "http://repo.continuum.io/miniconda/"
6+
7+
8+
function DownloadMiniconda ($python_version, $platform_suffix) {
9+
$webclient = New-Object System.Net.WebClient
10+
if ($python_version -match "3.4") {
11+
$filename = "Miniconda3-latest-Windows-" + $platform_suffix + ".exe"
12+
} else {
13+
$filename = "Miniconda-latest-Windows-" + $platform_suffix + ".exe"
14+
}
15+
$url = $MINICONDA_URL + $filename
16+
17+
$basedir = $pwd.Path + "\"
18+
$filepath = $basedir + $filename
19+
if (Test-Path $filename) {
20+
Write-Host "Reusing" $filepath
21+
return $filepath
22+
}
23+
24+
# Download and retry up to 3 times in case of network transient errors.
25+
Write-Host "Downloading" $filename "from" $url
26+
$retry_attempts = 2
27+
for($i=0; $i -lt $retry_attempts; $i++){
28+
try {
29+
$webclient.DownloadFile($url, $filepath)
30+
break
31+
}
32+
Catch [Exception]{
33+
Start-Sleep 1
34+
}
35+
}
36+
if (Test-Path $filepath) {
37+
Write-Host "File saved at" $filepath
38+
} else {
39+
# Retry once to get the error message if any at the last try
40+
$webclient.DownloadFile($url, $filepath)
41+
}
42+
return $filepath
43+
}
44+
45+
46+
function InstallMiniconda ($python_version, $architecture, $python_home) {
47+
Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home
48+
if (Test-Path $python_home) {
49+
Write-Host $python_home "already exists, skipping."
50+
return $false
51+
}
52+
if ($architecture -match "32") {
53+
$platform_suffix = "x86"
54+
} else {
55+
$platform_suffix = "x86_64"
56+
}
57+
58+
$filepath = DownloadMiniconda $python_version $platform_suffix
59+
Write-Host "Installing" $filepath "to" $python_home
60+
$install_log = $python_home + ".log"
61+
$args = "/S /D=$python_home"
62+
Write-Host $filepath $args
63+
Start-Process -FilePath $filepath -ArgumentList $args -Wait -Passthru
64+
if (Test-Path $python_home) {
65+
Write-Host "Python $python_version ($architecture) installation complete"
66+
} else {
67+
Write-Host "Failed to install Python in $python_home"
68+
Get-Content -Path $install_log
69+
Exit 1
70+
}
71+
}
72+
73+
74+
function InstallCondaPackages ($python_home, $spec) {
75+
$conda_path = $python_home + "\Scripts\conda.exe"
76+
$args = "install --yes " + $spec
77+
Write-Host ("conda " + $args)
78+
Start-Process -FilePath "$conda_path" -ArgumentList $args -Wait -Passthru
79+
}
80+
81+
function UpdateConda ($python_home) {
82+
$conda_path = $python_home + "\Scripts\conda.exe"
83+
Write-Host "Updating conda..."
84+
$args = "update --yes conda"
85+
Write-Host $conda_path $args
86+
Start-Process -FilePath "$conda_path" -ArgumentList $args -Wait -Passthru
87+
}
88+
89+
90+
function main () {
91+
InstallMiniconda $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON
92+
UpdateConda $env:PYTHON
93+
InstallCondaPackages $env:PYTHON "conda-build jinja2 anaconda-client"
94+
}
95+
96+
main

0 commit comments

Comments
 (0)