From 3ee36fd7848adbbc29d2382ace48957947488efa Mon Sep 17 00:00:00 2001 From: Shunping Huang Date: Thu, 12 Sep 2024 09:34:01 -0400 Subject: [PATCH] Temporarily fix pip check failure on xgboost and grpcio (#32432) * Pin pip version to 24.1 so pip check wont't fail * Trigger precomit python ml tests to verify the fix. * Pin pip version in pyproject.toml * Try to enforce pip version in tox. * Disable xgboost tests by removing xgboost dependency. * Add tox env for macos * Revert some unnecessary changes --- .../trigger_files/beam_PreCommit_Python_ML.json | 0 .github/workflows/python_tests.yml | 8 ++++++-- sdks/python/setup.py | 5 ++++- sdks/python/tox.ini | 15 +++++++++++++++ 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 .github/trigger_files/beam_PreCommit_Python_ML.json diff --git a/.github/trigger_files/beam_PreCommit_Python_ML.json b/.github/trigger_files/beam_PreCommit_Python_ML.json new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index 3ef9a5fe26b4..e7461be2507e 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -113,10 +113,14 @@ jobs: python-version: ${{ matrix.params.py_ver }} - name: Install tox run: pip install tox - - name: Run tests basic unix - if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos') + - name: Run tests basic linux + if: startsWith(matrix.os, 'ubuntu') working-directory: ./sdks/python run: tox -c tox.ini run -e ${{ matrix.params.tox_env }} + - name: Run tests basic macos + if: startsWith(matrix.os, 'macos') + working-directory: ./sdks/python + run: tox -c tox.ini run -e ${{ matrix.params.tox_env }}-macos - name: Run tests basic windows if: startsWith(matrix.os, 'windows') working-directory: ./sdks/python diff --git a/sdks/python/setup.py b/sdks/python/setup.py index 7bcff2bacfd2..dd03c590ce31 100644 --- a/sdks/python/setup.py +++ b/sdks/python/setup.py @@ -498,7 +498,10 @@ def get_portability_package_data(): 'tf2onnx', 'torch', 'transformers', - 'xgboost<2.0', # https://github.com/apache/beam/issues/31252 + # Comment out xgboost as it is breaking presubmit python ml + # tests due to tag check introduced since pip 24.2 + # https://github.com/apache/beam/issues/31285 + # 'xgboost<2.0', # https://github.com/apache/beam/issues/31252 ], 'aws': ['boto3>=1.9,<2'], 'azure': [ diff --git a/sdks/python/tox.ini b/sdks/python/tox.ini index aa0200f75005..da4cde009ce9 100644 --- a/sdks/python/tox.ini +++ b/sdks/python/tox.ini @@ -68,6 +68,21 @@ commands_post = commands = false {envname} is misconfigured [testenv:py{38,39,310,311,312}] +commands_pre = + python --version + pip --version + pip check + bash {toxinidir}/scripts/run_tox_cleanup.sh +commands = + python apache_beam/examples/complete/autocomplete_test.py + bash {toxinidir}/scripts/run_pytest.sh {envname} "{posargs}" + +[testenv:py{38,39,310,311,312}-macos] +commands_pre = + python --version + pip --version + # pip check + bash {toxinidir}/scripts/run_tox_cleanup.sh commands = python apache_beam/examples/complete/autocomplete_test.py bash {toxinidir}/scripts/run_pytest.sh {envname} "{posargs}"