Skip to content

Commit

Permalink
Switch from qiskit-terra to qiskit (#297)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
woodsp-ibm and mergify[bot] authored Sep 1, 2023
1 parent 14e7cc0 commit f07a024
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 69 deletions.
34 changes: 17 additions & 17 deletions .github/actions/install-main-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@ inputs:
python-version:
description: 'Python version'
required: true
terra-main:
description: 'Use Terra main'
qiskit-main:
description: 'Use Qiskit main'
required: true
runs:
using: "composite"
steps:
- name: Get main last commit ids
run: |
echo "TERRA_HASH=$(git ls-remote --heads https://github.com/Qiskit/qiskit-terra.git refs/heads/main | awk '{print $1}')" >> $GITHUB_ENV
echo "QISKIT_HASH=$(git ls-remote --heads https://github.com/Qiskit/qiskit.git refs/heads/main | awk '{print $1}')" >> $GITHUB_ENV
echo "OPTIMIZATION_HASH=$(git ls-remote --heads https://github.com/Qiskit/qiskit-optimization.git refs/heads/main | awk '{print $1}')" >> $GITHUB_ENV
shell: bash
- name: Terra Cache
- name: Qiskit Cache
env:
CACHE_VERSION: v1
id: terra-cache
id: qiskit-cache
uses: actions/cache@v3
with:
path: terra-cache
key: terra-cache-${{ inputs.os }}-${{ inputs.python-version }}-${{ env.TERRA_HASH }}-${{ env.CACHE_VERSION }}
path: qiskit-cache
key: qiskit-cache-${{ inputs.os }}-${{ inputs.python-version }}-${{ env.QISKIT_HASH }}-${{ env.CACHE_VERSION }}
- name: Optimization Cache
env:
CACHE_VERSION: v1
Expand All @@ -46,19 +46,19 @@ runs:
with:
path: optimization-cache
key: optimization-cache-${{ inputs.os }}-${{ inputs.python-version }}-${{ env.OPTIMIZATION_HASH }}-${{ env.CACHE_VERSION }}
- name: Install Terra from Main
- name: Install Qiskit from Main
env:
MACOSX_DEPLOYMENT_TARGET: 10.15
run: |
if [ "${{ inputs.terra-main }}" == "true" ]; then
echo 'Install Terra from Main'
if [ "${{ inputs.qiskit-main }}" == "true" ]; then
echo 'Install Qiskit from Main'
if [ "${{ inputs.os }}" == "windows-2019" ]; then
source "$CONDA/etc/profile.d/conda.sh"
conda activate scsenv
fi
BASE_DIR=terra-cache
BASE_DIR=qiskit-cache
build_from_main=true
cache_hit=${{ steps.terra-cache.outputs.cache-hit }}
cache_hit=${{ steps.qiskit-cache.outputs.cache-hit }}
echo "cache hit: ${cache_hit}"
if [ "$cache_hit" == "true" ]; then
pip_result=0
Expand All @@ -74,23 +74,23 @@ runs:
if [ "$build_from_main" == "true" ]; then
echo 'Create wheel file from main'
pip install -U wheel setuptools_rust
git clone --depth 1 --branch main https://github.com/Qiskit/qiskit-terra.git /tmp/qiskit-terra
pushd /tmp/qiskit-terra
git clone --depth 1 --branch main https://github.com/Qiskit/qiskit.git /tmp/qiskit
pushd /tmp/qiskit
python setup.py bdist_wheel
popd
cp -rf /tmp/qiskit-terra/dist/*.whl "${BASE_DIR}"
cp -rf /tmp/qiskit/dist/*.whl "${BASE_DIR}"
pushd "${BASE_DIR}"
python -m pip install *.whl
popd
pip uninstall -y setuptools_rust
fi
else
echo 'Install Terra from Stable'
echo 'Install Qiskit from Stable'
if [ "${{ inputs.os }}" == "windows-2019" ]; then
source "$CONDA/etc/profile.d/conda.sh"
conda activate scsenv
fi
pip install -U qiskit-terra
pip install -U qiskit
fi
shell: bash
- name: Install stable Aer
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
os: ${{ matrix.os }}
- name: Install Dependencies
run: |
pip install jupyter qiskit-terra[visualization]
pip install jupyter qiskit[visualization]
sudo apt-get install -y pandoc graphviz
shell: bash
- name: Build and publish
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install jupyter qiskit-terra[visualization] torchvision tox
pip install jupyter qiskit[visualization] torchvision tox
sudo apt-get install -y pandoc graphviz
shell: bash
- name: Build and publish
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ jobs:
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
terra-main: "false"
qiskit-main: "false"
if: ${{ !startsWith(github.ref, 'refs/heads/stable') && !startsWith(github.base_ref, 'stable/') }}
- uses: ./.github/actions/install-finance
with:
os: ${{ matrix.os }}
- name: Install Dependencies
run: |
pip install jupyter qiskit-terra[visualization]
pip install jupyter qiskit[visualization]
sudo apt-get -y install pandoc graphviz
sudo apt-get -y install python3-enchant
sudo apt-get -y install hunspell-en-us
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:
os: ${{ matrix.os }}
- name: Install Dependencies
run: |
pip install jupyter qiskit-terra[visualization]
pip install jupyter qiskit[visualization]
sudo apt-get install -y pandoc graphviz
shell: bash
- name: Run Finance Tutorials
Expand Down
54 changes: 9 additions & 45 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,26 +98,7 @@ please ensure that:

### Changelog generation

The changelog is automatically generated as part of the release process
automation. This works through a combination of the git log and the pull
request. When a release is tagged and pushed to github the release automation
bot looks at all commit messages from the git log for the release. It takes the
PR numbers from the git log (assuming a squash merge) and checks if that PR had
a `Changelog:` label on it. If there is a label it will add the git commit
message summary line from the git log for the release to the changelog.

If there are multiple `Changelog:` tags on a PR the git commit message summary
line from the git log will be used for each changelog category tagged.

The current categories for each label are as follows:

| PR Label | Changelog Category |
| -----------------------|--------------------|
| Changelog: Deprecation | Deprecated |
| Changelog: New Feature | Added |
| Changelog: API Change | Changed |
| Changelog: Removal | Removed |
| Changelog: Bugfix | Fixed |
A changelog is manually generated as part of the release process from the release notes.

### Release Notes

Expand Down Expand Up @@ -201,8 +182,8 @@ deprecations:
You can also look at other release notes for other examples.
You can use any restructured text feature in them (code sections, tables,
enumerated lists, bulleted list, etc) to express what is being changed as
needed. In general you want the release notes to include as much detail as
enumerated lists, bulleted list, etc.) to express what is being changed as
needed. In general, you want the release notes to include as much detail as
needed so that users will understand what has changed, why it changed, and how
they'll have to update their code.
Expand Down Expand Up @@ -245,10 +226,8 @@ Please see the [Installing Qiskit Finance from
Source](https://github.com/qiskit-community/qiskit-finance#installatione)
section of the Qiskit documentation.

Note: Finance depends on Terra, and has optional dependence on Aer and IBM Q Provider, so
these should be installed too. The main branch of Finance is kept working with those other element
main branches so these should be installed from source too following the instructions at
the same location
Note: Finance depends on Qiskit, and has an optional dependence, so
should be installed too.

Finance also has some other optional dependents see
[Finance optional installs](https://github.com/qiskit-community/qiskit-finance#optional-installs) for
Expand All @@ -266,12 +245,12 @@ The test suite can be run from a command line or via your IDE. You can run `make
run all unit tests. Another way to run the test suite is to use
[**tox**](https://tox.readthedocs.io/en/latest/#). For more information about using tox please
refer to
[Terra CONTRIBUTING](https://github.com/Qiskit/qiskit-terra/blob/main/CONTRIBUTING.md#test)
[Qiskit CONTRIBUTING](https://github.com/Qiskit/qiskit/blob/main/CONTRIBUTING.md#test)
Test section. However please note Finance does not have any
[online tests](https://github.com/Qiskit/qiskit-terra/blob/main/CONTRIBUTING.md#online-tests)
[online tests](https://github.com/Qiskit/qiskit/blob/main/CONTRIBUTING.md#online-tests)
nor does it have
[test skip
options](https://github.com/Qiskit/qiskit-terra/blob/main/CONTRIBUTING.md#test-skip-options).
options](https://github.com/Qiskit/qiskit/blob/main/CONTRIBUTING.md#test-skip-options).

### Development Cycle

Expand All @@ -294,24 +273,9 @@ stable and the only changes merged to it are bugfixes.

### Release Cycle

From time to time, we will release brand new versions of Qiskit Finance. These
From time to time, we will release brand-new versions of Qiskit Finance. These
are well-tested versions of the software.

When the time for a new release has come, we will:

1. Create a new tag with the version number and push it to github
2. Change the `main` version to the next release version.

The release automation processes will be triggered by the new tag and perform
the following steps:

1. Create a stable branch for the new minor version from the release tag
on the `main` branch
2. Build and upload binary wheels to pypi
3. Create a github release page with a generated changelog
4. Generate a PR on the meta-repository to bump the terra version and
meta-package version.

The `stable/*` branches should only receive changes in the form of bug
fixes.

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
qiskit-terra>=0.20.0
qiskit>=0.44
qiskit-optimization>=0.2.0
scipy>=1.4
numpy>=1.17
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ setenv =
LANGUAGE=en_US
LC_ALL=en_US.utf-8
ARGS="-V"
deps = git+https://github.com/Qiskit/qiskit-terra.git
deps = git+https://github.com/Qiskit/qiskit.git
git+https://github.com/Qiskit/qiskit-aer.git
git+https://github.com/Qiskit/qiskit-optimization.git
-r{toxinidir}/requirements.txt
Expand Down

0 comments on commit f07a024

Please sign in to comment.