Skip to content

Commit

Permalink
Bump lint jobs to latest stable python version (#3189)
Browse files Browse the repository at this point in the history
* 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 #3127 and #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.
  • Loading branch information
mtreinish authored and kdk committed Oct 9, 2019
1 parent 8f9dbc9 commit 12ec7ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ stages:
condition: not(startsWith(variables['Build.SourceBranch'], 'refs/tags'))
strategy:
matrix:
Python35:
python.version: '3.5'
Python37:
python.version: '3.7'
steps:
- task: UsePythonVersion@0
inputs:
Expand Down
2 changes: 1 addition & 1 deletion qiskit/pulse/commands/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

class MetaCount(ABCMeta):
"""Meta class to count class instances."""
def __new__(mcs, name, bases, namespace):
def __new__(mcs, name, bases, namespace, **_):
new_cls = super(MetaCount, mcs).__new__(mcs, name, bases, namespace)
new_cls.instances_counter = 0
return new_cls
Expand Down

0 comments on commit 12ec7ad

Please sign in to comment.