|
1 | | -# clone directory |
2 | | -clone_folder: C:\projects\qbsolv |
3 | | - |
4 | 1 | environment: |
5 | | - global: |
6 | | - # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the |
7 | | - # /E:ON and /V:ON options are not enabled in the batch script intepreter |
8 | | - # See: http://stackoverflow.com/a/13751649/163740 |
9 | | - CMD_IN_ENV: "cmd /E:ON /V:ON /C %APPVEYOR_BUILD_FOLDER%\\ci\\appveyor\\run_with_env.cmd" |
10 | 2 |
|
11 | 3 | # PyPI login |
12 | | - username: dwtools |
13 | | - password: |
| 4 | + TWINE_USERNAME: dwtools |
| 5 | + TWINE_PASSWORD: |
14 | 6 | secure: 9/YAQhmz9Kb1ZeXzhBYeQA== |
15 | 7 |
|
16 | 8 | matrix: |
17 | 9 | - PYTHON: "C:\\Python35" |
18 | | - PYTHON_VERSION: "3.5.x" |
19 | | - PYTHON_ARCH: "32" |
20 | | - |
21 | 10 | - PYTHON: "C:\\Python35-x64" |
22 | | - PYTHON_VERSION: "3.5.x" |
23 | | - PYTHON_ARCH: "64" |
24 | | - |
25 | 11 | - PYTHON: "C:\\Python36" |
26 | | - PYTHON_VERSION: "3.6.x" |
27 | | - PYTHON_ARCH: "32" |
28 | | - |
29 | 12 | - PYTHON: "C:\\Python36-x64" |
30 | | - PYTHON_VERSION: "3.6.x" |
31 | | - PYTHON_ARCH: "64" |
32 | | - |
33 | 13 | - PYTHON: "C:\\Python37" |
34 | | - PYTHON_VERSION: "3.7.x" |
35 | | - PYTHON_ARCH: "32" |
36 | | - |
37 | 14 | - PYTHON: "C:\\Python37-x64" |
38 | | - PYTHON_VERSION: "3.7.x" |
39 | | - PYTHON_ARCH: "64" |
40 | | - |
41 | 15 | - PYTHON: "C:\\Python38" |
42 | | - PYTHON_VERSION: "3.8.x" |
43 | | - PYTHON_ARCH: "32" |
44 | | - |
45 | 16 | - PYTHON: "C:\\Python38-x64" |
46 | | - PYTHON_VERSION: "3.8.x" |
47 | | - PYTHON_ARCH: "64" |
48 | 17 |
|
49 | 18 | install: |
50 | | - # If there is a newer build queued for the same PR, cancel this one. |
51 | | - # The AppVeyor 'rollout builds' option is supposed to serve the same |
52 | | - # purpose but it is problematic because it tends to cancel builds pushed |
53 | | - # directly to master instead of just PR builds (or the converse). |
54 | | - # credits: JuliaLang developers. |
55 | | - - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` |
56 | | - https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` |
57 | | - Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` |
58 | | - throw "There are newer queued builds for this pull request, failing early." } |
59 | | - - ECHO "Filesystem root:" |
60 | | - - ps: "ls \"C:/\"" |
61 | | - |
62 | | - - ECHO "Installed SDKs:" |
63 | | - - ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\"" |
64 | | - |
65 | | - # Install Python (from the official .msi of http://python.org) and pip when |
66 | | - # not already installed. |
67 | | - - ps: if (-not(Test-Path($env:PYTHON))) { & ci\appveyor\install.ps1 } |
68 | | - |
69 | | - # Prepend newly installed Python to the PATH of this build (this cannot be |
70 | | - # done from inside the powershell script as it would require to restart |
71 | | - # the parent CMD process). |
72 | | - - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" |
| 19 | + # required to link py35 (x86 and x64) |
| 20 | + - set PATH=%PATH%;C:\Program Files (x86)\Windows Kits\8.1\bin\x86 |
73 | 21 |
|
74 | 22 | # Check that we have the expected version and architecture for Python |
75 | | - - "python --version" |
76 | | - - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" |
77 | | - |
78 | | - # Upgrade to the latest version of pip to avoid it displaying warnings |
79 | | - # about it being out of date. |
80 | | - # - "pip install --disable-pip-version-check --user --upgrade pip" |
| 23 | + - "%PYTHON%\\python.exe --version" |
| 24 | + - "%PYTHON%\\python.exe -c \"import struct; print(struct.calcsize('P') * 8)\"" |
81 | 25 |
|
82 | | - # Install the build dependencies of the project. If some dependencies contain |
83 | | - # compiled extensions and are not provided as pre-built wheel packages, |
84 | | - # pip will build them from source using the MSVC compiler matching the |
85 | | - # target Python version and architecture |
86 | | - - "%CMD_IN_ENV% pip install -r requirements.txt -r tests\\requirements.txt" |
87 | | - - "%CMD_IN_ENV% pip install wheel setuptools --upgrade --force" |
| 26 | + # install dependencies |
| 27 | + - "%PYTHON%\\python.exe -m pip install -r requirements.txt -r tests\\requirements.txt" |
| 28 | + - "%PYTHON%\\python.exe -m pip install wheel twine" |
88 | 29 |
|
89 | 30 | build_script: |
90 | | - # Build the compiled extension |
91 | | - - "%CMD_IN_ENV% python setup.py bdist_wheel" |
92 | | - - pip install dwave_qbsolv --no-index -f dist\\ |
| 31 | + # build the compiled extension and install qbsolv |
| 32 | + - "%PYTHON%\\python.exe setup.py build_ext --inplace" |
| 33 | + - "%PYTHON%\\python.exe -m pip install ." |
93 | 34 |
|
94 | 35 | test_script: |
95 | | - # Run the project tests |
96 | | - - python -m unittest discover |
97 | | - |
| 36 | + - "%PYTHON%\\python.exe -m unittest discover" |
| 37 | + |
98 | 38 | after_test: |
99 | | - # If tests are successful, create binary packages for the project. |
100 | | - #- "%CMD_IN_ENV% python setup.py bdist_wininst" |
101 | | - #- "%CMD_IN_ENV% python setup.py bdist_msi" |
| 39 | + # If tests are successful, create binary wheels |
| 40 | + - "%PYTHON%\\python.exe setup.py bdist_wheel" |
102 | 41 | - ps: "ls dist" |
103 | 42 |
|
104 | 43 | artifacts: |
105 | 44 | # Archive the generated packages in the ci.appveyor.com build report. |
106 | 45 | - path: dist\* |
107 | 46 |
|
108 | 47 | deploy_script: |
109 | | - - "echo [pypi] > %USERPROFILE%\\.pypirc" |
110 | | - - "echo username: %username% >> %USERPROFILE%\\.pypirc" |
111 | | - - "echo password: %password% >> %USERPROFILE%\\.pypirc" |
112 | | - - "%CMD_IN_ENV% pip install twine" |
113 | | - - cmd: "if [%APPVEYOR_REPO_TAG%]==[true] twine upload --skip-existing dist\\*.whl" |
| 48 | + - cmd: "if [%APPVEYOR_REPO_TAG%]==[true] if NOT [%CPPDEBUG%]==[1] %PYTHON%\\Scripts\\twine upload --skip-existing dist\\*.whl" |
0 commit comments