forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move build configuration to static configuration files
This removes the vast majority of the dynamic code from our `setup.py` files, and instead uses static configuration to specify them. As part of this, we also use a single `VERSION.txt` as a single source of truth for both the `qiskit-terra` main package and the `qiskit` "metapackage". This should avoid a situation where we let the two get out of sync during a release, which can cause us severe problems for fixing the problem with respect to git tags.
- Loading branch information
1 parent
7585bd5
commit 74d9013
Showing
11 changed files
with
242 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,134 @@ | |
requires = ["setuptools", "wheel", "setuptools-rust"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "qiskit-terra" | ||
description = "An open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives." | ||
requires-python = ">=3.8" | ||
license = { file = "LICENSE.txt" } | ||
authors = [ | ||
{ name = "Qiskit Development Team", email = "[email protected]" }, | ||
] | ||
keywords = [ | ||
"qiskit", | ||
"quantum circuit", | ||
"quantum computing", | ||
"quantum programming language", | ||
"quantum", | ||
"sdk", | ||
] | ||
classifiers = [ | ||
"Environment :: Console", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: MacOS", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: POSIX :: Linux", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Topic :: Scientific/Engineering", | ||
] | ||
# These are configured in the `tool.setuptools.dynamic` table. | ||
dynamic = ["version", "readme", "dependencies"] | ||
|
||
# If modifying this table, be sure to sync with `requirements-optional.txt`, | ||
# `qiskit.utils.optionals`, and `qiskit_pkg`'s `pyproject.toml` too. | ||
[project.optional-dependencies] | ||
qasm3-import = [ | ||
"qiskit-qasm3-import >= 0.1.0", | ||
] | ||
visualization = [ | ||
"matplotlib >= 3.3", | ||
"ipywidgets >= 7.3.0", | ||
"pydot", | ||
"Pillow >= 4.2.1", | ||
"pylatexenc >= 1.4", | ||
"seaborn >= 0.9.0", | ||
"pygments >= 2.4", | ||
] | ||
crosstalk-pass = [ | ||
"z3-solver >= 4.7", | ||
] | ||
csp-layout-pass = [ | ||
"python-constraint >= 1.4", | ||
] | ||
# This will make the resolution work for installers from PyPI, but `pip install .[all]` will be | ||
# unreliable because `qiskit-terra` will resolve to the PyPI version, so local changes in the | ||
# optionals won't be reflected. | ||
all = ["qiskit-terra[qasm3-import,visualization,crosstalk-pass,csp-layout-pass]"] | ||
|
||
[project.urls] | ||
Homepage = "https://qiskit.org" | ||
Documentation = "https://qiskit.org/documentation" | ||
"Source Code" = "https://github.com/Qiskit/qiskit" | ||
"Bug Tracker" = "https://github.com/Qiskit/qiskit/issues" | ||
Changelog = "https://qiskit.org/documentation/release_notes.html" | ||
|
||
[project.entry-points."qiskit.unitary_synthesis"] | ||
default = "qiskit.transpiler.passes.synthesis.unitary_synthesis:DefaultUnitarySynthesis" | ||
aqc = "qiskit.transpiler.synthesis.aqc.aqc_plugin:AQCSynthesisPlugin" | ||
sk = "qiskit.transpiler.passes.synthesis.solovay_kitaev_synthesis:SolovayKitaevSynthesis" | ||
|
||
[project.entry-points."qiskit.synthesis"] | ||
"clifford.default" = "qiskit.transpiler.passes.synthesis.high_level_synthesis:DefaultSynthesisClifford" | ||
"clifford.ag" = "qiskit.transpiler.passes.synthesis.high_level_synthesis:AGSynthesisClifford" | ||
"clifford.bm" = "qiskit.transpiler.passes.synthesis.high_level_synthesis:BMSynthesisClifford" | ||
"clifford.greedy" = "qiskit.transpiler.passes.synthesis.high_level_synthesis:GreedySynthesisClifford" | ||
"clifford.layers" = "qiskit.transpiler.passes.synthesis.high_level_synthesis:LayerSynthesisClifford" | ||
"clifford.lnn" = "qiskit.transpiler.passes.synthesis.high_level_synthesis:LayerLnnSynthesisClifford" | ||
"linear_function.default" = "qiskit.transpiler.passes.synthesis.high_level_synthesis:DefaultSynthesisLinearFunction" | ||
"linear_function.kms" = "qiskit.transpiler.passes.synthesis.high_level_synthesis:KMSSynthesisLinearFunction" | ||
"linear_function.pmh" = "qiskit.transpiler.passes.synthesis.high_level_synthesis:PMHSynthesisLinearFunction" | ||
"permutation.default" = "qiskit.transpiler.passes.synthesis.high_level_synthesis:BasicSynthesisPermutation" | ||
"permutation.kms" = "qiskit.transpiler.passes.synthesis.high_level_synthesis:KMSSynthesisPermutation" | ||
"permutation.basic" = "qiskit.transpiler.passes.synthesis.high_level_synthesis:BasicSynthesisPermutation" | ||
"permutation.acg" = "qiskit.transpiler.passes.synthesis.high_level_synthesis:ACGSynthesisPermutation" | ||
|
||
[project.entry-points."qiskit.transpiler.init"] | ||
default = "qiskit.transpiler.preset_passmanagers.builtin_plugins:DefaultInitPassManager" | ||
|
||
[project.entry-points."qiskit.transpiler.translation"] | ||
synthesis = "qiskit.transpiler.preset_passmanagers.builtin_plugins:UnitarySynthesisPassManager" | ||
translator = "qiskit.transpiler.preset_passmanagers.builtin_plugins:BasisTranslatorPassManager" | ||
unroller = "qiskit.transpiler.preset_passmanagers.builtin_plugins:UnrollerPassManager" | ||
|
||
[project.entry-points."qiskit.transpiler.routing"] | ||
basic = "qiskit.transpiler.preset_passmanagers.builtin_plugins:BasicSwapPassManager" | ||
lookahead = "qiskit.transpiler.preset_passmanagers.builtin_plugins:LookaheadSwapPassManager" | ||
none = "qiskit.transpiler.preset_passmanagers.builtin_plugins:NoneRoutingPassManager" | ||
sabre = "qiskit.transpiler.preset_passmanagers.builtin_plugins:SabreSwapPassManager" | ||
stochastic = "qiskit.transpiler.preset_passmanagers.builtin_plugins:StochasticSwapPassManager" | ||
|
||
[project.entry-points."qiskit.transpiler.optimization"] | ||
default = "qiskit.transpiler.preset_passmanagers.builtin_plugins:OptimizationPassManager" | ||
|
||
[project.entry-points."qiskit.transpiler.layout"] | ||
default = "qiskit.transpiler.preset_passmanagers.builtin_plugins:DefaultLayoutPassManager" | ||
dense = "qiskit.transpiler.preset_passmanagers.builtin_plugins:DenseLayoutPassManager" | ||
noise_adaptive = "qiskit.transpiler.preset_passmanagers.builtin_plugins:NoiseAdaptiveLayoutPassManager" | ||
sabre = "qiskit.transpiler.preset_passmanagers.builtin_plugins:SabreLayoutPassManager" | ||
trivial = "qiskit.transpiler.preset_passmanagers.builtin_plugins:TrivialLayoutPassManager" | ||
|
||
[project.entry-points."qiskit.transpiler.scheduling"] | ||
alap = "qiskit.transpiler.preset_passmanagers.builtin_plugins:AlapSchedulingPassManager" | ||
asap = "qiskit.transpiler.preset_passmanagers.builtin_plugins:AsapSchedulingPassManager" | ||
default = "qiskit.transpiler.preset_passmanagers.builtin_plugins:DefaultSchedulingPassManager" | ||
|
||
[tool.setuptools] | ||
include-package-data = true | ||
|
||
[tool.setuptools.dynamic] | ||
version = { file = "qiskit/VERSION.txt" } | ||
readme = { file = "README.md", content-type = "text/markdown" } | ||
dependencies = {file = "requirements.txt" } | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["qiskit", "qiskit.*"] | ||
|
||
[tool.black] | ||
line-length = 100 | ||
target-version = ['py38', 'py39', 'py310', 'py311'] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../qiskit/VERSION.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
[build-system] | ||
requires = ["setuptools", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "qiskit" | ||
description = "An open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives." | ||
requires-python = ">=3.8" | ||
license = { file = "LICENSE.txt" } | ||
authors = [ | ||
{ name = "Qiskit Development Team", email = "[email protected]" }, | ||
] | ||
keywords = [ | ||
"qiskit", | ||
"quantum circuit", | ||
"quantum computing", | ||
"quantum programming language", | ||
"quantum", | ||
"sdk", | ||
] | ||
classifiers = [ | ||
"Environment :: Console", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: MacOS", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: POSIX :: Linux", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Topic :: Scientific/Engineering", | ||
] | ||
# These are configured in the `tool.setuptools.dynamic` table except for "dependencies", which is | ||
# handled by `setup.py` because we need to hard pin to one particular version of "qiskit-terra", | ||
# which we can't represent with the dynamic attributes setuptools allows us. | ||
dynamic = ["version", "readme", "dependencies"] | ||
|
||
[project.urls] | ||
Homepage = "https://qiskit.org" | ||
Documentation = "https://qiskit.org/documentation" | ||
"Source Code" = "https://github.com/Qiskit/qiskit" | ||
"Bug Tracker" = "https://github.com/Qiskit/qiskit/issues" | ||
Changelog = "https://qiskit.org/documentation/release_notes.html" | ||
|
||
[project.optional-dependencies] | ||
qasm3-import = ["qiskit-terra[qasm3-import]"] | ||
visualization = ["qiskit-terra[visualization]"] | ||
crosstalk-pass = ["qiskit-terra[crosstalk-pass]"] | ||
csp-layout-pass = ["qiskit-terra[csp-layout-pass]"] | ||
all = ["qiskit-terra[all]"] | ||
|
||
[tool.setuptools] | ||
py-modules = [] | ||
packages = [] | ||
include-package-data = true | ||
|
||
[tool.setuptools.dynamic] | ||
version = { file = "VERSION.txt" } | ||
readme = { file = "README.md", content-type = "text/markdown" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,52 +22,12 @@ | |
|
||
from setuptools import setup | ||
|
||
README_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), "README.md") | ||
with open(README_PATH) as readme_file: | ||
README = readme_file.read() | ||
|
||
requirements = ["qiskit-terra==1.0.0"] | ||
# We have to do this dynamically because the requirement on Terra is more dynamic than the static | ||
# configuration can express. | ||
VERSION_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), "VERSION.txt") | ||
with open(VERSION_PATH, "r") as version_file: | ||
VERSION = version_file.read().strip() | ||
|
||
setup( | ||
name="qiskit", | ||
version="1.0.0", | ||
description="Software for developing quantum computing programs", | ||
long_description=README, | ||
long_description_content_type="text/markdown", | ||
url="https://qiskit.org/", | ||
author="Qiskit Development Team", | ||
author_email="[email protected]", | ||
license="Apache 2.0", | ||
py_modules=[], | ||
packages=[], | ||
classifiers=[ | ||
"Environment :: Console", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Science/Research", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: MacOS", | ||
"Operating System :: POSIX :: Linux", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Topic :: Scientific/Engineering", | ||
], | ||
keywords="qiskit sdk quantum", | ||
install_requires=requirements, | ||
project_urls={ | ||
"Bug Tracker": "https://github.com/Qiskit/qiskit/issues", | ||
"Documentation": "https://qiskit.org/documentation/", | ||
"Source Code": "https://github.com/Qiskit/qiskit", | ||
}, | ||
include_package_data=True, | ||
python_requires=">=3.8", | ||
extras_require={ | ||
"qasm3-import": ["qiskit-terra[qasm3-import]"], | ||
"visualization": ["qiskit-terra[visualization]"], | ||
"crosstalk-pass": ["qiskit-terra[crosstalk-pass]"], | ||
"csp-layout-pass": ["qiskit-terra[csp-layout-pass]"], | ||
"all": ["qiskit-terra[all]"], | ||
}, | ||
install_requires=[f"qiskit-terra=={VERSION}"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.