-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from evo-company/update-rpc-servicer
Update rpc servicer
- Loading branch information
Showing
57 changed files
with
2,754 additions
and
1,547 deletions.
There are no files selected for viewing
This file contains 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,4 +1,5 @@ | ||
name: Test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
|
@@ -10,33 +11,15 @@ on: | |
- reopened | ||
|
||
jobs: | ||
test-client: | ||
test-web: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./client | ||
strategy: | ||
matrix: | ||
python-version: [3.7, 3.8, 3.9, "3.10", 3.11] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: pdm-project/setup-pdm@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: python -m pip install tox tox-gh-actions tox-pdm | ||
- name: Test with tox | ||
run: | | ||
tox --version | ||
tox | ||
|
||
test-server: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install lets | ||
uses: lets-cli/[email protected] | ||
|
||
- name: Run test | ||
run: lets test server | ||
run: lets test |
This file contains 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
HAS_STAGED_PY=$(git diff --staged --diff-filter=d --name-only '*.py') | ||
|
||
if [ -n "$HAS_STAGED_PY" ]; then | ||
|
||
echo "Running mypy ..." | ||
lets mypy | ||
if [[ $? -ne 0 ]]; then | ||
exit 1 | ||
fi | ||
|
||
echo "Running black ..." | ||
lets black --diff --check | ||
if [[ $? -ne 0 ]]; then | ||
exit 1 | ||
fi | ||
|
||
echo "Running ruff ..." | ||
lets ruff-diff | ||
if [[ $? -ne 0 ]]; then | ||
exit 1 | ||
fi | ||
|
||
fi | ||
|
||
exit 0 |
This file contains 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 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 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 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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from starlette import status | ||
|
||
|
||
class BaseInternalServerError(Exception): | ||
"""Internal server error.""" | ||
|
||
status_code: int = status.HTTP_500_INTERNAL_SERVER_ERROR | ||
detail: str = "Internal server error." | ||
|
||
|
||
class UserNotAuthorizedError(BaseInternalServerError): | ||
"""User not authorized.""" | ||
|
||
status_code: int = status.HTTP_401_UNAUTHORIZED | ||
detail: str = "User not authorized." |
Oops, something went wrong.