Skip to content

Commit 2d1e4af

Browse files
committed
Avoid running sessions on sources for API repos
API repos are supposed to just ship python files generated from protocol buffer files. Only a stub __init__.py should be included, which doesn't really need to be checked. Allowing checks on the sources for an API repos triggers a lot of issues when the protocol buffers files are generated, as they don't pass any checks. An alternative would be to exclude auto-generated files, but it's not easy because each tool has its own exclusion mechanism, and some don't even have any (hello darglint), so it is simpler to just skip testing the stub __init__.py file. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 28b51c0 commit 2d1e4af

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/frequenz/repo/config/nox/default.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@
9191

9292
api_config: _config.Config = dataclasses.replace(
9393
common_config,
94-
source_paths=list(util.replace(common_config.source_paths, {"src": "py"})),
94+
opts=api_command_options,
95+
# We don't check the sources at all because they are automatically generated.
96+
source_paths=[],
97+
# We adapt the path to the tests.
9598
extra_paths=list(util.replace(common_config.extra_paths, {"tests": "pytests"})),
9699
)
97100
"""Default configuration for APIs.

0 commit comments

Comments
 (0)