forked from freqtrade/freqtrade
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'freqtrade:develop' into freqtrade-develop
- Loading branch information
Showing
38 changed files
with
5,159 additions
and
1,482 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,47 @@ | ||
name: Binance Leverage tiers update | ||
|
||
on: | ||
schedule: | ||
- cron: "0 3 * * 4" | ||
# on demand | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
auto-update: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: develop | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install ccxt | ||
run: pip install ccxt | ||
|
||
- name: Run leverage tier update | ||
env: | ||
CI_WEB_PROXY: ${{ secrets.CI_WEB_PROXY }} | ||
FREQTRADE__EXCHANGE__KEY: ${{ secrets.BINANCE_EXCHANGE_KEY }} | ||
FREQTRADE__EXCHANGE__SECRET: ${{ secrets.BINANCE_EXCHANGE_SECRET }} | ||
run: python build_helpers/binance_update_lev_tiers.py | ||
|
||
|
||
- uses: peter-evans/create-pull-request@v6 | ||
with: | ||
token: ${{ secrets.REPO_SCOPED_TOKEN }} | ||
add-paths: freqtrade/exchange/binance_leverage_tiers.json | ||
labels: | | ||
Tech maintenance | ||
Dependencies | ||
branch: update/binance-leverage-tiers | ||
title: Update Binance Leverage Tiers | ||
commit-message: "chore: update pre-commit hooks" | ||
committer: Freqtrade Bot <[email protected]> | ||
body: Update binance leverage tiers. | ||
delete-branch: true |
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 |
---|---|---|
|
@@ -19,7 +19,7 @@ concurrency: | |
permissions: | ||
repository-projects: read | ||
jobs: | ||
build_linux: | ||
build-linux: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
|
@@ -60,11 +60,16 @@ jobs: | |
export TA_LIBRARY_PATH=${HOME}/dependencies/lib | ||
export TA_INCLUDE_PATH=${HOME}/dependencies/include | ||
pip install -r requirements-dev.txt | ||
pip install -e ft_client/ | ||
pip install -e . | ||
- name: Check for version alignment | ||
run: | | ||
python build_helpers/freqtrade_client_version_align.py | ||
- name: Tests | ||
run: | | ||
pytest --random-order --cov=freqtrade --cov-config=.coveragerc | ||
pytest --random-order --cov=freqtrade --cov=freqtrade_client --cov-config=.coveragerc | ||
- name: Coveralls | ||
if: (runner.os == 'Linux' && matrix.python-version == '3.10' && matrix.os == 'ubuntu-22.04') | ||
|
@@ -188,6 +193,7 @@ jobs: | |
export TA_LIBRARY_PATH=${HOME}/dependencies/lib | ||
export TA_INCLUDE_PATH=${HOME}/dependencies/include | ||
pip install -r requirements-dev.txt | ||
pip install -e ft_client/ | ||
pip install -e . | ||
- name: Tests | ||
|
@@ -362,7 +368,7 @@ jobs: | |
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} | ||
|
||
|
||
build_linux_online: | ||
build-linux-online: | ||
# Run pytest with "live" checks | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
|
@@ -398,25 +404,26 @@ jobs: | |
export TA_LIBRARY_PATH=${HOME}/dependencies/lib | ||
export TA_INCLUDE_PATH=${HOME}/dependencies/include | ||
pip install -r requirements-dev.txt | ||
pip install -e ft_client/ | ||
pip install -e . | ||
- name: Tests incl. ccxt compatibility tests | ||
env: | ||
CI_WEB_PROXY: http://152.67.78.211:13128 | ||
run: | | ||
pytest --random-order --longrun --durations 20 -n auto --dist loadscope | ||
pytest --random-order --longrun --durations 20 -n auto | ||
# Notify only once - when CI completes (and after deploy) in case it's successfull | ||
notify-complete: | ||
needs: [ | ||
build_linux, | ||
build-linux, | ||
build-macos, | ||
build-windows, | ||
docs-check, | ||
mypy-version-check, | ||
pre-commit, | ||
build_linux_online | ||
build-linux-online | ||
] | ||
runs-on: ubuntu-22.04 | ||
# Discord notification can't handle schedule events | ||
|
@@ -443,7 +450,7 @@ jobs: | |
|
||
build: | ||
name: "Build" | ||
needs: [ build_linux, build-macos, build-windows, docs-check, mypy-version-check, pre-commit ] | ||
needs: [ build-linux, build-macos, build-windows, docs-check, mypy-version-check, pre-commit ] | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
|
@@ -467,6 +474,19 @@ jobs: | |
dist | ||
retention-days: 10 | ||
|
||
- name: Build Client distribution | ||
run: | | ||
pip install -U build | ||
python -m build --sdist --wheel ft_client | ||
- name: Upload artifacts 📦 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: freqtrade-client-build | ||
path: | | ||
ft_client/dist | ||
retention-days: 10 | ||
|
||
deploy-pypi: | ||
name: "Deploy to PyPI" | ||
needs: [ build ] | ||
|
@@ -484,8 +504,10 @@ jobs: | |
- name: Download artifact 📦 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: freqtrade-build | ||
name: freqtrade*-build | ||
path: dist | ||
merge-multiple: true | ||
|
||
|
||
- name: Publish to PyPI (Test) | ||
uses: pypa/[email protected] | ||
|
@@ -497,7 +519,7 @@ jobs: | |
|
||
|
||
deploy-docker: | ||
needs: [ build_linux, build-macos, build-windows, docs-check, mypy-version-check, pre-commit ] | ||
needs: [ build-linux, build-macos, build-windows, docs-check, mypy-version-check, pre-commit ] | ||
runs-on: ubuntu-22.04 | ||
|
||
if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'release') && github.repository == 'freqtrade/freqtrade' | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
name: Pre-commit auto-update | ||
|
||
on: | ||
# every day at midnight | ||
schedule: | ||
- cron: "0 3 * * 2" | ||
# on demand | ||
|
@@ -14,32 +13,32 @@ jobs: | |
auto-update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
|
||
|
||
- name: Install pre-commit | ||
run: pip install pre-commit | ||
|
||
- name: Run auto-update | ||
run: pre-commit autoupdate | ||
|
||
- name: Run pre-commit | ||
run: pre-commit run --all-files | ||
|
||
- uses: peter-evans/create-pull-request@v6 | ||
with: | ||
token: ${{ secrets.REPO_SCOPED_TOKEN }} | ||
add-paths: .pre-commit-config.yaml | ||
labels: | | ||
Tech maintenance | ||
Dependencies | ||
branch: update/pre-commit-hooks | ||
title: Update pre-commit hooks | ||
commit-message: "chore: update pre-commit hooks" | ||
committer: Freqtrade Bot <[email protected]> | ||
body: Update versions of pre-commit hooks to latest version. | ||
delete-branch: true | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
|
||
|
||
- name: Install pre-commit | ||
run: pip install pre-commit | ||
|
||
- name: Run auto-update | ||
run: pre-commit autoupdate | ||
|
||
- name: Run pre-commit | ||
run: pre-commit run --all-files | ||
|
||
- uses: peter-evans/create-pull-request@v6 | ||
with: | ||
token: ${{ secrets.REPO_SCOPED_TOKEN }} | ||
add-paths: .pre-commit-config.yaml | ||
labels: | | ||
Tech maintenance | ||
Dependencies | ||
branch: update/pre-commit-hooks | ||
title: Update pre-commit hooks | ||
commit-message: "chore: update pre-commit hooks" | ||
committer: Freqtrade Bot <[email protected]> | ||
body: Update versions of pre-commit hooks to latest version. | ||
delete-branch: true |
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,26 @@ | ||
#!/usr/bin/env python3 | ||
import json | ||
import os | ||
from pathlib import Path | ||
|
||
import ccxt | ||
|
||
|
||
key = os.environ.get('FREQTRADE__EXCHANGE__KEY') | ||
secret = os.environ.get('FREQTRADE__EXCHANGE__SECRET') | ||
|
||
proxy = os.environ.get('CI_WEB_PROXY') | ||
|
||
exchange = ccxt.binance({ | ||
'apiKey': key, | ||
'secret': secret, | ||
'httpsProxy': proxy, | ||
'options': {'defaultType': 'swap'} | ||
}) | ||
_ = exchange.load_markets() | ||
|
||
lev_tiers = exchange.fetch_leverage_tiers() | ||
|
||
# Assumes this is running in the root of the repository. | ||
file = Path('freqtrade/exchange/binance_leverage_tiers.json') | ||
json.dump(dict(sorted(lev_tiers.items())), file.open('w'), indent=2) |
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,18 @@ | ||
#!/usr/bin/env python3 | ||
from freqtrade_client import __version__ as client_version | ||
|
||
from freqtrade import __version__ as ft_version | ||
|
||
|
||
def main(): | ||
if ft_version != client_version: | ||
print(f"Versions do not match: \n" | ||
f"ft: {ft_version} \n" | ||
f"client: {client_version}") | ||
exit(1) | ||
print(f"Versions match: ft: {ft_version}, client: {client_version}") | ||
exit(0) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
Oops, something went wrong.