Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update publish.yaml #1870

Closed
wants to merge 104 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
8f16f6b
update publish.yaml
SunsetWolf Dec 17, 2024
dbbcfef
fix manylinux error
SunsetWolf Dec 17, 2024
9e4bdc2
fix manylinux error
SunsetWolf Dec 17, 2024
0de40d1
fix manylinux error
SunsetWolf Dec 17, 2024
b05d442
fix manylinux error
SunsetWolf Dec 17, 2024
7c9ef8d
fix manylinux error
SunsetWolf Dec 17, 2024
9b9accd
fix build error
SunsetWolf Dec 17, 2024
7dec568
fix build error
SunsetWolf Dec 17, 2024
5b0fb43
fix build error
SunsetWolf Dec 17, 2024
fa1a4ce
fix build error
SunsetWolf Dec 17, 2024
4330975
fix build error
SunsetWolf Dec 17, 2024
a6e9d8b
fix build error
SunsetWolf Dec 17, 2024
b43f8ea
test upload to testpypi
SunsetWolf Dec 18, 2024
5a8ff65
fix upload to testpypi error
SunsetWolf Dec 18, 2024
a6646da
fix upload to testpypi error
SunsetWolf Dec 18, 2024
a616409
fix upload to testpypi error
SunsetWolf Dec 18, 2024
0cafe3e
fix upload to testpypi error
SunsetWolf Dec 18, 2024
625d119
fix upload to testpypi error
SunsetWolf Dec 18, 2024
a8f3d38
fix upload to testpypi error
SunsetWolf Dec 18, 2024
bb6acaf
fix upload to testpypi error
SunsetWolf Dec 18, 2024
624adb4
fix upload to testpypi error
SunsetWolf Dec 18, 2024
c243557
fix upload to testpypi error
SunsetWolf Dec 18, 2024
666c8d5
fix upload to testpypi error
SunsetWolf Dec 18, 2024
a023665
fix upload to testpypi error
SunsetWolf Dec 18, 2024
d592bfd
fix upload to testpypi error
SunsetWolf Dec 18, 2024
44b674c
fix upload to testpypi error
SunsetWolf Dec 18, 2024
df391f0
fix upload to testpypi error
SunsetWolf Dec 18, 2024
687a2b2
fix upload to testpypi error
SunsetWolf Dec 18, 2024
34908c8
fix upload to testpypi error
SunsetWolf Dec 18, 2024
8aaa75d
fix upload to testpypi error
SunsetWolf Dec 18, 2024
808ef6b
fix upload to testpypi error
SunsetWolf Dec 18, 2024
86b4d4c
fix upload to testpypi error
SunsetWolf Dec 18, 2024
6a0bc50
fix upload to testpypi error
SunsetWolf Dec 18, 2024
303e624
fix upload to testpypi error
SunsetWolf Dec 18, 2024
1aa61a6
fix upload to testpypi error
SunsetWolf Dec 18, 2024
cc4ac5d
fix upload to testpypi error
SunsetWolf Dec 18, 2024
ea9ef13
fix upload to testpypi error
SunsetWolf Dec 18, 2024
07a8d72
fix upload to testpypi error
SunsetWolf Dec 18, 2024
1239a68
fix upload to testpypi error
SunsetWolf Dec 18, 2024
bac5642
fix upload to testpypi error
SunsetWolf Dec 18, 2024
10f43b8
fix upload to testpypi error
SunsetWolf Dec 18, 2024
e82f225
fix upload to testpypi error
SunsetWolf Dec 18, 2024
deffd97
fix upload to testpypi error
SunsetWolf Dec 18, 2024
c7d3f1f
fix upload to testpypi error
SunsetWolf Dec 18, 2024
b91d0fa
fix upload to testpypi error
SunsetWolf Dec 18, 2024
276ee14
fix upload to testpypi error
SunsetWolf Dec 18, 2024
631fa33
fix upload to testpypi error
SunsetWolf Dec 18, 2024
34a5303
fix upload to testpypi error
SunsetWolf Dec 18, 2024
05a9f8c
test pip install from testpypi
SunsetWolf Dec 19, 2024
6a4273c
test pip install from testpypi
SunsetWolf Dec 19, 2024
431b9c1
fix macos package name error
SunsetWolf Dec 19, 2024
5281d77
fix macos package name error
SunsetWolf Dec 19, 2024
8e1c7d3
fix macos package name error
SunsetWolf Dec 19, 2024
f4bcbe3
fix macos package name error
SunsetWolf Dec 19, 2024
351eea1
fix macos package name error
SunsetWolf Dec 19, 2024
b512074
fix macos package name error
SunsetWolf Dec 19, 2024
16fc2f5
fix macos package name error
SunsetWolf Dec 19, 2024
2e2f912
test package with pip
SunsetWolf Dec 19, 2024
b80abda
test package with pip
SunsetWolf Dec 19, 2024
0b938bd
fix pip install not matching packages
SunsetWolf Dec 19, 2024
f45d031
fix pip install not matching packages
SunsetWolf Dec 19, 2024
82e755d
fix pip install not matching packages
SunsetWolf Dec 19, 2024
9d324f6
fix pip install not matching packages
SunsetWolf Dec 19, 2024
a9941bd
fix pip install not matching packages
SunsetWolf Dec 19, 2024
c030176
build multi version for macos
SunsetWolf Dec 19, 2024
6f39f16
build multi version for macos
SunsetWolf Dec 19, 2024
fe8a860
build multi version for macos
SunsetWolf Dec 19, 2024
e336320
test pip for macos
SunsetWolf Dec 19, 2024
d31d17e
rewrite deploy with macos
SunsetWolf Dec 19, 2024
36e2f66
rewrite deploy with macos
SunsetWolf Dec 19, 2024
2a2615a
rewrite deploy with macos
SunsetWolf Dec 19, 2024
92e1f07
rewrite deploy with macos
SunsetWolf Dec 19, 2024
2d595ac
rewrite deploy with macos
SunsetWolf Dec 19, 2024
e28c1e0
rewrite deploy with macos
SunsetWolf Dec 19, 2024
043d283
rewrite deploy with macos
SunsetWolf Dec 19, 2024
ed360a5
rewrite deploy with macos
SunsetWolf Dec 19, 2024
ef289fa
rewrite deploy with macos
SunsetWolf Dec 19, 2024
ece5637
rewrite deploy with macos
SunsetWolf Dec 19, 2024
848e1f9
rewrite deploy with macos
SunsetWolf Dec 19, 2024
e4910dd
rewrite deploy with macos
SunsetWolf Dec 19, 2024
01d2011
rewrite deploy with macos
SunsetWolf Dec 19, 2024
22ca863
rewrite deploy with macos
SunsetWolf Dec 19, 2024
59d28b8
rewrite deploy with macos
SunsetWolf Dec 19, 2024
abeb5cf
rewrite deploy with macos
SunsetWolf Dec 19, 2024
fed2691
rewrite deploy with macos
SunsetWolf Dec 19, 2024
bfec2aa
rewrite deploy with macos
SunsetWolf Dec 19, 2024
04ffb40
rewrite deploy with macos
SunsetWolf Dec 19, 2024
94458af
rewrite deploy with macos
SunsetWolf Dec 19, 2024
5222de4
rewrite deploy with macos
SunsetWolf Dec 19, 2024
7e6bdc9
rewrite deploy with macos
SunsetWolf Dec 19, 2024
0486ab1
rewrite deploy with macos
SunsetWolf Dec 19, 2024
8581d30
rewrite deploy with macos
SunsetWolf Dec 19, 2024
80a81c0
rewrite deploy with macos
SunsetWolf Dec 19, 2024
3bc1ae4
rewrite deploy with macos
SunsetWolf Dec 19, 2024
d478795
rewrite deploy with macos
SunsetWolf Dec 19, 2024
b8ff81e
rewrite deploy with macos
SunsetWolf Dec 19, 2024
f10affe
rewrite deploy with macos
SunsetWolf Dec 19, 2024
0f0f49c
rewrite deploy with macos
SunsetWolf Dec 19, 2024
1a0dc06
rewrite deploy with macos
SunsetWolf Dec 19, 2024
e111fc8
rebuild total package
SunsetWolf Dec 20, 2024
dd67d23
test pip install rebuild package
SunsetWolf Dec 20, 2024
c0f608e
test pip install rebuild package
SunsetWolf Dec 20, 2024
6a123db
test pip install rebuild package
SunsetWolf Dec 20, 2024
5dfc661
test build package with macos-15
SunsetWolf Dec 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 33 additions & 19 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,33 @@

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, ubuntu-20.04, ubuntu-22.04, 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
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
python-version: "3.11"
- os: macos-13
python-version: "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
Expand All @@ -32,30 +41,35 @@ jobs:
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }}
run: |
twine upload dist/*
ls dist
twine check dist/*.whl

deploy_with_manylinux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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.3.1-manylinux2010_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: 'cp37-cp37m cp38-cp38'
python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312'
build-requirements: 'numpy cython'
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
pip install twine
python -m pip install twine
python -m pip list
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }}
run: |
twine upload dist/pyqlib-*-manylinux*.whl
ls dist
twine check dist/*.whl


21 changes: 4 additions & 17 deletions .github/workflows/test_qlib_from_pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,15 @@ 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]
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.7, 3.8]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

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 }}
Expand All @@ -47,13 +37,10 @@ jobs:

- 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
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
Expand Down
116 changes: 0 additions & 116 deletions .github/workflows/test_qlib_from_source.yml

This file was deleted.

61 changes: 0 additions & 61 deletions .github/workflows/test_qlib_from_source_slow.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -192,4 +192,4 @@ upload:
########################################################################################

docs-gen:
python -m sphinx.cmd.build -W docs $(PUBLIC_DIR)
python -m sphinx.cmd.build -W docs $(PUBLIC_DIR)
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion qlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Licensed under the MIT License.
from pathlib import Path

__version__ = "0.9.5.99"
__version__ = "0.9.5.80"
__version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version
import os
from typing import Union
Expand Down
3 changes: 0 additions & 3 deletions setup.cfg

This file was deleted.

41 changes: 41 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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],
),
]
)
Loading