-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
510 additions
and
5,259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
name: Build and Test | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, 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 build dependencies (Ubuntu) | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y build-essential cmake | ||
- name: Install build dependencies (macOS) | ||
if: runner.os == 'macOS' | ||
run: | | ||
brew install cmake | ||
- name: Install build dependencies (Windows) | ||
if: runner.os == 'Windows' | ||
run: | | ||
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' | ||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install pytest pytest-cov | ||
python -m pip install -e .[dev] | ||
- name: Run tests | ||
run: | | ||
pytest tests/ --cov=pybottrader --cov-report=xml | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
file: ./coverage.xml | ||
flags: unittests | ||
fail_ci_if_error: true | ||
|
||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install cibuildwheel | ||
run: python -m pip install cibuildwheel | ||
|
||
- name: Build wheels | ||
run: python -m cibuildwheel --output-dir wheelhouse | ||
env: | ||
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* | ||
CIBW_SKIP: "*-win32 *-manylinux_i686" | ||
CIBW_TEST_REQUIRES: pytest | ||
CIBW_TEST_COMMAND: "pytest {project}/tests" | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
name: wheels-${{ matrix.os }}-${{ matrix.python-version }} | ||
|
||
publish: | ||
needs: [test, build_wheels] | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'release' && github.event.action == 'created' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build twine | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: dist | ||
|
||
- name: Publish to PyPI | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
run: | | ||
twine upload dist/*/*.whl |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,5 @@ | |
pip install pybottrader | ||
``` | ||
""" | ||
|
||
from .indicators import * # Import the C++ module directly |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
project(indicators) | ||
|
||
if(NOT TARGET pybind11::module) | ||
find_package(pybind11 REQUIRED) | ||
endif() | ||
|
||
# Platform specific flags | ||
if(MSVC) | ||
# Windows-specific flags | ||
add_compile_options(/W4 /EHsc) | ||
else() | ||
# Linux/macOS flags | ||
add_compile_options(-Wall -Wextra) | ||
endif() | ||
|
||
# Create module | ||
pybind11_add_module(_indicators | ||
src/bindings.cpp | ||
) | ||
|
||
# Include directories | ||
target_include_directories(_indicators | ||
PRIVATE | ||
${CMAKE_CURRENT_SOURCE_DIR}/include | ||
) | ||
|
||
# Platform-specific link options | ||
if(APPLE) | ||
target_link_options(_indicators PRIVATE -undefined dynamic_lookup) | ||
endif() | ||
|
||
install(TARGETS _indicators | ||
LIBRARY DESTINATION pybottrader/indicators | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from ._indicators import * # This will import ATR and other symbols directly into indicators namespace |
Oops, something went wrong.