Skip to content

Commit d32a05b

Browse files
Switch to src-layout (#342)
1 parent 638aaac commit d32a05b

40 files changed

Lines changed: 141 additions & 96 deletions

.github/codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ coverage:
1919
comment:
2020
layout: "reach, diff, flags, files"
2121
behavior: default
22-
require_changes: true # if false: post the comment even if coverage doesn't change
22+
require_changes: false # if false: post the comment even if coverage doesn't change
2323
require_base: no # [yes :: must have a base report to post]
2424
require_head: yes # [yes :: must have a head report to post]

.github/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ changelog:
2424
labels:
2525
- Bug
2626
- bug
27-
- title: Other Changes
27+
- title: Other Changes 📝
2828
labels:
2929
- "*"
3030
exclude:
3131
labels:
3232
- dependencies
3333
- github_actions
34-
- title: 👒 Dependencies
34+
- title: Dependencies 👒
3535
labels:
3636
- dependencies
3737
- github_actions

.github/workflows/_test_futures_private.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ jobs:
8989
FUTURES_SECRET_KEY: ${{ secrets.FUTURES_SECRET_KEY }}
9090
FUTURES_SANDBOX_KEY: ${{ secrets.FUTURES_SANDBOX_KEY }}
9191
FUTURES_SANDBOX_SECRET: ${{ secrets.FUTURES_SANDBOX_SECRET }}
92-
run: pytest -vv -m "futures and futures_auth and not futures_websocket and not flaky" tests
92+
run: pytest -vv -m "futures and futures_auth and not futures_websocket" tests
9393

9494
- name: Testing Futures websocket client
9595
env:
9696
FUTURES_API_KEY: ${{ secrets.FUTURES_API_KEY }}
9797
FUTURES_SECRET_KEY: ${{ secrets.FUTURES_SECRET_KEY }}
9898
FUTURES_SANDBOX_KEY: ${{ secrets.FUTURES_SANDBOX_KEY }}
9999
FUTURES_SANDBOX_SECRET: ${{ secrets.FUTURES_SANDBOX_SECRET }}
100-
run: pytest -vv -m "futures and futures_auth and futures_websocket and not flaky" tests
100+
run: pytest -vv -m "futures and futures_auth and futures_websocket" tests

.github/workflows/cicd.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
fail-fast: true
8484
matrix:
8585
os: [ubuntu-latest, macos-latest, windows-latest]
86-
python-version: ["3.11", "3.12"]
86+
python-version: ["3.11", "3.12", "3.13"]
8787
with:
8888
os: ${{ matrix.os }}
8989
python-version: ${{ matrix.python-version }}
@@ -110,7 +110,7 @@ jobs:
110110
fail-fast: false
111111
matrix:
112112
os: [ubuntu-latest, windows-latest]
113-
python-version: ["3.11", "3.12"]
113+
python-version: ["3.11", "3.12", "3.13"]
114114
with:
115115
os: ${{ matrix.os }}
116116
python-version: ${{ matrix.python-version }}
@@ -125,7 +125,7 @@ jobs:
125125
fail-fast: false
126126
matrix:
127127
os: [ubuntu-latest, windows-latest]
128-
python-version: ["3.11", "3.12"]
128+
python-version: ["3.11", "3.13"] # not testing 3.12 to reduce CI time
129129
with:
130130
os: ${{ matrix.os }}
131131
python-version: ${{ matrix.python-version }}
@@ -143,7 +143,7 @@ jobs:
143143
fail-fast: false
144144
matrix:
145145
os: [ubuntu-latest, windows-latest]
146-
python-version: ["3.11", "3.12"]
146+
python-version: ["3.11", "3.12", "3.13"]
147147
with:
148148
os: ${{ matrix.os }}
149149
python-version: ${{ matrix.python-version }}
@@ -158,7 +158,7 @@ jobs:
158158
fail-fast: false
159159
matrix:
160160
os: [ubuntu-latest, windows-latest]
161-
python-version: ["3.11", "3.12"]
161+
python-version: ["3.11", "3.12", "3.13"]
162162
with:
163163
os: ${{ matrix.os }}
164164
python-version: ${{ matrix.python-version }}
@@ -175,7 +175,7 @@ jobs:
175175
fail-fast: false
176176
matrix:
177177
os: [ubuntu-latest, windows-latest]
178-
python-version: ["3.11", "3.12"]
178+
python-version: ["3.11", "3.12", "3.13"]
179179
with:
180180
os: ${{ matrix.os }}
181181
python-version: ${{ matrix.python-version }}
@@ -190,7 +190,7 @@ jobs:
190190
fail-fast: false
191191
matrix:
192192
os: [ubuntu-latest, windows-latest]
193-
python-version: ["3.11", "3.12"]
193+
python-version: ["3.11", "3.12", "3.13"]
194194
with:
195195
os: ${{ matrix.os }}
196196
python-version: ${{ matrix.python-version }}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@ repos:
9191
- --max-average=A
9292
- --max-modules=A
9393
- --max-absolute=C
94-
- --exclude=kraken/spot/ws_client.py
94+
- --exclude=src/kraken/spot/ws_client.py

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
Uncategorized merged pull requests:
88

9+
- 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))
10+
- 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))
11+
- Update the documentation [\#339](https://github.com/btschwertfeger/python-kraken-sdk/pull/339) ([btschwertfeger](https://github.com/btschwertfeger))
12+
- 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))
913
- 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))
1014
- 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))
1115

