-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test-cycles: Get rid of explicit package list
Automatically derive paths to scan from the namespace package in the current venv. Make the job use the new uv venv along the way. Change-Id: I52547ca3ff28ebd575b579d10fbe31d3d89e37fa
- Loading branch information
1 parent
34b508b
commit 5818893
Showing
2 changed files
with
29 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (C) 2019 Checkmk GmbH - License: GNU General Public License v2 | ||
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and | ||
# conditions defined in the file COPYING, which is part of this source code package. | ||
|
||
"""Find all directories that are part of the given implicit namespace package.""" | ||
|
||
import importlib | ||
import os | ||
|
||
|
||
def find_namespace_package_paths(namespace_name: str) -> list[str]: | ||
try: | ||
namespace_module = importlib.import_module(namespace_name) | ||
except ModuleNotFoundError: | ||
return [] | ||
|
||
if not hasattr(namespace_module, "__path__"): | ||
return [] # not a namespace package | ||
|
||
return [os.path.abspath(path) for path in namespace_module.__path__] | ||
|
||
|
||
print("\n".join(find_namespace_package_paths("cmk"))) |