-
Notifications
You must be signed in to change notification settings - Fork 16
/
pyproject.toml
166 lines (155 loc) · 4.33 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
[tool.poetry]
name = "{{ cookiecutter.repo_name }}"
version = "1.0"
description = "{{ cookiecutter.project_title }}"
license = "Proprietary" # or "MIT"
authors = ["{{ cookiecutter.domain_name }} <{{ cookiecutter.admin_email }}>"]
repository = "{{ cookiecutter.gitlab_repo_url }}"
# NOTE:
# without this explicit reference to PyPI, poetry may raise exception "PackageNotFound".
[[tool.poetry.source]]
name = "the_pypi"
url = "https://pypi.org/simple"
default = true
[tool.poetry.dependencies]
python = "^{{ cookiecutter.python_version }}"
# - {% if cookiecutter.include_celery == YES %}
celery = {version = "==5.2.*", extras = ["redis"]}
# - {% endif %}
Django = "==4.0.*"
environs = "*"
dj-database-url = "*"
django-redis = "==5.2.*"
# - {%- if cookiecutter.django_media_engine == GCS %}
django-storages = { version = "==1.*", extras = ["google"] }
# - {% elif cookiecutter.django_media_engine == S3 %}
boto3 = "==1.*"
django-storages = { version = "==1.*" }
# - {%- endif %}
gunicorn = "==20.*"
# - {%- if cookiecutter.docker_base_image == 'alpine' %}
# If you change the docker base image to be non-alpine
# This can be changed to psycopg2-binary to get advantage from
# using wheels
psycopg2 = "==2.9.*"
# - {%- else %}
psycopg2-binary = "==2.9.*"
# - {%- endif %}
sentry-sdk = "==1.*"
redis = "==4.*"
# - {% if cookiecutter.frontend_style == WEBAPP %}
django-crispy-forms = "==1.11.*"
django-reverse-js = "==0.1.3"
django-settings-export = "==1.2.*"
django-webpack-loader = "==1.4.*"
# - {% elif cookiecutter.frontend_style == SPA %}
djangorestframework = "==3.13.*"
djangorestframework_simplejwt = "==5.1.*"
django-cors-headers = "==3.11.*"
django-filter = "==21.*"
tg-react = "==3.*"
# - {% endif %}
tg-utils = {version = "*", extras = ["model-hash", "health_check"]}
[tool.poetry.dev-dependencies]
black = "==22.3.0"
django-debug-toolbar = "*"
# Testing & quality tools
coverage = "==6.*"
ipdb = "*"
safety = "*"
isort = "==5.*"
# Note prospector is very picky about its dependencies,
# avoid specifying versions for pylint/pylint-django/astroid
# and let prospector determine which versions work together
prospector = {version = "==1.*", extras=["with_bandit"]}
pytest = "==7.*"
pytest-django = "*"
pytest-cov = "*"
pytest-mock = "*"
pylint-django = "*"
model-bakery = "*"
freezegun = "*"
# - {% if cookiecutter.use_mypy == YES %}
# MyPy dependencies
types-freezegun = "*"
boto3-stubs = "*"
django-stubs = "*"
djangorestframework-stubs = "*"
mypy = "*"
# - {% endif %}
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
[tool.black]
# Enable specific Python version if necessary:
# target-version = ['py38']
line-length = 88
include = '\.pyi?$'
exclude = '''
(
/(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.mypy_cache
| \.tox
| \.venv
| _build
| build
| dist
| docs
| cover
)/
| local.py
| local_test.py
)
'''
[tool.isort]
skip = "settings/local.py,settings/local_test.py,{{cookiecutter.repo_name}}/wsgi.py"
skip_glob = "node_modules"
line_length = '88'
atomic = 'true'
multi_line_output = '3'
include_trailing_comma = 'true'
force_grid_wrap = '0'
use_parentheses = 'true'
ensure_newline_before_comments = 'true'
known_django = "django"
known_pytest = "pytest"
overwrite_in_place = 'true'
known_first_party = "accounts,{{cookiecutter.repo_name}},settings"
lines_between_types = '0'
sections = "FUTURE,STDLIB,DJANGO,PYTEST,THIRDPARTY,FIRSTPARTY,LOCALFOLDER"
lines_after_imports = '2'
force_alphabetical_sort_within_sections = '1'
[tool.coverage.run]
branch = true
relative_files = true
omit = [
"*test*",
"*migrations*",
"manage.py",
"{{cookiecutter.repo_name}}/urls.py",
"{{cookiecutter.repo_name}}/celery.py",
"{{cookiecutter.repo_name}}/celery_settings.py",
"{{cookiecutter.repo_name}}/storages.py",
"{{cookiecutter.repo_name}}/wsgi.py",
"settings/*",
]
[tool.coverage.html]
directory = "cover"
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--junit-xml report.xml"
DJANGO_SETTINGS_MODULE = "settings.local_test"
markers = ["django_db", "parametrize", "unit"]
norecursedirs = [
"migrations",
".data",
# - {% if cookiecutter.frontend_style == SPA %}
"app",
# - {% elif cookiecutter.frontend_style == WEBAPP %}
"webapp",
# - {% endif %}
"node_modules",
]
python_files = ["test_*.py", "tests/*.py", "tests.py"]