This repository was archived by the owner on Apr 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Convert backends from Protocol classes to sets of Callables #132
Merged
philvarner
merged 14 commits into
stapi-spec:main
from
pjhartzell:pjh/convert-backend-protocols-to-callables
Feb 4, 2025
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e2572dc
feat: convert backend protocols to callables
pjhartzell 8419715
docs: update CHANGELOG
pjhartzell 32920e7
review: correct return type in root backend docstrings
pjhartzell 528a513
review: remove backend types from __init__.py __all__ list
pjhartzell 80ca7b0
review: enable overriding of orders_db and opportunities in stapi_cli…
pjhartzell f013ef3
ci: fix incorrect python version being used in github workflow
pjhartzell 92bfb3f
fix: allow python 3.12.0 and above
pjhartzell 734180c
review: correct response to exposing types in public API
pjhartzell c6ca74b
review: more test cleanup
pjhartzell bc4e7e0
Merge branch 'main' into pjh/convert-backend-protocols-to-callables
pjhartzell 8c96be3
fix: clean up some merge detritus
pjhartzell db236c5
refactor (tests): move backend functions to ... backends.py
pjhartzell 037ce46
refactor (tests): move shared test code to ... shared.py
pjhartzell d0594c0
docs: add missing changelog entry for token-based pagination
pjhartzell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,37 +1,36 @@ | ||
| name: Build Python Package | ||
| name: PR Checks | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| release: | ||
| types: | ||
| - published | ||
| branches: ["main"] | ||
|
|
||
| jobs: | ||
| build-package: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: pypi | ||
| url: https://pypi.org/p/stapi-fastapi | ||
| permissions: | ||
| id-token: write | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.12", "3.13"] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12.x" | ||
| - name: Install dependencies | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Cache dependencies | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: | | ||
| ~/.cache/pip | ||
| .venv | ||
| key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pip-${{ matrix.python-version }}- | ||
| ${{ runner.os }}-pip- | ||
| - name: Install | ||
| run: | | ||
| python -m pip install poetry==1.7.1 | ||
| poetry install --with=dev | ||
| - name: Lint | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install build | ||
| pip install . | ||
| - name: Build package | ||
| run: python -m build | ||
| - name: Publish package distributions to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| if: startsWith(github.ref, 'refs/tags') | ||
| poetry run pre-commit run --all-files | ||
| - name: Test | ||
| run: poetry run pytest |
This file contains hidden or 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 hidden or 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 hidden or 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,7 @@ | ||
| import nox | ||
|
|
||
|
|
||
| @nox.session(python=["3.12"]) | ||
| @nox.session(python=["3.12", "3.13"]) | ||
| def tests(session): | ||
| session.run("poetry", "install", external=True) | ||
| session.run("poetry", "run", "pytest", external=True) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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,10 @@ | ||
| from .product_backend import ProductBackend | ||
| from .root_backend import RootBackend | ||
| from .product_backend import CreateOrder, SearchOpportunities | ||
| from .root_backend import GetOrder, GetOrders, GetOrderStatuses | ||
|
|
||
| __all__ = [ | ||
| "ProductBackend", | ||
| "RootBackend", | ||
| "CreateOrder", | ||
| "GetOrder", | ||
| "GetOrders", | ||
| "GetOrderStatuses", | ||
| "SearchOpportunities", | ||
| ] |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.