[PATCH v3 01/15] python/mkvenv: create timestamp file for each group "ensured"

John Snow posted 15 patches 1 week, 2 days ago
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Thomas Huth <thuth@redhat.com>, Ed Maste <emaste@freebsd.org>, Li-Wen Hsu <lwhsu@freebsd.org>, Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>
[PATCH v3 01/15] python/mkvenv: create timestamp file for each group "ensured"
Posted by John Snow 1 week, 2 days ago
Each group ensured by the mkvenv script will create an empty timestamp
file named {groupname}.group which can be used to conditionally trigger
dependency installation from various scripts and build machinery.

Signed-off-by: John Snow <jsnow@redhat.com>
---
 python/scripts/mkvenv.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/python/scripts/mkvenv.py b/python/scripts/mkvenv.py
index a064709e6ce..a22e3ee3394 100644
--- a/python/scripts/mkvenv.py
+++ b/python/scripts/mkvenv.py
@@ -838,6 +838,12 @@ def ensure_group(
             raise Ouch(result[0])
         raise SystemExit(f"\n{result[0]}\n\n")
 
+    if inside_a_venv():
+        for group in groups:
+            path = Path(sys.prefix).joinpath(f"{group}.group")
+            with open(path, "w", encoding="UTF8"):
+                pass
+
 
 def post_venv_setup() -> None:
     """
-- 
2.51.1
Re: [PATCH v3 01/15] python/mkvenv: create timestamp file for each group "ensured"
Posted by Thomas Huth 1 week, 1 day ago
On 05/12/2025 07.00, John Snow wrote:
> Each group ensured by the mkvenv script will create an empty timestamp
> file named {groupname}.group which can be used to conditionally trigger
> dependency installation from various scripts and build machinery.
> 
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>   python/scripts/mkvenv.py | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/python/scripts/mkvenv.py b/python/scripts/mkvenv.py
> index a064709e6ce..a22e3ee3394 100644
> --- a/python/scripts/mkvenv.py
> +++ b/python/scripts/mkvenv.py
> @@ -838,6 +838,12 @@ def ensure_group(
>               raise Ouch(result[0])
>           raise SystemExit(f"\n{result[0]}\n\n")
>   
> +    if inside_a_venv():
> +        for group in groups:
> +            path = Path(sys.prefix).joinpath(f"{group}.group")
> +            with open(path, "w", encoding="UTF8"):
> +                pass
> +
>   
>   def post_venv_setup() -> None:
>       """

Reviewed-by: Thomas Huth <thuth@redhat.com>