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

Switch to src-layout #342

Merged
merged 4 commits into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ coverage:
comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: true # if false: post the comment even if coverage doesn't change
require_changes: false # if false: post the comment even if coverage doesn't change
require_base: no # [yes :: must have a base report to post]
require_head: yes # [yes :: must have a head report to post]
4 changes: 2 additions & 2 deletions .github/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ changelog:
labels:
- Bug
- bug
- title: Other Changes
- title: Other Changes 📝
labels:
- "*"
exclude:
labels:
- dependencies
- github_actions
- title: 👒 Dependencies
- title: Dependencies 👒
labels:
- dependencies
- github_actions
4 changes: 2 additions & 2 deletions .github/workflows/_test_futures_private.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ jobs:
FUTURES_SECRET_KEY: ${{ secrets.FUTURES_SECRET_KEY }}
FUTURES_SANDBOX_KEY: ${{ secrets.FUTURES_SANDBOX_KEY }}
FUTURES_SANDBOX_SECRET: ${{ secrets.FUTURES_SANDBOX_SECRET }}
run: pytest -vv -m "futures and futures_auth and not futures_websocket and not flaky" tests
run: pytest -vv -m "futures and futures_auth and not futures_websocket" tests

- name: Testing Futures websocket client
env:
FUTURES_API_KEY: ${{ secrets.FUTURES_API_KEY }}
FUTURES_SECRET_KEY: ${{ secrets.FUTURES_SECRET_KEY }}
FUTURES_SANDBOX_KEY: ${{ secrets.FUTURES_SANDBOX_KEY }}
FUTURES_SANDBOX_SECRET: ${{ secrets.FUTURES_SANDBOX_SECRET }}
run: pytest -vv -m "futures and futures_auth and futures_websocket and not flaky" tests
run: pytest -vv -m "futures and futures_auth and futures_websocket" tests
14 changes: 7 additions & 7 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13"]
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
Expand All @@ -110,7 +110,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13"]
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
Expand All @@ -125,7 +125,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.11", "3.12"]
python-version: ["3.11", "3.13"] # not testing 3.12 to reduce CI time
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
Expand All @@ -143,7 +143,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13"]
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
Expand All @@ -158,7 +158,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13"]
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
Expand All @@ -175,7 +175,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13"]
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
Expand All @@ -190,7 +190,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13"]
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ repos:
- --max-average=A
- --max-modules=A
- --max-absolute=C
- --exclude=kraken/spot/ws_client.py
- --exclude=src/kraken/spot/ws_client.py
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

Uncategorized merged pull requests:

