Skip to content

Commit 0325608

Browse files
luisorofinoclaude
andauthored
Pass --explicit-package-bases to mypy by default (DataDog#23742)
* Add --explicit-package-bases to default mypy_args Always prepend --explicit-package-bases to the mypy command built by the datadog-checks Hatch environment collector. The flag is structurally required by every integration's datadog_checks/<name>/ namespace package layout, so integrations that enable check-types = true no longer need to repeat it in their own hatch.toml. It is also a no-op on the few integrations that ship a datadog_checks/__init__.py. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Add changelog --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ea18f7f commit 0325608

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

ddev/changelog.d/23742.added

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add --explicit-package-bases to default mypy_args

ddev/src/ddev/plugin/external/hatch/environment_collector.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ def on_config(self, name: str, on_true: Any, on_false: Any) -> Any:
6363

6464
@cached_property
6565
def mypy_args(self):
66-
return self.config.get('mypy-args', []) + ['--install-types', '--non-interactive']
66+
return (
67+
['--explicit-package-bases'] + self.config.get('mypy-args', []) + ['--install-types', '--non-interactive']
68+
)
6769

6870
@cached_property
6971
def mypy_files(self):

0 commit comments

Comments
 (0)