From af4b8772d2935fca7197dd1bcf4f6b20c977e54c Mon Sep 17 00:00:00 2001 From: Linlang <30293408+SunsetWolf@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:23:21 +0800 Subject: [PATCH] Saurabh12571257/main (#1866) * Update README.md * test macos ci * test macos ci * test macos ci * fix ci error * fix ci error --------- Co-authored-by: saurabh dave <87791567+saurabh12571257@users.noreply.github.com> --- .github/workflows/python-publish.yml | 2 +- .github/workflows/test_qlib_from_pip.yml | 15 +++++++-------- .github/workflows/test_qlib_from_source.yml | 19 ++++++++----------- .../workflows/test_qlib_from_source_slow.yml | 12 +++++++----- README.md | 6 +++--- 5 files changed, 26 insertions(+), 28 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 9310cd5e97..b13e5bd47c 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -12,7 +12,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-latest, macos-11] + os: [windows-latest, macos-13] # FIXME: macos-latest will raise error now. # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 python-version: [3.7, 3.8] diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml index 029e292d37..65e31131a8 100644 --- a/.github/workflows/test_qlib_from_pip.yml +++ b/.github/workflows/test_qlib_from_pip.yml @@ -15,8 +15,10 @@ jobs: matrix: # Since macos-latest changed from 12.7.4 to 14.4.1, # the minimum python version that matches a 14.4.1 version of macos is 3.10, - # so we limit the macos version to macos-12. - os: [windows-latest, ubuntu-20.04, ubuntu-22.04, macos-12] + # If you want to use python 3.7 in github action, then the latest macos system version is macos-13, + # after macos-13 python 3.7 is no longer supported. + # so we limit the macos version to macos-13. + os: [windows-latest, ubuntu-20.04, ubuntu-22.04, macos-13] # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 python-version: [3.7, 3.8] @@ -28,13 +30,13 @@ jobs: # So we make the version number of python 3.7 for MacOS more specific. # refs: https://github.com/actions/setup-python/issues/682 - name: Set up Python ${{ matrix.python-version }} - if: (matrix.os == 'macos-latest' && matrix.python-version == '3.7') || (matrix.os == 'macos-11' && matrix.python-version == '3.7') + if: (matrix.os == 'macos-latest' && matrix.python-version == '3.7') || (matrix.os == 'macos-13' && matrix.python-version == '3.7') uses: actions/setup-python@v4 with: python-version: "3.7.16" - name: Set up Python ${{ matrix.python-version }} - if: (matrix.os != 'macos-latest' || matrix.python-version != '3.7') && (matrix.os != 'macos-11' || matrix.python-version != '3.7') + if: (matrix.os != 'macos-latest' || matrix.python-version != '3.7') && (matrix.os != 'macos-13' || matrix.python-version != '3.7') uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -51,7 +53,7 @@ jobs: python -m pip install pyqlib - name: Install Lightgbm for MacOS - if: ${{ matrix.os == 'macos-11' || matrix.os == 'macos-latest' }} + if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-latest' }} run: | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Microsoft/qlib/main/.github/brew_install.sh)" HOMEBREW_NO_AUTO_UPDATE=1 brew install lightgbm @@ -68,8 +70,5 @@ jobs: cd qlib - name: Test workflow by config - # On macos-11 system, it will lead to "Segmentation fault: 11" error, - # which may be caused by the excessive memory overhead of macos-11 system, so we disable macos-11 temporarily here. - if: ${{ matrix.os != 'macos-11' }} run: | qrun examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml diff --git a/.github/workflows/test_qlib_from_source.yml b/.github/workflows/test_qlib_from_source.yml index 8238db9bb2..db878be837 100644 --- a/.github/workflows/test_qlib_from_source.yml +++ b/.github/workflows/test_qlib_from_source.yml @@ -16,8 +16,10 @@ jobs: matrix: # Since macos-latest changed from 12.7.4 to 14.4.1, # the minimum python version that matches a 14.4.1 version of macos is 3.10, - # so we limit the macos version to macos-12. - os: [windows-latest, ubuntu-20.04, ubuntu-22.04, macos-12] + # If you want to use python 3.7 in github action, then the latest macos system version is macos-13, + # after macos-13 python 3.7 is no longer supported. + # so we limit the macos version to macos-13. + os: [windows-latest, ubuntu-20.04, ubuntu-22.04, macos-13] # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 python-version: [3.7, 3.8] @@ -29,13 +31,13 @@ jobs: # So we make the version number of python 3.7 for MacOS more specific. # refs: https://github.com/actions/setup-python/issues/682 - name: Set up Python ${{ matrix.python-version }} - if: (matrix.os == 'macos-latest' && matrix.python-version == '3.7') || (matrix.os == 'macos-11' && matrix.python-version == '3.7') + if: (matrix.os == 'macos-latest' && matrix.python-version == '3.7') || (matrix.os == 'macos-13' && matrix.python-version == '3.7') uses: actions/setup-python@v4 with: python-version: "3.7.16" - name: Set up Python ${{ matrix.python-version }} - if: (matrix.os != 'macos-latest' || matrix.python-version != '3.7') && (matrix.os != 'macos-11' || matrix.python-version != '3.7') + if: (matrix.os != 'macos-latest' || matrix.python-version != '3.7') && (matrix.os != 'macos-13' || matrix.python-version != '3.7') uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -45,7 +47,7 @@ jobs: python -m pip install --upgrade pip - name: Installing pytorch for macos - if: ${{ matrix.os == 'macos-11' || matrix.os == 'macos-latest' }} + if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-latest' }} run: | python -m pip install torch torchvision torchaudio @@ -149,7 +151,7 @@ jobs: python scripts/get_data.py download_data --file_name rl_data.zip --target_dir tests/.data/rl - name: Install Lightgbm for MacOS - if: ${{ matrix.os == 'macos-11' || matrix.os == 'macos-latest' }} + if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-latest' }} run: | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Microsoft/qlib/main/.github/brew_install.sh)" HOMEBREW_NO_AUTO_UPDATE=1 brew install lightgbm @@ -161,16 +163,11 @@ jobs: # Run after data downloads - name: Check Qlib ipynb with nbconvert - # Running the nbconvert check on a macos-11 system results in a "Kernel died" error, so we've temporarily disabled macos-11 here. - if: ${{ matrix.os != 'macos-11' }} run: | # add more ipynb files in future jupyter nbconvert --to notebook --execute examples/workflow_by_code.ipynb - name: Test workflow by config (install from source) - # On macos-11 system, it will lead to "Segmentation fault: 11" error, - # which may be caused by the excessive memory overhead of macos-11 system, so we disable macos-11 temporarily here. - if: ${{ matrix.os != 'macos-11' }} run: | python -m pip install numba python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml diff --git a/.github/workflows/test_qlib_from_source_slow.yml b/.github/workflows/test_qlib_from_source_slow.yml index 3401ea3fd0..350d64c047 100644 --- a/.github/workflows/test_qlib_from_source_slow.yml +++ b/.github/workflows/test_qlib_from_source_slow.yml @@ -16,8 +16,10 @@ jobs: matrix: # Since macos-latest changed from 12.7.4 to 14.4.1, # the minimum python version that matches a 14.4.1 version of macos is 3.10, - # so we limit the macos version to macos-12. - os: [windows-latest, ubuntu-20.04, ubuntu-22.04, macos-12] + # If you want to use python 3.7 in github action, then the latest macos system version is macos-13, + # after macos-13 python 3.7 is no longer supported. + # so we limit the macos version to macos-13. + os: [windows-latest, ubuntu-20.04, ubuntu-22.04, macos-13] # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 python-version: [3.7, 3.8] @@ -29,13 +31,13 @@ jobs: # So we make the version number of python 3.7 for MacOS more specific. # refs: https://github.com/actions/setup-python/issues/682 - name: Set up Python ${{ matrix.python-version }} - if: (matrix.os == 'macos-latest' && matrix.python-version == '3.7') || (matrix.os == 'macos-11' && matrix.python-version == '3.7') + if: (matrix.os == 'macos-latest' && matrix.python-version == '3.7') || (matrix.os == 'macos-13' && matrix.python-version == '3.7') uses: actions/setup-python@v4 with: python-version: "3.7.16" - name: Set up Python ${{ matrix.python-version }} - if: (matrix.os != 'macos-latest' || matrix.python-version != '3.7') && (matrix.os != 'macos-11' || matrix.python-version != '3.7') + if: (matrix.os != 'macos-latest' || matrix.python-version != '3.7') && (matrix.os != 'macos-13' || matrix.python-version != '3.7') uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -51,7 +53,7 @@ jobs: python scripts/get_data.py qlib_data --name qlib_data_simple --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn - name: Install Lightgbm for MacOS - if: ${{ matrix.os == 'macos-11' || matrix.os == 'macos-latest' }} + if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-latest' }} run: | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Microsoft/qlib/main/.github/brew_install.sh)" HOMEBREW_NO_AUTO_UPDATE=1 brew install lightgbm diff --git a/README.md b/README.md index d79aa24cdf..c23c533bcb 100644 --- a/README.md +++ b/README.md @@ -152,11 +152,11 @@ Here is a quick **[demo](https://terminalizer.com/view/3f24561a4470)** shows how ## Installation This table demonstrates the supported Python version of `Qlib`: -| | install with pip | install from source | plot | -| ------------- |:---------------------:|:--------------------:|:----:| +| | install with pip | install from source | plot | +| ------------- |:---------------------:|:--------------------:|:------------------:| | Python 3.7 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | Python 3.8 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| Python 3.9 | :x: | :heavy_check_mark: | :x: | +| Python 3.9 | :x: | :heavy_check_mark: | :x: | **Note**: 1. **Conda** is suggested for managing your Python environment. In some cases, using Python outside of a `conda` environment may result in missing header files, causing the installation failure of certain packages.