external/python3/ExternalPackage_python3.mk |    6 +++++-
 external/python3/ExternalProject_python3.mk |    1 -
 external/python3/generateExternalPackage.py |    2 +-
 pyuno/Module_pyuno.mk                       |    1 +
 pyuno/PythonTest_pyuno_pytests_testvenv.mk  |   16 ++++++++++++++++
 pyuno/qa/pytests/testvenv.py                |   14 ++++++++++++++
 6 files changed, 37 insertions(+), 3 deletions(-)

New commits:
commit fbb1d7bcba219685d789c2f4cdf348f8f7f8d696
Author:     Xisco Fauli <[email protected]>
AuthorDate: Tue Sep 23 12:24:46 2025 +0200
Commit:     Xisco Fauli <[email protected]>
CommitDate: Mon Oct 20 20:09:54 2025 +0200

    related tdf#168511: bundle venv on mac too + Add test
    
    I missed it in
    commit dd8c42bf4b6eb5f692bb929547f69a9aedcf6c0c
    Author: Xisco Fauli <[email protected]>
    Date:   Tue Sep 23 10:07:26 2025 +0200
    
        tdf#168511: python3: bundle venv
    
    Change-Id: I180df8df27ece92aaa1feca379d280ff3f1ba2de
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191392
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191398

diff --git a/external/python3/ExternalProject_python3.mk 
b/external/python3/ExternalProject_python3.mk
index 7530031563ee..2277edb2a79c 100644
--- a/external/python3/ExternalProject_python3.mk
+++ b/external/python3/ExternalProject_python3.mk
@@ -202,7 +202,6 @@ $(call 
gb_ExternalProject_get_state_target,python3,removeunnecessarystuff) : $(c
        rm -r 
$(python3_fw_prefix)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/tkinter
        rm -r 
$(python3_fw_prefix)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/turtledemo
        rm -r 
$(python3_fw_prefix)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/test
-       rm -r 
$(python3_fw_prefix)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/venv
        # Then the binary libraries
        rm 
$(python3_fw_prefix)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_dbm.$(python3_EXTENSION_MODULE_SUFFIX).so
        rm 
$(python3_fw_prefix)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_sqlite3.$(python3_EXTENSION_MODULE_SUFFIX).so
diff --git a/pyuno/Module_pyuno.mk b/pyuno/Module_pyuno.mk
index 804163ea4db0..7cf679bafdc6 100644
--- a/pyuno/Module_pyuno.mk
+++ b/pyuno/Module_pyuno.mk
@@ -49,6 +49,7 @@ $(eval $(call gb_Module_add_check_targets,pyuno, \
     PythonTest_pyuno_pytests_testbz2 \
     PythonTest_pyuno_pytests_testpip \
     PythonTest_pyuno_pytests_testsetuptools \
+    PythonTest_pyuno_pytests_testvenv \
 ))
 
 endif # !SYSTEM_PYTHON
diff --git a/pyuno/PythonTest_pyuno_pytests_testvenv.mk 
b/pyuno/PythonTest_pyuno_pytests_testvenv.mk
new file mode 100644
index 000000000000..26eaf99aed30
--- /dev/null
+++ b/pyuno/PythonTest_pyuno_pytests_testvenv.mk
@@ -0,0 +1,16 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_PythonTest_PythonTest,pyuno_pytests_testvenv))
+
+$(eval $(call 
gb_PythonTest_add_modules,pyuno_pytests_testvenv,$(SRCDIR)/pyuno/qa/pytests,\
+    testvenv \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/pyuno/qa/pytests/testvenv.py b/pyuno/qa/pytests/testvenv.py
new file mode 100644
index 000000000000..2a72dfd4a9d7
--- /dev/null
+++ b/pyuno/qa/pytests/testvenv.py
@@ -0,0 +1,14 @@
+import os
+import unittest
+
+# I want to ensure that import venv works on all platforms
+class VENVTest(unittest.TestCase):
+    def test_venv_import(self):
+        import venv
+
+        # use imported venv module for pyflakes
+        with open(os.devnull, "w") as devnull:
+            print(str(venv), file=devnull)
+
+if __name__ == '__main__':
+    unittest.main()
commit ecda1df6a14e99d5713309b786ff9137dda4767e
Author:     Xisco Fauli <[email protected]>
AuthorDate: Tue Sep 23 10:07:26 2025 +0200
Commit:     Xisco Fauli <[email protected]>
CommitDate: Mon Oct 20 20:09:49 2025 +0200

    tdf#168511: python3: bundle venv
    
    Change-Id: I5d4b03571099486b981f83b0487cdcbc4dd7a1a7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191377
    Reviewed-by: Xisco Fauli <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit dd8c42bf4b6eb5f692bb929547f69a9aedcf6c0c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191386

diff --git a/external/python3/ExternalPackage_python3.mk 
b/external/python3/ExternalPackage_python3.mk
index 3e10b65a0320..b9323fd0b380 100644
--- a/external/python3/ExternalPackage_python3.mk
+++ b/external/python3/ExternalPackage_python3.mk
@@ -177,7 +177,6 @@ endif
 # curses - need curses to build the C module
 # idlelib, tkinter, turtledemo - need Tk to build the C module
 # test - probably unnecessary? was explicitly removed #i116738#
-# venv - why would we need virtual environments
 #
 # Call generateExternalPackage.py to update the lists below
 #
@@ -1867,6 +1866,11 @@ $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
        Lib/urllib/robotparser.py \
 ))
 
+$(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/venv,\
+       Lib/venv/__init__.py \
+       Lib/venv/__main__.py \
+))
+
 $(eval $(call 
gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/wsgiref,\
        Lib/wsgiref/__init__.py \
        Lib/wsgiref/handlers.py \
diff --git a/external/python3/generateExternalPackage.py 
b/external/python3/generateExternalPackage.py
index 962c8f3a8130..b53a04e7f58a 100755
--- a/external/python3/generateExternalPackage.py
+++ b/external/python3/generateExternalPackage.py
@@ -10,7 +10,7 @@ from os import path, walk
 
 if __name__ == '__main__':
 
-    ignoredPackages = ["dbm", "curses", "test", "tkinter", "turtledemo", 
"sqlite3", "idlelib", "venv"]
+    ignoredPackages = ["dbm", "curses", "test", "tkinter", "turtledemo", 
"sqlite3", "idlelib"]
 
     coreDir = path.dirname(path.dirname(path.dirname(path.abspath(__file__))))
     pythonDir = path.join(coreDir, "workdir/UnpackedTarball/python3")

Reply via email to