0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-21 20:49:10 +01:00

SERVER-37588 Python linters version incompatability

This commit is contained in:
Ben Caimano 2018-10-12 11:34:53 -04:00
parent 3991353124
commit afc927262e
6 changed files with 24 additions and 25 deletions

View File

@ -15,7 +15,7 @@ class PyLintLinter(base.LinterBase):
def __init__(self):
# type: () -> None
"""Create a pylint linter."""
super(PyLintLinter, self).__init__("pylint", "pylint 1.8.3")
super(PyLintLinter, self).__init__("pylint", "pylint 1.9.3")
def get_lint_version_cmd_args(self):
# type: () -> List[str]

View File

@ -4336,17 +4336,18 @@ tasks:
set -o verbose
${activate_virtualenv}
python3 -m pip install -r etc/pip/lint-requirements.txt
python2 -m pip install -r etc/pip/lint-requirements.txt
python3 -m pip install -I -r etc/pip/lint-requirements.txt
python2 -m pip install -I -r etc/pip/lint-requirements.txt
export MYPY="$(
PATH+=':/opt/mongodbtoolchain/v2/bin'
if command -V cygpath 2>/dev/null; then
PATH+=":$(cypath "${workdir}")/venv_3/Scripts"
else
PATH+=":${workdir}/venv_3/bin"
fi
PATH+=':/opt/mongodbtoolchain/v2/bin'
which mypy
)"
echo "Found mypy executable at '$MYPY'"
${compile_env|} python2 ./buildscripts/scons.py ${compile_flags|} --stack-size=1024 lint
- name: verify_pip
@ -4370,8 +4371,8 @@ tasks:
${activate_virtualenv}
# This installs the explicit project versions which would be installed in the toolchain
# from this patch
python2 -m pip install -r etc/pip/constraints.txt
python3 -m pip install -r etc/pip/constraints.txt
python2 -m pip install -I -r etc/pip/constraints.txt
python3 -m pip install -I -r etc/pip/constraints.txt
python2 -m pip freeze >requirements.txt.python2.old
python3 -m pip freeze >requirements.txt.python3.old

View File

@ -1,6 +1,5 @@
# Linters
pylint
yapf
# typing in Python 2 for mypy
typing; python_version < "3"
pydocstyle
# Note: These versions are checked by python modules in buildscripts/linter/
pylint == 1.9.3
yapf == 0.21.0
pydocstyle == 2.1.1

View File

@ -1 +1,3 @@
mypy == 0.620; python_version > "3.4"
# Note: This version is checked by python modules in buildscripts/linter/
mypy == 0.580; python_version > "3.4"
typing

View File

@ -6,9 +6,10 @@
# Common requirements
asn1crypto==0.24.0
boto3==1.9.21
botocore==1.12.21
certifi==2018.8.24
astroid==1.6.5
boto3==1.9.23
botocore==1.12.23
certifi==2018.10.15
cffi==1.11.5
chardet==3.0.4
cryptography==2.3
@ -28,6 +29,7 @@ psutil==5.4.7
pycparser==2.19
pydocstyle==2.1.1
PyJWT==1.6.4
pylint==1.9.3
pymongo==3.5.1
python-dateutil==2.7.3
PyYAML==3.13
@ -39,12 +41,12 @@ requests-toolbelt==0.8.0
s3transfer==0.1.13
six==1.11.0
snowballstemmer==1.2.1
typing==3.6.6
urllib3==1.23
wrapt==1.10.11
yapf==0.24.0
yapf==0.21.0
# Python2 requirements
astroid==1.6.5; python_version < "3"
backports.functools-lru-cache==1.5; python_version < "3"
Cheetah3==3.1.0; python_version < "3"
configparser==3.5.0; python_version < "3"
@ -54,14 +56,10 @@ futures==3.2.0; python_version < "3"
ipaddress==1.0.22; python_version < "3"
mock==2.0.0; python_version < "3"
PyKMIP==0.4.0; python_version < "3"
pylint==1.9.3; python_version < "3"
singledispatch==3.4.0.3; python_version < "3"
typing==3.6.6; python_version < "3"
# Python3 requirements
astroid==2.0.4; python_version > "3"
mypy==0.620; python_version > "3"
pylint==2.1.1; python_version > "3"
mypy==0.580; python_version > "3"
typed-ast==1.1.0; python_version > "3"
# Platform-specific components

View File

@ -2,7 +2,6 @@
# Check Python 2 code for type annotations in comments.
python_version = 2.7
[mypy-*]
disallow_untyped_defs = False
# Do not error on imported files since all imported files may not be mypy clean.
follow_imports = silent
@ -11,10 +10,10 @@ follow_imports = silent
# This will limit effectiveness but avoids mypy complaining about running code.
ignore_missing_imports = True
[mypy-idl*]
[mypy-idl.*]
# Error if any code is missing type annotations.
disallow_untyped_defs = True
[mypy-lint*]
[mypy-lint.*]
# Error if any code is missing type annotations.
disallow_untyped_defs = True