Skip to content

Commit

Permalink
Merge pull request #251 from pranjal-joshi/new-features
Browse files Browse the repository at this point in the history
Upgraded yfinance to 0.2.54 - Caching pipeline backward compatibility added
  • Loading branch information
pranjal-joshi authored Feb 23, 2025
2 parents 22f25cc + 41102b1 commit a3d01f8
Show file tree
Hide file tree
Showing 89 changed files with 2,361 additions and 2,119 deletions.
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.git
.github
actions-data-download
patterns
screenshots
test
.dockerignore
.gitignore
**/*.md
**/*.spec
Dockerfile
Makefile
*.code-workspace
Binary file added .github/dependencies/sqlite3.dll
Binary file not shown.
188 changes: 121 additions & 67 deletions .github/workflows/workflow-build-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,68 +14,86 @@ on:
jobs:

# Job for builing packages
Build:
Build-Executables:
name: Build Packages
#needs: Create-Release
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
TARGET: Windows
CMD_BUILD: |
pyinstaller --onefile --icon=src\icon.ico src\screenipy.py --hidden-import cmath --hidden-import numpy --hidden-import pandas --hidden-import alive-progress --hidden-import alive_progress
DEP_BUILD: |
python -m pip install --upgrade pip
pip install -r requirements.txt
TEST_BUILD: |
./dist/screenipy.exe --testbuild
exit $?
OUT_PATH: .\dist\screenipy.exe
FILE_NAME: screenipy.exe
runs-on: ubuntu-latest
needs: Docker-Build
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# include:
# - os: windows-latest
# TARGET: Windows
# CMD_BUILD: |
# pyinstaller --onefile --icon=src\icon.ico src\screenipy.py --hidden-import cmath --hidden-import talib.stream --hidden-import numpy --hidden-import pandas --hidden-import alive-progress --hidden-import alive_progress --hidden-import chromadb
# DEP_BUILD: |
# python -m pip install --upgrade pip
# echo Installing TA-lib...
# cd .github/dependencies/
# echo %cd%
# pip install TA_Lib-0.4.19-cp39-cp39-win_amd64.whl
# cd ..
# cd ..
# python -m pip install --upgrade pip
# pip install -r requirements.txt
# TEST_BUILD: |
# ./dist/screenipy.exe --testbuild
# exit $?
# OUT_PATH: .\dist\screenipy.exe
# FILE_NAME: screenipy.exe

- os: ubuntu-20.04
TARGET: Linux
CMD_BUILD: |
pyinstaller --onefile --icon=src/icon.ico src/screenipy.py --hidden-import cmath --hidden-import numpy --hidden-import pandas --hidden-import alive-progress --hidden-import alive_progress
mv /home/runner/work/Screeni-py/Screeni-py/dist/screenipy /home/runner/work/Screeni-py/Screeni-py/dist/screenipy.bin
chmod +x /home/runner/work/Screeni-py/Screeni-py/dist/screenipy.bin
DEP_BUILD: |
cd /home/runner/work/Screeni-py/Screeni-py/
python -m pip install --upgrade pip
pip install -r requirements.txt
TEST_BUILD: |
/home/runner/work/Screeni-py/Screeni-py/dist/screenipy.bin --testbuild
exit $?
OUT_PATH: /home/runner/work/Screeni-py/Screeni-py/dist/screenipy.bin
FILE_NAME: screenipy.bin

