-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pr 280 support windows #282
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
94e975f
Add Appveyor support
mdboom d9450cf
Fix up color printing on Windows
pv 624009d
Allow multi-argument range spec for Git
pv 913851b
Fix up util.check_output + util.which on Windows
pv 65ac571
Fix up executable discovery for virtualenv & conda on Windows
pv efbde6f
Fix up memory benchmark test on Windows
pv 7e5f51e
Fix issues in test_environment on windows
pv 9344e17
Use colorama instead of psutil for tests, because psutil is not pure-…
pv 7fa11ff
Work around the 260 char PATH_MAX on Windows
pv 1b96efc
Fix up test failure in test_workflow on 32-bit Python 2.x
pv 2f85a69
Fix right-aligning of benchmark results; Windows cmd terminal wraps o…
pv 1362881
Fix multiprocessing test failures, when run via python setup.py test …
pv 5fa41ed
Ensure setup.py test passes the given extra arguments to pytest
pv 6d48594
Run pytest in appveyor with --tb=native to avoid pytest bug
pv 1d84c83
Try harder to remove directories on Windows
pv c74a558
Fix division by zero in asv continuous
pv 413fe9d
Disable colorama colors on Windows -- too many failure modes in practice
pv b685890
Mark a failing test on Windows/Appveyor as xfail
pv f353c7b
Skip multiprocessing using tests when run from py.test on Windows
pv cc6acca
Convert xrange to while loop, because xrange on 32-bit Python 2.x can…
pv 35d8c99
Tell jquery to parse incoming data as json, for json files (asv previ…
pv 9eda5f5
Fix up serving long path names on Windows for asv preview
pv aae7a03
Refactor Conda/Virtualenv by moving common helper methods to Environm…
pv 0d2a125
Enable running all test_environment tests if conda is available
pv 0f0ef02
Mark hglib requiring test as skipif rather than xfail
pv 53457ec
Add test checking check_presence doesn't return obvious false negatives
pv d880953
Add comment explaining not using xrange + make Environment.setup priv…
pv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Sample script to install anaconda under windows | ||
# Authors: Stuart Mumford | ||
# Borrwed from: Olivier Grisel and Kyle Kastner | ||
# License: BSD 3 clause | ||
|
||
$MINICONDA_URL = "http://repo.continuum.io/miniconda/" | ||
|
||
function DownloadMiniconda ($version, $platform_suffix) { | ||
$webclient = New-Object System.Net.WebClient | ||
$filename = "Miniconda-" + $version + "-Windows-" + $platform_suffix + ".exe" | ||
|
||
$url = $MINICONDA_URL + $filename | ||
|
||
$basedir = $pwd.Path + "\" | ||
$filepath = $basedir + $filename | ||
if (Test-Path $filename) { | ||
Write-Host "Reusing" $filepath | ||
return $filepath | ||
} | ||
|
||
# Download and retry up to 3 times in case of network transient errors. | ||
Write-Host "Downloading" $filename "from" $url | ||
$retry_attempts = 2 | ||
for($i=0; $i -lt $retry_attempts; $i++){ | ||
try { | ||
$webclient.DownloadFile($url, $filepath) | ||
break | ||
} | ||
Catch [Exception]{ | ||
Start-Sleep 1 | ||
} | ||
} | ||
if (Test-Path $filepath) { | ||
Write-Host "File saved at" $filepath | ||
} else { | ||
# Retry once to get the error message if any at the last try | ||
$webclient.DownloadFile($url, $filepath) | ||
} | ||
return $filepath | ||
} | ||
|
||
function InstallMiniconda ($python_version, $architecture, $python_home) { | ||
Write-Host "Installing miniconda" $python_version "for" $architecture "bit architecture to" $python_home | ||
if (Test-Path $python_home) { | ||
Write-Host $python_home "already exists, skipping." | ||
return $false | ||
} | ||
if ($architecture -eq "x86") { | ||
$platform_suffix = "x86" | ||
} else { | ||
$platform_suffix = "x86_64" | ||
} | ||
$filepath = DownloadMiniconda $python_version $platform_suffix | ||
Write-Host "Installing" $filepath "to" $python_home | ||
$args = "/InstallationType=AllUsers /S /AddToPath=1 /RegisterPython=1 /D=" + $python_home | ||
Write-Host $filepath $args | ||
Start-Process -FilePath $filepath -ArgumentList $args -Wait -Passthru | ||
#Start-Sleep -s 15 | ||
if (Test-Path C:\conda) { | ||
Write-Host "Miniconda $python_version ($architecture) installation complete" | ||
} else { | ||
Write-Host "Failed to install Python in $python_home" | ||
Exit 1 | ||
} | ||
} | ||
|
||
function main () { | ||
InstallMiniconda $env:MINICONDA_VERSION $env:PLATFORM $env:PYTHON | ||
} | ||
|
||
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
:: To build extensions for 64 bit Python 3, we need to configure environment | ||
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of: | ||
:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1) | ||
:: | ||
:: To build extensions for 64 bit Python 2, we need to configure environment | ||
:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of: | ||
:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0) | ||
:: | ||
:: 32 bit builds do not require specific environment configurations. | ||
:: | ||
:: Note: this script needs to be run with the /E:ON and /V:ON flags for the | ||
:: cmd interpreter, at least for (SDK v7.0) | ||
:: | ||
:: More details at: | ||
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows | ||
:: http://stackoverflow.com/a/13751649/163740 | ||
:: | ||
:: Author: Olivier Grisel | ||
:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ | ||
@ECHO OFF | ||
|
||
SET COMMAND_TO_RUN=%* | ||
SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows | ||
|
||
SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%" | ||
IF %MAJOR_PYTHON_VERSION% == "2" ( | ||
SET WINDOWS_SDK_VERSION="v7.0" | ||
) ELSE IF %MAJOR_PYTHON_VERSION% == "3" ( | ||
SET WINDOWS_SDK_VERSION="v7.1" | ||
) ELSE ( | ||
ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%" | ||
EXIT 1 | ||
) | ||
|
||
IF "%PYTHON_ARCH%"=="64" ( | ||
ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture | ||
SET DISTUTILS_USE_SDK=1 | ||
SET MSSdk=1 | ||
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION% | ||
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release | ||
ECHO Executing: %COMMAND_TO_RUN% | ||
call %COMMAND_TO_RUN% || EXIT 1 | ||
) ELSE ( | ||
ECHO Using default MSVC build environment for 32 bit architecture | ||
ECHO Executing: %COMMAND_TO_RUN% | ||
call %COMMAND_TO_RUN% || EXIT 1 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# AppVeyor.com is a Continuous Integration service to build and run tests under | ||
# Windows | ||
|
||
environment: | ||
|
||
global: | ||
PYTHON: "C:\\conda" | ||
MINICONDA_VERSION: "latest" | ||
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\.continuous-integration\\appveyor\\windows_sdk.cmd" | ||
|
||
matrix: | ||
|
||
- PYTHON_VERSION: "2.6" | ||
platform: x64 | ||
PYTHON_ARCH: "64" | ||
- PYTHON_VERSION: "2.7" | ||
platform: x64 | ||
PYTHON_ARCH: "64" | ||
- PYTHON_VERSION: "2.7" | ||
platform: x86 | ||
PYTHON_ARCH: "32" | ||
- PYTHON_VERSION: "3.4" | ||
platform: x64 | ||
PYTHON_ARCH: "64" | ||
|
||
install: | ||
# Install miniconda using a powershell script. | ||
- "powershell .continuous-integration/appveyor/install-miniconda.ps1" | ||
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" | ||
|
||
# Install the build and runtime dependencies of the project. | ||
- "conda update --yes conda" | ||
# Create a conda environment | ||
- "conda create -q --yes -n test python=%PYTHON_VERSION%" | ||
- "activate test" | ||
|
||
# Check that we have the expected version of Python | ||
- "python --version" | ||
|
||
# Install specified version of dependencies | ||
- "conda install -q --yes six pytest" | ||
|
||
# Not a .NET project | ||
build: false | ||
|
||
test_script: | ||
- "%CMD_IN_ENV% python setup.py test -a --tb=native" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,15 +116,21 @@ def resample_data(self, val): | |
max_time = max(x[0] for x in val) | ||
step_size = int((max_time - min_time) / RESAMPLED_POINTS) | ||
|
||
# This loop cannot use xrange, because xrange on Python2 on | ||
# 32-bit systems can only deal with 32-bit integers, and | ||
# Javascript timestamps (1000*unix_timestamp) handled here | ||
# overflow this range | ||
new_val = [] | ||
j = 0 | ||
for i in xrange(min_time + step_size, max_time + step_size, step_size): | ||
i = min_time + step_size | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this change? Less likely for a change to inadvertently fail the loop end condition when using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Javascript timestamps handled here overflow the 32-bit integers on
win32, and xrange on Py2 only works with native size integers, so using
it is not possible here.
|
||
while i < max_time + step_size: | ||
chunk = [] | ||
while j < len(val) and val[j][0] < i: | ||
chunk.append(val[j][1]) | ||
j += 1 | ||
if len(chunk): | ||
new_val.append((i, _mean_with_none(chunk))) | ||
i += step_size | ||
return new_val | ||
|
||
def get_data(self): | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. The comment addresses this nicely.