Skip to content

Commit 2572d31

Browse files
tuhaiheliushengsong
authored andcommitted
Replace pip3 download with curl for Python deps
Replace pip3 download commands with curl for downloading psutil, PyYAML, PyGreSQL and mock packages in gpMgmt/bin/Makefile. This change unifies the download mechanism to use curl consistently for all Python dependencies, avoiding potential pip3 download compatibility issues across different environments. Changes: - Remove pip3 download commands for psutil, PyYAML, PyGreSQL & mock - Use curl to download packages directly from PyPI - Maintain existing wheel and cython installation for PyYAML build - Keep the same package versions and download locations Also, add curl and pip3 dependency detection in configure.ac file for better user experience. When `--with-pythonsrc-ext` option is enabled, configure can check the required dependencies early.
1 parent 0952063 commit 2572d31

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

gpMgmt/bin/Makefile

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ PYYAML_VERSION=5.4.1
9090
download-python-deps:
9191
@echo "--- Downloading Python dependencies for gpMgmt modules"
9292
@mkdir -p $(PYLIB_SRC_EXT)
93-
# Download psutil
94-
pip3 download --no-deps --no-binary :all: --no-build-isolation psutil==$(PSUTIL_VERSION) --dest $(PYLIB_SRC_EXT)/
95-
# Download PyYAML, wheel is for metadata vefiry;
96-
# cython is used for building, see https://github.com/apache/cloudberry/issues/1201
97-
pip3 install wheel "cython<3.0.0"
98-
pip3 download --no-deps --no-binary :all: --no-build-isolation PyYAML==$(PYYAML_VERSION) --dest $(PYLIB_SRC_EXT)/
99-
# Download PyGreSQL, the `PATH` is needed to avoid cannot find the pg_config
100-
PATH=$(DESTDIR)$(bindir):$$PATH pip3 download --no-deps --no-binary :all: --no-build-isolation PyGreSQL==$(PYGRESQL_VERSION) --dest $(PYLIB_SRC_EXT)/
93+
# Download psutil using curl
94+
curl -sSL https://files.pythonhosted.org/packages/source/p/psutil/psutil-$(PSUTIL_VERSION).tar.gz -o $(PYLIB_SRC_EXT)/psutil-$(PSUTIL_VERSION).tar.gz
95+
# Download PyYAML using curl
96+
curl -sSL https://files.pythonhosted.org/packages/source/P/PyYAML/PyYAML-$(PYYAML_VERSION).tar.gz -o $(PYLIB_SRC_EXT)/PyYAML-$(PYYAML_VERSION).tar.gz
97+
# Download PyGreSQL using curl
98+
curl -sSL https://files.pythonhosted.org/packages/source/P/PyGreSQL/PyGreSQL-$(PYGRESQL_VERSION).tar.gz -o $(PYLIB_SRC_EXT)/PyGreSQL-$(PYGRESQL_VERSION).tar.gz
99+
# Install wheel and cython for PyYAML building
100+
pip3 install --user wheel "cython<3.0.0"
101101

102102
#
103103
# PyGreSQL
@@ -148,14 +148,14 @@ $(MOCK_BIN):
148148
@echo "--- mock for platform $(UBUNTU_PLATFORM)"
149149
@if [ "$(UBUNTU_PLATFORM)" = "Ubuntu" ]; then\
150150
pip3 install mock;\
151-
else\
152-
mkdir -p $(PYLIB_SRC_EXT) && \
153-
pip3 download --no-deps --no-binary :all: --no-build-isolation mock==$(MOCK_VERSION) --dest $(PYLIB_SRC_EXT)/ && \
154-
mkdir -p $(PYTHONSRC_INSTALL_SITE) && \
155-
cd $(PYLIB_SRC_EXT)/ && unzip -q $(MOCK_DIR).zip && \
156-
cd $(PYLIB_SRC_EXT)/$(MOCK_DIR)/ && \
157-
PYTHONPATH=$(PYTHONSRC_INSTALL_PYTHON_PATH) python3 setup.py install --prefix $(PYTHONSRC_INSTALL) ; \
158-
fi;
151+
else\
152+
mkdir -p $(PYLIB_SRC_EXT) && \
153+
curl -sSL https://files.pythonhosted.org/packages/source/m/mock/mock-$(MOCK_VERSION).zip -o $(PYLIB_SRC_EXT)/mock-$(MOCK_VERSION).zip && \
154+
mkdir -p $(PYTHONSRC_INSTALL_SITE) && \
155+
cd $(PYLIB_SRC_EXT)/ && unzip -q $(MOCK_DIR).zip && \
156+
cd $(PYLIB_SRC_EXT)/$(MOCK_DIR)/ && \
157+
PYTHONPATH=$(PYTHONSRC_INSTALL_PYTHON_PATH) python3 setup.py install --prefix $(PYTHONSRC_INSTALL) ; \
158+
fi;
159159

160160
# -----------------------------------------------------------------------------
161161
#

0 commit comments

Comments
 (0)