- os: macos-latest
TARGET: MacOS
CMD_BUILD: |
pyinstaller --onefile --windowed --icon=src/icon.ico src/screenipy.py --hidden-import cmath --hidden-import numpy --hidden-import pandas --hidden-import alive-progress --hidden-import alive_progress
mv /Users/runner/work/Screeni-py/Screeni-py/dist/screenipy /Users/runner/work/Screeni-py/Screeni-py/dist/screenipy.run
DEP_BUILD: |
python -m pip install --upgrade pip
pip install -r requirements.txt
TEST_BUILD: |
/Users/runner/work/Screeni-py/Screeni-py/dist/screenipy.run --testbuild
exit $?
OUT_PATH: /Users/runner/work/Screeni-py/Screeni-py/dist/screenipy.run
FILE_NAME: screenipy.run
# - os: ubuntu-20.04
# TARGET: Linux
# CMD_BUILD: |
# pyinstaller --onefile --icon=src/icon.ico src/screenipy.py --hidden-import cmath --hidden-import talib.stream --hidden-import numpy --hidden-import pandas --hidden-import alive-progress --hidden-import alive_progress --hidden-import chromadb
# mv /home/runner/work/Screeni-py/Screeni-py/dist/screenipy /home/runner/work/Screeni-py/Screeni-py/dist/screenipy.bin
# chmod +x /home/runner/work/Screeni-py/Screeni-py/dist/screenipy.bin
# DEP_BUILD: |
# cd .github/dependencies/
# pwd
# tar -xzf ta-lib-0.4.0-src.tar.gz
# cd ta-lib/
# ./configure --prefix=/usr
# make
# sudo make install
# cd /home/runner/work/Screeni-py/Screeni-py/
# python -m pip install --upgrade pip
# pip install -r requirements.txt
# pip install ta-lib==0.4.24
# TEST_BUILD: |
# /home/runner/work/Screeni-py/Screeni-py/dist/screenipy.bin --testbuild
# exit $?
# OUT_PATH: /home/runner/work/Screeni-py/Screeni-py/dist/screenipy.bin
# FILE_NAME: screenipy.bin

# - os: macos-latest
# TARGET: MacOS
# CMD_BUILD: |
# pyinstaller --onefile --windowed --icon=src/icon.ico src/screenipy.py --hidden-import cmath --hidden-import talib.stream --hidden-import numpy --hidden-import pandas --hidden-import alive-progress --hidden-import alive_progress --hidden-import chromadb
# mv /Users/runner/work/Screeni-py/Screeni-py/dist/screenipy /Users/runner/work/Screeni-py/Screeni-py/dist/screenipy.run
# DEP_BUILD: |
# brew install ta-lib
# python -m pip install --upgrade pip
# pip install -r requirements.txt
# pip install ta-lib==0.4.24
# TEST_BUILD: |
# /Users/runner/work/Screeni-py/Screeni-py/dist/screenipy.run --testbuild
# exit $?
# OUT_PATH: /Users/runner/work/Screeni-py/Screeni-py/dist/screenipy.run
# FILE_NAME: screenipy.run

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Get the GitHub Tag version
id: get_version
shell: bash
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Set up Python 3.9.4
uses: actions/setup-python@v2
with:
python-version: 3.9.4
# - name: Set up Python 3.9.4
# uses: actions/setup-python@v2
# with:
# python-version: 3.9.4

# - name: Load Cache for Linux Dependencies
# uses: actions/cache@v2
Expand All @@ -88,22 +106,22 @@ jobs:
# restore-keys: |
# ${{ runner.os }}-talib

- name: Install dependencies for ${{ matrix.TARGET }}
run: ${{ matrix.DEP_BUILD }}
# - name: Install dependencies for ${{ matrix.TARGET }}
# run: ${{ matrix.DEP_BUILD }}

- name: Build for ${{ matrix.TARGET }}
run: ${{ matrix.CMD_BUILD }}
# - name: Build for ${{ matrix.TARGET }}
# run: ${{ matrix.CMD_BUILD }}

- name: Test Built Binary for ${{ matrix.TARGET }}
shell: bash
run: ${{ matrix.TEST_BUILD }}
continue-on-error: false
# - name: Test Built Binary for ${{ matrix.TARGET }}
# shell: bash
# run: ${{ matrix.TEST_BUILD }}
# continue-on-error: false

- name: Save Binaries as Artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.FILE_NAME }}
path: ${{ matrix.OUT_PATH }}
# - name: Save Binaries as Artifacts
# uses: actions/upload-artifact@v2
# with:
# name: ${{ matrix.FILE_NAME }}
# path: ${{ matrix.OUT_PATH }}

