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

Bump lint jobs to latest stable python version #3189

Merged
merged 5 commits into from
Oct 9, 2019

Conversation

mtreinish
Copy link
Member

Summary

The python version used for pylint can effect results returned, pylint
is very sensitive to the environment it's run in. Running on python 3.5
which is the oldest supported python version masks issues on newer
python versions. For example, if you have python 3.7 installed locally
lint will always fail becaues of changes to the stdlib. This starts to
become more of an issue as a particular python version ages, since the
user and contributor base moves to newer versions of python. This commit
changes the version of pylint we run in CI to 3.7 to tests the leading
edge instead of the trailing so we keep our pylint testing up to date
with the python versions we support.

Details and comments

Related to #3127 and #1179

The python version used for pylint can effect results returned, pylint
is very sensitive to the environment it's run in. Running on python 3.5
which is the oldest supported python version masks issues on newer
python versions. For example, if you have python 3.7 installed locally
lint will always fail becaues of changes to the stdlib. This starts to
become more of an issue as a particular python version ages, since the
user and contributor base moves to newer versions of python. This commit
changes the version of pylint we run in CI to 3.7 to tests the leading
edge instead of the trailing so we keep our pylint testing up to date
with the python versions we support.

Related to Qiskit#3127 and Qiskit#1179
The abc.ABCMeta class defition added a **kwargs to the __new__ method
definition in python 3.6. This breaks the linter because the
qiskit.pulse.commands.command.MetaCount subclass function signature
differs from stdlib on newer python versions. This works around this by
adding a throwaway kwargs argument to the signature so that we pass
pylint's blind pedantry when running on newer python versions, but still
work with python 3.5.
@kdk kdk merged commit 12ec7ad into Qiskit:master Oct 9, 2019
@mtreinish mtreinish deleted the bump-lint-job-to-37 branch October 9, 2019 13:36
faisaldebouni pushed a commit to faisaldebouni/qiskit-terra that referenced this pull request Aug 5, 2020
* Bump lint jobs to latest stable python version

The python version used for pylint can effect results returned, pylint
is very sensitive to the environment it's run in. Running on python 3.5
which is the oldest supported python version masks issues on newer
python versions. For example, if you have python 3.7 installed locally
lint will always fail becaues of changes to the stdlib. This starts to
become more of an issue as a particular python version ages, since the
user and contributor base moves to newer versions of python. This commit
changes the version of pylint we run in CI to 3.7 to tests the leading
edge instead of the trailing so we keep our pylint testing up to date
with the python versions we support.

Related to Qiskit#3127 and Qiskit#1179

* Add **kwargs to avoid linter error

The abc.ABCMeta class defition added a **kwargs to the __new__ method
definition in python 3.6. This breaks the linter because the
qiskit.pulse.commands.command.MetaCount subclass function signature
differs from stdlib on newer python versions. This works around this by
adding a throwaway kwargs argument to the signature so that we pass
pylint's blind pedantry when running on newer python versions, but still
work with python 3.5.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants