Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tweedledum to requirements-dev.txt #9477

Merged
merged 2 commits into from
Jan 27, 2023
Merged

Conversation

mtreinish
Copy link
Member

Summary

This commit adds a tweedledum to the requirements-dev.txt list. Since the release of qiskit-terra 0.23.0 the CI docs job has started to fail. This is because tweedledum is a requirement for the classicalfunction compiler docs. It turns out we were getting tweedledum installed in docs build jobs via a weird path. The install order for docs build was installing packages that require qiskit-terra before terra itself was being installed. This would cause qiskit-terra from pypi from being isntalled first, and old versions of terra required tweedledum which would install it. Then we'd later upgrade terra to the current version under test. To fix this in the short term this adds add tweedledum to the requirements list so we unblock CI. One thing to note is that since the primary reason we removed tweedledum from the requirements list in #8947 was because macOS users were not able to install it reliably the new entry in the requirement-dev.txt list does not cause issues for developers on macOS systems.

Longer term we should make two fixes, first we need to update the classicalfunction compiler docs so they build without having tweedledum installed. The second is we should update the CI job to avoid installing terra from pypi before we build it from source. But, given that CI is currently broken just adding it to the requirements-dev.txt list is the fastest fix.

Details and comments

@mtreinish mtreinish added type: qa Issues and PRs that relate to testing and code quality stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: None Do not include in changelog labels Jan 27, 2023
@mtreinish mtreinish requested a review from a team as a code owner January 27, 2023 20:24
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core

This commit adds a tweedledum to the requirements-dev.txt list. Since
the release of qiskit-terra 0.23.0 the CI docs job has started to fail.
This is because tweedledum is a requirement for the classicalfunction
compiler docs. It turns out we were getting tweedledum installed in docs
build jobs via a weird path. The install order for docs build was
installing packages that require qiskit-terra before terra itself was
being installed. This would cause qiskit-terra from pypi from being
isntalled first, and old versions of terra required tweedledum which
would install it. Then we'd later upgrade terra to the current version
under test. To fix this in the short term this adds add tweedledum to
the requirements list so we unblock CI. One thing to note is that since
the primary reason we removed tweedledum from the requirements list
in Qiskit#8947 was because macOS users were not able to install it reliably
the new entry in the requirement-dev.txt list does not cause issues for
developers on macOS systems.

Longer term we should make two fixes, first we need to update the
classicalfunction compiler docs so they build without having tweedledum
installed. The second is we should update the CI job to avoid installing
terra from pypi before we build it from source. But, given that CI is
currently broken just adding it to the requirements-dev.txt list is the
fastest fix.
@mtreinish mtreinish changed the title Add tweedldedum to requirements-dev.txt Add tweedledum to requirements-dev.txt Jan 27, 2023
jakelishman
jakelishman previously approved these changes Jan 27, 2023
Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reminds me that I need to revive #8967.

@coveralls
Copy link

coveralls commented Jan 27, 2023

Pull Request Test Coverage Report for Build 4028452106

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 3 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.4%) to 85.263%

Files with Coverage Reduction New Missed Lines %
qiskit/visualization/circuit/_utils.py 1 93.54%
src/sabre_swap/mod.rs 2 99.54%
Totals Coverage Status
Change from base Build 4018513094: 0.4%
Covered Lines: 66962
Relevant Lines: 78536

💛 - Coveralls

@mtreinish
Copy link
Member Author

Sigh, forgot to exclude 3.11 too

Copy link
Contributor

@kevinhartman kevinhartman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mergify mergify bot merged commit a3b359b into Qiskit:main Jan 27, 2023
mergify bot pushed a commit that referenced this pull request Jan 27, 2023
* Add tweedledum to requirements-dev.txt

This commit adds a tweedledum to the requirements-dev.txt list. Since
the release of qiskit-terra 0.23.0 the CI docs job has started to fail.
This is because tweedledum is a requirement for the classicalfunction
compiler docs. It turns out we were getting tweedledum installed in docs
build jobs via a weird path. The install order for docs build was
installing packages that require qiskit-terra before terra itself was
being installed. This would cause qiskit-terra from pypi from being
isntalled first, and old versions of terra required tweedledum which
would install it. Then we'd later upgrade terra to the current version
under test. To fix this in the short term this adds add tweedledum to
the requirements list so we unblock CI. One thing to note is that since
the primary reason we removed tweedledum from the requirements list
in #8947 was because macOS users were not able to install it reliably
the new entry in the requirement-dev.txt list does not cause issues for
developers on macOS systems.

