-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyproject.toml
More file actions
150 lines (130 loc) · 3.66 KB
/
Copy pathpyproject.toml
File metadata and controls
150 lines (130 loc) · 3.66 KB
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
[tool.black]
line-length = 110
target-version = ['py37', 'py38', 'py39', 'py310', 'py312']
include = '(app|tests)/.*\.pyi?$'
[tool.poetry]
name = "notification-document-download-api"
version = "0.1.0"
description = "Document Download API"
authors = ["Canadian Digital Service"]
license = "MIT license"
readme = "README.md"
packages = []
[build-system]
requires = ["poetry-core>=1.7.1"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.dependencies]
python = "~3.12.7"
aws-xray-sdk = "^2.14.0"
awscli-cwlogs = "1.4.6"
environs = "^11.2.1"
Flask = "2.3.3"
Flask-Env = "2.0.0"
gevent = "24.2.1"
# PaaS
gunicorn = "22.0.0"
newrelic = "11.0.0"
notifications-utils = { git = "https://github.com/cds-snc/notifier-utils.git", tag = "53.0.1"}
pycryptodome = "*"
python-dotenv = "1.0.1"
python-magic = "0.4.27"
PyYAML = "6.0.1"
requests = { extras = ["security"], version = "*" }
types-aws-xray-sdk = "^2.14.0.20240606"
[tool.poetry.group.test.dependencies]
coveralls = "1.11.1"
freezegun = "1.5.1"
jinja2-cli = { extras = ["yaml"], version = "0.8.2" }
monkeytype = "23.3.0"
mypy = "1.0.1"
poethepoet = "^0.24.4"
pytest = "7.2.0"
pytest-cov = "3.0.0"
pytest-env = "0.8.1"
pytest-mock = "3.14.0"
requests-mock = "1.10.0"
ruff = "^0.8.2"
types-requests = "2.28.11"
# Poe the Poet tasks
[tool.poe.tasks.trace-app]
help = "Runs the app with monkeytype type collection enabled."
shell = """
monkeytype run -m flask run -p 7000 --host=0.0.0.0
"""
[tool.poe.tasks.trace-tests]
help = "Runs a test suite or single test through MonkeyType, generating a record of type annotation traces monkeytype.sqlite3"
shell = """
if [ -z "${method}" ]; then
monkeytype run -m pytest '/tests/app/${test-path}::${method}'
else
monkeytype run -m pytest '/tests/app/${test-path}'
fi
"""
# Define arguments for trace-tests
[tool.poe.tasks.trace-tests.args.test-path]
help = "Path to the test file to run. /tests/app/ can be omitted. e.g. poe trace-tests -p main/test_contact.py"
options = ["-p", "--path"]
type = "string"
required = true
[tool.poe.tasks.trace-tests.args.method]
help = "Name of the test method to execute and trace"
options = ["-m", "--method"]
type = "string"
default = ""
required = false
[tool.poe.tasks.list-modules]
help = "Lists all files and modules that have trace data associated with them in monkeytype.sqlite3"
cmd = "monkeytype list-modules"
# Composite task that uses list-modules to obtain a list of files and modules
[tool.poe.tasks.apply-annotations]
help = "Applies ALL known type annotations stored in monkeytype.sqlite3"
shell = """
for trace in ${TRACES}
do
monkeytype apply $trace
done
"""
deps = ["list-modules"]
uses = { TRACES = "list-modules"}
[tool.ruff]
target-version = "py310"
exclude = [
"venv*",
"__pycache__",
"node_modules",
"cache",
"migrations",
"build",
]
extend-include = ['(app|migrations|tests)/.*\.pyi?$']
src = ["app", "migrations", "tests"]
# Ruff formatter will wrap lines at a length of 130 characters.
line-length = 130
indent-width = 4
[tool.ruff.lint]
select = [
# PyFlakes
"F",
# Pycodestyle
"E",
"W",
# isort
"I001",
"I002",
]
ignore = ["E203", "E501", "E402"]
# Provide line length leeway for docstrings
[tool.ruff.lint.pycodestyle]
max-doc-length = 170
# Enforce doc string format? (google, numpy or pep257)
# convention = "google"
[tool.ruff.format]
# Match black formatting
# Double quotes for strings.
quote-style = "double"
# Indent with spaces, rather than tabs.
indent-style = "space"
# Respect magic trailing commas.
skip-magic-trailing-comma = false
# Automatically detect the appropriate line ending.
line-ending = "auto"