- Bump github/codeql-action from 3.28.1 to 3.28.2 [\#341](https://github.com/btschwertfeger/python-kraken-sdk/pull/341) ([dependabot[bot]](https://github.com/apps/dependabot))
- Bump codecov/codecov-action from 5.1.2 to 5.2.0 [\#340](https://github.com/btschwertfeger/python-kraken-sdk/pull/340) ([dependabot[bot]](https://github.com/apps/dependabot))
- Update the documentation [\#339](https://github.com/btschwertfeger/python-kraken-sdk/pull/339) ([btschwertfeger](https://github.com/btschwertfeger))
- Bump step-security/harden-runner from 2.10.3 to 2.10.4 [\#338](https://github.com/btschwertfeger/python-kraken-sdk/pull/338) ([dependabot[bot]](https://github.com/apps/dependabot))
- Bump step-security/harden-runner from 2.10.2 to 2.10.3 [\#337](https://github.com/btschwertfeger/python-kraken-sdk/pull/337) ([dependabot[bot]](https://github.com/apps/dependabot))
- Bump github/codeql-action from 3.28.0 to 3.28.1 [\#336](https://github.com/btschwertfeger/python-kraken-sdk/pull/336) ([dependabot[bot]](https://github.com/apps/dependabot))

Expand Down
39 changes: 25 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,22 @@ PYTEST_OPTS := -vv --junit-xml=pytest.xml
PYTEST_COV_OPTS := $(PYTEST_OPTS) --cov --cov-report=xml:coverage.xml --cov-report=term
TEST_DIR := tests

## ======= H E L P =======
## ======= M A K E F I L E - T A R G E T S =====================================
## help Show this help message
##
.PHONY: help
help:
@grep "^##" Makefile | sed -e "s/##//"

## ======= B U I L D I N G =======
## build Builds the python-kraken-sdk
## ======= B U I L D I N G =====================================================
## build Builds the package
##
.PHONY: build
build: check-uv
$(UV) build .

## rebuild Rebuild the package
##
.PHONY: rebuild
rebuild: clean build

Expand All @@ -32,7 +36,7 @@ rebuild: clean build
doc:
cd doc && make html

## ======= I N S T A L L A T I O N =======
## ======= I N S T A L L A T I O N =============================================
## install Install the package
##
.PHONY: install
Expand All @@ -43,9 +47,9 @@ install: check-uv
##
.PHONY: dev
dev: check-uv
$(UV) pip install -e ".[dev,test]"
$(UV) pip install -e ".[dev,test,examples,jupyter]"

## ======= T E S T I N G =======
## ======= T E S T I N G =======================================================
## test Run the unit tests
##
.PHONY: test
Expand All @@ -56,14 +60,21 @@ test:
.PHONY: tests
tests: test

## retest Run tests that failed in the last run
##
.PHONY: retest
retest:
@rm .cache/tests/*.log || true
$(PYTEST) $(PYTEST_OPTS) --lf $(TEST_DIR)

## wip Run tests marked as 'wip'
##
.PHONY: wip
wip:
@rm .cache/tests/*.log || true
$(PYTEST) -m "wip" -vv $(TEST_DIR)

## coverage Run all tests and generate the coverage report
## coverage Run all tests and generate the coverage report
##
.PHONY: coverage
coverage:
Expand All @@ -76,14 +87,15 @@ coverage:
doctest:
cd docs && make doctest

## ======= M I S C E L A N I O U S =======
## ======= M I S C E L A N I O U S =============================================
## pre-commit Run the pre-commit targets
##
.PHONY: pre-commit
pre-commit:
@pre-commit run -a

## ruff Run ruff without fix
## ruff Run ruff without fix
##
.PHONY: ruff
ruff:
$(UVX) ruff check --preview .
Expand Down Expand Up @@ -119,25 +131,24 @@ clean:
.vscode \
dist/ \
doc/_build \
python_kraken_sdk.egg-info \
src/python_kraken_sdk.egg-info \
build/

rm -f .coverage \
*.csv \
*.log \
*.zip \
coverage.xml \
kraken/_version.py \
src/kraken/_version.py \
mypy.xml \
pytest.xml \
python_kraken_sdk-*.whl \
tests/*.zip

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

## check-uv Check if uv is installed
## check-uv Check if uv is installed
##
.PHONY: check-uv
check-uv:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ if __name__ == "__main__":
calculation is based on timestamps and a sent nonce must always be the highest
nonce ever sent of that API key. Having multiple algorithms using the same
keys will result in invalid nonce errors.
- Always keep an eye on https://status.kraken.com/ when encountering
connectivity problems.

---

Expand Down
8 changes: 3 additions & 5 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
copyright = "2023, Benjamin Thomas Schwertfeger" # noqa: A001 # pylint: disable=redefined-builtin
author = "Benjamin Thomas Schwertfeger"

# to import the package
parent_directory: Path = Path("..").resolve()
sys.path.insert(0, str(parent_directory))
# Add the package to sys.path:
sys.path.insert(0, str(Path("..").resolve()))

rst_epilog = ""
# Read link all targets from file
Expand Down Expand Up @@ -69,11 +68,10 @@ def setup(app: Any) -> None: # noqa: ARG001,ANN401
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
# html_static_path = ["_static"]
html_context = {
"display_github": True,
"github_user": "btschwertfeger",
"github_repo": "python-kraken-sdk",
"github_version": "master/doc/",
}
# html_theme_options = {"rightsidebar": "true", "relbarbgcolor": "black"}
3 changes: 2 additions & 1 deletion doc/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@ Troubleshooting
calculation is based on timestamps and a sent nonce must always be the highest
nonce ever sent of that API key. Having multiple algorithms using the same
keys will result in invalid nonce errors.
- Always keep an eye on https://status.kraken.com/ when encountering
connectivity problems.
- Feel free to open an issue at `python-kraken-sdk/issues`_.


References
----------

Expand Down
Loading
Loading