You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by tv...@apache.org on 2022/09/30 16:32:30 UTC

[beam] branch master updated: Relax `pip` check in setup.py to allow installation via other package managers (e.g. `poetry`) (#23326)

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

tvalentyn 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 cefd47ce61d Relax `pip` check in setup.py to allow installation via other package managers (e.g. `poetry`) (#23326)
cefd47ce61d is described below

commit cefd47ce61d1b96332eb9c5198667c6e1d81bb5e
Author: Daniel Smilkov <ds...@gmail.com>
AuthorDate: Fri Sep 30 12:32:20 2022 -0400

    Relax `pip` check in setup.py to allow installation via other package managers (e.g. `poetry`) (#23326)
---
 sdks/python/setup.py | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/sdks/python/setup.py b/sdks/python/setup.py
index e63958dde96..05aa2c026b6 100644
--- a/sdks/python/setup.py
+++ b/sdks/python/setup.py
@@ -95,15 +95,20 @@ execution engines and providing extensibility points for connecting to
 different technologies and user communities.
 '''
 
-REQUIRED_PIP_VERSION = '7.0.0'
-_PIP_VERSION = get_distribution('pip').version
-if parse_version(_PIP_VERSION) < parse_version(REQUIRED_PIP_VERSION):
-  warnings.warn(
-      "You are using version {0} of pip. " \
-      "However, version {1} is recommended.".format(
-          _PIP_VERSION, REQUIRED_PIP_VERSION
-      )
-  )
+RECOMMENDED_MIN_PIP_VERSION = '7.0.0'
+try:
+  _PIP_VERSION = get_distribution('pip').version
+  if parse_version(_PIP_VERSION) < parse_version(RECOMMENDED_MIN_PIP_VERSION):
+    warnings.warn(
+        "You are using version {0} of pip. " \
+        "However, the recommended min version is {1}.".format(
+            _PIP_VERSION, RECOMMENDED_MIN_PIP_VERSION
+        )
+    )
+except DistributionNotFound:
+  # Do nothing if pip is not found. This can happen when using `Poetry` or
+  # `pipenv` package managers.
+  pass
 
 REQUIRED_CYTHON_VERSION = '0.28.1'
 try: