You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by mi...@apache.org on 2023/03/16 00:21:56 UTC
[impala] branch master updated: IMPALA-11955: (Addendum) Use impala-python for packaging
This is an automated email from the ASF dual-hosted git repository.
michaelsmith pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
The following commit(s) were added to refs/heads/master by this push:
new c5aed4e78 IMPALA-11955: (Addendum) Use impala-python for packaging
c5aed4e78 is described below
commit c5aed4e78e89a41bb018f3fe9d6fcc90d899c243
Author: Michael Smith <mi...@cloudera.com>
AuthorDate: Tue Mar 14 15:52:46 2023 -0700
IMPALA-11955: (Addendum) Use impala-python for packaging
Uses impala-python when running packaging scripts to use a known python
version with setuptools available. This supports running on systems
where the `python` binary is available (as Python 2) but doesn't include
setuptools.
In this configuration IMPALA_SYSTEM_PYTHON2_OVERRIDE= is set to disable
building with python2, and only python3 is used for shell packaging.
Also ensures that we use IMPALA_SYSTEM_PYTHON2/3 when using system
python for building.
Testing:
- Manual build with python as a minimal Python 2 install, and Python 3.8
(including setuptools).
Change-Id: I51c257010ef8fb1790482cdc3315aede908ef095
Reviewed-on: http://gerrit.cloudera.org:8080/19619
Reviewed-by: Joe McDonnell <jo...@cloudera.com>
Tested-by: Michael Smith <mi...@cloudera.com>
---
shell/CMakeLists.txt | 8 ++++----
shell/packaging/make_python_package.sh | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/shell/CMakeLists.txt b/shell/CMakeLists.txt
index 1205106e2..e41e72d0f 100644
--- a/shell/CMakeLists.txt
+++ b/shell/CMakeLists.txt
@@ -19,7 +19,7 @@ add_custom_target(shell_tarball DEPENDS gen-deps
COMMAND "${CMAKE_SOURCE_DIR}/shell/make_shell_tarball.sh"
)
-add_custom_target(shell_pypi_package DEPENDS shell_tarball
+add_custom_target(shell_pypi_package DEPENDS shell_tarball impala_python
COMMAND "${CMAKE_SOURCE_DIR}/shell/packaging/make_python_package.sh"
)
@@ -32,7 +32,7 @@ set(SHELL_TEST_PKG
"${CMAKE_SOURCE_DIR}/shell/build/dist/impala_shell-${PKG_VERSION}.tar.gz")
get_filename_component(SHELL_TEST_PKG_DIR "${SHELL_TEST_PKG}" DIRECTORY)
# Generates SHELL_TEST_PKG
-add_custom_target(shell_pypi_test_package DEPENDS shell_tarball
+add_custom_target(shell_pypi_test_package DEPENDS shell_tarball impala_python
COMMAND env BUILD_VERSION=${PKG_VERSION} OFFICIAL=true DIST_DIR="${SHELL_TEST_PKG_DIR}"
"${CMAKE_SOURCE_DIR}/shell/packaging/make_python_package.sh"
)
@@ -41,7 +41,7 @@ set(PYTHON2_VENV "${CMAKE_SOURCE_DIR}/shell/build/py2_venv")
set(PYTHON3_VENV "${CMAKE_SOURCE_DIR}/shell/build/py3_venv")
add_custom_command(OUTPUT "${PYTHON2_VENV}" DEPENDS impala_python
- COMMAND impala-virtualenv --python python2 "${PYTHON2_VENV}"
+ COMMAND impala-virtualenv --python "$ENV{IMPALA_SYSTEM_PYTHON2}" "${PYTHON2_VENV}"
)
add_custom_target(shell_python2_install DEPENDS "${PYTHON2_VENV}" shell_pypi_test_package
@@ -49,7 +49,7 @@ add_custom_target(shell_python2_install DEPENDS "${PYTHON2_VENV}" shell_pypi_tes
)
add_custom_command(OUTPUT "${PYTHON3_VENV}" DEPENDS impala_python
- COMMAND impala-virtualenv --python python3 "${PYTHON3_VENV}"
+ COMMAND impala-virtualenv --python "$ENV{IMPALA_SYSTEM_PYTHON3}" "${PYTHON3_VENV}"
)
add_custom_target(shell_python3_install DEPENDS "${PYTHON3_VENV}" shell_pypi_test_package
diff --git a/shell/packaging/make_python_package.sh b/shell/packaging/make_python_package.sh
index 0f1abafd3..7bdd9ae74 100755
--- a/shell/packaging/make_python_package.sh
+++ b/shell/packaging/make_python_package.sh
@@ -82,7 +82,7 @@ create_distributable_python_package() {
pushd "${PACKAGE_DIR}"
echo "Building package..."
PACKAGE_TYPE="${PACKAGE_TYPE:-}" OFFICIAL="${OFFICIAL:-}" \
- python setup.py sdist --dist-dir "${DIST_DIR}"
+ impala-python setup.py sdist --dist-dir "${DIST_DIR}"
popd
if [[ "${NO_CLEAN_DIST}" != "true" ]]; then