Skip to content

Commit 71d0b13

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

File tree

12 files changed

+2136
-0
lines changed

12 files changed

+2136
-0
lines changed

.flake8

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
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+
94+
; all init files
95+
__init__.py:
96+
; ignore not used imports
97+
F401,
98+
; ignore import with wildcard
99+
F403,
100+
; Found wrong metadata variable
101+
WPS410,
102+
103+
per-file-ignores =
104+
; all tests
105+
test_*.py,tests.py,tests_*.py,*/tests/*:
106+
; Use of assert detected
107+
S101,
108+
; Found magic number
109+
WPS432,
110+
; Missing parameter(s) in Docstring
111+
DAR101,
112+
; Found too short name
113+
WPS111,
114+
; Found complex default value
115+
WPS404,
116+
117+
exclude =
118+
./.git,
119+
./venv,
120+
./cached_venv,
121+
./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: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Testing package
2+
3+
on: push
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 }}
29+
pytest:
30+
permissions:
31+
checks: write
32+
pull-requests: write
33+
contents: write
34+
strategy:
35+
matrix:
36+
py_version: ["3.7", "3.8", "3.9", "3.10"]
37+
os: [ubuntu-latest, windows-latest]
38+
runs-on: "${{ matrix.os }}"
39+
steps:
40+
- uses: actions/checkout@v2
41+
- name: Install poetry
42+
run: pipx install poetry
43+
- name: Set up Python
44+
uses: actions/setup-python@v4
45+
with:
46+
python-version: "${{ matrix.py_version }}"
47+
cache: "poetry"
48+
- name: Install deps
49+
run: poetry install
50+
- name: Run pytest check
51+
run: poetry run pytest -vv -n auto --cov="taskiq_fastapi" .
52+
- name: Generate report
53+
run: poetry run coverage xml
54+
- name: Upload coverage reports to Codecov with GitHub Action
55+
uses: codecov/codecov-action@v3
56+
if: matrix.os == 'ubuntu-latest' && matrix.py_version == '3.9'
57+
with:
58+
token: ${{ secrets.CODECOV_TOKEN }}
59+
fail_ci_if_error: false
60+
verbose: true

.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/

0 commit comments

Comments
 (0)