You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by ch...@apache.org on 2022/07/27 19:55:00 UTC

[beam] branch master updated: Upgrades pip before installing Beam for Python default expansion service (#22462)

This is an automated email from the ASF dual-hosted git repository.

chamikara pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 694a6669baf Upgrades pip before installing Beam for Python default expansion service (#22462)
694a6669baf is described below

commit 694a6669bafe4147744dd37494f4b3da57d4ab36
Author: Chamikara Jayalath <ch...@gmail.com>
AuthorDate: Wed Jul 27 12:54:51 2022 -0700

    Upgrades pip before installing Beam for Python default expansion service (#22462)
    
    * Upgrades pip before installing Beam for Python default expansion service
    
    * Also upgrades setuptools
---
 .../apache/beam/sdk/extensions/python/bootstrap_beam_venv.py  | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sdks/java/extensions/python/src/main/resources/org/apache/beam/sdk/extensions/python/bootstrap_beam_venv.py b/sdks/java/extensions/python/src/main/resources/org/apache/beam/sdk/extensions/python/bootstrap_beam_venv.py
index cb5870adb66..a8f6b33d9c3 100644
--- a/sdks/java/extensions/python/src/main/resources/org/apache/beam/sdk/extensions/python/bootstrap_beam_venv.py
+++ b/sdks/java/extensions/python/src/main/resources/org/apache/beam/sdk/extensions/python/bootstrap_beam_venv.py
@@ -92,6 +92,17 @@ def main():
     if not os.path.exists(venv_python):
         try:
             subprocess.run([executable, '-m', 'venv', venv_dir], check=True)
+
+            # Upgrading pip and setuptools for the virtual environment.
+            subprocess.run([
+                venv_python, '-m', 'pip', 'install', '--upgrade', 'pip'
+            ],
+                           check=True)
+            subprocess.run([
+                venv_python, '-m', 'pip', 'install', '--upgrade', 'setuptools'
+            ],
+                           check=True)
+
             # See https://github.com/apache/beam/issues/21506
             subprocess.run([
                 venv_python, '-m', 'pip', 'install', beam_package,