Longer term we should make two fixes, first we need to update the
classicalfunction compiler docs so they build without having tweedledum
installed. The second is we should update the CI job to avoid installing
terra from pypi before we build it from source. But, given that CI is
currently broken just adding it to the requirements-dev.txt list is the
fastest fix.

* Exclude tweedledum on Python 3.11 too

(cherry picked from commit a3b359b)
mergify bot added a commit that referenced this pull request Jan 27, 2023
* Add tweedledum to requirements-dev.txt

This commit adds a tweedledum to the requirements-dev.txt list. Since
the release of qiskit-terra 0.23.0 the CI docs job has started to fail.
This is because tweedledum is a requirement for the classicalfunction
compiler docs. It turns out we were getting tweedledum installed in docs
build jobs via a weird path. The install order for docs build was
installing packages that require qiskit-terra before terra itself was
being installed. This would cause qiskit-terra from pypi from being
isntalled first, and old versions of terra required tweedledum which
would install it. Then we'd later upgrade terra to the current version
under test. To fix this in the short term this adds add tweedledum to
the requirements list so we unblock CI. One thing to note is that since
the primary reason we removed tweedledum from the requirements list
in #8947 was because macOS users were not able to install it reliably
the new entry in the requirement-dev.txt list does not cause issues for
developers on macOS systems.

Longer term we should make two fixes, first we need to update the
classicalfunction compiler docs so they build without having tweedledum
installed. The second is we should update the CI job to avoid installing
terra from pypi before we build it from source. But, given that CI is
currently broken just adding it to the requirements-dev.txt list is the
fastest fix.

* Exclude tweedledum on Python 3.11 too

(cherry picked from commit a3b359b)

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
@mtreinish mtreinish deleted the fix-docs-build branch January 29, 2023 20:43
@Eric-Arellano
Copy link
Collaborator

Longer term we should make two fixes, first we need to update the classicalfunction compiler docs so they build without having tweedledum installed.

Fixed by #9754 (review)

--

The second is we should update the CI job to avoid installing terra from pypi before we build it from source.

The install order for docs build was installing packages that require qiskit-terra before terra itself was being installed.

It looks like the problematic dependency is qiskit-aer:

https://github.com/Qiskit/qiskit-aer/blob/5e5f22cc638a288ad2a35be882f27aaed04d1a8f/setup.py#L20

But I'm confused how this was happening? I checked that in every Azure pipeline, we install from source before we install Aer, e.g. see these line numbers:

https://github.com/Qiskit/qiskit-terra/blob/fa7ac688fdce3ecc27fb7e13d8b2c3f8553b3ff8/.azure/test-linux.yml#L74-L75

https://github.com/Qiskit/qiskit-terra/blob/fa7ac688fdce3ecc27fb7e13d8b2c3f8553b3ff8/.azure/test-linux.yml#L83

Pip is showing in CI logs that Terra is already satisfied from the editable install, so it doesn't try installing from PyPI:

Requirement already satisfied: qiskit-terra>=0.21.0 in ./test-job/lib/python3.11/site-packages (from qiskit-aer) (0.24.0)

(PyPI currently is 0.23.2)

The .azure/ folder hasn't changed in Git history since when this PR landed, so this setup was the same.

The install order for docs build was installing packages that require qiskit-terra before terra itself was being installed.

How did you reach this conclusion?

@jakelishman
Copy link
Member

jakelishman commented Mar 8, 2023

Eric: you're talking about the tests, which we set up and run manually, but the issue is in the docs build, which uses tox. That installs Aer (via requirements-dev.txt) as part of the initial venv setup, and only after (re)installs Terra from source. Aer has a 100% hard dependency on Terra, so it pulls a version from PyPI to install at first.

I don't know if tox has a way of installing dependencies after the package installation. It could well mess with its venv caching if so.

@mtreinish
Copy link
Member Author

I don't think tox gives a simple way to do it (but maybe there is one in tox 4.x.y now), the normal pattern I've used is something like:

tox -edocs --notest
.tox/docs/bin/pip install package
tox -edocs

to build the venv but skip the commands, install the extra package, and then run everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog stable backport potential The bug might be minimal and/or import enough to be port to stable type: qa Issues and PRs that relate to testing and code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants