From 8f16f6b0bdc6be22d6d4c8368c73a67db1a5b10a Mon Sep 17 00:00:00 2001 From: Linlang Date: Tue, 17 Dec 2024 11:48:04 +0800 Subject: [PATCH 001/104] update publish.yaml --- .github/workflows/python-publish.yml | 32 +++-- .github/workflows/test_qlib_from_pip.yml | 74 ----------- .github/workflows/test_qlib_from_source.yml | 116 ------------------ .../workflows/test_qlib_from_source_slow.yml | 61 --------- 4 files changed, 14 insertions(+), 269 deletions(-) delete mode 100644 .github/workflows/test_qlib_from_pip.yml delete mode 100644 .github/workflows/test_qlib_from_source.yml delete mode 100644 .github/workflows/test_qlib_from_source_slow.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index ef0aa98e48..08b83e8a41 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -4,23 +4,25 @@ name: Upload Python Package on: - release: - types: [published] + push: + branches: [ main ] + pull_request: + branches: [ main ] jobs: deploy_with_bdist_wheel: runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-latest, ubuntu-20.04, ubuntu-22.04, macos-13, macos-14, macos-latest] + os: [windows-latest, macos-13, macos-14, macos-latest] # 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.8", "3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -30,32 +32,26 @@ jobs: run: | make build - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} run: | - twine upload dist/* + ls dist deploy_with_manylinux: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Build wheel on Linux uses: RalfG/python-wheels-manylinux-build@v0.3.1-manylinux2010_x86_64 with: # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 - python-versions: 'cp37-cp37m cp38-cp38' + python-versions: 'cp38-cp38 cp39-cp39m cp310-cp310m cp311-cp311m cp312-cp312m' build-requirements: 'numpy cython' - - name: Set up Python - uses: actions/setup-python@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | pip install twine - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} run: | - twine upload dist/pyqlib-*-manylinux*.whl + ls dist diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml deleted file mode 100644 index 65e31131a8..0000000000 --- a/.github/workflows/test_qlib_from_pip.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: Test qlib from pip - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - timeout-minutes: 120 - - runs-on: ${{ matrix.os }} - strategy: - 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, - # 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] - - steps: - - name: Test qlib from pip - uses: actions/checkout@v3 - - # Since version 3.7 of python for MacOS is installed in CI, version 3.7.17, this version causes "_bz not found error". - # 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-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-13' || matrix.python-version != '3.7') - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Update pip to the latest version - run: | - python -m pip install --upgrade pip - - - name: Qlib installation test - run: | - # 2024-05-30 scs has released a new version: 3.2.4.post2, - # This will cause the CI to fail, so we have limited the version of scs for now. - python -m pip install "scs<=3.2.4" - python -m pip install pyqlib - - - name: Install Lightgbm for MacOS - 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 - # FIX MacOS error: Segmentation fault - # reference: https://github.com/microsoft/LightGBM/issues/4229 - wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb - brew unlink libomp - brew install libomp.rb - - - name: Downloads dependencies data - run: | - cd .. - python -m qlib.run.get_data qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn - cd qlib - - - name: Test workflow by config - 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 deleted file mode 100644 index 4dfa1f1cb2..0000000000 --- a/.github/workflows/test_qlib_from_source.yml +++ /dev/null @@ -1,116 +0,0 @@ -name: Test qlib from source - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - timeout-minutes: 180 - # we may retry for 3 times for `Unit tests with Pytest` - - runs-on: ${{ matrix.os }} - strategy: - 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, - # 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, macos-14, macos-latest] - # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - - steps: - - name: Test qlib from source - uses: actions/checkout@v3 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Update pip to the latest version - run: | - python -m pip install --upgrade pip - - - name: Installing pytorch for macos - if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14' || matrix.os == 'macos-latest' }} - run: | - python -m pip install torch torchvision torchaudio - - - name: Installing pytorch for ubuntu - if: ${{ matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04' }} - run: | - python -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu - - - name: Installing pytorch for windows - if: ${{ matrix.os == 'windows-latest' }} - run: | - python -m pip install torch torchvision torchaudio - - - name: Set up Python tools - run: | - make dev - - - name: Lint with Black - run: | - make black - - - name: Make html with sphinx - # Since read the docs builds on ubuntu 22.04, we only need to test that the build passes on ubuntu 22.04. - if: ${{ matrix.os == 'ubuntu-22.04' }} - run: | - make docs-gen - - - name: Check Qlib with pylint - run: | - make pylint - - - name: Check Qlib with flake8 - run: | - make flake8 - - - name: Check Qlib with mypy - run: | - make mypy - - - name: Check Qlib ipynb with nbqa - run: | - make nbqa - - - name: Test data downloads - run: | - python scripts/get_data.py qlib_data --name qlib_data_simple --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn - 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-13' || matrix.os == 'macos-14' || 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 - # FIX MacOS error: Segmentation fault - # reference: https://github.com/microsoft/LightGBM/issues/4229 - wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb - brew unlink libomp - brew install libomp.rb - - - name: Check Qlib ipynb with nbconvert - run: | - make nbconvert - - - name: Test workflow by config (install from source) - run: | - python -m pip install numba - python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml - - - name: Unit tests with Pytest - uses: nick-fields/retry@v2 - with: - timeout_minutes: 60 - max_attempts: 3 - command: | - cd tests - python -m pytest . -m "not slow" --durations=0 diff --git a/.github/workflows/test_qlib_from_source_slow.yml b/.github/workflows/test_qlib_from_source_slow.yml deleted file mode 100644 index d302fe3072..0000000000 --- a/.github/workflows/test_qlib_from_source_slow.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Test qlib from source slow - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - timeout-minutes: 720 - # we may retry for 3 times for `Unit tests with Pytest` - - runs-on: ${{ matrix.os }} - strategy: - 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, - # 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, macos-14, macos-latest] - # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - - steps: - - name: Test qlib from source slow - uses: actions/checkout@v3 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Set up Python tools - run: | - make dev - - - name: Downloads dependencies data - run: | - 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-13' || matrix.os == 'macos-14' || 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 - # FIX MacOS error: Segmentation fault - # reference: https://github.com/microsoft/LightGBM/issues/4229 - wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb - brew unlink libomp - brew install libomp.rb - - - name: Unit tests with Pytest - uses: nick-fields/retry@v2 - with: - timeout_minutes: 240 - max_attempts: 3 - command: | - cd tests - python -m pytest . -m "slow" --durations=0 From dbbcfef723fff95b284324736c07afbe3a1d3fde Mon Sep 17 00:00:00 2001 From: Linlang Date: Tue, 17 Dec 2024 14:46:58 +0800 Subject: [PATCH 002/104] fix manylinux error --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 08b83e8a41..c490ae7ee5 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -43,7 +43,7 @@ jobs: uses: RalfG/python-wheels-manylinux-build@v0.3.1-manylinux2010_x86_64 with: # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 - python-versions: 'cp38-cp38 cp39-cp39m cp310-cp310m cp311-cp311m cp312-cp312m' + python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' build-requirements: 'numpy cython' - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 From 9e4bdc21ac1fa25dd7a7899ef1778682c566b3b4 Mon Sep 17 00:00:00 2001 From: Linlang Date: Tue, 17 Dec 2024 15:02:42 +0800 Subject: [PATCH 003/104] fix manylinux error --- .github/workflows/python-publish.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index c490ae7ee5..46cd167699 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -49,6 +49,10 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: update gcc + run: | + yum install -y centos-release-scl + yum install -y devtoolset-8-gcc devtoolset-8-gcc-c++ - name: Install dependencies run: | pip install twine From 0de40d1f8f38e347f5841bd97c4cca4365bf9408 Mon Sep 17 00:00:00 2001 From: Linlang Date: Tue, 17 Dec 2024 15:19:04 +0800 Subject: [PATCH 004/104] fix manylinux error --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 46cd167699..0881ee719a 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -40,7 +40,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Build wheel on Linux - uses: RalfG/python-wheels-manylinux-build@v0.3.1-manylinux2010_x86_64 + uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_aarch64 with: # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' From b05d442f34f47aee592c74e792d239478a8e7356 Mon Sep 17 00:00:00 2001 From: Linlang Date: Tue, 17 Dec 2024 15:22:43 +0800 Subject: [PATCH 005/104] fix manylinux error --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 0881ee719a..2d67ff7b84 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -40,7 +40,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Build wheel on Linux - uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_aarch64 + uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 with: # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' From 7c9ef8db88380a716d30e0371b8ebc7b371ee6f0 Mon Sep 17 00:00:00 2001 From: Linlang Date: Tue, 17 Dec 2024 15:25:20 +0800 Subject: [PATCH 006/104] fix manylinux error --- .github/workflows/python-publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 2d67ff7b84..7f8226f87c 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -49,10 +49,10 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: update gcc - run: | - yum install -y centos-release-scl - yum install -y devtoolset-8-gcc devtoolset-8-gcc-c++ + # - name: update gcc + # run: | + # yum install -y centos-release-scl + # yum install -y devtoolset-8-gcc devtoolset-8-gcc-c++ - name: Install dependencies run: | pip install twine From 9b9accdd687b1565f061baa149b274fd18a898e2 Mon Sep 17 00:00:00 2001 From: Linlang Date: Tue, 17 Dec 2024 20:22:19 +0800 Subject: [PATCH 007/104] fix build error --- .github/workflows/python-publish.yml | 6 +--- setup.cfg | 3 -- setup.py | 41 ++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 8 deletions(-) delete mode 100644 setup.cfg create mode 100644 setup.py diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 7f8226f87c..46dd9b3882 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -49,13 +49,9 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - # - name: update gcc - # run: | - # yum install -y centos-release-scl - # yum install -y devtoolset-8-gcc devtoolset-8-gcc-c++ - name: Install dependencies run: | - pip install twine + python -m pip list - name: Build and publish run: | ls dist diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index b406f824c8..0000000000 --- a/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[metadata] -name = qlib -version = attr: qlib.__version__ diff --git a/setup.py b/setup.py new file mode 100644 index 0000000000..d9e338315c --- /dev/null +++ b/setup.py @@ -0,0 +1,41 @@ +from setuptools import setup, Extension +import numpy +import os + + +def read(rel_path: str) -> str: + here = os.path.abspath(os.path.dirname(__file__)) + with open(os.path.join(here, rel_path), encoding="utf-8") as fp: + return fp.read() + + +def get_version(rel_path: str) -> str: + for line in read(rel_path).splitlines(): + if line.startswith("__version__"): + delim = '"' if '"' in line else "'" + return line.split(delim)[1] + raise RuntimeError("Unable to find version string.") + + +NUMPY_INCLUDE = numpy.get_include() + +VERSION = get_version("qlib/__init__.py") + + +setup( + version=VERSION, + ext_modules=[ + Extension( + "qlib.data._libs.rolling", + ["qlib/data/_libs/rolling.pyx"], + language="c++", + include_dirs=[NUMPY_INCLUDE], + ), + Extension( + "qlib.data._libs.expanding", + ["qlib/data/_libs/expanding.pyx"], + language="c++", + include_dirs=[NUMPY_INCLUDE], + ), + ] +) From 7dec56876f466bafd39e2dff00436f84170b1a73 Mon Sep 17 00:00:00 2001 From: Linlang Date: Tue, 17 Dec 2024 20:41:53 +0800 Subject: [PATCH 008/104] fix build error --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 547625d53e..fc0be79dd0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,3 +90,6 @@ packages = [ [project.scripts] qrun = "qlib.workflow.cli:run" + +[tool.distutils.bdist_wheel] +universal = False From 5b0fb43f3159b7f140217aaa97aa3c5c112d77ff Mon Sep 17 00:00:00 2001 From: Linlang Date: Tue, 17 Dec 2024 20:50:44 +0800 Subject: [PATCH 009/104] fix build error --- setup.cfg | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 setup.cfg diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000000..27bb3f8cc3 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,6 @@ +[metadata] +name = qlib +version = attr: qlib.__version__ + +[bdist_wheel] +universal=1 From fa1a4ce8f9f5d83014ecfda9d001b506a188d8d2 Mon Sep 17 00:00:00 2001 From: Linlang Date: Tue, 17 Dec 2024 20:51:56 +0800 Subject: [PATCH 010/104] fix build error --- pyproject.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fc0be79dd0..547625d53e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,6 +90,3 @@ packages = [ [project.scripts] qrun = "qlib.workflow.cli:run" - -[tool.distutils.bdist_wheel] -universal = False From 4330975f4cb035c51bcd24af3b2bdfc976462713 Mon Sep 17 00:00:00 2001 From: Linlang Date: Tue, 17 Dec 2024 21:02:49 +0800 Subject: [PATCH 011/104] fix build error --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 27824a6d3d..ffdc4e3056 100644 --- a/Makefile +++ b/Makefile @@ -181,7 +181,7 @@ lint: black pylint flake8 mypy nbqa # Build the package. build: - python -m build + python -m build --wheel # Upload the package. upload: From a6e9d8b594d56b7ae301b4390a5baa9bda097639 Mon Sep 17 00:00:00 2001 From: Linlang Date: Tue, 17 Dec 2024 21:13:21 +0800 Subject: [PATCH 012/104] fix build error --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 27bb3f8cc3..3d2d467599 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,4 +3,4 @@ name = qlib version = attr: qlib.__version__ [bdist_wheel] -universal=1 +universal=0 From b43f8eac31b2feb5db1afec8a4d621fb154d2bd1 Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 14:33:33 +0800 Subject: [PATCH 013/104] test upload to testpypi --- .github/workflows/python-publish.yml | 10 ++++++++++ pyproject.toml | 1 + 2 files changed, 11 insertions(+) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 46dd9b3882..d498e118c4 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -32,8 +32,13 @@ jobs: run: | make build - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} run: | ls dist + twine check dist/*.whl + twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl deploy_with_manylinux: runs-on: ubuntu-latest @@ -53,5 +58,10 @@ jobs: run: | python -m pip list - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} run: | ls dist + twine check dist/*.whl + twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl diff --git a/pyproject.toml b/pyproject.toml index 547625d53e..bb8cb07f26 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ name = "pyqlib" dynamic = ["version"] description = "A Quantitative-research Platform" requires-python = ">=3.8.0" +readme = {file = "README.md", content-type = "text/markdown"} dependencies = [ "pyyaml", From 5a8ff65a3b331947468e26827380e40fcc24e8b2 Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 14:43:38 +0800 Subject: [PATCH 014/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index d498e118c4..3db940cf93 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -14,7 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-latest, macos-13, macos-14, macos-latest] + os: [windows-latest, macos-13, macos-latest] # 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.8", "3.9", "3.10", "3.11", "3.12"] @@ -56,6 +56,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | + python -m pip install twine python -m pip list - name: Build and publish env: From a6646dac3ea93a1ab230bf01b1f2869eed124a4a Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 14:52:40 +0800 Subject: [PATCH 015/104] fix upload to testpypi error --- qlib/__init__.py | 2 +- setup.cfg | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) delete mode 100644 setup.cfg diff --git a/qlib/__init__.py b/qlib/__init__.py index db45762b86..98e3a3a915 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. from pathlib import Path -__version__ = "0.9.5.99" +__version__ = "0.9.5" __version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version import os from typing import Union diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 3d2d467599..0000000000 --- a/setup.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[metadata] -name = qlib -version = attr: qlib.__version__ - -[bdist_wheel] -universal=0 From a6164092a9585bb162e32554175f49a8cf32ce9e Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 17:10:05 +0800 Subject: [PATCH 016/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 7 ++++--- qlib/__init__.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 3db940cf93..9a051f70ed 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -15,9 +15,10 @@ jobs: strategy: matrix: os: [windows-latest, macos-13, macos-latest] - # 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.8", "3.9", "3.10", "3.11", "3.12"] + exclude: + - os: macos-13 + python-version: ["3.11", "3.12"] steps: - uses: actions/checkout@v3 @@ -65,4 +66,4 @@ jobs: run: | ls dist twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl + twine upload --repository-url https://test.pypi.org/legacy/ dist/pyqlib-*-linux*.whl diff --git a/qlib/__init__.py b/qlib/__init__.py index 98e3a3a915..4b9c3bfb0d 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. from pathlib import Path -__version__ = "0.9.5" +__version__ = "0.9.5.98" __version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version import os from typing import Union From 0cafe3e12ef91a772549deea7be8b7f85d21886d Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 17:21:59 +0800 Subject: [PATCH 017/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 9a051f70ed..2bec337c06 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -15,10 +15,14 @@ jobs: strategy: matrix: os: [windows-latest, macos-13, macos-latest] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - exclude: + python-version: [] + include: + - os: windows-latest + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + - os: macos-latest + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - os: macos-13 - python-version: ["3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v3 @@ -66,4 +70,4 @@ jobs: run: | ls dist twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/pyqlib-*-linux*.whl + twine upload --repository-url https://test.pypi.org/legacy/ dist/pyqlib-*-manylinux*.whl From 625d119f644a3ebaa7ffd3d293050c8f1e7e6c5f Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 17:25:44 +0800 Subject: [PATCH 018/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 63 ++++++++++++++-------------- qlib/__init__.py | 2 +- 2 files changed, 32 insertions(+), 33 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 2bec337c06..b9e71b7554 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -11,39 +11,38 @@ on: jobs: deploy_with_bdist_wheel: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest, macos-13, macos-latest] - python-version: [] - include: - - os: windows-latest - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - - os: macos-latest - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - - os: macos-13 - python-version: ["3.8", "3.9", "3.10"] + includes_only: + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: windows-latest + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + - os: macos-latest + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + - os: macos-13 + python-version: ["3.8", "3.9", "3.10"] - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - make dev - - name: Build wheel on ${{ matrix.os }} - run: | - make build - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} - run: | - ls dist - twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + make dev + - name: Build wheel on ${{ matrix.os }} + run: | + make build + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + run: | + ls dist + twine check dist/*.whl + twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl deploy_with_manylinux: runs-on: ubuntu-latest diff --git a/qlib/__init__.py b/qlib/__init__.py index 4b9c3bfb0d..92d9be50ef 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. from pathlib import Path -__version__ = "0.9.5.98" +__version__ = "0.9.5.97" __version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version import os from typing import Union From a8f3d382f87e61364ff246f694e7ae4a542697a1 Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 17:29:47 +0800 Subject: [PATCH 019/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 61 ++++++++++++++-------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index b9e71b7554..8ff6e6e79e 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -11,38 +11,37 @@ on: jobs: deploy_with_bdist_wheel: - includes_only: - runs-on: ${{ matrix.os }} - strategy: - matrix: - include: - - os: windows-latest - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - - os: macos-latest - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - - os: macos-13 - python-version: ["3.8", "3.9", "3.10"] + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest, macos-13, macos-latest] + python-version: ["3.8", "3.9", "3.10"] + include: + - os: windows-latest + python-version: ["3.11", "3.12"] + - os: macos-latest + python-version: ["3.11", "3.12"] - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - make dev - - name: Build wheel on ${{ matrix.os }} - run: | - make build - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} - run: | - ls dist - twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + make dev + - name: Build wheel on ${{ matrix.os }} + run: | + make build + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + run: | + ls dist + twine check dist/*.whl + twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl deploy_with_manylinux: runs-on: ubuntu-latest From bb6acaf9321c079113a91c48a9e2fc08545d1385 Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 17:32:47 +0800 Subject: [PATCH 020/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 8ff6e6e79e..9cef059315 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -18,9 +18,13 @@ jobs: python-version: ["3.8", "3.9", "3.10"] include: - os: windows-latest - python-version: ["3.11", "3.12"] + python-version: "3.11" + - os: windows-latest + python-version: "3.12" + - os: macos-latest + python-version: "3.11" - os: macos-latest - python-version: ["3.11", "3.12"] + python-version: "3.12" steps: - uses: actions/checkout@v3 From 624adb40a9cd75c80578b57ccd5b0fe0f539026f Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 19:28:41 +0800 Subject: [PATCH 021/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 72 ++++++++++++++-------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 9cef059315..f77fdfb4ba 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -10,42 +10,42 @@ on: branches: [ main ] jobs: - deploy_with_bdist_wheel: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest, macos-13, macos-latest] - python-version: ["3.8", "3.9", "3.10"] - include: - - os: windows-latest - python-version: "3.11" - - os: windows-latest - python-version: "3.12" - - os: macos-latest - python-version: "3.11" - - os: macos-latest - python-version: "3.12" + # deploy_with_bdist_wheel: + # runs-on: ${{ matrix.os }} + # strategy: + # matrix: + # os: [windows-latest, macos-13, macos-latest] + # python-version: ["3.8", "3.9", "3.10"] + # include: + # - os: windows-latest + # python-version: "3.11" + # - os: windows-latest + # python-version: "3.12" + # - os: macos-latest + # python-version: "3.11" + # - os: macos-latest + # python-version: "3.12" - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - make dev - - name: Build wheel on ${{ matrix.os }} - run: | - make build - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} - run: | - ls dist - twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl + # steps: + # - uses: actions/checkout@v3 + # - name: Set up Python ${{ matrix.python-version }} + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ matrix.python-version }} + # - name: Install dependencies + # run: | + # make dev + # - name: Build wheel on ${{ matrix.os }} + # run: | + # make build + # - name: Build and publish + # env: + # TWINE_USERNAME: __token__ + # TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + # run: | + # ls dist + # twine check dist/*.whl + # twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl deploy_with_manylinux: runs-on: ubuntu-latest @@ -57,6 +57,8 @@ jobs: # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' build-requirements: 'numpy cython' + package-path: 'qlib' + pre-build-command: 'make dev && make build' - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: From c243557c13ba65f88d2c2699ea4630fc4301db18 Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 19:30:26 +0800 Subject: [PATCH 022/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index f77fdfb4ba..86b826cf8a 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -58,7 +58,7 @@ jobs: python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' build-requirements: 'numpy cython' package-path: 'qlib' - pre-build-command: 'make dev && make build' + pre-build-command: 'python -m pip install -e . && python -m build --wheel' - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: From 666c8d541d064f136648e7b3464f6bde2a04e5db Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 19:42:49 +0800 Subject: [PATCH 023/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 86b826cf8a..51e6a22a34 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -51,6 +51,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} - name: Build wheel on Linux uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 with: @@ -58,11 +62,11 @@ jobs: python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' build-requirements: 'numpy cython' package-path: 'qlib' - pre-build-command: 'python -m pip install -e . && python -m build --wheel' - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} + pre-build-command: | + python -m ensurepip --upgrade + python -m pip install --upgrade pip + python -m pip install -e . + python -m build --wheel - name: Install dependencies run: | python -m pip install twine From a0236654dfbca1a5642ccd0d0a51a5e517657edc Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 19:44:50 +0800 Subject: [PATCH 024/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 51e6a22a34..96d64897a1 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -63,7 +63,6 @@ jobs: build-requirements: 'numpy cython' package-path: 'qlib' pre-build-command: | - python -m ensurepip --upgrade python -m pip install --upgrade pip python -m pip install -e . python -m build --wheel From d592bfdea1cc9fb89b0b7904477296c88003be3d Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 19:51:41 +0800 Subject: [PATCH 025/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 96d64897a1..fb95347a6a 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -61,8 +61,11 @@ jobs: # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' build-requirements: 'numpy cython' + system-packages: 'python' package-path: 'qlib' pre-build-command: | + which python + which pip python -m pip install --upgrade pip python -m pip install -e . python -m build --wheel From 44b674ce05685f3c4166f3201c6175483ad3f709 Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 19:54:11 +0800 Subject: [PATCH 026/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index fb95347a6a..33c1d84479 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -61,7 +61,7 @@ jobs: # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' build-requirements: 'numpy cython' - system-packages: 'python' + system-packages: 'python pip' package-path: 'qlib' pre-build-command: | which python From df391f0569de4232d4afcf8ab9eea8da51466d2d Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 19:58:05 +0800 Subject: [PATCH 027/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 33c1d84479..8ee5bea8ff 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -56,19 +56,11 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Build wheel on Linux - uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 + uses: RalfG/python-wheels-manylinux-build@v0.7.0-manylinux2010_x86_64 with: # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' build-requirements: 'numpy cython' - system-packages: 'python pip' - package-path: 'qlib' - pre-build-command: | - which python - which pip - python -m pip install --upgrade pip - python -m pip install -e . - python -m build --wheel - name: Install dependencies run: | python -m pip install twine From 687a2b209ae31ccd71c12a619046b438e851d8ac Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 20:06:41 +0800 Subject: [PATCH 028/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 8ee5bea8ff..2e76b8249a 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -56,7 +56,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Build wheel on Linux - uses: RalfG/python-wheels-manylinux-build@v0.7.0-manylinux2010_x86_64 + uses: RalfG/python-wheels-manylinux-build@v0.7.0-manylinux2014_x86_64 with: # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' From 34908c88460b204e6bae4f3185344d5160243723 Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 20:13:10 +0800 Subject: [PATCH 029/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 2e76b8249a..0750a6c919 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -56,11 +56,12 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Build wheel on Linux - uses: RalfG/python-wheels-manylinux-build@v0.7.0-manylinux2014_x86_64 + uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 with: # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' build-requirements: 'numpy cython' + pre-build-command: 'sudo apt install gcc-12 g++-12 -y' - name: Install dependencies run: | python -m pip install twine From 8aaa75daa46d879360844989760b85faf445c8f1 Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 20:15:27 +0800 Subject: [PATCH 030/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 0750a6c919..813a571c9a 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -61,7 +61,7 @@ jobs: # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' build-requirements: 'numpy cython' - pre-build-command: 'sudo apt install gcc-12 g++-12 -y' + pre-build-command: 'apt install gcc-12 g++-12 -y' - name: Install dependencies run: | python -m pip install twine From 808ef6b95ee54c5c0e7795c79609c1aea7f0a248 Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 20:41:47 +0800 Subject: [PATCH 031/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 83 +++++++++++++++++++--------- 1 file changed, 58 insertions(+), 25 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 813a571c9a..08cef1a1ba 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -47,30 +47,63 @@ jobs: # twine check dist/*.whl # twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl + # deploy_with_manylinux: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + # - name: Set up Python ${{ matrix.python-version }} + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ matrix.python-version }} + # - name: Build wheel on Linux + # uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 + # with: + # # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 + # python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' + # build-requirements: 'numpy cython' + # pre-build-command: 'apt install gcc-12 g++-12 -y' + # - name: Install dependencies + # run: | + # python -m pip install twine + # python -m pip list + # - name: Build and publish + # env: + # TWINE_USERNAME: __token__ + # TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + # run: | + # ls dist + # twine check dist/*.whl + # twine upload --repository-url https://test.pypi.org/legacy/ dist/pyqlib-*-manylinux*.whl + deploy_with_manylinux: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Build wheel on Linux - uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 - with: - # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 - python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' - build-requirements: 'numpy cython' - pre-build-command: 'apt install gcc-12 g++-12 -y' - - name: Install dependencies - run: | - python -m pip install twine - python -m pip list - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} - run: | - ls dist - twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/pyqlib-*-manylinux*.whl + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install cibuildwheel + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel + + - name: Build wheel + run: | + python -m cibuildwheel --output-dir dist + + - name: Upload wheel + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + run: | + ls dist + twine check dist/*.whl + twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl From 86b4d4c7079774a8044237d91bf230203b655840 Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 20:44:02 +0800 Subject: [PATCH 032/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 46 ++++++++++++++-------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 08cef1a1ba..4ed099f2ca 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -81,29 +81,29 @@ jobs: matrix: python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - steps: - - name: Checkout repo - uses: actions/checkout@v3 + steps: + - name: Checkout repo + uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install cibuildwheel + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel - - name: Install cibuildwheel - run: | - python -m pip install --upgrade pip - python -m pip install cibuildwheel - - - name: Build wheel - run: | - python -m cibuildwheel --output-dir dist + - name: Build wheel + run: | + python -m cibuildwheel --output-dir dist - - name: Upload wheel - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} - run: | - ls dist - twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl + - name: Upload wheel + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + run: | + ls dist + twine check dist/*.whl + twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl From 6a0bc50386489989a59955b47ded4035f6e2e94c Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 20:52:07 +0800 Subject: [PATCH 033/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 4ed099f2ca..09061dafbb 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -83,10 +83,10 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v5 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} From 303e62445bd88a08e84ddcdeee7a33bca5ae5009 Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 20:54:43 +0800 Subject: [PATCH 034/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 09061dafbb..4198a6d875 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -83,7 +83,7 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v5 + uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 From 1aa61a6735528410b3dca3f09f54c5ad672bfd2c Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 21:09:59 +0800 Subject: [PATCH 035/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 4198a6d875..307c008c29 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -85,19 +85,22 @@ jobs: - name: Checkout repo uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} + # - name: Set up Python ${{ matrix.python-version }} + # uses: actions/setup-python@v5 + # with: + # python-version: ${{ matrix.python-version }} - - name: Install cibuildwheel - run: | - python -m pip install --upgrade pip - python -m pip install cibuildwheel - + # - name: Install cibuildwheel + # run: | + # python -m pip install --upgrade pip + # python -m pip install cibuildwheel + + # - name: Build wheel + # run: | + # python -m cibuildwheel --output-dir dist + - name: Build wheel - run: | - python -m cibuildwheel --output-dir dist + uses: pypa/cibuildwheel@v0.22.0 - name: Upload wheel env: From cc4ac5d4d787e5cbf4fd94b7d2d3aa3c3b9a8660 Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 21:13:18 +0800 Subject: [PATCH 036/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 6 +++--- qlib/__init__.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 307c008c29..3930f22492 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -75,11 +75,11 @@ jobs: # twine check dist/*.whl # twine upload --repository-url https://test.pypi.org/legacy/ dist/pyqlib-*-manylinux*.whl - deploy_with_manylinux: - runs-on: ubuntu-latest + build_wheels: + runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + os: [windows-latest, ubuntu-latest, macos-13, macos-latest] steps: - name: Checkout repo diff --git a/qlib/__init__.py b/qlib/__init__.py index 92d9be50ef..4dbd8f56fb 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. from pathlib import Path -__version__ = "0.9.5.97" +__version__ = "0.9.5.96" __version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version import os from typing import Union From ea9ef1343cc7e3ed4e1e65bdc4f931e74c21c386 Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 21:15:59 +0800 Subject: [PATCH 037/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 48 ++++++++++++++-------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 3930f22492..19070c48e4 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -82,31 +82,31 @@ jobs: os: [windows-latest, ubuntu-latest, macos-13, macos-latest] steps: - - name: Checkout repo - uses: actions/checkout@v4 + - name: Checkout repo + uses: actions/checkout@v4 - # - name: Set up Python ${{ matrix.python-version }} - # uses: actions/setup-python@v5 - # with: - # python-version: ${{ matrix.python-version }} - - # - name: Install cibuildwheel - # run: | - # python -m pip install --upgrade pip - # python -m pip install cibuildwheel + # - name: Set up Python ${{ matrix.python-version }} + # uses: actions/setup-python@v5 + # with: + # python-version: ${{ matrix.python-version }} + + # - name: Install cibuildwheel + # run: | + # python -m pip install --upgrade pip + # python -m pip install cibuildwheel - # - name: Build wheel - # run: | - # python -m cibuildwheel --output-dir dist + # - name: Build wheel + # run: | + # python -m cibuildwheel --output-dir dist - - name: Build wheel - uses: pypa/cibuildwheel@v0.22.0 + - name: Build wheel + uses: pypa/cibuildwheel@v0.22.0 - - name: Upload wheel - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} - run: | - ls dist - twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl + - name: Upload wheel + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + run: | + ls dist + twine check dist/*.whl + twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl From 07a8d72d508e701a26c97105b53a0be7e9b9661c Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 21:21:29 +0800 Subject: [PATCH 038/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 52 +++++++++++++++------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 19070c48e4..ed32e5584d 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -82,31 +82,35 @@ jobs: os: [windows-latest, ubuntu-latest, macos-13, macos-latest] steps: - - name: Checkout repo - uses: actions/checkout@v4 + - name: Checkout repo + uses: actions/checkout@v4 - # - name: Set up Python ${{ matrix.python-version }} - # uses: actions/setup-python@v5 - # with: - # python-version: ${{ matrix.python-version }} - - # - name: Install cibuildwheel - # run: | - # python -m pip install --upgrade pip - # python -m pip install cibuildwheel + # - name: Set up Python ${{ matrix.python-version }} + # uses: actions/setup-python@v5 + # with: + # python-version: ${{ matrix.python-version }} + + # - name: Install cibuildwheel + # run: | + # python -m pip install --upgrade pip + # python -m pip install cibuildwheel - # - name: Build wheel - # run: | - # python -m cibuildwheel --output-dir dist + # - name: Build wheel + # run: | + # python -m cibuildwheel --output-dir dist - - name: Build wheel - uses: pypa/cibuildwheel@v0.22.0 + - name: Build wheel + uses: pypa/cibuildwheel@v0.22.0 + with: + package-dir: qlib + output-dir: dist + config-file: "pyproject.toml" - - name: Upload wheel - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} - run: | - ls dist - twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl + - name: Upload wheel + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + run: | + ls dist + twine check dist/*.whl + twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl From 1239a68edc6f24e8b0915b86d04a4829b5530f6f Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 21:26:43 +0800 Subject: [PATCH 039/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index ed32e5584d..5628742178 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -100,7 +100,7 @@ jobs: # python -m cibuildwheel --output-dir dist - name: Build wheel - uses: pypa/cibuildwheel@v0.22.0 + uses: pypa/cibuildwheel@v2.22.0 with: package-dir: qlib output-dir: dist From bac5642d690f67e5381af98a51ae54bd33eed7d8 Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 21:27:57 +0800 Subject: [PATCH 040/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 5628742178..dbed75e820 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -102,7 +102,7 @@ jobs: - name: Build wheel uses: pypa/cibuildwheel@v2.22.0 with: - package-dir: qlib + package-dir: . output-dir: dist config-file: "pyproject.toml" From 10f43b8f01bb82350f030b6b272ba640ae8b6e21 Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 21:48:28 +0800 Subject: [PATCH 041/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 140 ++++++++++++++------------- 1 file changed, 72 insertions(+), 68 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index dbed75e820..0a65d8be12 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -10,42 +10,46 @@ on: branches: [ main ] jobs: - # deploy_with_bdist_wheel: - # runs-on: ${{ matrix.os }} - # strategy: - # matrix: - # os: [windows-latest, macos-13, macos-latest] - # python-version: ["3.8", "3.9", "3.10"] - # include: - # - os: windows-latest - # python-version: "3.11" - # - os: windows-latest - # python-version: "3.12" - # - os: macos-latest - # python-version: "3.11" - # - os: macos-latest - # python-version: "3.12" + deploy_with_bdist_wheel: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest, ubuntu-20.04, ubuntu-22.04, macos-13, macos-latest] + python-version: ["3.8", "3.9", "3.10"] + include: + - os: windows-latest + python-version: "3.11" + - os: windows-latest + python-version: "3.12" + - os: macos-latest + python-version: "3.11" + - os: macos-latest + python-version: "3.12" + - os: ubuntu-20.04 + python-version: "3.11" + - os: ubuntu-22.04 + python-version: "3.12" - # steps: - # - uses: actions/checkout@v3 - # - name: Set up Python ${{ matrix.python-version }} - # uses: actions/setup-python@v4 - # with: - # python-version: ${{ matrix.python-version }} - # - name: Install dependencies - # run: | - # make dev - # - name: Build wheel on ${{ matrix.os }} - # run: | - # make build - # - name: Build and publish - # env: - # TWINE_USERNAME: __token__ - # TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} - # run: | - # ls dist - # twine check dist/*.whl - # twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + make dev + - name: Build wheel on ${{ matrix.os }} + run: | + make build + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + run: | + ls dist + twine check dist/*.whl + twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl # deploy_with_manylinux: # runs-on: ubuntu-latest @@ -75,42 +79,42 @@ jobs: # twine check dist/*.whl # twine upload --repository-url https://test.pypi.org/legacy/ dist/pyqlib-*-manylinux*.whl - build_wheels: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest, ubuntu-latest, macos-13, macos-latest] + # build_wheels: + # runs-on: ${{ matrix.os }} + # strategy: + # matrix: + # os: [windows-latest, ubuntu-latest, macos-13, macos-latest] - steps: - - name: Checkout repo - uses: actions/checkout@v4 + # steps: + # - name: Checkout repo + # uses: actions/checkout@v4 - # - name: Set up Python ${{ matrix.python-version }} - # uses: actions/setup-python@v5 - # with: - # python-version: ${{ matrix.python-version }} + # # - name: Set up Python ${{ matrix.python-version }} + # # uses: actions/setup-python@v5 + # # with: + # # python-version: ${{ matrix.python-version }} - # - name: Install cibuildwheel - # run: | - # python -m pip install --upgrade pip - # python -m pip install cibuildwheel + # # - name: Install cibuildwheel + # # run: | + # # python -m pip install --upgrade pip + # # python -m pip install cibuildwheel - # - name: Build wheel - # run: | - # python -m cibuildwheel --output-dir dist + # # - name: Build wheel + # # run: | + # # python -m cibuildwheel --output-dir dist - - name: Build wheel - uses: pypa/cibuildwheel@v2.22.0 - with: - package-dir: . - output-dir: dist - config-file: "pyproject.toml" + # - name: Build wheel + # uses: pypa/cibuildwheel@v2.22.0 + # with: + # package-dir: . + # output-dir: dist + # config-file: "pyproject.toml" - - name: Upload wheel - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} - run: | - ls dist - twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl + # - name: Upload wheel + # env: + # TWINE_USERNAME: __token__ + # TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + # run: | + # ls dist + # twine check dist/*.whl + # twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl From e82f225dc4b0663fea8abe0843707a2ea92e82a5 Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 21:54:40 +0800 Subject: [PATCH 042/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 0a65d8be12..f4010a06ed 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -14,20 +14,12 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-latest, ubuntu-20.04, ubuntu-22.04, macos-13, macos-latest] - python-version: ["3.8", "3.9", "3.10"] - include: - - os: windows-latest + os: [windows-latest, ubuntu-22.04, macos-13, macos-latest] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + exclude: + - os: macos-13 python-version: "3.11" - - os: windows-latest - python-version: "3.12" - - os: macos-latest - python-version: "3.11" - - os: macos-latest - python-version: "3.12" - - os: ubuntu-20.04 - python-version: "3.11" - - os: ubuntu-22.04 + - os: macos-13 python-version: "3.12" steps: From deffd9749f656b375bf8f6c861be5209e2d48c9c Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 21:55:12 +0800 Subject: [PATCH 043/104] fix upload to testpypi error --- qlib/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qlib/__init__.py b/qlib/__init__.py index 4dbd8f56fb..782f463359 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. from pathlib import Path -__version__ = "0.9.5.96" +__version__ = "0.9.5.95" __version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version import os from typing import Union From c7d3f1f7298d2962642cae4860df2ce7614871fd Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 22:02:44 +0800 Subject: [PATCH 044/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index f4010a06ed..3439e21e02 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -41,7 +41,7 @@ jobs: run: | ls dist twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl + twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose # deploy_with_manylinux: # runs-on: ubuntu-latest From b91d0fa07632f6c968871df07145ce486778b27f Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 22:03:35 +0800 Subject: [PATCH 045/104] fix upload to testpypi error --- qlib/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qlib/__init__.py b/qlib/__init__.py index 782f463359..87954a4b65 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. from pathlib import Path -__version__ = "0.9.5.95" +__version__ = "0.9.5.94" __version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version import os from typing import Union From 276ee144e7301c4b1f8b14ce59a0ffc8c0aed7f2 Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 22:09:51 +0800 Subject: [PATCH 046/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 87 ++++++++++++++-------------- 1 file changed, 43 insertions(+), 44 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 3439e21e02..e99450a015 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -10,58 +10,30 @@ on: branches: [ main ] jobs: - deploy_with_bdist_wheel: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest, ubuntu-22.04, macos-13, macos-latest] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - exclude: - - os: macos-13 - python-version: "3.11" - - os: macos-13 - python-version: "3.12" - - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - make dev - - name: Build wheel on ${{ matrix.os }} - run: | - make build - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} - run: | - ls dist - twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose + # deploy_with_bdist_wheel: + # runs-on: ${{ matrix.os }} + # strategy: + # matrix: + # os: [windows-latest, ubuntu-22.04, macos-13, macos-latest] + # python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + # exclude: + # - os: macos-13 + # python-version: "3.11" + # - os: macos-13 + # python-version: "3.12" - # deploy_with_manylinux: - # runs-on: ubuntu-latest # steps: # - uses: actions/checkout@v3 # - name: Set up Python ${{ matrix.python-version }} # uses: actions/setup-python@v4 # with: # python-version: ${{ matrix.python-version }} - # - name: Build wheel on Linux - # uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 - # with: - # # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 - # python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' - # build-requirements: 'numpy cython' - # pre-build-command: 'apt install gcc-12 g++-12 -y' # - name: Install dependencies # run: | - # python -m pip install twine - # python -m pip list + # make dev + # - name: Build wheel on ${{ matrix.os }} + # run: | + # make build # - name: Build and publish # env: # TWINE_USERNAME: __token__ @@ -69,7 +41,34 @@ jobs: # run: | # ls dist # twine check dist/*.whl - # twine upload --repository-url https://test.pypi.org/legacy/ dist/pyqlib-*-manylinux*.whl + # twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose + + deploy_with_manylinux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Build wheel on Linux + uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 + with: + # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 + python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' + build-requirements: 'numpy cython' + - name: Install dependencies + run: | + python -m pip install twine + python -m pip list + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + run: | + ls dist + twine check dist/*.whl + twine upload --repository-url https://test.pypi.org/legacy/ dist/pyqlib-*-manylinux*.whl --verbose # build_wheels: # runs-on: ${{ matrix.os }} From 631fa338808cd10198a458a08ced69281620291f Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 22:21:07 +0800 Subject: [PATCH 047/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 62 ++++++++++++++-------------- qlib/__init__.py | 2 +- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index e99450a015..734655561d 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -10,38 +10,38 @@ on: branches: [ main ] jobs: - # deploy_with_bdist_wheel: - # runs-on: ${{ matrix.os }} - # strategy: - # matrix: - # os: [windows-latest, ubuntu-22.04, macos-13, macos-latest] - # python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - # exclude: - # - os: macos-13 - # python-version: "3.11" - # - os: macos-13 - # python-version: "3.12" + deploy_with_bdist_wheel: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest, ubuntu-22.04, macos-13, macos-latest] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + exclude: + - os: macos-13 + python-version: "3.11" + - os: macos-13 + python-version: "3.12" - # steps: - # - uses: actions/checkout@v3 - # - name: Set up Python ${{ matrix.python-version }} - # uses: actions/setup-python@v4 - # with: - # python-version: ${{ matrix.python-version }} - # - name: Install dependencies - # run: | - # make dev - # - name: Build wheel on ${{ matrix.os }} - # run: | - # make build - # - name: Build and publish - # env: - # TWINE_USERNAME: __token__ - # TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} - # run: | - # ls dist - # twine check dist/*.whl - # twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + make dev + - name: Build wheel on ${{ matrix.os }} + run: | + make build + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + run: | + ls dist + twine check dist/*.whl + twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose deploy_with_manylinux: runs-on: ubuntu-latest diff --git a/qlib/__init__.py b/qlib/__init__.py index 87954a4b65..deaa44e890 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. from pathlib import Path -__version__ = "0.9.5.94" +__version__ = "0.9.5.93" __version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version import os from typing import Union From 34a53033f170280541071f1013d788aa3fd600f1 Mon Sep 17 00:00:00 2001 From: Linlang Date: Wed, 18 Dec 2024 22:21:52 +0800 Subject: [PATCH 048/104] fix upload to testpypi error --- .github/workflows/python-publish.yml | 2 +- qlib/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 734655561d..c587d3f887 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -14,7 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-latest, ubuntu-22.04, macos-13, macos-latest] + os: [windows-latest, macos-13, macos-latest] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] exclude: - os: macos-13 diff --git a/qlib/__init__.py b/qlib/__init__.py index deaa44e890..a182f1bfd0 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. from pathlib import Path -__version__ = "0.9.5.93" +__version__ = "0.9.5.92" __version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version import os from typing import Union From 05a9f8cd309c371420d1b311a84e26e092b5336c Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 10:41:31 +0800 Subject: [PATCH 049/104] test pip install from testpypi --- .github/workflows/python-publish.yml | 6 +-- .github/workflows/test_qlib_from_pip.yml | 56 ++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/test_qlib_from_pip.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index c587d3f887..54be619ab9 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -4,10 +4,8 @@ name: Upload Python Package on: - push: - branches: [ main ] - pull_request: - branches: [ main ] + release: + types: [published] jobs: deploy_with_bdist_wheel: diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml new file mode 100644 index 0000000000..5f53f1d316 --- /dev/null +++ b/.github/workflows/test_qlib_from_pip.yml @@ -0,0 +1,56 @@ +name: Test qlib from pip + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + timeout-minutes: 120 + + runs-on: ${{ matrix.os }} + strategy: + 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, + # 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, macos-14, macos-latest] + # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - name: Test qlib from pip + uses: actions/checkout@v3 + + - name: Update pip to the latest version + run: | + python -m pip install --upgrade pip + + - name: Qlib installation test + run: | + python -m pip install --index-url https://test.pypi.org/simple/ pyqlib==0.9.5.92 + + - name: Install Lightgbm for MacOS + if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14' || 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 + # FIX MacOS error: Segmentation fault + # reference: https://github.com/microsoft/LightGBM/issues/4229 + wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb + brew unlink libomp + brew install libomp.rb + + - name: Downloads dependencies data + run: | + cd .. + python -m qlib.run.get_data qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn + cd qlib + + - name: Test workflow by config + run: | + qrun examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml From 6a4273c30009104fe37c2f83a1e29615ad6039e0 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 10:50:20 +0800 Subject: [PATCH 050/104] test pip install from testpypi --- .github/workflows/test_qlib_from_pip.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml index 5f53f1d316..6b386d85a6 100644 --- a/.github/workflows/test_qlib_from_pip.yml +++ b/.github/workflows/test_qlib_from_pip.yml @@ -32,7 +32,7 @@ jobs: - name: Qlib installation test run: | - python -m pip install --index-url https://test.pypi.org/simple/ pyqlib==0.9.5.92 + python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyqlib[dev]==0.9.5.92 - name: Install Lightgbm for MacOS if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14' || matrix.os == 'macos-latest' }} From 431b9c128175ccd6fc516b00e8e3f9825973d64d Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 12:29:15 +0800 Subject: [PATCH 051/104] fix macos package name error --- .github/workflows/python-publish.yml | 75 +++++++++++++----------- .github/workflows/test_qlib_from_pip.yml | 56 ------------------ qlib/__init__.py | 2 +- 3 files changed, 42 insertions(+), 91 deletions(-) delete mode 100644 .github/workflows/test_qlib_from_pip.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 54be619ab9..8dbd0ea9bd 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -4,21 +4,18 @@ name: Upload Python Package on: - release: - types: [published] + push: + branches: [ main ] + pull_request: + branches: [ main ] jobs: deploy_with_bdist_wheel: runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-latest, macos-13, macos-latest] + os: [windows-latest, macos-13, macos-14, macos-latest] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - exclude: - - os: macos-13 - python-version: "3.11" - - os: macos-13 - python-version: "3.12" steps: - uses: actions/checkout@v3 @@ -29,6 +26,16 @@ jobs: - name: Install dependencies run: | make dev + - name: Set MACOSX_DEPLOYMENT_TARGET + run: | + if [[ ${{ matrix.os }} == "macos-13" ]]; then + export MACOSX_DEPLOYMENT_TARGET=13.0 + elif [[ ${{ matrix.os }} == "macos-14" ]]; then + export MACOSX_DEPLOYMENT_TARGET=14.0 + else + export MACOSX_DEPLOYMENT_TARGET=15.0 # Default for macos-latest + fi + echo "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET" - name: Build wheel on ${{ matrix.os }} run: | make build @@ -41,32 +48,32 @@ jobs: twine check dist/*.whl twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose - deploy_with_manylinux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Build wheel on Linux - uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 - with: - # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 - python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' - build-requirements: 'numpy cython' - - name: Install dependencies - run: | - python -m pip install twine - python -m pip list - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} - run: | - ls dist - twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/pyqlib-*-manylinux*.whl --verbose + # deploy_with_manylinux: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + # - name: Set up Python ${{ matrix.python-version }} + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ matrix.python-version }} + # - name: Build wheel on Linux + # uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 + # with: + # # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 + # python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' + # build-requirements: 'numpy cython' + # - name: Install dependencies + # run: | + # python -m pip install twine + # python -m pip list + # - name: Build and publish + # env: + # TWINE_USERNAME: __token__ + # TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + # run: | + # ls dist + # twine check dist/*.whl + # twine upload --repository-url https://test.pypi.org/legacy/ dist/pyqlib-*-manylinux*.whl --verbose # build_wheels: # runs-on: ${{ matrix.os }} diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml deleted file mode 100644 index 6b386d85a6..0000000000 --- a/.github/workflows/test_qlib_from_pip.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Test qlib from pip - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - timeout-minutes: 120 - - runs-on: ${{ matrix.os }} - strategy: - 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, - # 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, macos-14, macos-latest] - # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - - steps: - - name: Test qlib from pip - uses: actions/checkout@v3 - - - name: Update pip to the latest version - run: | - python -m pip install --upgrade pip - - - name: Qlib installation test - run: | - python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyqlib[dev]==0.9.5.92 - - - name: Install Lightgbm for MacOS - if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14' || 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 - # FIX MacOS error: Segmentation fault - # reference: https://github.com/microsoft/LightGBM/issues/4229 - wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb - brew unlink libomp - brew install libomp.rb - - - name: Downloads dependencies data - run: | - cd .. - python -m qlib.run.get_data qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn - cd qlib - - - name: Test workflow by config - run: | - qrun examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml diff --git a/qlib/__init__.py b/qlib/__init__.py index a182f1bfd0..b2192f2060 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. from pathlib import Path -__version__ = "0.9.5.92" +__version__ = "0.9.5.91" __version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version import os from typing import Union From 5281d77fbb326d5c9b60d80537dec5824da9aa98 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 13:09:00 +0800 Subject: [PATCH 052/104] fix macos package name error --- .github/workflows/python-publish.yml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 8dbd0ea9bd..293e1cc913 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -26,27 +26,31 @@ jobs: - name: Install dependencies run: | make dev - - name: Set MACOSX_DEPLOYMENT_TARGET - run: | - if [[ ${{ matrix.os }} == "macos-13" ]]; then - export MACOSX_DEPLOYMENT_TARGET=13.0 - elif [[ ${{ matrix.os }} == "macos-14" ]]; then - export MACOSX_DEPLOYMENT_TARGET=14.0 - else - export MACOSX_DEPLOYMENT_TARGET=15.0 # Default for macos-latest - fi - echo "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET" - name: Build wheel on ${{ matrix.os }} run: | make build + - name: Rename macos filename + if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14' || matrix.os == 'macos-latest' }} + run: | + python -c " + from pathlib import Path + import subprocess + replaced = subprocess.run(['sw_vers', '-productVersion'], capture_output=True, text=True).stdout.strip().split('.', 1)[0] + '_0' + for whl_file in Path('./dist').glob('*.whl'): + parts = whl_file.name.split('_') + be_replaced = '_'.join(parts[1:3]) + new_name = whl_file.name.replace(be_replaced, replaced) + new_whl_file = whl_file.with_name(new_name) + whl_file.rename(new_whl_file) + print(f'Renamed: {whl_file} -> {new_whl_file}') + " - name: Build and publish env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} run: | - ls dist twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose + # twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose # deploy_with_manylinux: # runs-on: ubuntu-latest From 8e1c7d395bae0e05a34780d6eaabe9797522f2d7 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 13:37:58 +0800 Subject: [PATCH 053/104] fix macos package name error --- .github/workflows/python-publish.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 293e1cc913..3236efd361 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -14,7 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-latest, macos-13, macos-14, macos-latest] + os: [windows-latest, macos-13, macos-latest] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: @@ -35,13 +35,14 @@ jobs: python -c " from pathlib import Path import subprocess + import shutil replaced = subprocess.run(['sw_vers', '-productVersion'], capture_output=True, text=True).stdout.strip().split('.', 1)[0] + '_0' for whl_file in Path('./dist').glob('*.whl'): parts = whl_file.name.split('_') be_replaced = '_'.join(parts[1:3]) new_name = whl_file.name.replace(be_replaced, replaced) - new_whl_file = whl_file.with_name(new_name) - whl_file.rename(new_whl_file) + new_whl_file = whl_file.resolve().parent.joinpath(whl_file.with_name(new_name)) + shutil.copy(whl_file.resolve(), new_whl_file) print(f'Renamed: {whl_file} -> {new_whl_file}') " - name: Build and publish From f4bcbe3a0a18aa1382041ef4471a137087e326d5 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 13:47:33 +0800 Subject: [PATCH 054/104] fix macos package name error --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 3236efd361..287f7db214 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -41,7 +41,7 @@ jobs: parts = whl_file.name.split('_') be_replaced = '_'.join(parts[1:3]) new_name = whl_file.name.replace(be_replaced, replaced) - new_whl_file = whl_file.resolve().parent.joinpath(whl_file.with_name(new_name)) + new_whl_file = whl_file.resolve().parent.parent.joinpath(whl_file.with_name(new_name)) shutil.copy(whl_file.resolve(), new_whl_file) print(f'Renamed: {whl_file} -> {new_whl_file}') " From 351eea1f785716bf7b95ed8df712ec26d374e773 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 13:59:08 +0800 Subject: [PATCH 055/104] fix macos package name error --- .github/workflows/python-publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 287f7db214..eda4b6de43 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -35,16 +35,16 @@ jobs: python -c " from pathlib import Path import subprocess - import shutil replaced = subprocess.run(['sw_vers', '-productVersion'], capture_output=True, text=True).stdout.strip().split('.', 1)[0] + '_0' for whl_file in Path('./dist').glob('*.whl'): parts = whl_file.name.split('_') be_replaced = '_'.join(parts[1:3]) new_name = whl_file.name.replace(be_replaced, replaced) - new_whl_file = whl_file.resolve().parent.parent.joinpath(whl_file.with_name(new_name)) - shutil.copy(whl_file.resolve(), new_whl_file) + new_whl_file = whl_file.with_name(new_name) + whl_file.rename(new_whl_file) print(f'Renamed: {whl_file} -> {new_whl_file}') " + make build - name: Build and publish env: TWINE_USERNAME: __token__ From b5120745679f52fcfbe10a865a66b8b751a07de8 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 14:23:39 +0800 Subject: [PATCH 056/104] fix macos package name error --- .github/workflows/python-publish.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index eda4b6de43..91c9cf9a53 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -44,6 +44,9 @@ jobs: whl_file.rename(new_whl_file) print(f'Renamed: {whl_file} -> {new_whl_file}') " + - name: Build the project + if: ${{ (matrix.os != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.os != 'macos-13' || matrix['python-version'] != '3.12') }} + run: | make build - name: Build and publish env: From 16fc2f54c29d4615b824dd4f8c9776cff7b92be6 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 14:40:09 +0800 Subject: [PATCH 057/104] fix macos package name error --- .github/workflows/python-publish.yml | 54 ++++++++++++++-------------- qlib/__init__.py | 2 +- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 91c9cf9a53..0a1baa0f26 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -54,34 +54,34 @@ jobs: TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} run: | twine check dist/*.whl - # twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose + twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose - # deploy_with_manylinux: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # - name: Set up Python ${{ matrix.python-version }} - # uses: actions/setup-python@v4 - # with: - # python-version: ${{ matrix.python-version }} - # - name: Build wheel on Linux - # uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 - # with: - # # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 - # python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' - # build-requirements: 'numpy cython' - # - name: Install dependencies - # run: | - # python -m pip install twine - # python -m pip list - # - name: Build and publish - # env: - # TWINE_USERNAME: __token__ - # TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} - # run: | - # ls dist - # twine check dist/*.whl - # twine upload --repository-url https://test.pypi.org/legacy/ dist/pyqlib-*-manylinux*.whl --verbose + deploy_with_manylinux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Build wheel on Linux + uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 + with: + # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 + python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' + build-requirements: 'numpy cython' + - name: Install dependencies + run: | + python -m pip install twine + python -m pip list + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + run: | + ls dist + twine check dist/*.whl + twine upload --repository-url https://test.pypi.org/legacy/ dist/pyqlib-*-manylinux*.whl --verbose # build_wheels: # runs-on: ${{ matrix.os }} diff --git a/qlib/__init__.py b/qlib/__init__.py index b2192f2060..6b2b0cdca4 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. from pathlib import Path -__version__ = "0.9.5.91" +__version__ = "0.9.5.90" __version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version import os from typing import Union From 2e2f9125a730de5fca18f235843cf363b9e2db14 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 14:58:28 +0800 Subject: [PATCH 058/104] test package with pip --- .github/workflows/python-publish.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 0a1baa0f26..8196ca1df7 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -4,10 +4,8 @@ name: Upload Python Package on: - push: - branches: [ main ] - pull_request: - branches: [ main ] + release: + types: [published] jobs: deploy_with_bdist_wheel: From b80abdaf890a8dbfd84ec5a16a5d1d8979009225 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 14:59:33 +0800 Subject: [PATCH 059/104] test package with pip --- .github/workflows/test_qlib_from_pip.yml | 56 ++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/test_qlib_from_pip.yml diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml new file mode 100644 index 0000000000..ca31342c3e --- /dev/null +++ b/.github/workflows/test_qlib_from_pip.yml @@ -0,0 +1,56 @@ +name: Test qlib from pip + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + timeout-minutes: 120 + + runs-on: ${{ matrix.os }} + strategy: + 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, + # 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, macos-latest] + # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - name: Test qlib from pip + uses: actions/checkout@v3 + + - name: Update pip to the latest version + run: | + python -m pip install --upgrade pip + + - name: Qlib installation test + run: | + python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyqlib==0.9.5.90 + + - name: Install Lightgbm for MacOS + 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 + # FIX MacOS error: Segmentation fault + # reference: https://github.com/microsoft/LightGBM/issues/4229 + wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb + brew unlink libomp + brew install libomp.rb + + - name: Downloads dependencies data + run: | + cd .. + python -m qlib.run.get_data qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn + cd qlib + + - name: Test workflow by config + run: | + qrun examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml From 0b938bddddea0c1c31dd60e617e9383d9a6b2db5 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 15:15:20 +0800 Subject: [PATCH 060/104] fix pip install not matching packages --- .github/workflows/python-publish.yml | 16 +++++++++++----- .github/workflows/test_qlib_from_pip.yml | 12 ++++++++---- qlib/__init__.py | 2 +- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 8196ca1df7..cd482ffe64 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -3,9 +3,15 @@ name: Upload Python Package +# on: +# release: +# types: [published] + on: - release: - types: [published] + push: + branches: [ main ] + pull_request: + branches: [ main ] jobs: deploy_with_bdist_wheel: @@ -33,10 +39,10 @@ jobs: python -c " from pathlib import Path import subprocess - replaced = subprocess.run(['sw_vers', '-productVersion'], capture_output=True, text=True).stdout.strip().split('.', 1)[0] + '_0' + replaced = subprocess.run(['sw_vers', '-productVersion'], capture_output=True, text=True).stdout.strip().split('.', 1)[0] + '_0_x86_64' for whl_file in Path('./dist').glob('*.whl'): - parts = whl_file.name.split('_') - be_replaced = '_'.join(parts[1:3]) + parts = whl_file.stem.split('_') + be_replaced = '_'.join(parts[1:]) new_name = whl_file.name.replace(be_replaced, replaced) new_whl_file = whl_file.with_name(new_name) whl_file.rename(new_whl_file) diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml index ca31342c3e..b2fe44e781 100644 --- a/.github/workflows/test_qlib_from_pip.yml +++ b/.github/workflows/test_qlib_from_pip.yml @@ -1,10 +1,14 @@ name: Test qlib from pip +# on: +# push: +# branches: [ main ] +# pull_request: +# branches: [ main ] + on: - push: - branches: [ main ] - pull_request: - branches: [ main ] + release: + types: [published] jobs: build: diff --git a/qlib/__init__.py b/qlib/__init__.py index 6b2b0cdca4..5737e40def 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. from pathlib import Path -__version__ = "0.9.5.90" +__version__ = "0.9.5.89" __version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version import os from typing import Union From f45d0317275cb53986609e775690623f1fa26e12 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 15:16:44 +0800 Subject: [PATCH 061/104] fix pip install not matching packages --- .github/workflows/test_qlib_from_pip.yml | 60 ------------------------ 1 file changed, 60 deletions(-) delete mode 100644 .github/workflows/test_qlib_from_pip.yml diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml deleted file mode 100644 index b2fe44e781..0000000000 --- a/.github/workflows/test_qlib_from_pip.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Test qlib from pip - -# on: -# push: -# branches: [ main ] -# pull_request: -# branches: [ main ] - -on: - release: - types: [published] - -jobs: - build: - timeout-minutes: 120 - - runs-on: ${{ matrix.os }} - strategy: - 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, - # 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, macos-latest] - # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - - steps: - - name: Test qlib from pip - uses: actions/checkout@v3 - - - name: Update pip to the latest version - run: | - python -m pip install --upgrade pip - - - name: Qlib installation test - run: | - python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyqlib==0.9.5.90 - - - name: Install Lightgbm for MacOS - 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 - # FIX MacOS error: Segmentation fault - # reference: https://github.com/microsoft/LightGBM/issues/4229 - wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb - brew unlink libomp - brew install libomp.rb - - - name: Downloads dependencies data - run: | - cd .. - python -m qlib.run.get_data qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn - cd qlib - - - name: Test workflow by config - run: | - qrun examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml From 82e755dc7fc6f98d471ceb1062d0f57b89d4c32f Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 15:29:51 +0800 Subject: [PATCH 062/104] fix pip install not matching packages --- .github/workflows/python-publish.yml | 16 +++---- .github/workflows/test_qlib_from_pip.yml | 56 ++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/test_qlib_from_pip.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index cd482ffe64..ae022689ac 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -3,15 +3,15 @@ name: Upload Python Package -# on: -# release: -# types: [published] - on: - push: - branches: [ main ] - pull_request: - branches: [ main ] + release: + types: [published] + +# on: +# push: +# branches: [ main ] +# pull_request: +# branches: [ main ] jobs: deploy_with_bdist_wheel: diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml new file mode 100644 index 0000000000..121c39d2ab --- /dev/null +++ b/.github/workflows/test_qlib_from_pip.yml @@ -0,0 +1,56 @@ +name: Test qlib from pip + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + timeout-minutes: 120 + + runs-on: ${{ matrix.os }} + strategy: + 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, + # 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, macos-latest] + # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - name: Test qlib from pip + uses: actions/checkout@v3 + + - name: Update pip to the latest version + run: | + python -m pip install --upgrade pip + + - name: Qlib installation test + run: | + python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyqlib==0.9.5.89 + + - name: Install Lightgbm for MacOS + 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 + # FIX MacOS error: Segmentation fault + # reference: https://github.com/microsoft/LightGBM/issues/4229 + wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb + brew unlink libomp + brew install libomp.rb + + - name: Downloads dependencies data + run: | + cd .. + python -m qlib.run.get_data qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn + cd qlib + + - name: Test workflow by config + run: | + qrun examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml From 9d324f648139e8b8dfa325da705f39f33fb8ebab Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 15:41:36 +0800 Subject: [PATCH 063/104] fix pip install not matching packages --- .github/workflows/test_qlib_from_pip.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml index 121c39d2ab..9415491b4e 100644 --- a/.github/workflows/test_qlib_from_pip.yml +++ b/.github/workflows/test_qlib_from_pip.yml @@ -18,7 +18,7 @@ jobs: # 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, macos-latest] + os: [macos-13, macos-latest] # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] @@ -32,7 +32,7 @@ jobs: - name: Qlib installation test run: | - python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyqlib==0.9.5.89 + python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyqlib - name: Install Lightgbm for MacOS if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-latest' }} From a9941bd25c3404a5feda533452b1bfe579c32502 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 15:43:45 +0800 Subject: [PATCH 064/104] fix pip install not matching packages --- .github/workflows/test_qlib_from_pip.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml index 9415491b4e..30ada6ea64 100644 --- a/.github/workflows/test_qlib_from_pip.yml +++ b/.github/workflows/test_qlib_from_pip.yml @@ -18,7 +18,7 @@ jobs: # 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: [macos-13, macos-latest] + os: [windows-latest, ubuntu-20.04, ubuntu-22.04] # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] @@ -32,7 +32,7 @@ jobs: - name: Qlib installation test run: | - python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyqlib + python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyqlib==0.9.5.89 - name: Install Lightgbm for MacOS if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-latest' }} From c03017628dff6e53ef32b43abec46498e28fc90d Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 16:24:50 +0800 Subject: [PATCH 065/104] build multi version for macos --- .github/workflows/python-publish.yml | 126 ++++++++++++----------- .github/workflows/test_qlib_from_pip.yml | 56 ---------- qlib/__init__.py | 2 +- 3 files changed, 66 insertions(+), 118 deletions(-) delete mode 100644 .github/workflows/test_qlib_from_pip.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index ae022689ac..093c98d5ba 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-latest, macos-13, macos-latest] + os: [macos-13, macos-latest] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: @@ -33,14 +33,32 @@ jobs: - name: Build wheel on ${{ matrix.os }} run: | make build - - name: Rename macos filename - if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14' || matrix.os == 'macos-latest' }} + - name: change macos version and arm64 + if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-latest' }} run: | + python -c " + from pathlib import Path + import subprocess + replaced = subprocess.run(['sw_vers', '-productVersion'], capture_output=True, text=True).stdout.strip().split('.', 1)[0] + '_0_arm64' + for whl_file in Path('./dist').glob('*.whl'): + if "universal2" in whl_file.stem: + parts = whl_file.stem.split('_') + be_replaced = '_'.join(parts[1:]) + new_name = whl_file.name.replace(be_replaced, replaced) + new_whl_file = whl_file.with_name(new_name) + whl_file.rename(new_whl_file) + print(f'Renamed: {whl_file} -> {new_whl_file}') + " + - name: change macos version and x86_64 + if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-latest' }} + run: | + make build python -c " from pathlib import Path import subprocess replaced = subprocess.run(['sw_vers', '-productVersion'], capture_output=True, text=True).stdout.strip().split('.', 1)[0] + '_0_x86_64' for whl_file in Path('./dist').glob('*.whl'): + if "universal2" in whl_file.stem: parts = whl_file.stem.split('_') be_replaced = '_'.join(parts[1:]) new_name = whl_file.name.replace(be_replaced, replaced) @@ -48,81 +66,67 @@ jobs: whl_file.rename(new_whl_file) print(f'Renamed: {whl_file} -> {new_whl_file}') " - - name: Build the project + - name: change macos version and arm64 if: ${{ (matrix.os != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.os != 'macos-13' || matrix['python-version'] != '3.12') }} run: | make build - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + python -c " + from pathlib import Path + for whl_file in Path('./dist').glob('*.whl'): + if "universal2" in whl_file.stem: + new_name = whl_file.name.replace("universal2", "arm64") + new_whl_file = whl_file.with_name(new_name) + whl_file.rename(new_whl_file) + print(f'Renamed: {whl_file} -> {new_whl_file}') + " + - name: change macos version and x86_64 + if: ${{ (matrix.os != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.os != 'macos-13' || matrix['python-version'] != '3.12') }} run: | - twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose - - deploy_with_manylinux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Build wheel on Linux - uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 - with: - # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 - python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' - build-requirements: 'numpy cython' - - name: Install dependencies + make build + python -c " + from pathlib import Path + for whl_file in Path('./dist').glob('*.whl'): + if "universal2" in whl_file.stem: + new_name = whl_file.name.replace("universal2", "x86_64") + new_whl_file = whl_file.with_name(new_name) + whl_file.rename(new_whl_file) + print(f'Renamed: {whl_file} -> {new_whl_file}') + " + - name: Build the project + if: ${{ (matrix.os != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.os != 'macos-13' || matrix['python-version'] != '3.12') }} run: | - python -m pip install twine - python -m pip list + make build - name: Build and publish env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} run: | - ls dist twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/pyqlib-*-manylinux*.whl --verbose - - # build_wheels: - # runs-on: ${{ matrix.os }} - # strategy: - # matrix: - # os: [windows-latest, ubuntu-latest, macos-13, macos-latest] + twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose + # deploy_with_manylinux: + # runs-on: ubuntu-latest # steps: - # - name: Checkout repo - # uses: actions/checkout@v4 - - # # - name: Set up Python ${{ matrix.python-version }} - # # uses: actions/setup-python@v5 - # # with: - # # python-version: ${{ matrix.python-version }} - - # # - name: Install cibuildwheel - # # run: | - # # python -m pip install --upgrade pip - # # python -m pip install cibuildwheel - - # # - name: Build wheel - # # run: | - # # python -m cibuildwheel --output-dir dist - - # - name: Build wheel - # uses: pypa/cibuildwheel@v2.22.0 + # - uses: actions/checkout@v3 + # - name: Set up Python ${{ matrix.python-version }} + # uses: actions/setup-python@v4 # with: - # package-dir: . - # output-dir: dist - # config-file: "pyproject.toml" - - # - name: Upload wheel + # python-version: ${{ matrix.python-version }} + # - name: Build wheel on Linux + # uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 + # with: + # # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 + # python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' + # build-requirements: 'numpy cython' + # - name: Install dependencies + # run: | + # python -m pip install twine + # python -m pip list + # - name: Build and publish # env: # TWINE_USERNAME: __token__ # TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} # run: | # ls dist # twine check dist/*.whl - # twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl + # twine upload --repository-url https://test.pypi.org/legacy/ dist/pyqlib-*-manylinux*.whl --verbose diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml deleted file mode 100644 index 30ada6ea64..0000000000 --- a/.github/workflows/test_qlib_from_pip.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Test qlib from pip - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - timeout-minutes: 120 - - runs-on: ${{ matrix.os }} - strategy: - 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, - # 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] - # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - - steps: - - name: Test qlib from pip - uses: actions/checkout@v3 - - - name: Update pip to the latest version - run: | - python -m pip install --upgrade pip - - - name: Qlib installation test - run: | - python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyqlib==0.9.5.89 - - - name: Install Lightgbm for MacOS - 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 - # FIX MacOS error: Segmentation fault - # reference: https://github.com/microsoft/LightGBM/issues/4229 - wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb - brew unlink libomp - brew install libomp.rb - - - name: Downloads dependencies data - run: | - cd .. - python -m qlib.run.get_data qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn - cd qlib - - - name: Test workflow by config - run: | - qrun examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml diff --git a/qlib/__init__.py b/qlib/__init__.py index 5737e40def..349bd3f56c 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. from pathlib import Path -__version__ = "0.9.5.89" +__version__ = "0.9.5.88" __version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version import os from typing import Union From 6f39f166957f0bb238720f1980bc78b7ed056ead Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 16:25:57 +0800 Subject: [PATCH 066/104] build multi version for macos --- .github/workflows/python-publish.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 093c98d5ba..99c7e0b775 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -3,15 +3,15 @@ name: Upload Python Package -on: - release: - types: [published] - # on: -# push: -# branches: [ main ] -# pull_request: -# branches: [ main ] +# release: +# types: [published] + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] jobs: deploy_with_bdist_wheel: From fe8a860f5e0380ab6faa418eb5167e0d99b54989 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 16:35:07 +0800 Subject: [PATCH 067/104] build multi version for macos --- .github/workflows/python-publish.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 99c7e0b775..1bc8bfbd80 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -41,7 +41,7 @@ jobs: import subprocess replaced = subprocess.run(['sw_vers', '-productVersion'], capture_output=True, text=True).stdout.strip().split('.', 1)[0] + '_0_arm64' for whl_file in Path('./dist').glob('*.whl'): - if "universal2" in whl_file.stem: + if 'universal2' in whl_file.stem: parts = whl_file.stem.split('_') be_replaced = '_'.join(parts[1:]) new_name = whl_file.name.replace(be_replaced, replaced) @@ -58,7 +58,7 @@ jobs: import subprocess replaced = subprocess.run(['sw_vers', '-productVersion'], capture_output=True, text=True).stdout.strip().split('.', 1)[0] + '_0_x86_64' for whl_file in Path('./dist').glob('*.whl'): - if "universal2" in whl_file.stem: + if 'universal2' in whl_file.stem: parts = whl_file.stem.split('_') be_replaced = '_'.join(parts[1:]) new_name = whl_file.name.replace(be_replaced, replaced) @@ -73,8 +73,8 @@ jobs: python -c " from pathlib import Path for whl_file in Path('./dist').glob('*.whl'): - if "universal2" in whl_file.stem: - new_name = whl_file.name.replace("universal2", "arm64") + if 'universal2' in whl_file.stem: + new_name = whl_file.name.replace('universal2', 'arm64') new_whl_file = whl_file.with_name(new_name) whl_file.rename(new_whl_file) print(f'Renamed: {whl_file} -> {new_whl_file}') @@ -86,8 +86,8 @@ jobs: python -c " from pathlib import Path for whl_file in Path('./dist').glob('*.whl'): - if "universal2" in whl_file.stem: - new_name = whl_file.name.replace("universal2", "x86_64") + if 'universal2' in whl_file.stem: + new_name = whl_file.name.replace('universal2', 'x86_64') new_whl_file = whl_file.with_name(new_name) whl_file.rename(new_whl_file) print(f'Renamed: {whl_file} -> {new_whl_file}') From e3363208a0b8b056ecefecc30ca3652ca563712f Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 16:50:29 +0800 Subject: [PATCH 068/104] test pip for macos --- .github/workflows/python-publish.yml | 16 +++---- .github/workflows/test_qlib_from_pip.yml | 56 ++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/test_qlib_from_pip.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 1bc8bfbd80..45efda3631 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -3,15 +3,15 @@ name: Upload Python Package -# on: -# release: -# types: [published] - on: - push: - branches: [ main ] - pull_request: - branches: [ main ] + release: + types: [published] + +# on: +# push: +# branches: [ main ] +# pull_request: +# branches: [ main ] jobs: deploy_with_bdist_wheel: diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml new file mode 100644 index 0000000000..45c8113d7d --- /dev/null +++ b/.github/workflows/test_qlib_from_pip.yml @@ -0,0 +1,56 @@ +name: Test qlib from pip + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + timeout-minutes: 120 + + runs-on: ${{ matrix.os }} + strategy: + 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, + # 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: [macos-13, macos-latest] + # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - name: Test qlib from pip + uses: actions/checkout@v3 + + - name: Update pip to the latest version + run: | + python -m pip install --upgrade pip + + - name: Qlib installation test + run: | + python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyqlib==0.9.5.88 + + - name: Install Lightgbm for MacOS + 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 + # FIX MacOS error: Segmentation fault + # reference: https://github.com/microsoft/LightGBM/issues/4229 + wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb + brew unlink libomp + brew install libomp.rb + + - name: Downloads dependencies data + run: | + cd .. + python -m qlib.run.get_data qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn + cd qlib + + - name: Test workflow by config + run: | + qrun examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml From d31d17e7aa71b260d4499d51e6ac7d1602b8ac3b Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 17:18:36 +0800 Subject: [PATCH 069/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 203 ++++++++++++----------- .github/workflows/test_qlib_from_pip.yml | 56 ------- qlib/__init__.py | 2 +- 3 files changed, 111 insertions(+), 150 deletions(-) delete mode 100644 .github/workflows/test_qlib_from_pip.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 45efda3631..43d369d552 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -3,106 +3,123 @@ name: Upload Python Package -on: - release: - types: [published] - # on: -# push: -# branches: [ main ] -# pull_request: -# branches: [ main ] +# release: +# types: [published] + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] jobs: - deploy_with_bdist_wheel: - runs-on: ${{ matrix.os }} + # deploy_with_windows: + # runs-on: ${{ matrix.os }} + # strategy: + # matrix: + # os: [windows-latest, macos-13, macos-latest] + # python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + # steps: + # - uses: actions/checkout@v3 + # - name: Set up Python ${{ matrix.python-version }} + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ matrix.python-version }} + # - name: Install dependencies + # run: | + # make dev + # - name: Build wheel on ${{ matrix.os }} + # run: | + # make build + # - name: change macos version and arm64 + # if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-latest' }} + # run: | + # python -c " + # from pathlib import Path + # import subprocess + # replaced = subprocess.run(['sw_vers', '-productVersion'], capture_output=True, text=True).stdout.strip().split('.', 1)[0] + '_0_arm64' + # for whl_file in Path('./dist').glob('*.whl'): + # if 'universal2' in whl_file.stem: + # parts = whl_file.stem.split('_') + # be_replaced = '_'.join(parts[1:]) + # new_name = whl_file.name.replace(be_replaced, replaced) + # new_whl_file = whl_file.with_name(new_name) + # whl_file.rename(new_whl_file) + # print(f'Renamed: {whl_file} -> {new_whl_file}') + # " + # - name: change macos version and x86_64 + # if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-latest' }} + # run: | + # make build + # python -c " + # from pathlib import Path + # import subprocess + # replaced = subprocess.run(['sw_vers', '-productVersion'], capture_output=True, text=True).stdout.strip().split('.', 1)[0] + '_0_x86_64' + # for whl_file in Path('./dist').glob('*.whl'): + # if 'universal2' in whl_file.stem: + # parts = whl_file.stem.split('_') + # be_replaced = '_'.join(parts[1:]) + # new_name = whl_file.name.replace(be_replaced, replaced) + # new_whl_file = whl_file.with_name(new_name) + # whl_file.rename(new_whl_file) + # print(f'Renamed: {whl_file} -> {new_whl_file}') + # " + # - name: change macos version and arm64 + # if: ${{ (matrix.os != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.os != 'macos-13' || matrix['python-version'] != '3.12') }} + # run: | + # make build + # python -c " + # from pathlib import Path + # for whl_file in Path('./dist').glob('*.whl'): + # if 'universal2' in whl_file.stem: + # new_name = whl_file.name.replace('universal2', 'arm64') + # new_whl_file = whl_file.with_name(new_name) + # whl_file.rename(new_whl_file) + # print(f'Renamed: {whl_file} -> {new_whl_file}') + # " + # - name: change macos version and x86_64 + # if: ${{ (matrix.os != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.os != 'macos-13' || matrix['python-version'] != '3.12') }} + # run: | + # make build + # python -c " + # from pathlib import Path + # for whl_file in Path('./dist').glob('*.whl'): + # if 'universal2' in whl_file.stem: + # new_name = whl_file.name.replace('universal2', 'x86_64') + # new_whl_file = whl_file.with_name(new_name) + # whl_file.rename(new_whl_file) + # print(f'Renamed: {whl_file} -> {new_whl_file}') + # " + # - name: Build the project + # if: ${{ (matrix.os != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.os != 'macos-13' || matrix['python-version'] != '3.12') }} + # run: | + # make build + # - name: Build and publish + # env: + # TWINE_USERNAME: __token__ + # TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + # run: | + # twine check dist/*.whl + # twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose + + deploy_with_macos: + runs-on: ${{ matrix.buildplat[0] }} strategy: matrix: - os: [macos-13, macos-latest] + buildplat: + - [macos-13, macosx_arm64, ""] + - [macos-13, macosx_x86_64, ""] + - [macos-14, macosx_arm64, ""] + - [macos-14, macosx_x86_64, ""] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - make dev - - name: Build wheel on ${{ matrix.os }} - run: | - make build - - name: change macos version and arm64 - if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-latest' }} - run: | - python -c " - from pathlib import Path - import subprocess - replaced = subprocess.run(['sw_vers', '-productVersion'], capture_output=True, text=True).stdout.strip().split('.', 1)[0] + '_0_arm64' - for whl_file in Path('./dist').glob('*.whl'): - if 'universal2' in whl_file.stem: - parts = whl_file.stem.split('_') - be_replaced = '_'.join(parts[1:]) - new_name = whl_file.name.replace(be_replaced, replaced) - new_whl_file = whl_file.with_name(new_name) - whl_file.rename(new_whl_file) - print(f'Renamed: {whl_file} -> {new_whl_file}') - " - - name: change macos version and x86_64 - if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-latest' }} - run: | - make build - python -c " - from pathlib import Path - import subprocess - replaced = subprocess.run(['sw_vers', '-productVersion'], capture_output=True, text=True).stdout.strip().split('.', 1)[0] + '_0_x86_64' - for whl_file in Path('./dist').glob('*.whl'): - if 'universal2' in whl_file.stem: - parts = whl_file.stem.split('_') - be_replaced = '_'.join(parts[1:]) - new_name = whl_file.name.replace(be_replaced, replaced) - new_whl_file = whl_file.with_name(new_name) - whl_file.rename(new_whl_file) - print(f'Renamed: {whl_file} -> {new_whl_file}') - " - - name: change macos version and arm64 - if: ${{ (matrix.os != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.os != 'macos-13' || matrix['python-version'] != '3.12') }} - run: | - make build - python -c " - from pathlib import Path - for whl_file in Path('./dist').glob('*.whl'): - if 'universal2' in whl_file.stem: - new_name = whl_file.name.replace('universal2', 'arm64') - new_whl_file = whl_file.with_name(new_name) - whl_file.rename(new_whl_file) - print(f'Renamed: {whl_file} -> {new_whl_file}') - " - - name: change macos version and x86_64 - if: ${{ (matrix.os != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.os != 'macos-13' || matrix['python-version'] != '3.12') }} - run: | - make build - python -c " - from pathlib import Path - for whl_file in Path('./dist').glob('*.whl'): - if 'universal2' in whl_file.stem: - new_name = whl_file.name.replace('universal2', 'x86_64') - new_whl_file = whl_file.with_name(new_name) - whl_file.rename(new_whl_file) - print(f'Renamed: {whl_file} -> {new_whl_file}') - " - - name: Build the project - if: ${{ (matrix.os != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.os != 'macos-13' || matrix['python-version'] != '3.12') }} - run: | - make build - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} - run: | - twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} # deploy_with_manylinux: # runs-on: ubuntu-latest diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml deleted file mode 100644 index 45c8113d7d..0000000000 --- a/.github/workflows/test_qlib_from_pip.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Test qlib from pip - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - timeout-minutes: 120 - - runs-on: ${{ matrix.os }} - strategy: - 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, - # 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: [macos-13, macos-latest] - # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - - steps: - - name: Test qlib from pip - uses: actions/checkout@v3 - - - name: Update pip to the latest version - run: | - python -m pip install --upgrade pip - - - name: Qlib installation test - run: | - python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyqlib==0.9.5.88 - - - name: Install Lightgbm for MacOS - 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 - # FIX MacOS error: Segmentation fault - # reference: https://github.com/microsoft/LightGBM/issues/4229 - wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb - brew unlink libomp - brew install libomp.rb - - - name: Downloads dependencies data - run: | - cd .. - python -m qlib.run.get_data qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn - cd qlib - - - name: Test workflow by config - run: | - qrun examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml diff --git a/qlib/__init__.py b/qlib/__init__.py index 349bd3f56c..0a0579565a 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. from pathlib import Path -__version__ = "0.9.5.88" +__version__ = "0.9.5.87" __version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version import os from typing import Union From 36e2f66730ab9f92c0e3b3b6d33495d82af5ee38 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 17:22:34 +0800 Subject: [PATCH 070/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 43d369d552..a787849a61 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -109,10 +109,10 @@ jobs: strategy: matrix: buildplat: - - [macos-13, macosx_arm64, ""] - - [macos-13, macosx_x86_64, ""] - - [macos-14, macosx_arm64, ""] - - [macos-14, macosx_x86_64, ""] + - [macos-13, macosx_arm64] + - [macos-13, macosx_x86_64] + - [macos-14, macosx_arm64] + - [macos-14, macosx_x86_64] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 @@ -120,6 +120,19 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + make dev + - name: Build wheel on ${{ matrix.os }} + run: | + make build + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + run: | + twine check dist/*.whl + # deploy_with_manylinux: # runs-on: ubuntu-latest From 2a2615a71e1130f7e7e16ea4b7210fe3e9575797 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 17:33:36 +0800 Subject: [PATCH 071/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index a787849a61..d1ac955284 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -120,18 +120,24 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies + # - name: Install dependencies + # run: | + # make dev + # - name: Build wheel on ${{ matrix.os }} + # run: | + # make build + - name: Run python scripts run: | - make dev - - name: Build wheel on ${{ matrix.os }} - run: | - make build - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} - run: | - twine check dist/*.whl + python -c " + a = '${{ matrix.buildplat[1] }}' + print(f'Value of a: {a}') + " + # - name: Build and publish + # env: + # TWINE_USERNAME: __token__ + # TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + # run: | + # twine check dist/*.whl # deploy_with_manylinux: From 92e1f07a01ed285eb250a36abf3db37ac7fcad42 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 17:37:46 +0800 Subject: [PATCH 072/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index d1ac955284..de9a493f88 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -129,8 +129,11 @@ jobs: - name: Run python scripts run: | python -c " - a = '${{ matrix.buildplat[1] }}' - print(f'Value of a: {a}') + plat_info = '${{ matrix.buildplat[1] }}'.split('_')[-1] + sys_ver_info = '${{ matrix.buildplat[1] }}'.split('-')[-1] + + print(f'Value of plat_info: {plat_info}') + print(f'Value of sys_ver_info: {sys_ver_info}') " # - name: Build and publish # env: From 2d595aca08146e59e2a542485deff2318cc39971 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 18:43:47 +0800 Subject: [PATCH 073/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 44 +++++++++++++++++++++------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index de9a493f88..3d325d720f 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -126,21 +126,43 @@ jobs: # - name: Build wheel on ${{ matrix.os }} # run: | # make build - - name: Run python scripts + - name: Build 1 run: | + make build python -c " plat_info = '${{ matrix.buildplat[1] }}'.split('_')[-1] - sys_ver_info = '${{ matrix.buildplat[1] }}'.split('-')[-1] - - print(f'Value of plat_info: {plat_info}') - print(f'Value of sys_ver_info: {sys_ver_info}') + sys_ver_info = '${{ matrix.buildplat[0] }}'.split('-')[-1] + replaced = f'{sys_ver_info}_0_{plat_info}' + for whl_file in Path('./dist').glob('*.whl'): + if 'universal2' in whl_file.stem: + new_name = whl_file.name.replace(be_replaced, replaced) + new_whl_file = whl_file.with_name(new_name) + whl_file.rename(new_whl_file) + print(f'Renamed: {whl_file} -> {new_whl_file}') " - # - name: Build and publish - # env: - # TWINE_USERNAME: __token__ - # TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} - # run: | - # twine check dist/*.whl + - name: Build 2 + if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }} + run: | + make build + python -c " + plat_info = '${{ matrix.buildplat[1] }}'.split('_')[-1] + for whl_file in Path('./dist').glob('*.whl'): + if 'universal2' in whl_file.stem: + new_name = whl_file.name.replace('universal2', 'plat_info') + new_whl_file = whl_file.with_name(new_name) + whl_file.rename(new_whl_file) + print(f'Renamed: {whl_file} -> {new_whl_file}') + " + - name: Build 2 + if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }} + run: | + make build + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + run: | + twine check dist/*.whl # deploy_with_manylinux: From e28c1e0c3831919cac7899b9ddea9a20ce2447fd Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 18:44:41 +0800 Subject: [PATCH 074/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 3d325d720f..58f9ce1ae9 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -120,9 +120,9 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - # - name: Install dependencies - # run: | - # make dev + - name: Install dependencies + run: | + make dev # - name: Build wheel on ${{ matrix.os }} # run: | # make build From 043d283d2a6f11c975925ca3ac005d9dd42833b7 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 18:49:21 +0800 Subject: [PATCH 075/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 58f9ce1ae9..62282a52f4 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -134,11 +134,11 @@ jobs: sys_ver_info = '${{ matrix.buildplat[0] }}'.split('-')[-1] replaced = f'{sys_ver_info}_0_{plat_info}' for whl_file in Path('./dist').glob('*.whl'): - if 'universal2' in whl_file.stem: - new_name = whl_file.name.replace(be_replaced, replaced) - new_whl_file = whl_file.with_name(new_name) - whl_file.rename(new_whl_file) - print(f'Renamed: {whl_file} -> {new_whl_file}') + if 'universal2' in whl_file.stem: + new_name = whl_file.name.replace(be_replaced, replaced) + new_whl_file = whl_file.with_name(new_name) + whl_file.rename(new_whl_file) + print(f'Renamed: {whl_file} -> {new_whl_file}') " - name: Build 2 if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }} @@ -147,11 +147,11 @@ jobs: python -c " plat_info = '${{ matrix.buildplat[1] }}'.split('_')[-1] for whl_file in Path('./dist').glob('*.whl'): - if 'universal2' in whl_file.stem: - new_name = whl_file.name.replace('universal2', 'plat_info') - new_whl_file = whl_file.with_name(new_name) - whl_file.rename(new_whl_file) - print(f'Renamed: {whl_file} -> {new_whl_file}') + if 'universal2' in whl_file.stem: + new_name = whl_file.name.replace('universal2', 'plat_info') + new_whl_file = whl_file.with_name(new_name) + whl_file.rename(new_whl_file) + print(f'Renamed: {whl_file} -> {new_whl_file}') " - name: Build 2 if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }} From ed360a58d92e68e155112f97a5899004c608e57e Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 19:20:03 +0800 Subject: [PATCH 076/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 62282a52f4..e371239a75 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -130,6 +130,7 @@ jobs: run: | make build python -c " + from pathlib import Path plat_info = '${{ matrix.buildplat[1] }}'.split('_')[-1] sys_ver_info = '${{ matrix.buildplat[0] }}'.split('-')[-1] replaced = f'{sys_ver_info}_0_{plat_info}' @@ -145,6 +146,7 @@ jobs: run: | make build python -c " + from pathlib import Path plat_info = '${{ matrix.buildplat[1] }}'.split('_')[-1] for whl_file in Path('./dist').glob('*.whl'): if 'universal2' in whl_file.stem: From ef289faf30be7ec8643e92fb49f576bb92b9d43e Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 19:24:11 +0800 Subject: [PATCH 077/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index e371239a75..92e903036a 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -136,6 +136,8 @@ jobs: replaced = f'{sys_ver_info}_0_{plat_info}' for whl_file in Path('./dist').glob('*.whl'): if 'universal2' in whl_file.stem: + parts = whl_file.stem.split('_') + be_replaced = '_'.join(parts[1:]) new_name = whl_file.name.replace(be_replaced, replaced) new_whl_file = whl_file.with_name(new_name) whl_file.rename(new_whl_file) From ece56371d960704d9d80a9c80110cfb76a8f8803 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 19:32:54 +0800 Subject: [PATCH 078/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 92e903036a..8f989867d1 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -131,7 +131,7 @@ jobs: make build python -c " from pathlib import Path - plat_info = '${{ matrix.buildplat[1] }}'.split('_')[-1] + plat_info = '${{ matrix.buildplat[1] }}'.split('_', 1)[-1] sys_ver_info = '${{ matrix.buildplat[0] }}'.split('-')[-1] replaced = f'{sys_ver_info}_0_{plat_info}' for whl_file in Path('./dist').glob('*.whl'): @@ -149,10 +149,10 @@ jobs: make build python -c " from pathlib import Path - plat_info = '${{ matrix.buildplat[1] }}'.split('_')[-1] + plat_info = '${{ matrix.buildplat[1] }}'.split('_', 1)[-1] for whl_file in Path('./dist').glob('*.whl'): if 'universal2' in whl_file.stem: - new_name = whl_file.name.replace('universal2', 'plat_info') + new_name = whl_file.name.replace('universal2', plat_info) new_whl_file = whl_file.with_name(new_name) whl_file.rename(new_whl_file) print(f'Renamed: {whl_file} -> {new_whl_file}') From 848e1f9b1873e474eb9432c33c613f70addf24e6 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 20:06:36 +0800 Subject: [PATCH 079/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 8f989867d1..6d700d3a71 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -127,6 +127,9 @@ jobs: # run: | # make build - name: Build 1 + run: | + make build + - name: Rename 1 run: | make build python -c " @@ -147,6 +150,9 @@ jobs: if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }} run: | make build + - name: Rename 2 + if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }} + run: | python -c " from pathlib import Path plat_info = '${{ matrix.buildplat[1] }}'.split('_', 1)[-1] @@ -157,7 +163,7 @@ jobs: whl_file.rename(new_whl_file) print(f'Renamed: {whl_file} -> {new_whl_file}') " - - name: Build 2 + - name: Build 3 if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }} run: | make build @@ -167,6 +173,7 @@ jobs: TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} run: | twine check dist/*.whl + twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose # deploy_with_manylinux: From e4910dd7d1250d76a0a14a422a72afec4f8db309 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 20:10:46 +0800 Subject: [PATCH 080/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 1 - qlib/__init__.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 6d700d3a71..6d55829252 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -173,7 +173,6 @@ jobs: TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} run: | twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose # deploy_with_manylinux: diff --git a/qlib/__init__.py b/qlib/__init__.py index 0a0579565a..565574c359 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. from pathlib import Path -__version__ = "0.9.5.87" +__version__ = "0.9.5.86" __version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version import os from typing import Union From 01d20119053d17b2ad6fb1c21395ffab755c74e2 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 20:47:55 +0800 Subject: [PATCH 081/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 6d55829252..3a7a0424ff 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -131,18 +131,22 @@ jobs: make build - name: Rename 1 run: | - make build python -c " from pathlib import Path plat_info = '${{ matrix.buildplat[1] }}'.split('_', 1)[-1] sys_ver_info = '${{ matrix.buildplat[0] }}'.split('-')[-1] replaced = f'{sys_ver_info}_0_{plat_info}' + print(replaced) for whl_file in Path('./dist').glob('*.whl'): if 'universal2' in whl_file.stem: parts = whl_file.stem.split('_') + print(parts) be_replaced = '_'.join(parts[1:]) + print(be_replaced) new_name = whl_file.name.replace(be_replaced, replaced) + print(new_name) new_whl_file = whl_file.with_name(new_name) + print(new_whl_file) whl_file.rename(new_whl_file) print(f'Renamed: {whl_file} -> {new_whl_file}') " From 22ca863113d1637f344aee10757d0be9bf566a70 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 20:59:46 +0800 Subject: [PATCH 082/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 3a7a0424ff..eac3552bdc 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -138,17 +138,16 @@ jobs: replaced = f'{sys_ver_info}_0_{plat_info}' print(replaced) for whl_file in Path('./dist').glob('*.whl'): - if 'universal2' in whl_file.stem: - parts = whl_file.stem.split('_') - print(parts) - be_replaced = '_'.join(parts[1:]) - print(be_replaced) - new_name = whl_file.name.replace(be_replaced, replaced) - print(new_name) - new_whl_file = whl_file.with_name(new_name) - print(new_whl_file) - whl_file.rename(new_whl_file) - print(f'Renamed: {whl_file} -> {new_whl_file}') + parts = whl_file.stem.split('_') + print(parts) + be_replaced = '_'.join(parts[1:]) + print(be_replaced) + new_name = whl_file.name.replace(be_replaced, replaced) + print(new_name) + new_whl_file = whl_file.with_name(new_name) + print(new_whl_file) + whl_file.rename(new_whl_file) + print(f'Renamed: {whl_file} -> {new_whl_file}') " - name: Build 2 if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }} From 59d28b8a111cb13f3b30d5eaf34a7b8f8adec37d Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 21:21:15 +0800 Subject: [PATCH 083/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index eac3552bdc..75b7d01c6a 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -150,24 +150,20 @@ jobs: print(f'Renamed: {whl_file} -> {new_whl_file}') " - name: Build 2 - if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }} run: | make build - name: Rename 2 - if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }} run: | python -c " from pathlib import Path plat_info = '${{ matrix.buildplat[1] }}'.split('_', 1)[-1] for whl_file in Path('./dist').glob('*.whl'): - if 'universal2' in whl_file.stem: - new_name = whl_file.name.replace('universal2', plat_info) - new_whl_file = whl_file.with_name(new_name) - whl_file.rename(new_whl_file) - print(f'Renamed: {whl_file} -> {new_whl_file}') + new_name = whl_file.name.replace('universal2', plat_info) + new_whl_file = whl_file.with_name(new_name) + whl_file.rename(new_whl_file) + print(f'Renamed: {whl_file} -> {new_whl_file}') " - name: Build 3 - if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }} run: | make build - name: Build and publish From abeb5cfbe0dc81c9a1df78c711f68e2c7c4971e9 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 21:37:55 +0800 Subject: [PATCH 084/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 75b7d01c6a..623325e247 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -158,7 +158,9 @@ jobs: from pathlib import Path plat_info = '${{ matrix.buildplat[1] }}'.split('_', 1)[-1] for whl_file in Path('./dist').glob('*.whl'): - new_name = whl_file.name.replace('universal2', plat_info) + parts = whl_file.stem.split('_', 3) + be_replaced = parts[-1] + new_name = whl_file.name.replace(be_replaced, plat_info) new_whl_file = whl_file.with_name(new_name) whl_file.rename(new_whl_file) print(f'Renamed: {whl_file} -> {new_whl_file}') From fed2691cbed9d62bfa3545b3e16975d7c0c08676 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 22:08:00 +0800 Subject: [PATCH 085/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 7 ++++--- qlib/__init__.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 623325e247..828efd6abf 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -165,15 +165,16 @@ jobs: whl_file.rename(new_whl_file) print(f'Renamed: {whl_file} -> {new_whl_file}') " - - name: Build 3 - run: | - make build + # - name: Build 3 + # run: | + # make build - name: Build and publish env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} run: | twine check dist/*.whl + twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose # deploy_with_manylinux: diff --git a/qlib/__init__.py b/qlib/__init__.py index 565574c359..22069b3002 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. from pathlib import Path -__version__ = "0.9.5.86" +__version__ = "0.9.5.85" __version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version import os from typing import Union From bfec2aa27a126c710438d038dfe9a65f0ccb7143 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 22:31:43 +0800 Subject: [PATCH 086/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 828efd6abf..88cbd5c0d9 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -150,9 +150,11 @@ jobs: print(f'Renamed: {whl_file} -> {new_whl_file}') " - name: Build 2 + if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }} run: | make build - name: Rename 2 + if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }} run: | python -c " from pathlib import Path From 04ffb400b25f10ff4a40967fc87dc63ce35db3cd Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 22:32:01 +0800 Subject: [PATCH 087/104] rewrite deploy with macos --- qlib/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qlib/__init__.py b/qlib/__init__.py index 22069b3002..77c7ce0037 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. from pathlib import Path -__version__ = "0.9.5.85" +__version__ = "0.9.5.84" __version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version import os from typing import Union From 94458af3f7e73530419a78381d472f150e52e7e0 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 22:40:52 +0800 Subject: [PATCH 088/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 16 +++---- .github/workflows/test_qlib_from_pip.yml | 56 ++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/test_qlib_from_pip.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 88cbd5c0d9..4c63d41a19 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -3,15 +3,15 @@ name: Upload Python Package -# on: -# release: -# types: [published] - on: - push: - branches: [ main ] - pull_request: - branches: [ main ] + release: + types: [published] + +# on: +# push: +# branches: [ main ] +# pull_request: +# branches: [ main ] jobs: # deploy_with_windows: diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml new file mode 100644 index 0000000000..189e14e348 --- /dev/null +++ b/.github/workflows/test_qlib_from_pip.yml @@ -0,0 +1,56 @@ +name: Test qlib from pip + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + timeout-minutes: 120 + + runs-on: ${{ matrix.os }} + strategy: + 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, + # 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: [macos-13, macos-latest] + # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - name: Test qlib from pip + uses: actions/checkout@v3 + + - name: Update pip to the latest version + run: | + python -m pip install --upgrade pip + + - name: Qlib installation test + run: | + python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyqlib==0.9.5.89 + + - name: Install Lightgbm for MacOS + 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 + # FIX MacOS error: Segmentation fault + # reference: https://github.com/microsoft/LightGBM/issues/4229 + wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb + brew unlink libomp + brew install libomp.rb + + - name: Downloads dependencies data + run: | + cd .. + python -m qlib.run.get_data qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn + cd qlib + + - name: Test workflow by config + run: | + qrun examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml From 5222de49349bc4e620a9186590b07740380affaf Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 22:41:20 +0800 Subject: [PATCH 089/104] rewrite deploy with macos --- .github/workflows/test_qlib_from_pip.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml index 189e14e348..4a60bba964 100644 --- a/.github/workflows/test_qlib_from_pip.yml +++ b/.github/workflows/test_qlib_from_pip.yml @@ -32,7 +32,7 @@ jobs: - name: Qlib installation test run: | - python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyqlib==0.9.5.89 + python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyqlib==0.9.5.84 - name: Install Lightgbm for MacOS if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-latest' }} From 7e6bdc94934ffa8913ee3f0e9c6ccc6917ce61c4 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 23:17:54 +0800 Subject: [PATCH 090/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 78 ++++++++++++++-------------- qlib/__init__.py | 2 +- setup.py | 37 ++++++++++++- 3 files changed, 75 insertions(+), 42 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 4c63d41a19..9cdce9c8f3 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -128,45 +128,45 @@ jobs: # make build - name: Build 1 run: | - make build - - name: Rename 1 - run: | - python -c " - from pathlib import Path - plat_info = '${{ matrix.buildplat[1] }}'.split('_', 1)[-1] - sys_ver_info = '${{ matrix.buildplat[0] }}'.split('-')[-1] - replaced = f'{sys_ver_info}_0_{plat_info}' - print(replaced) - for whl_file in Path('./dist').glob('*.whl'): - parts = whl_file.stem.split('_') - print(parts) - be_replaced = '_'.join(parts[1:]) - print(be_replaced) - new_name = whl_file.name.replace(be_replaced, replaced) - print(new_name) - new_whl_file = whl_file.with_name(new_name) - print(new_whl_file) - whl_file.rename(new_whl_file) - print(f'Renamed: {whl_file} -> {new_whl_file}') - " - - name: Build 2 - if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }} - run: | - make build - - name: Rename 2 - if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }} - run: | - python -c " - from pathlib import Path - plat_info = '${{ matrix.buildplat[1] }}'.split('_', 1)[-1] - for whl_file in Path('./dist').glob('*.whl'): - parts = whl_file.stem.split('_', 3) - be_replaced = parts[-1] - new_name = whl_file.name.replace(be_replaced, plat_info) - new_whl_file = whl_file.with_name(new_name) - whl_file.rename(new_whl_file) - print(f'Renamed: {whl_file} -> {new_whl_file}') - " + python setup.py bdist_wheel + # - name: Rename 1 + # run: | + # python -c " + # from pathlib import Path + # plat_info = '${{ matrix.buildplat[1] }}'.split('_', 1)[-1] + # sys_ver_info = '${{ matrix.buildplat[0] }}'.split('-')[-1] + # replaced = f'{sys_ver_info}_0_{plat_info}' + # print(replaced) + # for whl_file in Path('./dist').glob('*.whl'): + # parts = whl_file.stem.split('_') + # print(parts) + # be_replaced = '_'.join(parts[1:]) + # print(be_replaced) + # new_name = whl_file.name.replace(be_replaced, replaced) + # print(new_name) + # new_whl_file = whl_file.with_name(new_name) + # print(new_whl_file) + # whl_file.rename(new_whl_file) + # print(f'Renamed: {whl_file} -> {new_whl_file}') + # " + # - name: Build 2 + # if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }} + # run: | + # make build + # - name: Rename 2 + # if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }} + # run: | + # python -c " + # from pathlib import Path + # plat_info = '${{ matrix.buildplat[1] }}'.split('_', 1)[-1] + # for whl_file in Path('./dist').glob('*.whl'): + # parts = whl_file.stem.split('_', 3) + # be_replaced = parts[-1] + # new_name = whl_file.name.replace(be_replaced, plat_info) + # new_whl_file = whl_file.with_name(new_name) + # whl_file.rename(new_whl_file) + # print(f'Renamed: {whl_file} -> {new_whl_file}') + # " # - name: Build 3 # run: | # make build diff --git a/qlib/__init__.py b/qlib/__init__.py index 77c7ce0037..c4bfe0aafd 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. from pathlib import Path -__version__ = "0.9.5.84" +__version__ = "0.9.5.83" __version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version import os from typing import Union diff --git a/setup.py b/setup.py index d9e338315c..fe610e6fe9 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ -from setuptools import setup, Extension +from setuptools import find_packages, setup, Extension +import tomli import numpy import os @@ -16,6 +17,21 @@ def get_version(rel_path: str) -> str: return line.split(delim)[1] raise RuntimeError("Unable to find version string.") +here = os.path.abspath(os.path.dirname(__file__)) + +with open("pyproject.toml", "rb") as f: + pyproject_data = tomli.load(f) + +with open(os.path.join(here, "README.md"), encoding="utf-8") as f: + long_description = f.read() + +project_config = pyproject_data.get("project", {}) +name = project_config.get("name", "default-package-name") +description = project_config.get("description", "") +dependencies = project_config.get("dependencies", []) +classifiers = project_config.get("classifiers", []) +python_requires = project_config.get("requires-python", ">=3.8.0") +optional_dependencies = pyproject_data.get("project", {}).get("optional-dependencies", {}) NUMPY_INCLUDE = numpy.get_include() @@ -24,6 +40,23 @@ def get_version(rel_path: str) -> str: setup( version=VERSION, + name=name, + description=description, + install_requires=dependencies, + long_description=long_description, + long_description_content_type="text/markdown", + include_package_data=True, + classifiers=classifiers, + extras_require=optional_dependencies, + python_requires=python_requires, + license="MIT Licence", + url="https://github.com/microsoft/qlib", + packages=find_packages(exclude=("tests",)), + entry_points={ + "console_scripts": [ + "qrun=qlib.workflow.cli:run", + ], + }, ext_modules=[ Extension( "qlib.data._libs.rolling", @@ -37,5 +70,5 @@ def get_version(rel_path: str) -> str: language="c++", include_dirs=[NUMPY_INCLUDE], ), - ] + ], ) From 0486ab1f999336682a0454cd94e46ff783fca569 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 23:19:14 +0800 Subject: [PATCH 091/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 16 +++---- .github/workflows/test_qlib_from_pip.yml | 56 ------------------------ 2 files changed, 8 insertions(+), 64 deletions(-) delete mode 100644 .github/workflows/test_qlib_from_pip.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 9cdce9c8f3..325bcc3d08 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -3,15 +3,15 @@ name: Upload Python Package -on: - release: - types: [published] - # on: -# push: -# branches: [ main ] -# pull_request: -# branches: [ main ] +# release: +# types: [published] + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] jobs: # deploy_with_windows: diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml deleted file mode 100644 index 4a60bba964..0000000000 --- a/.github/workflows/test_qlib_from_pip.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Test qlib from pip - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - timeout-minutes: 120 - - runs-on: ${{ matrix.os }} - strategy: - 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, - # 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: [macos-13, macos-latest] - # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - - steps: - - name: Test qlib from pip - uses: actions/checkout@v3 - - - name: Update pip to the latest version - run: | - python -m pip install --upgrade pip - - - name: Qlib installation test - run: | - python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyqlib==0.9.5.84 - - - name: Install Lightgbm for MacOS - 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 - # FIX MacOS error: Segmentation fault - # reference: https://github.com/microsoft/LightGBM/issues/4229 - wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb - brew unlink libomp - brew install libomp.rb - - - name: Downloads dependencies data - run: | - cd .. - python -m qlib.run.get_data qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn - cd qlib - - - name: Test workflow by config - run: | - qrun examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml From 8581d30736d7f61070afbe8396d545b19062a537 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 23:23:27 +0800 Subject: [PATCH 092/104] rewrite deploy with macos --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index bb8cb07f26..6a74b17402 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,7 @@ classifiers = [ "Programming Language :: Python :: 3.12", ] name = "pyqlib" +license = {text = "MIT License"} dynamic = ["version"] description = "A Quantitative-research Platform" requires-python = ">=3.8.0" From 80a81c0bf7deff916d311be306300445dcdfd1f0 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 23:30:43 +0800 Subject: [PATCH 093/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 325bcc3d08..dec88d845c 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -108,12 +108,14 @@ jobs: runs-on: ${{ matrix.buildplat[0] }} strategy: matrix: - buildplat: - - [macos-13, macosx_arm64] - - [macos-13, macosx_x86_64] - - [macos-14, macosx_arm64] - - [macos-14, macosx_x86_64] + os: [macos-13, macos-latest] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + # buildplat: + # - [macos-13, macosx_arm64] + # - [macos-13, macosx_x86_64] + # - [macos-14, macosx_arm64] + # - [macos-14, macosx_x86_64] + # python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} From 3bc1ae4aae0c4708fbdb9a5b596eeb8495bb8999 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 23:32:53 +0800 Subject: [PATCH 094/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index dec88d845c..397705af2a 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -110,12 +110,7 @@ jobs: matrix: os: [macos-13, macos-latest] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - # buildplat: - # - [macos-13, macosx_arm64] - # - [macos-13, macosx_x86_64] - # - [macos-14, macosx_arm64] - # - [macos-14, macosx_x86_64] - # python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} From d478795b543003e8e568b6c2866dbbcb5894cf26 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 23:35:19 +0800 Subject: [PATCH 095/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 397705af2a..c6f4e29544 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -105,7 +105,7 @@ jobs: # twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose deploy_with_macos: - runs-on: ${{ matrix.buildplat[0] }} + runs-on: ${{ matrix.os }} strategy: matrix: os: [macos-13, macos-latest] From b8ff81ecd43d498e0c6e87915673402c6ccef3e1 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 23:37:44 +0800 Subject: [PATCH 096/104] rewrite deploy with macos --- qlib/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qlib/__init__.py b/qlib/__init__.py index c4bfe0aafd..58567aa751 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. from pathlib import Path -__version__ = "0.9.5.83" +__version__ = "0.9.5.82" __version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version import os from typing import Union From f10affe9caa9104736b5e5a5dca61530fec1f539 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 23:43:26 +0800 Subject: [PATCH 097/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 1 + qlib/__init__.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index c6f4e29544..9321b59faa 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -124,6 +124,7 @@ jobs: # run: | # make build - name: Build 1 + if: ${{ (matrix.os != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.os != 'macos-13' || matrix['python-version'] != '3.12') }} run: | python setup.py bdist_wheel # - name: Rename 1 diff --git a/qlib/__init__.py b/qlib/__init__.py index 58567aa751..497d7a2986 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. from pathlib import Path -__version__ = "0.9.5.82" +__version__ = "0.9.5.81" __version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version import os from typing import Union From 0f0f49c860b9baf0e7cd56f4575199769094c6e0 Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 23:54:28 +0800 Subject: [PATCH 098/104] rewrite deploy with macos --- .github/workflows/python-publish.yml | 17 +++---- .github/workflows/test_qlib_from_pip.yml | 56 ++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/test_qlib_from_pip.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 9321b59faa..19be86b403 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -3,15 +3,15 @@ name: Upload Python Package -# on: -# release: -# types: [published] - on: - push: - branches: [ main ] - pull_request: - branches: [ main ] + release: + types: [published] + +# on: +# push: +# branches: [ main ] +# pull_request: +# branches: [ main ] jobs: # deploy_with_windows: @@ -169,6 +169,7 @@ jobs: # run: | # make build - name: Build and publish + if: ${{ (matrix.os != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.os != 'macos-13' || matrix['python-version'] != '3.12') }} env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml new file mode 100644 index 0000000000..9415491b4e --- /dev/null +++ b/.github/workflows/test_qlib_from_pip.yml @@ -0,0 +1,56 @@ +name: Test qlib from pip + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + timeout-minutes: 120 + + runs-on: ${{ matrix.os }} + strategy: + 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, + # 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: [macos-13, macos-latest] + # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - name: Test qlib from pip + uses: actions/checkout@v3 + + - name: Update pip to the latest version + run: | + python -m pip install --upgrade pip + + - name: Qlib installation test + run: | + python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyqlib + + - name: Install Lightgbm for MacOS + 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 + # FIX MacOS error: Segmentation fault + # reference: https://github.com/microsoft/LightGBM/issues/4229 + wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb + brew unlink libomp + brew install libomp.rb + + - name: Downloads dependencies data + run: | + cd .. + python -m qlib.run.get_data qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn + cd qlib + + - name: Test workflow by config + run: | + qrun examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml From 1a0dc0610869a2d9311363dba702d2dabbfdc2ab Mon Sep 17 00:00:00 2001 From: Linlang Date: Thu, 19 Dec 2024 23:57:00 +0800 Subject: [PATCH 099/104] rewrite deploy with macos --- .github/workflows/test_qlib_from_pip.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml index 9415491b4e..913f58cd85 100644 --- a/.github/workflows/test_qlib_from_pip.yml +++ b/.github/workflows/test_qlib_from_pip.yml @@ -26,6 +26,11 @@ jobs: - name: Test qlib from pip uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Update pip to the latest version run: | python -m pip install --upgrade pip From e111fc817261510fc41f85c86f8a5136b47a544b Mon Sep 17 00:00:00 2001 From: Linlang Date: Fri, 20 Dec 2024 11:19:36 +0800 Subject: [PATCH 100/104] rebuild total package --- .github/workflows/python-publish.yml | 248 ++++++----------------- .github/workflows/test_qlib_from_pip.yml | 61 ------ Makefile | 2 +- pyproject.toml | 1 - qlib/__init__.py | 2 +- setup.py | 37 +--- 6 files changed, 61 insertions(+), 290 deletions(-) delete mode 100644 .github/workflows/test_qlib_from_pip.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 19be86b403..1f6c4e8792 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -4,203 +4,69 @@ name: Upload Python Package on: - release: - types: [published] - -# on: -# push: -# branches: [ main ] -# pull_request: -# branches: [ main ] + push: + branches: [ main ] + pull_request: + branches: [ main ] jobs: - # deploy_with_windows: - # runs-on: ${{ matrix.os }} - # strategy: - # matrix: - # os: [windows-latest, macos-13, macos-latest] - # python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - - # steps: - # - uses: actions/checkout@v3 - # - name: Set up Python ${{ matrix.python-version }} - # uses: actions/setup-python@v4 - # with: - # python-version: ${{ matrix.python-version }} - # - name: Install dependencies - # run: | - # make dev - # - name: Build wheel on ${{ matrix.os }} - # run: | - # make build - # - name: change macos version and arm64 - # if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-latest' }} - # run: | - # python -c " - # from pathlib import Path - # import subprocess - # replaced = subprocess.run(['sw_vers', '-productVersion'], capture_output=True, text=True).stdout.strip().split('.', 1)[0] + '_0_arm64' - # for whl_file in Path('./dist').glob('*.whl'): - # if 'universal2' in whl_file.stem: - # parts = whl_file.stem.split('_') - # be_replaced = '_'.join(parts[1:]) - # new_name = whl_file.name.replace(be_replaced, replaced) - # new_whl_file = whl_file.with_name(new_name) - # whl_file.rename(new_whl_file) - # print(f'Renamed: {whl_file} -> {new_whl_file}') - # " - # - name: change macos version and x86_64 - # if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-latest' }} - # run: | - # make build - # python -c " - # from pathlib import Path - # import subprocess - # replaced = subprocess.run(['sw_vers', '-productVersion'], capture_output=True, text=True).stdout.strip().split('.', 1)[0] + '_0_x86_64' - # for whl_file in Path('./dist').glob('*.whl'): - # if 'universal2' in whl_file.stem: - # parts = whl_file.stem.split('_') - # be_replaced = '_'.join(parts[1:]) - # new_name = whl_file.name.replace(be_replaced, replaced) - # new_whl_file = whl_file.with_name(new_name) - # whl_file.rename(new_whl_file) - # print(f'Renamed: {whl_file} -> {new_whl_file}') - # " - # - name: change macos version and arm64 - # if: ${{ (matrix.os != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.os != 'macos-13' || matrix['python-version'] != '3.12') }} - # run: | - # make build - # python -c " - # from pathlib import Path - # for whl_file in Path('./dist').glob('*.whl'): - # if 'universal2' in whl_file.stem: - # new_name = whl_file.name.replace('universal2', 'arm64') - # new_whl_file = whl_file.with_name(new_name) - # whl_file.rename(new_whl_file) - # print(f'Renamed: {whl_file} -> {new_whl_file}') - # " - # - name: change macos version and x86_64 - # if: ${{ (matrix.os != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.os != 'macos-13' || matrix['python-version'] != '3.12') }} - # run: | - # make build - # python -c " - # from pathlib import Path - # for whl_file in Path('./dist').glob('*.whl'): - # if 'universal2' in whl_file.stem: - # new_name = whl_file.name.replace('universal2', 'x86_64') - # new_whl_file = whl_file.with_name(new_name) - # whl_file.rename(new_whl_file) - # print(f'Renamed: {whl_file} -> {new_whl_file}') - # " - # - name: Build the project - # if: ${{ (matrix.os != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.os != 'macos-13' || matrix['python-version'] != '3.12') }} - # run: | - # make build - # - name: Build and publish - # env: - # TWINE_USERNAME: __token__ - # TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} - # run: | - # twine check dist/*.whl - # twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose - - deploy_with_macos: + deploy_with_bdist_wheel: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-13, macos-latest] + os: [windows-latest, macos-13, macos-latest] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + exclude: + - os: macos-13 + python-version: "3.11" + - os: macos-13 + python-version: "3.12" + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + make dev + - name: Build wheel on ${{ matrix.os }} + run: | + make build + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + run: | + ls dist + twine check dist/*.whl + twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose + deploy_with_manylinux: + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - make dev - # - name: Build wheel on ${{ matrix.os }} - # run: | - # make build - - name: Build 1 - if: ${{ (matrix.os != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.os != 'macos-13' || matrix['python-version'] != '3.12') }} - run: | - python setup.py bdist_wheel - # - name: Rename 1 - # run: | - # python -c " - # from pathlib import Path - # plat_info = '${{ matrix.buildplat[1] }}'.split('_', 1)[-1] - # sys_ver_info = '${{ matrix.buildplat[0] }}'.split('-')[-1] - # replaced = f'{sys_ver_info}_0_{plat_info}' - # print(replaced) - # for whl_file in Path('./dist').glob('*.whl'): - # parts = whl_file.stem.split('_') - # print(parts) - # be_replaced = '_'.join(parts[1:]) - # print(be_replaced) - # new_name = whl_file.name.replace(be_replaced, replaced) - # print(new_name) - # new_whl_file = whl_file.with_name(new_name) - # print(new_whl_file) - # whl_file.rename(new_whl_file) - # print(f'Renamed: {whl_file} -> {new_whl_file}') - # " - # - name: Build 2 - # if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }} - # run: | - # make build - # - name: Rename 2 - # if: ${{ (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.buildplat[0] != 'macos-13' || matrix['python-version'] != '3.12') }} - # run: | - # python -c " - # from pathlib import Path - # plat_info = '${{ matrix.buildplat[1] }}'.split('_', 1)[-1] - # for whl_file in Path('./dist').glob('*.whl'): - # parts = whl_file.stem.split('_', 3) - # be_replaced = parts[-1] - # new_name = whl_file.name.replace(be_replaced, plat_info) - # new_whl_file = whl_file.with_name(new_name) - # whl_file.rename(new_whl_file) - # print(f'Renamed: {whl_file} -> {new_whl_file}') - # " - # - name: Build 3 - # run: | - # make build - - name: Build and publish - if: ${{ (matrix.os != 'macos-13' || matrix['python-version'] != '3.11') && (matrix.os != 'macos-13' || matrix['python-version'] != '3.12') }} - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} - run: | - twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose - + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Build wheel on Linux + uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 + with: + # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 + python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' + build-requirements: 'numpy cython' + - name: Install dependencies + run: | + python -m pip install twine + python -m pip list + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} + run: | + ls dist + twine check dist/*.whl + twine upload --repository-url https://test.pypi.org/legacy/ dist/pyqlib-*-manylinux*.whl --verbose - # deploy_with_manylinux: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # - name: Set up Python ${{ matrix.python-version }} - # uses: actions/setup-python@v4 - # with: - # python-version: ${{ matrix.python-version }} - # - name: Build wheel on Linux - # uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 - # with: - # # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 - # python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' - # build-requirements: 'numpy cython' - # - name: Install dependencies - # run: | - # python -m pip install twine - # python -m pip list - # - name: Build and publish - # env: - # TWINE_USERNAME: __token__ - # TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} - # run: | - # ls dist - # twine check dist/*.whl - # twine upload --repository-url https://test.pypi.org/legacy/ dist/pyqlib-*-manylinux*.whl --verbose diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml deleted file mode 100644 index 913f58cd85..0000000000 --- a/.github/workflows/test_qlib_from_pip.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Test qlib from pip - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - timeout-minutes: 120 - - runs-on: ${{ matrix.os }} - strategy: - 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, - # 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: [macos-13, macos-latest] - # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - - steps: - - name: Test qlib from pip - uses: actions/checkout@v3 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Update pip to the latest version - run: | - python -m pip install --upgrade pip - - - name: Qlib installation test - run: | - python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyqlib - - - name: Install Lightgbm for MacOS - 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 - # FIX MacOS error: Segmentation fault - # reference: https://github.com/microsoft/LightGBM/issues/4229 - wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb - brew unlink libomp - brew install libomp.rb - - - name: Downloads dependencies data - run: | - cd .. - python -m qlib.run.get_data qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn - cd qlib - - - name: Test workflow by config - run: | - qrun examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml diff --git a/Makefile b/Makefile index ffdc4e3056..03dfc7310c 100644 --- a/Makefile +++ b/Makefile @@ -192,4 +192,4 @@ upload: ######################################################################################## docs-gen: - python -m sphinx.cmd.build -W docs $(PUBLIC_DIR) \ No newline at end of file + python -m sphinx.cmd.build -W docs $(PUBLIC_DIR) diff --git a/pyproject.toml b/pyproject.toml index 6a74b17402..bb8cb07f26 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,6 @@ classifiers = [ "Programming Language :: Python :: 3.12", ] name = "pyqlib" -license = {text = "MIT License"} dynamic = ["version"] description = "A Quantitative-research Platform" requires-python = ">=3.8.0" diff --git a/qlib/__init__.py b/qlib/__init__.py index 497d7a2986..cd62f11594 100644 --- a/qlib/__init__.py +++ b/qlib/__init__.py @@ -2,7 +2,7 @@ # Licensed under the MIT License. from pathlib import Path -__version__ = "0.9.5.81" +__version__ = "0.9.5.80" __version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version import os from typing import Union diff --git a/setup.py b/setup.py index fe610e6fe9..d9e338315c 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ -from setuptools import find_packages, setup, Extension -import tomli +from setuptools import setup, Extension import numpy import os @@ -17,21 +16,6 @@ def get_version(rel_path: str) -> str: return line.split(delim)[1] raise RuntimeError("Unable to find version string.") -here = os.path.abspath(os.path.dirname(__file__)) - -with open("pyproject.toml", "rb") as f: - pyproject_data = tomli.load(f) - -with open(os.path.join(here, "README.md"), encoding="utf-8") as f: - long_description = f.read() - -project_config = pyproject_data.get("project", {}) -name = project_config.get("name", "default-package-name") -description = project_config.get("description", "") -dependencies = project_config.get("dependencies", []) -classifiers = project_config.get("classifiers", []) -python_requires = project_config.get("requires-python", ">=3.8.0") -optional_dependencies = pyproject_data.get("project", {}).get("optional-dependencies", {}) NUMPY_INCLUDE = numpy.get_include() @@ -40,23 +24,6 @@ def get_version(rel_path: str) -> str: setup( version=VERSION, - name=name, - description=description, - install_requires=dependencies, - long_description=long_description, - long_description_content_type="text/markdown", - include_package_data=True, - classifiers=classifiers, - extras_require=optional_dependencies, - python_requires=python_requires, - license="MIT Licence", - url="https://github.com/microsoft/qlib", - packages=find_packages(exclude=("tests",)), - entry_points={ - "console_scripts": [ - "qrun=qlib.workflow.cli:run", - ], - }, ext_modules=[ Extension( "qlib.data._libs.rolling", @@ -70,5 +37,5 @@ def get_version(rel_path: str) -> str: language="c++", include_dirs=[NUMPY_INCLUDE], ), - ], + ] ) From dd67d235af6f23930cc9f3d149554cff469e6bf3 Mon Sep 17 00:00:00 2001 From: Linlang Date: Fri, 20 Dec 2024 11:40:27 +0800 Subject: [PATCH 101/104] test pip install rebuild package --- .github/workflows/test_qlib_from_pip.yml | 61 ++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/test_qlib_from_pip.yml diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml new file mode 100644 index 0000000000..77e627e6ff --- /dev/null +++ b/.github/workflows/test_qlib_from_pip.yml @@ -0,0 +1,61 @@ +name: Test qlib from pip + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + timeout-minutes: 120 + + runs-on: ${{ matrix.os }} + strategy: + 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, + # 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, macos-14, macos-15] + # not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129 + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - name: Test qlib from pip + uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Update pip to the latest version + run: | + python -m pip install --upgrade pip + + - name: Qlib installation test + run: | + python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyqlib==0.9.5.80 + + - name: Install Lightgbm for MacOS + 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 + # FIX MacOS error: Segmentation fault + # reference: https://github.com/microsoft/LightGBM/issues/4229 + wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb + brew unlink libomp + brew install libomp.rb + + - name: Downloads dependencies data + run: | + cd .. + python -m qlib.run.get_data qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn + cd qlib + + - name: Test workflow by config + run: | + qrun examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml From c0f608e3f8f7c47c1d110e0fc0d2413609305bc8 Mon Sep 17 00:00:00 2001 From: Linlang Date: Fri, 20 Dec 2024 11:40:43 +0800 Subject: [PATCH 102/104] test pip install rebuild package --- .github/workflows/python-publish.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 1f6c4e8792..64fbdd34fd 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -4,10 +4,8 @@ name: Upload Python Package on: - push: - branches: [ main ] - pull_request: - branches: [ main ] + release: + types: [published] jobs: deploy_with_bdist_wheel: From 6a123db10950618be404c312f8ec53811c0992a8 Mon Sep 17 00:00:00 2001 From: Linlang Date: Fri, 20 Dec 2024 11:43:36 +0800 Subject: [PATCH 103/104] test pip install rebuild package --- .github/workflows/test_qlib_from_pip.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_qlib_from_pip.yml b/.github/workflows/test_qlib_from_pip.yml index 77e627e6ff..dc0b1eefab 100644 --- a/.github/workflows/test_qlib_from_pip.yml +++ b/.github/workflows/test_qlib_from_pip.yml @@ -40,7 +40,7 @@ jobs: python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyqlib==0.9.5.80 - name: Install Lightgbm for MacOS - if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-latest' }} + if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14' || matrix.os == 'macos-15' }} 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 From 5dfc661fc31a62580a0b82f0dfbf8bcb31680563 Mon Sep 17 00:00:00 2001 From: Linlang Date: Fri, 20 Dec 2024 11:55:29 +0800 Subject: [PATCH 104/104] test build package with macos-15 --- .github/workflows/python-publish.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 64fbdd34fd..557476c43a 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -3,16 +3,22 @@ name: Upload Python Package +# on: +# release: +# types: [published] + on: - release: - types: [published] + push: + branches: [ main ] + pull_request: + branches: [ main ] jobs: deploy_with_bdist_wheel: runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-latest, macos-13, macos-latest] + os: [windows-latest, macos-13, macos-latest, macos-15] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] exclude: - os: macos-13 @@ -39,7 +45,6 @@ jobs: run: | ls dist twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/*.whl --verbose deploy_with_manylinux: runs-on: ubuntu-latest @@ -66,5 +71,5 @@ jobs: run: | ls dist twine check dist/*.whl - twine upload --repository-url https://test.pypi.org/legacy/ dist/pyqlib-*-manylinux*.whl --verbose +