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

python-common: Add mypy testing #31071

Merged
merged 1 commit into from Oct 28, 2019

Conversation

sebastian-philipp
Copy link
Contributor

Signed-off-by: Sebastian Wagner sebastian.wagner@suse.com

cc @jschmid1

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard backend
  • jenkins test docs
  • jenkins render docs

@jschmid1
Copy link
Contributor

+1 for mypy usage

@sebastian-philipp
Copy link
Contributor Author

This has an impact on make check, but its not related to QA.

@sebastian-philipp
Copy link
Contributor Author

jenkins test make check arm64

pytest
commands=py.test -v {posargs:ceph/tests}
deps=-rrequirements.txt
commands=python setup.py test --addopts="--mypy --mypy-ignore-missing-imports" {posargs}
Copy link
Contributor

Choose a reason for hiding this comment

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

does this imply python2?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a special overrride for [testenv:py27] below. I.e. there is no way to run this test for Python 2

Copy link
Contributor

@tchaikov tchaikov Oct 25, 2019

Choose a reason for hiding this comment

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

i still don't get it. i think it's

[testenv:py27]
commands=python setup.py test {posargs}

which overrides the global setting.

so "py3" will be using

python setup.py test --addopts="--mypy --mypy-ignore-missing-imports" {posargs}

for testing. as "lint" has its own "commands" already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So you would prefer to have a [testenv:py3] here? I can do that!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
@sebastian-philipp sebastian-philipp merged commit 002f563 into ceph:master Oct 28, 2019
@sebastian-philipp sebastian-philipp deleted the python-common-mypy branch October 28, 2019 14:07
Comment on lines +6 to +11
if sys.version_info >= (3,0):
mypy = ['mypy', 'pytest-mypy']
pytest = 'pytest >=2.1.3'
else:
mypy = []
pytest = 'pytest >=2.1.3,<5'
Copy link
Contributor

Choose a reason for hiding this comment

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

@sebastian-philipp
Copy link
Contributor Author

Probably caused https://tracker.ceph.com/issues/42528

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants