Skip to content

Commit

Permalink
fixing mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
emmyoop committed Jan 11, 2024
1 parent 9eed7dd commit caaf604
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
47 changes: 23 additions & 24 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-toml
- id: debug-statements
- id: check-yaml
args: [--unsafe]
Expand All @@ -29,27 +28,27 @@ repos:
args:
- "--check"
- "--diff"
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.4.1
# hooks:
# - id: mypy
# # N.B.: Mypy is... a bit fragile.
# #
# # By using `language: system` we run this hook in the local
# # environment instead of a pre-commit isolated one. This is needed
# # to ensure mypy correctly parses the project.
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.4.1
hooks:
- id: mypy
# N.B.: Mypy is... a bit fragile.
#
# By using `language: system` we run this hook in the local
# environment instead of a pre-commit isolated one. This is needed
# to ensure mypy correctly parses the project.

# # It may cause trouble
# # in that it adds environmental variables out of our control to the
# # mix. Unfortunately, there's nothing we can do about per pre-commit's
# # author.
# # See https://github.com/pre-commit/pre-commit/issues/730 for details.
# args: [--show-error-codes]
# files: ^dbt_common/
# language: system
# - id: mypy
# alias: mypy-check
# stages: [manual]
# args: [--show-error-codes, --pretty]
# files: ^dbt_common
# language: system
# It may cause trouble
# in that it adds environmental variables out of our control to the
# mix. Unfortunately, there's nothing we can do about per pre-commit's
# author.
# See https://github.com/pre-commit/pre-commit/issues/730 for details.
args: [--show-error-codes]
files: ^dbt_common/
language: system
- id: mypy
alias: mypy-check
stages: [manual]
args: [--show-error-codes, --pretty]
files: ^dbt_common
language: system
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ dependencies = [
"types-jsonschema~=4.17",
"types-python-dateutil~=2.8",
"types-PyYAML~=6.0",
"types-requests<2.31.0" # types-requests 2.31.0.8 requires urllib3>=2, but we pin urllib3 ~= 1.0 because of openssl requirement for requests
]

# ruff replaces flake8!
Expand Down Expand Up @@ -117,7 +118,8 @@ convention = "google"
mypy_path = "third-party-stubs/"
namespace_packages = true
warn_unused_configs = true
disallow_untyped_defs = true
show_error_codes = true
# disallow_untyped_defs = true # TODO: add type annotations everywhere
warn_redundant_casts = true

# Don't run the extensive mypy checks on custom stubs
Expand Down

0 comments on commit caaf604

Please sign in to comment.