Skip to content

Commit b7e3b83

Browse files
authored
Merge pull request #61 from MDAnalysis/appveyor
run tests on AppVeyor
2 parents 3b0bccf + 82511d0 commit b7e3b83

2 files changed

Lines changed: 71 additions & 1 deletion

File tree

.appveyor.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# AppVeyor config for GridDataFormats
2+
#
3+
# config based on MDAnalysis, which was based on
4+
# examples from SciPy & NumPy repositories, which
5+
# themselves credit an original example by Olivier Grisel at
6+
# https://github.com/ogrisel/python-appveyor-demo/blob/master/appveyor.yml
7+
clone_depth: 50
8+
max_jobs: 100
9+
10+
cache:
11+
- '%LOCALAPPDATA%\pip\Cache'
12+
13+
image:
14+
- Visual Studio 2015
15+
16+
environment:
17+
global:
18+
CONDA_CHANNELS: conda-forge
19+
CONDA_DEPENDENCIES: pip setuptools wheel six scipy vs2015_runtime pytest pytest-cov codecov
20+
DEBUG: "False"
21+
MINGW_64: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin
22+
OPENBLAS_64: https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com/openblas-5f998ef_gcc7_1_0_win64.zip
23+
APPVEYOR_SAVE_CACHE_ON_ERROR: true
24+
APPVEYOR_SKIP_FINALIZE_ON_EXIT: true
25+
TEST_TIMEOUT: 1000
26+
PYTHON: "C:\\conda"
27+
MINICONDA_VERSION: "latest"
28+
29+
matrix:
30+
- PYTHON_VERSION: 3.6
31+
PYTHON_ARCH: 64
32+
MSVC_VERSION: "Visual Studio 10 Win64"
33+
34+
init:
35+
- ps: Write-Host ${env:PYTHON} ${env:PYTHON_VERSION} ${env:PYTHON_ARCH}
36+
- ps: Write-Host ${env:APPVEYOR_SCHEDULED_BUILD}
37+
# cancel build if newer one is submitted; complicated
38+
# details for getting this to work are credited to JuliaLang
39+
# developers
40+
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
41+
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
42+
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
43+
raise "There are newer queued builds for this pull request, skipping build."
44+
}
45+
46+
install:
47+
# set up a conda env
48+
- ps: git clone -q --depth 1 git://github.com/astropy/ci-helpers.git
49+
- ps: ci-helpers/appveyor/install-miniconda.ps1
50+
- ps: $env:PATH = "${env:PYTHON};${env:PYTHON}\Scripts;" + $env:PATH
51+
# deal with missing stdint.h as previously described
52+
# see https://github.com/swistakm/pyimgui/blob/master/.appveyor.yml
53+
- ps: cp "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdint.h" "C:\Users\appveyor\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include\stdint.h"
54+
- ps: activate test
55+
56+
build_script:
57+
- cmd: C:\conda\envs\test\python.exe setup.py develop --no-deps --user 3>&1
58+
59+
test_script:
60+
- cmd: C:\conda\envs\test\python.exe setup.py develop --no-deps --user 3>&1
61+
- cmd: C:\conda\envs\test\Scripts\pytest.exe --cov=gridData 3>&1
62+
- cmd: codecov
63+
64+
after_build:
65+
# cache cleanup
66+
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -mtime +360 -delete
67+
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -size +10M -delete
68+
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -empty -delete
69+
# Show size of cache
70+
- C:\cygwin\bin\du -hs "%LOCALAPPDATA%\pip\Cache"

gridData/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def resample_factor(self, factor):
256256
"""
257257
# new number of edges N' = (N-1)*f + 1
258258
newlengths = [(N - 1) * float(factor) + 1 for N in self._len_edges()]
259-
edges = [numpy.linspace(start, stop, num=N, endpoint=True)
259+
edges = [numpy.linspace(start, stop, num=int(N), endpoint=True)
260260
for (start, stop, N) in
261261
zip(self._min_edges(), self._max_edges(), newlengths)]
262262
return self.resample(edges)

0 commit comments

Comments
 (0)