From 2f53d9f7ed40c280a05d959aa002d9daa9580061 Mon Sep 17 00:00:00 2001 From: Juan Gomez Date: Tue, 30 Apr 2019 21:51:33 +0200 Subject: [PATCH 1/7] Adding appveyor config file for Windows CI --- appveyor.yml | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000000..9d09535a5a --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,56 @@ +image: Visual Studio 2017 +environment: + global: + # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the + # /E:ON and /V:ON options are not enabled in the batch script intepreter + # See: http://stackoverflow.com/a/13751649/163740 + CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd" + + matrix: + - PYTHON: "C:\\Miniconda37-x64" + PYTHON_VERSION: "3.7.0" + PYTHON_ARCH: "64" + - PYTHON: "C:\\Miniconda35-x64" + PYTHON_VERSION: "3.5.3" + PYTHON_ARCH: "64" + - PYTHON: "C:\\Miniconda36-x64" + PYTHON_VERSION: "3.6.1" + PYTHON_ARCH: "64" + + +install: + # If there is a newer build queued for the same PR, cancel this one. + # The AppVeyor 'rollout builds' option is supposed to serve the same + # purpose but it is problematic because it tends to cancel builds pushed + # directly to master instead of just PR builds (or the converse). + # credits: JuliaLang developers. + - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` + https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` + Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` + throw "There are newer queued builds for this pull request, failing early." } + - ECHO "Filesystem root:" + - ps: "ls \"C:/\"" + + # Prepend newly installed Python to the PATH of this build (this cannot be + # done from inside the powershell script as it would require to restart + # the parent CMD process). + - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" + + # Check that we have the expected version and architecture for Python + - "python --version" + - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" + + # - "conda install --update-deps -y mkl" + # Because of issue #193, we have to keep pip in version 18. + - python -m pip install --disable-pip-version-check pip==18 + - pip install https://github.com/Qiskit/qiskit-terra/archive/master.zip + - pip install -r requirements-dev.txt + - python setup.py bdist_wheel -- -G "Visual Studio 15 2017 Win64" + - pip install dist/qiskit_aer*whl + +build: off + +test_script: + # Run the project tests + - python -m unittest discover -s test/terra -v + From 06bf15c2a5882a74593617eab4678ea9cd41399b Mon Sep 17 00:00:00 2001 From: Juan Gomez Date: Tue, 30 Apr 2019 21:58:41 +0200 Subject: [PATCH 2/7] Adding cython to Appveyor --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 9d09535a5a..42e80b3c2a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -43,6 +43,7 @@ install: # - "conda install --update-deps -y mkl" # Because of issue #193, we have to keep pip in version 18. - python -m pip install --disable-pip-version-check pip==18 + - pip install cython - pip install https://github.com/Qiskit/qiskit-terra/archive/master.zip - pip install -r requirements-dev.txt - python setup.py bdist_wheel -- -G "Visual Studio 15 2017 Win64" From d3690962cdb1b96635a326305dce12a2dab4a600 Mon Sep 17 00:00:00 2001 From: Juan Gomez Date: Tue, 30 Apr 2019 22:11:01 +0200 Subject: [PATCH 3/7] Fixing .whl installation step --- appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 42e80b3c2a..afa4414bf0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -47,7 +47,8 @@ install: - pip install https://github.com/Qiskit/qiskit-terra/archive/master.zip - pip install -r requirements-dev.txt - python setup.py bdist_wheel -- -G "Visual Studio 15 2017 Win64" - - pip install dist/qiskit_aer*whl + - pip install dist\qiskit_aer*.whl + build: off From ac83426726a2630b97e620b72b6568e187c517cc Mon Sep 17 00:00:00 2001 From: Juan Gomez Date: Tue, 30 Apr 2019 22:33:49 +0200 Subject: [PATCH 4/7] Fix wheel installation, take 2 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index afa4414bf0..bf48fd3a3f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -47,7 +47,7 @@ install: - pip install https://github.com/Qiskit/qiskit-terra/archive/master.zip - pip install -r requirements-dev.txt - python setup.py bdist_wheel -- -G "Visual Studio 15 2017 Win64" - - pip install dist\qiskit_aer*.whl + - pip install --find-links=dist\ qiskit_aer build: off From 47620d3bd1aa430ac222e3001f40e4c8eeb4869d Mon Sep 17 00:00:00 2001 From: Juan Gomez Date: Wed, 1 May 2019 11:14:11 +0200 Subject: [PATCH 5/7] Fix Python3.5 pip installation issue --- appveyor.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index bf48fd3a3f..63239b0836 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -37,15 +37,18 @@ install: - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" # Check that we have the expected version and architecture for Python - - "python --version" - - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" + - python --version + - python -c \"import struct; print(struct.calcsize('P') * 8)\" # - "conda install --update-deps -y mkl" # Because of issue #193, we have to keep pip in version 18. - python -m pip install --disable-pip-version-check pip==18 - pip install cython - pip install https://github.com/Qiskit/qiskit-terra/archive/master.zip - - pip install -r requirements-dev.txt + # Due to https://github.com/ContinuumIO/anaconda-issues/issues/542 + # we need to pass --ignore-installed, otherwise Python3.5 will fail + # while upgrading setuptools. + - pip install --ignore-installed -r requirements-dev.txt - python setup.py bdist_wheel -- -G "Visual Studio 15 2017 Win64" - pip install --find-links=dist\ qiskit_aer From 2120750d99cefd4a10cf0324c18b40492f9b72db Mon Sep 17 00:00:00 2001 From: Juan Gomez Date: Wed, 1 May 2019 12:06:11 +0200 Subject: [PATCH 6/7] Fix quote missuse --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 63239b0836..5c184b6e2d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -38,7 +38,7 @@ install: # Check that we have the expected version and architecture for Python - python --version - - python -c \"import struct; print(struct.calcsize('P') * 8)\" + - python -c "import struct; print(struct.calcsize('P') * 8)" # - "conda install --update-deps -y mkl" # Because of issue #193, we have to keep pip in version 18. From d2d44251a3421340d2ac2902862777771d4daa5c Mon Sep 17 00:00:00 2001 From: Juan Gomez Date: Wed, 1 May 2019 15:36:31 +0200 Subject: [PATCH 7/7] Some cleanup --- appveyor.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 5c184b6e2d..b11ce2c5a9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -28,9 +28,6 @@ install: https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` throw "There are newer queued builds for this pull request, failing early." } - - ECHO "Filesystem root:" - - ps: "ls \"C:/\"" - # Prepend newly installed Python to the PATH of this build (this cannot be # done from inside the powershell script as it would require to restart # the parent CMD process). @@ -38,9 +35,7 @@ install: # Check that we have the expected version and architecture for Python - python --version - - python -c "import struct; print(struct.calcsize('P') * 8)" - # - "conda install --update-deps -y mkl" # Because of issue #193, we have to keep pip in version 18. - python -m pip install --disable-pip-version-check pip==18 - pip install cython