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

Prepare Release v1.1.0 #61

Merged
merged 53 commits into from
Apr 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
6727c82
added doc dependencies to pyproject.toml
btschwertfeger Apr 2, 2023
cc23bc2
added targets to Makefile
btschwertfeger Apr 2, 2023
8c8eabf
added badges to readme
btschwertfeger Apr 2, 2023
dbefaee
extended the docstirngs
btschwertfeger Apr 2, 2023
865c5bb
started implementing the documentation (portal) using sphinx
btschwertfeger Apr 2, 2023
d5ed4b7
extended readme
btschwertfeger Apr 2, 2023
0bc839a
added codecov configuration file
btschwertfeger Apr 2, 2023
f22b782
test codecov
btschwertfeger Apr 2, 2023
5d8c042
test codecov
btschwertfeger Apr 2, 2023
5d2a3c3
test codecov
btschwertfeger Apr 2, 2023
810ae9b
reenabled CI/CD workflows
btschwertfeger Apr 2, 2023
3797d7c
extended docstrings
btschwertfeger Apr 4, 2023
0a190a1
extended documentation
btschwertfeger Apr 4, 2023
10acbba
modified tests
btschwertfeger Apr 4, 2023
60e88ff
fixed Issue #62; extended docstrings
btschwertfeger Apr 4, 2023
cfad799
added trailingStopDeviationUnit and trailingStopMaxDeviation to futur…
btschwertfeger Apr 4, 2023
af459c4
removed unused setup.py and adjusted Makefile
btschwertfeger Apr 4, 2023
9003dad
extended docstrings and examples within the docstrings
btschwertfeger Apr 4, 2023
768cce5
added setup.py again
btschwertfeger Apr 4, 2023
4b1cb5c
added docs requirements.txt
btschwertfeger Apr 5, 2023
bec425a
extended docstrings and examples within the docstrings
btschwertfeger Apr 5, 2023
0c177ba
extended the docstrings and added examples
btschwertfeger Apr 5, 2023
10ff582
extended the documentation
btschwertfeger Apr 5, 2023
6884a90
moved stuff from the readme to the documentation
btschwertfeger Apr 5, 2023
6f18237
added missing doc extension
btschwertfeger Apr 5, 2023
ef4f00c
removed some typing
btschwertfeger Apr 5, 2023
9187602
added doc build badges
btschwertfeger Apr 5, 2023
afcca49
extended doc
btschwertfeger Apr 6, 2023
9f226d9
extended docstrings
btschwertfeger Apr 6, 2023
31ec76d
added pre-commit jobs
btschwertfeger Apr 7, 2023
f87d486
extended docstrings, typing and adjusted examples
btschwertfeger Apr 7, 2023
0b9f741
extended doc strings
btschwertfeger Apr 7, 2023
ac292cb
extended doc strings
btschwertfeger Apr 7, 2023
cbe9a90
added trading bot code templates in the documentation
btschwertfeger Apr 7, 2023
8b82a82
adjusted examples; modified comments
btschwertfeger Apr 7, 2023
caed6f7
moved futures get_open_positions and get_open_orders back to futures.…
btschwertfeger Apr 7, 2023
ea3cab6
documented the traling_stop issue
btschwertfeger Apr 7, 2023
6099e2c
adjusted exmples in doc strings
btschwertfeger Apr 8, 2023
74ea62f
adjuested the docs
btschwertfeger Apr 8, 2023
e9695ec
extended docstrings; fixed test
btschwertfeger Apr 8, 2023
072e178
added the doc links in readme
btschwertfeger Apr 8, 2023
45f28aa
adjusted docstrings
btschwertfeger Apr 8, 2023
30a1079
extended documentation
btschwertfeger Apr 8, 2023
df3f34f
added build doc workflow
btschwertfeger Apr 8, 2023
3053cfe
merged deps in toml and removed old test
btschwertfeger Apr 8, 2023
7a79da9
fixed workflow
btschwertfeger Apr 8, 2023
255a95e
build workflow
btschwertfeger Apr 8, 2023
9a91bb9
removed the windows build job
btschwertfeger Apr 8, 2023
308f1b8
adjuested readme
btschwertfeger Apr 8, 2023
171f9ef
added license in docs
btschwertfeger Apr 8, 2023
7221432
removed latest docs badge
btschwertfeger Apr 8, 2023
86a0848
Merge branch 'master' into 58-create-a-documentation-for-the-package
btschwertfeger Apr 8, 2023
d53d0cd
Update README.md
btschwertfeger Apr 8, 2023
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
23 changes: 23 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
coverage:
## Status checks in PR
##
status:
project:
default:
informational: true
## Target coverage is the last one
##
target: auto
## this allows a 2% drop from the previous base commit coverage
##
threshold: 2%
patch:
default:
informational: true

comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: true # if false: post the comment even if coverage dont change
require_base: no # [yes :: must have a base report to post]
require_head: yes # [yes :: must have a head report to post]
14 changes: 4 additions & 10 deletions .github/workflows/_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,9 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install flake8 build

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Build the package
run: python -m build .
run: python -m pip wheel -w dist --no-deps .

- name: Install the package
run: python3 -m pip install dist/python_kraken_sdk*.whl
38 changes: 38 additions & 0 deletions .github/workflows/_build_doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2023 Benjamin Thomas Schwertfeger
# Github: https://github.com/btschwertfeger
#
# Template workflow to build documentation.
#

