-
Notifications
You must be signed in to change notification settings - Fork 127
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 #235 from Davi0kProgramsThings/fix/refactoring
Merge branch `Davi0kProgramsThings:fix/refactoring` into branch `bitfinexcom:master`.
- Loading branch information
Showing
49 changed files
with
2,223 additions
and
1,685 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[flake8] | ||
max-line-length = 80 | ||
extend-select = B950 | ||
extend-ignore = E203,E501,E701 | ||
|
||
exclude = | ||
__pycache__ | ||
build | ||
dist | ||
venv | ||
|
||
per-file-ignores = | ||
*/__init__.py:F401 |
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 |
---|---|---|
|
@@ -8,9 +8,6 @@ on: | |
branches: | ||
- master | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
@@ -23,7 +20,7 @@ jobs: | |
python-version: '3.8' | ||
- name: Install bitfinex-api-py's dependencies | ||
run: python -m pip install -r dev-requirements.txt | ||
- name: Lint the project with pylint (and fail if score is lower than 10.00/10.00) | ||
run: python -m pylint bfxapi | ||
- name: Run mypy to check the correctness of type hinting (and fail if any error or warning is found) | ||
- name: Run pre-commit hooks (see .pre-commit-config.yaml) | ||
uses: pre-commit/[email protected] | ||
- name: Run mypy to ensure correct type hinting | ||
run: python -m mypy bfxapi |
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,12 +1,16 @@ | ||
.venv | ||
.DS_Store | ||
.vscode | ||
*.pyc | ||
*.log | ||
.python-version | ||
__pycache__ | ||
|
||
bitfinex_api_py.egg-info | ||
bitfinex_api_py.dist-info | ||
build/ | ||
dist/ | ||
pip-wheel-metadata/ | ||
.eggs | ||
|
||
__pycache__ | ||
.idea | ||
|
||
dist | ||
venv | ||
!.gitkeep | ||
MANIFEST | ||
venv/ |
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,2 @@ | ||
[settings] | ||
profile = black |
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,17 @@ | ||
repos: | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev: 24.2.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 7.0.0 | ||
hooks: | ||
- id: flake8 | ||
|
||
additional_dependencies: [ | ||
flake8-bugbear | ||
] |
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 |
---|---|---|
@@ -1,6 +1 @@ | ||
from ._client import \ | ||
Client, \ | ||
REST_HOST, \ | ||
WSS_HOST, \ | ||
PUB_REST_HOST, \ | ||
PUB_WSS_HOST | ||
from ._client import PUB_REST_HOST, PUB_WSS_HOST, REST_HOST, WSS_HOST, Client |
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 |
---|---|---|
@@ -1,13 +1,16 @@ | ||
from typing import Dict, Any | ||
import json | ||
import re | ||
from typing import Any, Dict | ||
|
||
import re, json | ||
|
||
def _to_snake_case(string: str) -> str: | ||
return re.sub(r"(?<!^)(?=[A-Z])", "_", string).lower() | ||
|
||
|
||
def _object_hook(data: Dict[str, Any]) -> Any: | ||
return { _to_snake_case(key): value for key, value in data.items() } | ||
return {_to_snake_case(key): value for key, value in data.items()} | ||
|
||
|
||
class JSONDecoder(json.JSONDecoder): | ||
def __init__(self, *args: Any, **kwargs: Any) -> None: | ||
super().__init__(object_hook=_object_hook, *args, **kwargs) | ||
super().__init__(*args, **kwargs, object_hook=_object_hook) |
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
Oops, something went wrong.