Makefile

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,22 @@ PYTEST_OPTS := -vv --junit-xml=pytest.xml
1111
PYTEST_COV_OPTS := $(PYTEST_OPTS) --cov --cov-report=xml:coverage.xml --cov-report=term
1212
TEST_DIR := tests
1313

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

19-
## ======= B U I L D I N G =======
20-
## build Builds the python-kraken-sdk
21+
## ======= B U I L D I N G =====================================================
22+
## build Builds the package
2123
##
2224
.PHONY: build
2325
build: check-uv
2426
$(UV) build .
2527

28+
## rebuild Rebuild the package
29+
##
2630
.PHONY: rebuild
2731
rebuild: clean build
2832

@@ -32,7 +36,7 @@ rebuild: clean build
3236
doc:
3337
cd doc && make html
3438

35-
## ======= I N S T A L L A T I O N =======
39+
## ======= I N S T A L L A T I O N =============================================
3640
## install Install the package
3741
##
3842
.PHONY: install
@@ -43,9 +47,9 @@ install: check-uv
4347
##
4448
.PHONY: dev
4549
dev: check-uv
46-
$(UV) pip install -e ".[dev,test]"
50+
$(UV) pip install -e ".[dev,test,examples,jupyter]"
4751

48-
## ======= T E S T I N G =======
52+
## ======= T E S T I N G =======================================================
4953
## test Run the unit tests
5054
##
5155
.PHONY: test
@@ -56,14 +60,21 @@ test:
5660
.PHONY: tests
5761
tests: test
5862

63+
## retest Run tests that failed in the last run
64+
##
65+
.PHONY: retest
66+
retest:
67+
@rm .cache/tests/*.log || true
68+
$(PYTEST) $(PYTEST_OPTS) --lf $(TEST_DIR)
69+
5970
## wip Run tests marked as 'wip'
6071
##
6172
.PHONY: wip
6273
wip:
6374
@rm .cache/tests/*.log || true
6475
$(PYTEST) -m "wip" -vv $(TEST_DIR)
6576

66-
## coverage Run all tests and generate the coverage report
77+
## coverage Run all tests and generate the coverage report
6778
##
6879
.PHONY: coverage
6980
coverage:
@@ -76,14 +87,15 @@ coverage:
7687
doctest:
7788
cd docs && make doctest
7889

79-
## ======= M I S C E L A N I O U S =======
90+
## ======= M I S C E L A N I O U S =============================================
8091
## pre-commit Run the pre-commit targets
8192
##
8293
.PHONY: pre-commit
8394
pre-commit:
8495
@pre-commit run -a
8596

86-
## ruff Run ruff without fix
97+
## ruff Run ruff without fix
98+
##
8799
.PHONY: ruff
88100
ruff:
89101
$(UVX) ruff check --preview .
@@ -119,25 +131,24 @@ clean:
119131
.vscode \
120132
dist/ \
121133
doc/_build \
122-
python_kraken_sdk.egg-info \
134+
src/python_kraken_sdk.egg-info \
123135
build/
124136

125137
rm -f .coverage \
126138
*.csv \
127139
*.log \
128140
*.zip \
129141
coverage.xml \
130-
kraken/_version.py \
142+
src/kraken/_version.py \
131143
mypy.xml \
132144
pytest.xml \
133-
python_kraken_sdk-*.whl \
134145
tests/*.zip
135146

136147
find tests -name "__pycache__" | xargs rm -rf
137-
find kraken -name "__pycache__" | xargs rm -rf
148+
find src -name "__pycache__" | xargs rm -rf
138149
find examples -name "__pycache__" | xargs rm -rf
139150

140-
## check-uv Check if uv is installed
151+
## check-uv Check if uv is installed
141152
##
142153
.PHONY: check-uv
143154
check-uv:

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,8 @@ if __name__ == "__main__":
468468
calculation is based on timestamps and a sent nonce must always be the highest
469469
nonce ever sent of that API key. Having multiple algorithms using the same
470470
keys will result in invalid nonce errors.
471+
- Always keep an eye on https://status.kraken.com/ when encountering
472+
connectivity problems.
471473
472474
---
473475

doc/conf.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@
2323
copyright = "2023, Benjamin Thomas Schwertfeger" # noqa: A001 # pylint: disable=redefined-builtin
2424
author = "Benjamin Thomas Schwertfeger"
2525

26-
# to import the package
27-
parent_directory: Path = Path("..").resolve()
28-
sys.path.insert(0, str(parent_directory))
26+
# Add the package to sys.path:
27+
sys.path.insert(0, str(Path("..").resolve()))
2928

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

7170
html_theme = "sphinx_rtd_theme"
72-
html_static_path = ["_static"]
71+
# html_static_path = ["_static"]
7372
html_context = {
7473
"display_github": True,
7574
"github_user": "btschwertfeger",
7675
"github_repo": "python-kraken-sdk",
7776
"github_version": "master/doc/",
7877
}
79-
# html_theme_options = {"rightsidebar": "true", "relbarbgcolor": "black"}

doc/introduction.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,10 @@ Troubleshooting
9797
calculation is based on timestamps and a sent nonce must always be the highest
9898
nonce ever sent of that API key. Having multiple algorithms using the same
9999
keys will result in invalid nonce errors.
100+
- Always keep an eye on https://status.kraken.com/ when encountering
101+
connectivity problems.
100102
- Feel free to open an issue at `python-kraken-sdk/issues`_.
101103

102-
103104
References
104105
----------
105106

0 commit comments

Comments
 (0)