Revise travis configuration, using cmake
* Revise the travis configuration for using `cmake` for the several
targets, and use "stages" instead of parallel jobs:
* define three stages that are executed if the previous one suceeds:
1. "linter and pure python test": executes the linter and a test
without compiling the binaries, with the idea of providing quick
feedback for PRs.
2. "test": launch the test, including the compilation of binaries,
under GNU/Linux Python 3.6 and 3.6; and osx Python 3.6.
3. "deploy doc and pypi": for the stable branch, deploy the docs
to the landing page, and when using a specific commit message,
build the GNU/Linux and osx wheels, uploading them to test.pypi.
* use yaml anchors and definitions to avoid repeating code (and
working around travis limitations).
* Modify the `cmake``configuration to accomodate the stages flow:
* allow conditional creation of compilation and QA targets, mainly
for saving some time in some jobs.
* move the tests to `cmake/tests.cmake`.
* Update the tests:
* add a `requires_qe_access` decorator that retrieves QE_TOKEN and
QE_URL and appends them to the parameters in an unified manner.
* add an environment variable `SKIP_ONLINE_TESTS` that allows to
skip the tests that need network access.
* replace `TRAVIS_FORK_PULL_REQUEST` with the previous two
mechanisms, adding support for AppVeyor as well.
* fix a problem with matplotlib under osx headless, effectively
skipping `test_visualization.py` during the travis osx jobs.
* Move Sphinx to `requirements-dev.txt`.
2018-02-13 05:11:28 +08:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2019-04-30 22:36:47 +08:00
|
|
|
# This code is part of Qiskit.
|
Revise travis configuration, using cmake
* Revise the travis configuration for using `cmake` for the several
targets, and use "stages" instead of parallel jobs:
* define three stages that are executed if the previous one suceeds:
1. "linter and pure python test": executes the linter and a test
without compiling the binaries, with the idea of providing quick
feedback for PRs.
2. "test": launch the test, including the compilation of binaries,
under GNU/Linux Python 3.6 and 3.6; and osx Python 3.6.
3. "deploy doc and pypi": for the stable branch, deploy the docs
to the landing page, and when using a specific commit message,
build the GNU/Linux and osx wheels, uploading them to test.pypi.
* use yaml anchors and definitions to avoid repeating code (and
working around travis limitations).
* Modify the `cmake``configuration to accomodate the stages flow:
* allow conditional creation of compilation and QA targets, mainly
for saving some time in some jobs.
* move the tests to `cmake/tests.cmake`.
* Update the tests:
* add a `requires_qe_access` decorator that retrieves QE_TOKEN and
QE_URL and appends them to the parameters in an unified manner.
* add an environment variable `SKIP_ONLINE_TESTS` that allows to
skip the tests that need network access.
* replace `TRAVIS_FORK_PULL_REQUEST` with the previous two
mechanisms, adding support for AppVeyor as well.
* fix a problem with matplotlib under osx headless, effectively
skipping `test_visualization.py` during the travis osx jobs.
* Move Sphinx to `requirements-dev.txt`.
2018-02-13 05:11:28 +08:00
|
|
|
#
|
2019-04-30 22:36:47 +08:00
|
|
|
# (C) Copyright IBM 2017.
|
|
|
|
#
|
|
|
|
# This code is licensed under the Apache License, Version 2.0. You may
|
|
|
|
# obtain a copy of this license in the LICENSE.txt file in the root directory
|
|
|
|
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
|
|
|
|
#
|
|
|
|
# Any modifications or derivative works of this code must retain this
|
|
|
|
# copyright notice, and modified files need to carry a notice indicating
|
|
|
|
# that they have been altered from the originals.
|
Revise travis configuration, using cmake
* Revise the travis configuration for using `cmake` for the several
targets, and use "stages" instead of parallel jobs:
* define three stages that are executed if the previous one suceeds:
1. "linter and pure python test": executes the linter and a test
without compiling the binaries, with the idea of providing quick
feedback for PRs.
2. "test": launch the test, including the compilation of binaries,
under GNU/Linux Python 3.6 and 3.6; and osx Python 3.6.
3. "deploy doc and pypi": for the stable branch, deploy the docs
to the landing page, and when using a specific commit message,
build the GNU/Linux and osx wheels, uploading them to test.pypi.
* use yaml anchors and definitions to avoid repeating code (and
working around travis limitations).
* Modify the `cmake``configuration to accomodate the stages flow:
* allow conditional creation of compilation and QA targets, mainly
for saving some time in some jobs.
* move the tests to `cmake/tests.cmake`.
* Update the tests:
* add a `requires_qe_access` decorator that retrieves QE_TOKEN and
QE_URL and appends them to the parameters in an unified manner.
* add an environment variable `SKIP_ONLINE_TESTS` that allows to
skip the tests that need network access.
* replace `TRAVIS_FORK_PULL_REQUEST` with the previous two
mechanisms, adding support for AppVeyor as well.
* fix a problem with matplotlib under osx headless, effectively
skipping `test_visualization.py` during the travis osx jobs.
* Move Sphinx to `requirements-dev.txt`.
2018-02-13 05:11:28 +08:00
|
|
|
|
2019-02-22 02:58:06 +08:00
|
|
|
"The Qiskit Terra setup file."
|
2017-08-23 22:40:43 +08:00
|
|
|
|
2019-02-22 02:58:06 +08:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
from setuptools import setup, find_packages, Extension
|
2019-05-14 10:13:38 +08:00
|
|
|
try:
|
|
|
|
from Cython.Build import cythonize
|
|
|
|
except ImportError:
|
|
|
|
import subprocess
|
|
|
|
subprocess.call([sys.executable, '-m', 'pip', 'install', 'Cython>=0.27.1'])
|
|
|
|
from Cython.Build import cythonize
|
2017-12-20 17:40:09 +08:00
|
|
|
|
2019-02-22 02:58:06 +08:00
|
|
|
REQUIREMENTS = [
|
2019-08-24 03:35:32 +08:00
|
|
|
"jsonschema>=2.6",
|
2019-09-18 05:19:08 +08:00
|
|
|
"marshmallow>=3,<4",
|
|
|
|
"marshmallow_polyfield>=5.7,<6",
|
2019-11-09 12:49:47 +08:00
|
|
|
"networkx>=2.2;python_version>'3.5'",
|
|
|
|
# Networkx 2.4 is the final version with python 3.5 support.
|
|
|
|
"networkx>=2.2,<2.4;python_version=='3.5'",
|
2019-02-23 05:38:28 +08:00
|
|
|
"numpy>=1.13",
|
2018-06-13 22:21:15 +08:00
|
|
|
"ply>=3.10",
|
2018-12-18 20:07:01 +08:00
|
|
|
"psutil>=5",
|
2019-05-02 16:55:45 +08:00
|
|
|
"scipy>=1.0",
|
2019-10-29 02:29:23 +08:00
|
|
|
"sympy>=1.3",
|
|
|
|
"dill>=0.3",
|
2017-12-20 17:40:09 +08:00
|
|
|
]
|
|
|
|
|
2019-02-22 02:58:06 +08:00
|
|
|
# Add Cython extensions here
|
2019-04-08 18:09:12 +08:00
|
|
|
CYTHON_EXTS = ['utils', 'swap_trial']
|
2020-01-09 21:43:11 +08:00
|
|
|
CYTHON_MODULE = 'qiskit.transpiler.passes.routing.cython.stochastic_swap'
|
|
|
|
CYTHON_SOURCE_DIR = 'qiskit/transpiler/passes/routing/cython/stochastic_swap'
|
2019-02-22 02:58:06 +08:00
|
|
|
|
|
|
|
INCLUDE_DIRS = []
|
|
|
|
# Extra link args
|
|
|
|
LINK_FLAGS = []
|
|
|
|
# If on Win and not in MSYS2 (i.e. Visual studio compile)
|
|
|
|
if (sys.platform == 'win32' and os.environ.get('MSYSTEM') is None):
|
2019-02-24 21:07:16 +08:00
|
|
|
COMPILER_FLAGS = ['/O2']
|
2019-02-22 02:58:06 +08:00
|
|
|
# Everything else
|
|
|
|
else:
|
|
|
|
COMPILER_FLAGS = ['-O2', '-funroll-loops', '-std=c++11']
|
|
|
|
if sys.platform == 'darwin':
|
|
|
|
# These are needed for compiling on OSX 10.14+
|
|
|
|
COMPILER_FLAGS.append('-mmacosx-version-min=10.9')
|
|
|
|
LINK_FLAGS.append('-mmacosx-version-min=10.9')
|
|
|
|
|
|
|
|
|
|
|
|
EXT_MODULES = []
|
|
|
|
# Add Cython Extensions
|
|
|
|
for ext in CYTHON_EXTS:
|
2019-05-08 10:16:51 +08:00
|
|
|
mod = Extension(CYTHON_MODULE + '.' + ext,
|
|
|
|
sources=[CYTHON_SOURCE_DIR + '/' + ext + '.pyx'],
|
2019-02-22 02:58:06 +08:00
|
|
|
include_dirs=INCLUDE_DIRS,
|
|
|
|
extra_compile_args=COMPILER_FLAGS,
|
|
|
|
extra_link_args=LINK_FLAGS,
|
|
|
|
language='c++')
|
|
|
|
EXT_MODULES.append(mod)
|
|
|
|
|
2017-11-27 18:09:59 +08:00
|
|
|
|
2017-08-23 22:40:43 +08:00
|
|
|
setup(
|
2018-12-14 22:06:35 +08:00
|
|
|
name="qiskit-terra",
|
2019-12-10 20:44:52 +08:00
|
|
|
version="0.12.0",
|
2017-08-23 22:40:43 +08:00
|
|
|
description="Software for developing quantum computing programs",
|
2019-02-22 02:58:06 +08:00
|
|
|
long_description="""Terra provides the foundations for Qiskit. It allows the user to write
|
2018-12-14 22:06:35 +08:00
|
|
|
quantum circuits easily, and takes care of the constraints of real hardware.""",
|
2018-07-11 19:14:15 +08:00
|
|
|
url="https://github.com/Qiskit/qiskit-terra",
|
|
|
|
author="Qiskit Development Team",
|
2018-12-29 06:32:27 +08:00
|
|
|
author_email="qiskit@qiskit.org",
|
2017-08-23 22:40:43 +08:00
|
|
|
license="Apache 2.0",
|
|
|
|
classifiers=[
|
|
|
|
"Environment :: Console",
|
|
|
|
"License :: OSI Approved :: Apache Software License",
|
|
|
|
"Intended Audience :: Developers",
|
|
|
|
"Intended Audience :: Science/Research",
|
2017-10-25 22:12:04 +08:00
|
|
|
"Operating System :: Microsoft :: Windows",
|
|
|
|
"Operating System :: MacOS",
|
|
|
|
"Operating System :: POSIX :: Linux",
|
2019-12-11 04:43:58 +08:00
|
|
|
"Programming Language :: Python :: 3 :: Only",
|
2017-08-23 22:40:43 +08:00
|
|
|
"Programming Language :: Python :: 3.5",
|
2017-08-25 02:36:53 +08:00
|
|
|
"Programming Language :: Python :: 3.6",
|
2019-05-08 10:16:51 +08:00
|
|
|
"Programming Language :: Python :: 3.7",
|
2019-12-11 04:43:58 +08:00
|
|
|
"Programming Language :: Python :: 3.8",
|
2017-08-25 02:36:53 +08:00
|
|
|
"Topic :: Scientific/Engineering",
|
2017-08-23 22:40:43 +08:00
|
|
|
],
|
|
|
|
keywords="qiskit sdk quantum",
|
2018-05-07 18:40:59 +08:00
|
|
|
packages=find_packages(exclude=['test*']),
|
2019-02-22 02:58:06 +08:00
|
|
|
install_requires=REQUIREMENTS,
|
|
|
|
setup_requires=['Cython>=0.27.1'],
|
2017-08-25 17:15:48 +08:00
|
|
|
include_package_data=True,
|
2017-08-23 22:40:43 +08:00
|
|
|
python_requires=">=3.5",
|
2019-04-09 04:16:44 +08:00
|
|
|
extras_require={
|
2019-11-09 12:49:47 +08:00
|
|
|
'visualization': ['matplotlib>=2.1', 'ipywidgets>=7.3.0',
|
2019-08-13 02:48:26 +08:00
|
|
|
'pydot', "pillow>=4.2.1", "pylatexenc>=1.4",
|
|
|
|
"seaborn>=0.9.0"],
|
2019-12-23 06:16:09 +08:00
|
|
|
'full-featured-simulators': ['qiskit-aer>=0.1'],
|
|
|
|
'crosstalk-pass': ['z3-solver>=4.7'],
|
2019-02-22 02:58:06 +08:00
|
|
|
},
|
2019-05-08 10:16:51 +08:00
|
|
|
project_urls={
|
|
|
|
"Bug Tracker": "https://github.com/Qiskit/qiskit-terra/issues",
|
|
|
|
"Documentation": "https://qiskit.org/documentation/",
|
|
|
|
"Source Code": "https://github.com/Qiskit/qiskit-terra",
|
|
|
|
},
|
2019-02-22 02:58:06 +08:00
|
|
|
ext_modules=cythonize(EXT_MODULES),
|
|
|
|
zip_safe=False
|
2017-08-23 22:40:43 +08:00
|
|
|
)
|