name: Build Doc

on:
workflow_call:
inputs:
os:
type: string
required: true
python-version:
type: string
required: true

jobs:
Build:
runs-on: ${{ inputs.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r docs/requirements.txt

- name: Build the documentation
run: cd docs && make html
4 changes: 1 addition & 3 deletions .github/workflows/_pypi_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install build

- name: Build the package
run: python -m build .
run: python -m pip wheel -w dist --no-deps .

- name: Publish package distributions to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Install package
run: python -m pip install .

## Unittests of the Spot REST clients and endpoints
## Unit tests of the Spot REST clients and endpoints
## Only non-trade endpoints are tested
##
- name: Testing Spot REST endpoints
Expand All @@ -54,7 +54,7 @@ jobs:
run: |
pytest tests/test_spot_rest.py

## Unittests of the Spot websocket client
## Unit tests of the Spot websocket client
##
- name: Testing Spot websocket client
env:
Expand All @@ -63,7 +63,7 @@ jobs:
run: |
pytest tests/test_spot_websocket.py

## Unittests of the Futures REST clients and endpoints
## Unit tests of the Futures REST clients and endpoints
## Only non-trade endpoints are tested
##
- name: Testing Futures REST endpoints
Expand All @@ -75,7 +75,7 @@ jobs:
run: |
pytest tests/test_futures_rest.py

## Unittests of the Futures websocket client
## Unit tests of the Futures websocket client
##
- name: Testing Futures websocket client
env:
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,21 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, macos-latest] # todo: windows-latest
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}

## Build the documentation
##
Build-Doc:
needs: [Pre-Commit]
uses: ./.github/workflows/_build_doc.yml
with:
os: "ubuntu-latest"
python-version: "3.11"

## Run the unittests for Python 3.7 until Pyrthon 3.11
##
Test:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Important to ignore for setuptools_scm
_version.py
.vscode/

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
29 changes: 28 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,33 @@ repos:
hooks:
# all available hooks can be found here: https://github.com/pre-commit/pre-commit-hooks/blob/main/.pre-commit-hooks.yaml
- id: check-yaml
- id: check-json
- id: check-ast
- id: check-toml
- id: check-docstring-first
- id: check-case-conflict
- id: check-merge-conflict
- id: check-added-large-files
args: ["--maxkb=500"]
- id: check-executables-have-shebangs
- id: trailing-whitespace
- id: fix-byte-order-marker
- id: fix-encoding-pragma
- id: mixed-line-ending
- id: name-tests-test
args: ["--pytest-test-first"]
- id: requirements-txt-fixer
- id: end-of-file-fixer
- id: check-executables-have-shebangs
- id: pretty-format-json
- id: detect-private-key
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-use-type-annotations
- id: rst-backticks
# - id: rst-inline-touching-normal
- id: rst-directive-colons
- id: text-unicode-replacement-char
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
Expand All @@ -43,3 +57,16 @@ repos:
rev: v2.7.1
hooks:
- id: prettier

## Could destroy py<3.11
##
# - repo: https://github.com/asottile/pyupgrade
# rev: v3.3.1
# hooks:
# - id: pyupgrade
# ...
# - repo: https://github.com/rstcheck/rstcheck
# rev: v6.1.2
# hooks:
# - id: rstcheck
# name: rstcheck
3 changes: 2 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ good-names=i,
stopPrice,limitPrice,
orderType,
reduceOnly,triggerSignal,
EXCEPTION_ASSIGNMENT
EXCEPTION_ASSIGNMENT,
trailingStopDeviationUnit,trailingStopMaxDeviation


# Good variable names regexes, separated by a comma. If names match any regex,
Expand Down
29 changes: 21 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

#!make
# -*- coding: utf-8 -*-
# Copyright (C) 2023 Benjamin Thomas Schwertfeger
# Github: https://github.com/btschwertfeger

VENV := venv
GLOBAL_PYTHON := $(shell which python3)
Expand All @@ -9,33 +12,43 @@ PYTHON := $(VENV)/bin/python
## Builds the python-kraken-sdk
##
build:
$(PYTHON) -m build .
$(PYTHON) -m pip wheel -w dist --no-deps .

## Installs the local python-kraken-sdk
## in edit mode
## Installs the package in edit mode
##
dev:
$(PYTHON) -m pip install -e .
$(PYTHON) -m pip install -e .[dev]

## Installs python dependencies
## Install the package
##
install:
$(PYTHON) -m pip install build setuptools_scm
$(PYTHON) -m pip install .

## Run the unittests
##
test:
$(PYTHON) -m pytest tests/

##
## Build the documentation
##
doc:
cd docs && make html

## Run the documentation tests
##
doctest:
cd docs && make doctest

## Pre-Commit
pre-commit:
@pre-commit run -a

## Clean the workspace
##
clean:
rm -rf .pytest_cache build/ dist/ python_kraken_sdk.egg-info docs/_build
rm -f .coverage kraken/_version.py *.log *.csv *.zip tests/*.zip tests/.csv

find tests -name "__pycache__" | xargs rm -rf
find kraken -name "__pycache__" | xargs rm -rf
find examples -name "__pycache__" | xargs rm -rf
Loading