|
1 | 1 | environment: |
2 | 2 | matrix: |
3 | | - - PYTHON: "C:\\Python27" |
| 3 | + - PYARCH: "" |
4 | 4 | RUST_TARGET: "i686-pc-windows-msvc" |
5 | | - - PYTHON: "C:\\Python33" |
6 | | - RUST_TARGET: "i686-pc-windows-msvc" |
7 | | - - PYTHON: "C:\\Python34" |
8 | | - RUST_TARGET: "i686-pc-windows-msvc" |
9 | | - - PYTHON: "C:\\Python35" |
10 | | - RUST_TARGET: "i686-pc-windows-msvc" |
11 | | - - PYTHON: "C:\\Python27-x64" |
12 | | - RUST_TARGET: "x86_64-pc-windows-msvc" |
13 | | - - PYTHON: "C:\\Python33-x64" |
14 | | - DISTUTILS_USE_SDK: "1" |
15 | | - RUST_TARGET: "x86_64-pc-windows-msvc" |
16 | | - - PYTHON: "C:\\Python34-x64" |
17 | | - DISTUTILS_USE_SDK: "1" |
18 | | - RUST_TARGET: "x86_64-pc-windows-msvc" |
19 | | - - PYTHON: "C:\\Python35-x64" |
| 5 | + - PYARCH: "-x64" |
20 | 6 | RUST_TARGET: "x86_64-pc-windows-msvc" |
21 | 7 |
|
22 | 8 | install: |
| 9 | + - SET PYTHON=C:\Python27%PYARCH% |
23 | 10 | - "%PYTHON%\\python -m pip install -U pip setuptools wheel" |
24 | 11 | - ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-nightly-${env:RUST_TARGET}.exe" |
25 | 12 | - rust-nightly-%RUST_TARGET%.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust" |
26 | 13 | - SET PATH=%PATH%;C:\Program Files (x86)\Rust\bin |
27 | 14 | - SET PATH=%PATH%;C:\MinGW\bin |
28 | 15 |
|
29 | 16 | build_script: |
30 | | - - ".build.cmd %PYTHON%\\python -m pip install cffi pytest" |
31 | | - # We build the shared library outside of setuptools since we run into problems |
32 | | - # with the %PATH% set by .build.cmd... |
33 | | - - "cargo build --manifest-path fstwrapper/Cargo.toml --release" |
34 | | - - ".build.cmd %PYTHON%\\python -m pip -v wheel . -w .\\wheelhouse" |
| 17 | + - "%PYTHON%\\python -m pip install pytest" |
| 18 | + - "%PYTHON%\\python -m pip -v wheel . -w .\\wheelhouse" |
| 19 | + # Rename the wheel so it is valid for all Python versions |
| 20 | + # This is possible since our shared library does not link against any |
| 21 | + # Python ABI |
| 22 | + # TODO: This leaves the old Python ABI/ABI tags in the 'WHEEL' file inside |
| 23 | + # of the wheel. However, `pip` does not seem to validate against that |
| 24 | + # currently, so we're safe until they change it... |
| 25 | + - ps: | |
| 26 | + get-childItem wheelhouse\*-cp*-win*.whl | rename-item -newname { |
| 27 | + $_.name -replace '-cp.*?-cp.*?-','-py2.py3-none-' |
| 28 | + } |
35 | 29 | - dir wheelhouse |
36 | 30 |
|
37 | 31 | test_script: |
38 | 32 | - SET PROJPATH=C:\Projects\python-rust-fst |
39 | 33 | - cd c:\projects |
40 | | - - "%PYTHON%\\python -m pip -v install rust_fst --no-index -f %PROJPATH%\\wheelhouse" |
41 | | - - "%PYTHON%\\python -m pytest --verbose %PROJPATH%\\tests" |
| 34 | + - ps: | |
| 35 | + $PyVersions = @("27", "33", "34", "35") |
| 36 | + foreach ($pyver in $PyVersions) { |
| 37 | + $python = "C:\\Python$pyver${env:PYARCH}\\python" |
| 38 | + &$python -m pip install -U pip setuptools wheel pytest cffi |
| 39 | + &$python -m pip -v install rust_fst --no-index -f "${env:PROJPATH}\wheelhouse" |
| 40 | + &$python -m pytest "${env:PROJPATH}\tests" |
| 41 | + } |
42 | 42 |
|
43 | 43 | artifacts: |
44 | 44 | - path: wheelhouse\rust_fst*.whl |
0 commit comments