Skip to content

Commit

Permalink
mypy in docker (#35880)
Browse files Browse the repository at this point in the history
* mypy in docker

* --non-interactive --install-types

* --implicit-optional

* comment all

* --follow-imports=silent comment

* types-all

* -non-interactive

* --cache-dir

* del `ignore-missing-imports`

* PIP_NO_CACHE_DIR: "off"

* PIP_ROOT: "/tmp/mypy_types"

* mypy in docker

* env

* # PIP_ROOT: /tmp/mypy_types

* mypy_requirements

* add more libs

* docker image modes

* revert

* uncomment

* order

* comments

* test

* comments

* skip: true

* Update mypy-requirements.txt

Co-authored-by: dorschw <[email protected]>

* Update .pre-commit-config_template.yaml

---------

Co-authored-by: dorschw <[email protected]>
  • Loading branch information
shmuel44 and dorschw authored Sep 19, 2024
1 parent 6c18ada commit 1a6e34f
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .pre-commit-config_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,30 @@ repos:
skip:commit: true
pass_docker_extra_args:ci: --rm=false
pass_docker_extra_args:nightly: --rm=false


- id: mypy-in-docker
name: mypy-in-docker
copy_files:
- Packs/Base/Scripts/CommonServerPython/CommonServerPython.py
- Tests/demistomock/demistomock.py
description: Run mypy on the code in content packs
docker_image:nightly: native:ga,native:maintenance,from-yml,native:candidate
docker_image:native: native:ga,from-yml,native:dev,native:maintenance
docker_image:ci: native:ga,from-yml,native:dev,native:maintenance
docker_image: from-yml
entry: mypy
files: Packs\/.*\.py$
exclude: test_data|tests_data|.venv|.*_test.py$|infrastructure_tests|.vulture_whitelist.py|demistomock.py|Templates|conftest.py|Utils/download_packs_and_docker_images.py
min_py_version: '3.7'
args:
- --check-untyped-defs
- --show-error-codes
- --allow-redefinition
- --cache-dir=/tmp/.mypy_cache
- --implicit-optional
pass_docker_extra_args:ci: --rm=false
pass_docker_extra_args:nightly: --rm=false
skip: true # skip until the https://github.com/demisto/demisto-sdk/pull/4468 will merge
- id: pytest-in-docker
name: pytest-in-docker
description: Run pytest on the code in content packs
Expand Down
35 changes: 35 additions & 0 deletions mypy-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This file specifies the stub lib dependencies required for the mypy-in-docker hook.
# These dependencies will be installed in the Docker container, see `installation_scripts/python_image.sh` in the SDK.
cachetools
cffi
cryptography
dateparser
paramiko
protobuf
pycparser
PyMySQL
pyOpenSSL
python-dateutil
PyYAML
pytz
requests
setuptools
six
types-cachetools
types-cffi
types-dateparser
types-Deprecated
types-Markdown
types-paramiko
types-protobuf
types-pyOpenSSL
types-PyMySQL
types-python-dateutil
types-PyYAML
types-pytz
types-requests
types-setuptools
types-six
types-tabulate
types-ujson
ujson

0 comments on commit 1a6e34f

Please sign in to comment.