Skip to content

Commit

Permalink
Prepare Release v1.1.0 (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
btschwertfeger authored Apr 8, 2023
1 parent 6da80b6 commit a721b30
Show file tree
Hide file tree
Showing 58 changed files with 6,481 additions and 1,382 deletions.
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

0 comments on commit a721b30

Please sign in to comment.