-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
1,536 additions
and
349 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,15 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.py] | ||
indent_size = 4 | ||
|
||
[*.{md,txt,rst}] | ||
trim_trailing_whitespace = false |
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,3 @@ | ||
[flake8] | ||
max-line-length=120 | ||
exclude=.git,*tests* |
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,41 @@ | ||
--- | ||
name: Lint | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
lint: | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
python-version: | ||
- "3.7" | ||
- "3.8" | ||
- "3.9" | ||
steps: | ||
- | ||
name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- | ||
uses: actions/checkout@v2 | ||
- | ||
name: dependencies | ||
run: | | ||
python -m pip install poetry==1.1.7 | ||
poetry install | ||
- | ||
name: install hooks | ||
run: poetry run pre-commit install-hooks | ||
- | ||
name: flake8 | ||
run: poetry run pre-commit run flake8 --all-files --show-diff-on-failure | ||
- | ||
name: pylint | ||
run: poetry run pre-commit run pylint --all-files --show-diff-on-failure | ||
- | ||
name: mypy | ||
run: poetry run pre-commit run mypy --all-files --show-diff-on-failure |
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,32 @@ | ||
--- | ||
name: PyPI upload | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- | ||
name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.9" | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: dependencies | ||
run: | | ||
python -m pip install poetry==1.1.7 | ||
- | ||
name: build | ||
run: poetry build | ||
- | ||
name: publish | ||
run: | | ||
poetry config http-basic.pypi ${{ secrets.PYPI_LOGIN }} ${{ secrets.PYPI_PASS }} | ||
poetry publish |
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,34 @@ | ||
--- | ||
name: Test | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
tests: | ||
runs-on: windows-latest | ||
env: | ||
SOURCES_DIR: sources | ||
strategy: | ||
matrix: | ||
python-version: | ||
- "3.7" | ||
- "3.8" | ||
- "3.9" | ||
steps: | ||
- | ||
name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- | ||
uses: actions/checkout@v2 | ||
- | ||
name: Install dependencies | ||
run: | | ||
python -m pip install poetry==1.1.7 | ||
poetry install | ||
- | ||
name: pytest | ||
run: poetry run pytest -vv |
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,47 @@ | ||
repos: | ||
- | ||
repo: local | ||
hooks: | ||
# - | ||
# id: isort | ||
# name: isort | ||
# entry: isort | ||
# language: system | ||
# files: ^(winregistry|test)/.+\.py$ | ||
- | ||
id: black | ||
name: black | ||
entry: black | ||
language: system | ||
files: ^(winregistry|test)/.+\.py$ | ||
- | ||
id: flake8 | ||
name: flake8 | ||
entry: flake8 | ||
language: system | ||
files: ^(winregistry|test)/.+\.py$ | ||
- | ||
id: pylint | ||
name: pylint | ||
entry: pylint | ||
language: system | ||
files: ^(winregistry|test)/.+\.py$ | ||
- | ||
id: mypy | ||
name: mypy | ||
entry: mypy | ||
language: system | ||
files: ^(winregistry|test)/.+\.py$ | ||
- | ||
repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: "v3.4.0" | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-json | ||
- id: check-merge-conflict | ||
- id: check-yaml | ||
- id: detect-private-key | ||
- id: end-of-file-fixer | ||
- id: requirements-txt-fixer | ||
- id: forbid-new-submodules | ||
- id: trailing-whitespace |
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,39 @@ | ||
[mypy] | ||
ignore_missing_imports = True | ||
|
||
# Disallow dynamic typing | ||
disallow_any_unimported = False | ||
disallow_any_generics = True | ||
disallow_subclassing_any = False | ||
|
||
# Disallow untyped definitions and calls | ||
disallow_untyped_defs = True | ||
disallow_incomplete_defs = True | ||
|
||
# None and optional handling | ||
no_implicit_optional = True | ||
|
||
# Configuring warnings | ||
warn_unused_ignores = True | ||
warn_return_any = True | ||
warn_redundant_casts = True | ||
|
||
# Misc things | ||
strict_equality = True | ||
|
||
# Config file | ||
warn_unused_configs = True | ||
|
||
[mypy-tests.*] | ||
ignore_errors = True | ||
|
||
# ignore return type for routers | ||
[mypy-app.routers.*] | ||
disallow_incomplete_defs = False | ||
disallow_untyped_defs = False | ||
|
||
[pydantic-mypy] | ||
init_forbid_extra = True | ||
init_typed = True | ||
warn_required_dynamic_aliases = True | ||
warn_untyped_fields = True |
Oops, something went wrong.