Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 19 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
name: Release


on:
push:
branches:
- main
branches: [ main ]
pull_request:
branches: [ main ]

#on:
# push:
# branches:
# - main

permissions:
contents: read
Expand Down Expand Up @@ -31,30 +38,30 @@ jobs:

steps:
- uses: actions/checkout@v4
if: needs.release.outputs.release_created == 'true'
#if: needs.release.outputs.release_created == 'true'
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
if: needs.release.outputs.release_created == 'true'
#if: needs.release.outputs.release_created == 'true'
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Build wheel on Linux
if: needs.release.outputs.release_created == 'true'
#if: needs.release.outputs.release_created == 'true'
uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64
with:
python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312'
build-requirements: 'numpy cython'

- name: Install dependencies
if: needs.release.outputs.release_created == 'true'
#if: needs.release.outputs.release_created == 'true'
run: |
python -m pip install twine

- name: Upload to PyPi
if: needs.release.outputs.release_created == 'true'
#if: needs.release.outputs.release_created == 'true'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TESTPYPI }}
Expand All @@ -77,28 +84,28 @@ jobs:

steps:
- uses: actions/checkout@v4
if: needs.release.outputs.release_created == 'true'
#if: needs.release.outputs.release_created == 'true'
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
if: needs.release.outputs.release_created == 'true'
#if: needs.release.outputs.release_created == 'true'
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
if: needs.release.outputs.release_created == 'true'
#if: needs.release.outputs.release_created == 'true'
run: |
make dev

- name: Build wheel on ${{ matrix.os }}
if: needs.release.outputs.release_created == 'true'
#if: needs.release.outputs.release_created == 'true'
run: |
make build

- name: Upload to PyPi
if: needs.release.outputs.release_created == 'true'
#if: needs.release.outputs.release_created == 'true'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TESTPYPI }}
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ dev: prerequisite all

# Check lint with black.
black:
black . -l 120 --check --diff
black . -l 120 --check --diff --exclude qlib/_version.py

# Check code folder with pylint.
# TODO: These problems we will solve in the future. Important among them are: W0221, W0223, W0237, E1102
Expand Down Expand Up @@ -195,7 +195,7 @@ lint: black pylint flake8 mypy nbqa

# Build the package.
build:
python -m build --wheel
python -m build

# Upload the package.
upload:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,4 @@ qrun = "qlib.cli.run:run"
[tool.setuptools_scm]
local_scheme = "no-local-version"
version_scheme = "guess-next-dev"
write_to = "qlib/_version.py"
5 changes: 4 additions & 1 deletion qlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

from setuptools_scm import get_version

__version__ = get_version(root="..", relative_to=__file__)
try:
from ._version import version as __version__
except ImportError:
__version__ = get_version(root="..", relative_to=__file__)
__version__bak = __version__ # This version is backup for QlibConfig.reset_qlib_version
import logging
import os
Expand Down
8 changes: 1 addition & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@
from setuptools import Extension, setup


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()


NUMPY_INCLUDE = numpy.get_include()

# delete setuptools_scm

setup(
ext_modules=[
Extension(
Expand Down
Loading