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

Invoke pip install by module not executable #9972

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

jakelishman
Copy link
Member

Summary

On some OSes and configurations (usually Windows), there can be problems when a binary attempts to one that is in use, especially itself. For this reason, it is more reliable to use python -m pip install ... than pip install. We have seen some CI failures on Windows due to pip failing to update itself because of the direct-executable pip install form.

Details and comments

On some OSes and configurations (usually Windows), there can be problems
when a binary attempts to one that is in use, especially itself.  For
this reason, it is more reliable to use `python -m pip install ...` than
`pip install`.  We have seen some CI failures on Windows due to `pip`
failing to update itself because of the direct-executable `pip install`
form.
@jakelishman jakelishman 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 Apr 16, 2023
@jakelishman jakelishman requested a review from a team as a code owner April 16, 2023 20:48
@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

@coveralls
Copy link

Pull Request Test Coverage Report for Build 4715313887

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 13 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.009%) to 85.775%

Files with Coverage Reduction New Missed Lines %
qiskit/circuit/tools/pi_check.py 1 91.23%
crates/qasm2/src/lex.rs 3 91.65%
qiskit/pulse/library/waveform.py 3 91.67%
crates/qasm2/src/parse.rs 6 96.65%
Totals Coverage Status
Change from base Build 4704167625: -0.009%
Covered Lines: 70347
Relevant Lines: 82013

💛 - Coveralls

Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

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

This LGTM primarily because CI passed. TBH, I'm not convinced it's an OS limitation but more that the pip maintainers changed and/or broke something, as there was a new release published on Saturday:

https://pypi.org/project/pip/23.1/

But calling via module everywhere works fine, even if the issue in pip is fixed eventually.

@mtreinish mtreinish added this pull request to the merge queue Apr 17, 2023
@jakelishman
Copy link
Member Author

jakelishman commented Apr 17, 2023

I'm fairly sure it is a Windows limitation - the only line that did pip install -U pip (not python -m pip install -U pip) was added in #9850, which was when pip 23.0.1 was the latest pip, so since that PR, there hasn't actually been a version of pip to update to. I'm not 100%, but somewhat confident that I've seen this failure mode in the past.

Merged via the queue into Qiskit:main with commit 51fdb3c Apr 17, 2023
mergify bot pushed a commit that referenced this pull request Apr 17, 2023
On some OSes and configurations (usually Windows), there can be problems
when a binary attempts to one that is in use, especially itself.  For
this reason, it is more reliable to use `python -m pip install ...` than
`pip install`.  We have seen some CI failures on Windows due to `pip`
failing to update itself because of the direct-executable `pip install`
form.

(cherry picked from commit 51fdb3c)

# Conflicts:
#	.azure/lint-linux.yml
#	.azure/test-linux.yml
#	.azure/test-macos.yml
#	.azure/test-windows.yml
#	.azure/tutorials-linux.yml
#	.github/workflows/coverage.yml
#	.github/workflows/randomized_tests.yml
#	.github/workflows/slow.yml
jakelishman added a commit that referenced this pull request Apr 17, 2023
On some OSes and configurations (usually Windows), there can be problems
when a binary attempts to one that is in use, especially itself.  For
this reason, it is more reliable to use `python -m pip install ...` than
`pip install`.  We have seen some CI failures on Windows due to `pip`
failing to update itself because of the direct-executable `pip install`
form.

(cherry picked from commit 51fdb3c)
jakelishman added a commit that referenced this pull request Apr 17, 2023
On some OSes and configurations (usually Windows), there can be problems
when a binary attempts to one that is in use, especially itself.  For
this reason, it is more reliable to use `python -m pip install ...` than
`pip install`.  We have seen some CI failures on Windows due to `pip`
failing to update itself because of the direct-executable `pip install`
form.

(cherry picked from commit 51fdb3c)

Co-authored-by: Jake Lishman <[email protected]>
@jakelishman jakelishman deleted the fix-pip-self-update branch April 17, 2023 20:55
ikkoham pushed a commit to ikkoham/qiskit-terra that referenced this pull request Apr 19, 2023
On some OSes and configurations (usually Windows), there can be problems
when a binary attempts to one that is in use, especially itself.  For
this reason, it is more reliable to use `python -m pip install ...` than
`pip install`.  We have seen some CI failures on Windows due to `pip`
failing to update itself because of the direct-executable `pip install`
form.
king-p3nguin pushed a commit to king-p3nguin/qiskit-terra that referenced this pull request May 22, 2023
On some OSes and configurations (usually Windows), there can be problems
when a binary attempts to one that is in use, especially itself.  For
this reason, it is more reliable to use `python -m pip install ...` than
`pip install`.  We have seen some CI failures on Windows due to `pip`
failing to update itself because of the direct-executable `pip install`
form.
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.

4 participants