Skip to content

Commit 7128b27

Browse files
Move metapackage shim for combined releases (backport #10530) (#10636)
* Move metapackage shim for combined releases (#10530) * Move metapackage shim for combined releases Now that Qiskit 0.44.0 has been released, the Qiskit project is now what was formerly qiskit-terra. However, because Python packaging lacks a clean mechanism to enable one package superseding another we're not able to stop shipping a qiskit-terra package that owns the qiskit python namespace without introducing a lot of potential user friction. So moving forward the qiskit project will release 2 packages an inner qiskit-terra which still contains all the library code and public facing qiskit package which installs that inner package only. To enable this workflow this commit migrates the metapackage setup.py into the terra repository and setups build automation to publish a qiskit package in addition to the inner terra package on each release tag. * some follow up on #10530 (#19) * some follow up on #10530 * extend some badges * This Qiskit contains the building blocks for creating and working with quantum circuits, programs, and algorithms. -> This framework allows for building, transforming, and visualizing quantum circuits. * The explanation of the Bell state is moving to IBM Quantun learning platform * I think examples/ should eventually be replaced by proper tutorials * Add StackOverflow as a forum * Remove link to https://github.com/Qiskit/qiskit-tutorials * Update README.md Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * Update README.md * Update README.md * broken lines in badges * doi --------- Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * Expand lint checks to entire qiskit_pkg dir * Unify extras in terra setup.py * Update CI lint job * Remove unused json imports * Cleanup manifest file * Finish comment --------- Co-authored-by: Luciano Bello <bel@zurich.ibm.com> (cherry picked from commit 8a180ee) # Conflicts: # README.md * Fix merge conflicts --------- Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
1 parent 43ce89f commit 7128b27

10 files changed

Lines changed: 134 additions & 38 deletions

File tree

.azure/lint-linux.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
set -e
3636
source test-job/bin/activate
3737
echo "Running black, any errors reported can be fixed with 'tox -eblack'"
38-
black --check qiskit test tools examples setup.py
38+
black --check qiskit test tools examples setup.py qiskit_pkg
3939
echo "Running rustfmt check, any errors reported can be fixed with 'cargo fmt'"
4040
cargo fmt --check
4141
displayName: "Formatting"
@@ -44,7 +44,7 @@ jobs:
4444
set -e
4545
source test-job/bin/activate
4646
echo "Running ruff"
47-
ruff qiskit test tools examples setup.py
47+
ruff qiskit test tools examples setup.py qiskit_pkg/setup.py
4848
echo "Running pylint"
4949
pylint -rn qiskit test tools
5050
echo "Running Cargo Clippy"

README.md

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
# Qiskit Terra
2-
[![License](https://img.shields.io/github/license/Qiskit/qiskit-terra.svg?style=popout-square)](https://opensource.org/licenses/Apache-2.0)<!--- long-description-skip-begin -->[![Release](https://img.shields.io/github/release/Qiskit/qiskit-terra.svg?style=popout-square)](https://github.com/Qiskit/qiskit-terra/releases)[![Downloads](https://img.shields.io/pypi/dm/qiskit-terra.svg?style=popout-square)](https://pypi.org/project/qiskit-terra/)[![Coverage Status](https://coveralls.io/repos/github/Qiskit/qiskit-terra/badge.svg?branch=main)](https://coveralls.io/github/Qiskit/qiskit-terra?branch=main)[![Minimum rustc 1.61.0](https://img.shields.io/badge/rustc-1.61.0+-blue.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)<!--- long-description-skip-end -->
1+
# Qiskit
2+
[![License](https://img.shields.io/github/license/Qiskit/qiskit-terra.svg?)](https://opensource.org/licenses/Apache-2.0) <!--- long-description-skip-begin -->
3+
[![Release](https://img.shields.io/github/release/Qiskit/qiskit-terra.svg)](https://github.com/Qiskit/qiskit-terra/releases)
4+
[![Downloads](https://img.shields.io/pypi/dm/qiskit-terra.svg)](https://pypi.org/project/qiskit-terra/)
5+
[![Coverage Status](https://coveralls.io/repos/github/Qiskit/qiskit-terra/badge.svg?branch=main)](https://coveralls.io/github/Qiskit/qiskit-terra?branch=main)
6+
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/qiskit)
7+
[![Minimum rustc 1.61.0](https://img.shields.io/badge/rustc-1.61.0+-blue.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)
8+
[![Downloads](https://pepy.tech/badge/qiskit-terra)](https://pypi.org/project/qiskit-terra/)<!--- long-description-skip-end -->
9+
[![DOI](https://zenodo.org/badge/161550823.svg)](https://zenodo.org/badge/latestdoi/161550823)
310

411
**Qiskit** is an open-source framework for working with noisy quantum computers at the level of pulses, circuits, and algorithms.
512

6-
This library is the core component of Qiskit, **Terra**, which contains the building blocks for creating
7-
and working with quantum circuits, programs, and algorithms. It also contains a compiler that supports
13+
This framework allows for building, transforming, and visualizing quantum circuits. It also contains a compiler that supports
814
different quantum computers and a common interface for running programs on different quantum computer architectures.
915

1016
For more details on how to use Qiskit you can refer to the documentation located here:
1117

12-
https://qiskit.org/documentation/
18+
<https://qiskit.org/documentation/>
1319

1420

1521
## Installation
1622

17-
We encourage installing Qiskit via ``pip``. The following command installs the core Qiskit components, including Terra.
23+
We encourage installing Qiskit via ``pip``:
1824

1925
```bash
2026
pip install qiskit
@@ -24,7 +30,7 @@ Pip will handle all dependencies automatically and you will always install the l
2430

2531
To install from source, follow the instructions in the [documentation](https://qiskit.org/documentation/contributing_to_qiskit.html#install-install-from-source-label).
2632

27-
## Creating Your First Quantum Program in Qiskit Terra
33+
## Creating Your First Quantum Program in Qiskit
2834

2935
Now that Qiskit is installed, it's time to begin working with Qiskit. To do this
3036
we create a `QuantumCircuit` object to define a basic quantum program.
@@ -37,7 +43,7 @@ qc.cx(0, 1)
3743
qc.measure([0,1], [0,1])
3844
```
3945

40-
This simple example makes an entangled state, also called a [Bell state](https://qiskit.org/textbook/ch-gates/multiple-qubits-entangled-states.html#3.2-Entangled-States-).
46+
This example makes an entangled state, also called a [Bell state](https://en.wikipedia.org/wiki/Bell_state).
4147

4248
Once you've made your first quantum circuit, you can then simulate it.
4349
To do this, first we need to compile your circuit for the target backend we're going to run
@@ -66,12 +72,9 @@ The output from this execution will look similar to this:
6672
{'00': 513, '11': 511}
6773
```
6874

69-
For further examples of using Qiskit you can look at the example scripts in **examples/python**. You can start with
70-
[using_qiskit_terra_level_0.py](examples/python/using_qiskit_terra_level_0.py) and working up in the levels. Also
71-
you can refer to the tutorials in the documentation here:
72-
73-
https://qiskit.org/documentation/tutorials.html
75+
For further examples of using Qiskit you can look at the tutorials in the documentation here:
7476

77+
<https://qiskit.org/documentation/tutorials.html>
7578

7679
### Executing your code on a real quantum chip
7780

@@ -94,22 +97,18 @@ on how to get access and use these systems.
9497

9598
## Contribution Guidelines
9699

97-
If you'd like to contribute to Qiskit Terra, please take a look at our
98-
[contribution guidelines](CONTRIBUTING.md). This project adheres to Qiskit's [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
100+
If you'd like to contribute to Qiskit, please take a look at our
101+
[contribution guidelines](CONTRIBUTING.md). By participating, you are expected to uphold our [code of conduct](CODE_OF_CONDUCT.md).
99102

100103
We use [GitHub issues](https://github.com/Qiskit/qiskit-terra/issues) for tracking requests and bugs. Please
101-
[join the Qiskit Slack community](https://qisk.it/join-slack)
102-
and use our [Qiskit Slack channel](https://qiskit.slack.com) for discussion and simple questions.
103-
For questions that are more suited for a forum we use the `qiskit` tag in the [Stack Exchange](https://quantumcomputing.stackexchange.com/questions/tagged/qiskit).
104-
105-
## Next Steps
104+
[join the Qiskit Slack community](https://qisk.it/join-slack) for discussion, comments, and questions.
105+
For questions related to running or using Qiskit, [Stack Overflow has a `qiskit`](https://stackoverflow.com/questions/tagged/qiskit).
106+
For questions on quantum computing with Qiskit, use the `qiskit` tag in the [Quantum Computing Stack Exchange](https://quantumcomputing.stackexchange.com/questions/tagged/qiskit) (please, read first the [guidelines on how to ask](https://quantumcomputing.stackexchange.com/help/how-to-ask) in that forum).
106107

107-
Now you're set up and ready to check out some of the other examples from our
108-
[Qiskit Tutorials](https://github.com/Qiskit/qiskit-tutorials) repository.
109108

110109
## Authors and Citation
111110

112-
Qiskit Terra is the work of [many people](https://github.com/Qiskit/qiskit-terra/graphs/contributors) who contribute
111+
Qiskit is the work of [many people](https://github.com/Qiskit/qiskit-terra/graphs/contributors) who contribute
113112
to the project at different levels. If you use Qiskit, please cite as per the included [BibTeX file](CITATION.bib).
114113

115114
## Changelog and Release Notes
@@ -118,10 +117,10 @@ The changelog for a particular release is dynamically generated and gets
118117
written to the release page on Github for each release. For example, you can
119118
find the page for the `0.9.0` release here:
120119

121-
https://github.com/Qiskit/qiskit-terra/releases/tag/0.9.0
120+
<https://github.com/Qiskit/qiskit-terra/releases/tag/0.9.0>
122121

123122
The changelog for the current release can be found in the releases tab:
124-
[![Releases](https://img.shields.io/github/release/Qiskit/qiskit-terra.svg?style=popout-square)](https://github.com/Qiskit/qiskit-terra/releases)
123+
[![Releases](https://img.shields.io/github/release/Qiskit/qiskit-terra.svg?style=flat&label=)](https://github.com/Qiskit/qiskit-terra/releases)
125124
The changelog provides a quick overview of notable changes for a given
126125
release.
127126

azure-pipelines.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,3 +277,21 @@ stages:
277277
env:
278278
TWINE_USERNAME: "qiskit"
279279
TWINE_PASSWORD: $(TWINE_PASSWORD)
280+
- job: 'qiskit-pkg'
281+
pool: {vmImage: 'ubuntu-latest'}
282+
steps:
283+
- task: UsePythonVersion@0
284+
- bash: |
285+
set -e
286+
python -m pip install --upgrade pip build
287+
cd qiskit_pkg
288+
python -m build .
289+
- task: PublishBuildArtifacts@1
290+
inputs: {pathtoPublish: 'dist'}
291+
condition: succeededOrFailed()
292+
- bash: |
293+
python -m pip install --upgrade twine
294+
twine upload dist/*
295+
env:
296+
TWINE_USERNAME: "qiskit"
297+
TWINE_PASSWORD: $(TWINE_PASSWORD)

qiskit_pkg/LICENSE.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE.txt

qiskit_pkg/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include LICENSE.txt

qiskit_pkg/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../README.md

qiskit_pkg/setup.py

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# -*- coding: utf-8 -*-
2+
3+
# This code is part of Qiskit.
4+
#
5+
# (C) Copyright IBM 2018.
6+
#
7+
# This code is licensed under the Apache License, Version 2.0. You may
8+
# obtain a copy of this license in the LICENSE.txt file in the root directory
9+
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
10+
#
11+
# Any modifications or derivative works of this code must retain this
12+
# copyright notice, and modified files need to carry a notice indicating
13+
# that they have been altered from the originals.
14+
15+
# This file is the setup.py file for the qiskit package. Because python
16+
# packaging doesn't offer a mechanism to have qiskit supersede qiskit-terra
17+
# and cleanly upgrade from one to the other, there needs to be a separate
18+
# package shim to ensure no matter how people installed qiskit < 0.45.0 the
19+
# upgrade works.
20+
21+
import os
22+
23+
from setuptools import setup
24+
25+
README_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), "README.md")
26+
with open(README_PATH) as readme_file:
27+
README = readme_file.read()
28+
29+
requirements = ["qiskit-terra==0.45.0"]
30+
31+
setup(
32+
name="qiskit",
33+
version="0.45.0",
34+
description="Software for developing quantum computing programs",
35+
long_description=README,
36+
long_description_content_type="text/markdown",
37+
url="https://qiskit.org/",
38+
author="Qiskit Development Team",
39+
author_email="hello@qiskit.org",
40+
license="Apache 2.0",
41+
py_modules=[],
42+
packages=[],
43+
classifiers=[
44+
"Environment :: Console",
45+
"License :: OSI Approved :: Apache Software License",
46+
"Intended Audience :: Developers",
47+
"Intended Audience :: Science/Research",
48+
"Operating System :: Microsoft :: Windows",
49+
"Operating System :: MacOS",
50+
"Operating System :: POSIX :: Linux",
51+
"Programming Language :: Python :: 3.8",
52+
"Programming Language :: Python :: 3.9",
53+
"Programming Language :: Python :: 3.10",
54+
"Programming Language :: Python :: 3.11",
55+
"Topic :: Scientific/Engineering",
56+
],
57+
keywords="qiskit sdk quantum",
58+
install_requires=requirements,
59+
project_urls={
60+
"Bug Tracker": "https://github.com/Qiskit/qiskit/issues",
61+
"Documentation": "https://qiskit.org/documentation/",
62+
"Source Code": "https://github.com/Qiskit/qiskit",
63+
},
64+
include_package_data=True,
65+
python_requires=">=3.8",
66+
extras_require={
67+
"qasm3-import": ["qiskit-terra[qasm3-import]"],
68+
"visualization": ["qiskit-terra[visualization]"],
69+
"crosstalk-pass": ["qiskit-terra[crosstalk-pass]"],
70+
"csp-layout-pass": ["qiskit-terra[csp-layout-pass]"],
71+
"all": ["qiskit-terra[all]"],
72+
},
73+
)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
upgrade:
3+
- |
4+
The ``toqm`` optional setuptools extra that previously enabled running
5+
``pip install qiskit-terra[topm]`` has been removed as nothing in the
6+
Qiskit code base is currently using that package anymore. If you'd like
7+
to use the qiskit TOQM transpiler plugin you should install the
8+
``qiskit-toqm`` package directly.

setup.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@
5252
z3_requirements = [
5353
"z3-solver>=4.7",
5454
]
55-
bip_requirements = ["cplex", "docplex"]
5655
csp_requirements = ["python-constraint>=1.4"]
57-
toqm_requirements = ["qiskit-toqm>=0.1.0"]
56+
5857

5958
setup(
6059
name="qiskit-terra",
@@ -89,12 +88,8 @@
8988
extras_require={
9089
"qasm3-import": qasm3_import_extras,
9190
"visualization": visualization_extras,
92-
"bip-mapper": bip_requirements,
9391
"crosstalk-pass": z3_requirements,
9492
"csp-layout-pass": csp_requirements,
95-
"toqm": toqm_requirements,
96-
# Note: 'all' only includes extras that are stable and work on the majority of Python
97-
# versions and OSes supported by Terra. You have to ask for anything else explicitly.
9893
"all": visualization_extras + z3_requirements + csp_requirements + qasm3_import_extras,
9994
},
10095
project_urls={

tox.ini

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ commands =
2424
[testenv:lint]
2525
basepython = python3
2626
commands =
27-
ruff check qiskit test tools examples setup.py
28-
black --check {posargs} qiskit test tools examples setup.py
27+
ruff check qiskit test tools examples setup.py qiskit_pkg
28+
black --check {posargs} qiskit test tools examples setup.py qiskit_pkg
2929
pylint -rn qiskit test tools
3030
# This line is commented out until #6649 merges. We can't run this currently
3131
# via tox because tox doesn't support globbing
@@ -39,8 +39,8 @@ commands =
3939
basepython = python3
4040
allowlist_externals = git
4141
commands =
42-
ruff check qiskit test tools examples setup.py
43-
black --check {posargs} qiskit test tools examples setup.py
42+
ruff check qiskit test tools examples setup.py qiskit_pkg
43+
black --check {posargs} qiskit test tools examples setup.py qiskit_pkg
4444
-git fetch -q https://github.com/Qiskit/qiskit-terra.git :lint_incr_latest
4545
python {toxinidir}/tools/pylint_incr.py -rn -j4 -sn --paths :/qiskit/*.py :/test/*.py :/tools/*.py
4646
python {toxinidir}/tools/pylint_incr.py -rn -j4 -sn --disable='invalid-name,missing-module-docstring,redefined-outer-name' --paths :(glob,top)examples/python/*.py
@@ -50,7 +50,7 @@ commands =
5050
reno lint
5151

5252
[testenv:black]
53-
commands = black {posargs} qiskit test tools examples setup.py
53+
commands = black {posargs} qiskit test tools examples setup.py qiskit_pkg
5454

5555
[testenv:coverage]
5656
basepython = python3

0 commit comments

Comments
 (0)