- name: Read release.md
id: read_release
Expand All @@ -119,10 +137,46 @@ jobs:
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.OUT_PATH }}
asset_name: ${{ matrix.FILE_NAME }}
file: README.md
asset_name: README.md
tag: ${{ github.ref }}
release_name: Screenipy - v${{ steps.get_version.outputs.VERSION }}
body: |
${{ steps.read_release.outputs.RELEASE_BODY }}
overwrite: true

Docker-Build:
name: Build and Release Docker Multi-Arch images
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

# Setup hardware emulator using QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

# Setup Docker Buildx for multi-arch images
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Get tag version version
id: version
run: |
VER=$(grep 'VERSION = ' src/classes/Changelog.py | awk -F'"' '{print $2}')
echo "VERSION=$VER" >> $GITHUB_ENV
- name: Streamlit Build and Push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64, linux/arm64
push: true
tags: joshipranjal/screeni-py:latest, joshipranjal/screeni-py:${{ env.VERSION }}

14 changes: 7 additions & 7 deletions .github/workflows/workflow-download-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ jobs:
with:
python-version: 3.9.4

- name: Restore Dependencies from Cache
uses: actions/cache@v2
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
# - name: Restore Dependencies from Cache
# uses: actions/cache@v2
# with:
# path: ~\AppData\Local\pip\Cache
# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
# restore-keys: |
# ${{ runner.os }}-pip-

# - name: Install TA-Lib
# run: |
Expand Down
64 changes: 43 additions & 21 deletions .github/workflows/workflow-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,30 @@ jobs:
# Test the source-code
Test-Source:

runs-on: windows-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python 3.9.4
uses: actions/setup-python@v2
- name: Set up Python 3.11.6
uses: actions/setup-python@v4
with:
python-version: 3.9.4
python-version: 3.11.6

- name: Restore Dependencies from Cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
# - name: Install dependencies for TA-Lib
# run: |
# python -m pip install --upgrade pip
# cd .github/dependencies/
# echo %cd%
# pip install TA_Lib-0.4.19-cp39-cp39-win_amd64.whl

# - name: Install Numpy-MKL for Windows
# run: |
# echo Downloading Numpy-MKL (212MB), Please wait!
# powershell.exe -Command (new-object System.Net.WebClient).DownloadFile('https://download.lfd.uci.edu/pythonlibs/w4tscw6k/numpy-1.20.2+mkl-cp39-cp39-win_amd64.whl','numpy-1.20.2+mkl-cp39-cp39-win_amd64.whl')
# pip install numpy-1.20.2+mkl-cp39-cp39-win_amd64.whl

- name: Install dependencies using pip
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-mock
pip install -r requirements.txt
# pip install --no-deps advanced-ta
- name: Lint with flake8
run: |
Expand All @@ -66,6 +54,38 @@ jobs:
cd test/
pytest -v
Dev-Docker-Build:

runs-on: ubuntu-latest
# needs: [Test-Source]

steps:
- uses: actions/checkout@v4
with:
ref: new-features

# Setup hardware emulator using QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

# Setup Docker Buildx for multi-arch images
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Streamlit Build and Push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64, linux/arm64
push: true
tags: joshipranjal/screeni-py:dev

# Job to create PR
Create-Pull-Request:

Expand All @@ -74,7 +94,9 @@ jobs:

steps:
- name: Checkout Repo before PR
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: new-features

- name: Create Pull Request (new-features -> main)
id: create_pr
Expand All @@ -99,7 +121,7 @@ jobs:
echo ${{steps.create_pr.outputs.pr_number}} >> pr.txt
- name: Save PR Log File
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: PR_Log.txt
path: pr.txt
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ stock*.pkl
results*.pkl
*.spec
.DS_Store
.history/
*.code-workspace
Loading

0 comments on commit a3d01f8

Please sign in to comment.