Skip to content

Commit 4946866

Browse files
committed
Initial commit.
Signed-off-by: Pavel Kirilin <[email protected]>
0 parents  commit 4946866

File tree

14 files changed

+2521
-0
lines changed

14 files changed

+2521
-0
lines changed

.flake8

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
[flake8]
2+
max-complexity = 6
3+
inline-quotes = double
4+
max-line-length = 88
5+
extend-ignore = E203
6+
docstring_style=sphinx
7+
8+
ignore =
9+
; Found a line that starts with a dot
10+
WPS348,
11+
; Found overly complex type annotation
12+
WPS234,
13+
; `noqa` comments overuse ))))
14+
WPS402,
15+
; Found `%` string formatting
16+
WPS323,
17+
; Found block variable overlap.
18+
WPS440,
19+
; Found multi-line function type annotation
20+
WPS320,
21+
; Found statement that has no effect
22+
WPS428,
23+
; Found wrong variable name
24+
WPS110,
25+
; Found unpythonic getter or setter
26+
WPS615,
27+
; Found `f` string
28+
WPS305,
29+
; Missing docstring in public module
30+
D100,
31+
; Missing docstring in magic method
32+
D105,
33+
; Missing docstring in __init__
34+
D107,
35+
; Found class without a base class
36+
WPS306,
37+
; Missing docstring in public nested class
38+
D106,
39+
; First line should be in imperative mood
40+
D401,
41+
; Found `__init__.py` module with logic
42+
WPS412,
43+
; Found implicit string concatenation
44+
WPS326,
45+
; Found string constant over-use
46+
WPS226,
47+
; Found upper-case constant in a class
48+
WPS115,
49+
; Found nested function
50+
WPS430,
51+
; Found using `@staticmethod`
52+
WPS602,
53+
; Found method without arguments
54+
WPS605,
55+
; Found overused expression
56+
WPS204,
57+
; Found too many module members
58+
WPS202,
59+
; Found too high module cognitive complexity
60+
WPS232,
61+
; line break before binary operator
62+
W503,
63+
; Found module with too many imports
64+
WPS201,
65+
; Found vague import that may cause confusion: X
66+
WPS347,
67+
; Inline strong start-string without end-string.
68+
RST210,
69+
; subprocess call with shell=True seems safe, but may be changed in the future.
70+
S602,
71+
; Starting a process with a partial executable path.
72+
S607,
73+
; Consider possible security implications associated with subprocess module.
74+
S404,
75+
; Found nested class
76+
WPS431,
77+
; Found wrong module name
78+
WPS100,
79+
; Found too many methods
80+
WPS214,
81+
; Found too long ``try`` body
82+
WPS229,
83+
; Found function with too much cognitive complexity
84+
WPS231,
85+
; Found too deep nesting
86+
WPS220,
87+
; Found line with high Jones Complexity
88+
WPS221,
89+
; function name should be lowercase
90+
N802,
91+
; Do not perform function calls in argument defaults.
92+
B008,
93+
; Found protected attribute usage
94+
WPS437,
95+
96+
; all init files
97+
__init__.py:
98+
; ignore not used imports
99+
F401,
100+
; ignore import with wildcard
101+
F403,
102+
; Found wrong metadata variable
103+
WPS410,
104+
105+
per-file-ignores =
106+
; all tests
107+
test_*.py,tests.py,tests_*.py,*/tests/*:
108+
; Use of assert detected
109+
S101,
110+
; Found magic number
111+
WPS432,
112+
; Missing parameter(s) in Docstring
113+
DAR101,
114+
; Found too short name
115+
WPS111,
116+
; Found complex default value
117+
WPS404,
118+
119+
exclude =
120+
./.git,
121+
./venv,
122+
./cached_venv,
123+
./var,

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release python package
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Install poetry
14+
run: pipx install poetry
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: "3.9"
19+
- name: Install deps
20+
run: poetry install
21+
- name: Release package
22+
env:
23+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
24+
run: poetry publish --build

.github/workflows/test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Testing package
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint:
7+
strategy:
8+
matrix:
9+
cmd:
10+
- black
11+
- flake8
12+
- isort
13+
- mypy
14+
- autoflake
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Install poetry
19+
run: pipx install poetry
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: "3.9"
24+
cache: "poetry"
25+
- name: Install deps
26+
run: poetry install
27+
- name: Run lint check
28+
run: poetry run pre-commit run -a ${{ matrix.cmd }}

.gitignore

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+
#poetry.lock
103+
104+
# pdm
105+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106+
#pdm.lock
107+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108+
# in version control.
109+
# https://pdm.fming.dev/#use-with-ide
110+
.pdm.toml
111+
112+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113+
__pypackages__/
114+
115+
# Celery stuff
116+
celerybeat-schedule
117+
celerybeat.pid
118+
119+
# SageMath parsed files
120+
*.sage.py
121+
122+
# Environments
123+
.env
124+
.venv
125+
env/
126+
venv/
127+
ENV/
128+
env.bak/
129+
venv.bak/
130+
131+
# Spyder project settings
132+
.spyderproject
133+
.spyproject
134+
135+
# Rope project settings
136+
.ropeproject
137+
138+
# mkdocs documentation
139+
/site
140+
141+
# mypy
142+
.mypy_cache/
143+
.dmypy.json
144+
dmypy.json
145+
146+
# Pyre type checker
147+
.pyre/
148+
149+
# pytype static type analyzer
150+
.pytype/
151+
152+
# Cython debug symbols
153+
cython_debug/
154+
155+
# PyCharm
156+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158+
# and can be added to the global gitignore or merged into this file. For a more nuclear
159+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160+
.idea/
161+
.vscode/

.pre-commit-config.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v2.4.0
6+
hooks:
7+
- id: check-ast
8+
- id: trailing-whitespace
9+
- id: check-toml
10+
- id: end-of-file-fixer
11+
12+
- repo: https://github.com/asottile/add-trailing-comma
13+
rev: v2.1.0
14+
hooks:
15+
- id: add-trailing-comma
16+
17+
- repo: local
18+
hooks:
19+
- id: black
20+
name: Format with Black
21+
entry: poetry run black
22+
language: system
23+
types: [python]
24+
25+
- id: autoflake
26+
name: autoflake
27+
entry: poetry run autoflake
28+
language: system
29+
types: [python]
30+
args: [--in-place, --remove-all-unused-imports, --remove-duplicate-keys]
31+
32+
- id: isort
33+
name: isort
34+
entry: poetry run isort
35+
language: system
36+
types: [python]
37+
38+
- id: flake8
39+
name: Check with Flake8
40+
entry: poetry run flake8
41+
language: system
42+
pass_filenames: false
43+
types: [python]
44+
args: [--count, taskiq_aiogram]
45+
46+
- id: mypy
47+
name: Validate types with MyPy
48+
entry: poetry run mypy
49+
language: system
50+
types: [python]
51+
pass_filenames: false
52+
args: [taskiq_aiogram]
53+
54+
- id: yesqa
55+
name: Remove usless noqa
56+
entry: poetry run yesqa
57+
language: system
58+
types: [python]

0 commit comments

Comments
 (0)