-
Notifications
You must be signed in to change notification settings - Fork 13
/
pyproject.toml
166 lines (145 loc) · 4.58 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 = "simpler-grants-gov-api"
version = "0.1.0"
description = "Back end API for simpler.grants.gov"
packages = [{ include = "src" }]
authors = ["Nava Engineering <[email protected]>"]
[tool.poetry.dependencies]
# See /documentation/api/package-depedency-management.md#Upgrading Python
# for details on upgrading your Python version
python = "~3.13"
SQLAlchemy = { version = "^2.0.21", extras = ["mypy"] }
alembic = "^1.12.0"
python-dotenv = "^1.0.0"
pydantic = "^2.4.2"
botocore = "^1.31.62"
boto3 = "^1.28.62"
smart-open = "^7.0.0"
pytz = "^2023.3.post1"
APIFlask = "^2.1.0"
marshmallow-dataclass = { extras = ["enum", "union"], version = "^8.5.8" }
marshmallow = "^3.20.1"
gunicorn = "^23.0.0"
psycopg = { extras = ["binary"], version = "^3.1.19" }
pydantic-settings = "^2.0.3"
flask-cors = "^5.0.0"
opensearch-py = "^2.5.0"
[tool.poetry.group.dev.dependencies]
black = "^24.0.0"
isort = "^5.12.0"
mypy = "^1.8.0"
moto = { extras = ["s3"], version = "^5.0.0" }
types-pytz = "^2023.3.1.1"
coverage = "^7.3.2"
Faker = "^28.0.0"
factory-boy = "^3.3.0"
bandit = "^1.7.5"
pytest = "^8.0.0"
pytest-watch = "^4.2.0"
types-pyyaml = "^6.0.12.11"
setuptools = "^75.0.0"
pydot = "3.0.2"
sadisplay = "0.4.9"
ruff = "^0.7.0"
debugpy = "^1.8.1"
freezegun = "^1.5.0"
types-requests = "^2.31"
graphviz = "^0.20.3"
eralchemy = "^1.5.0"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.scripts]
db-migrate = "src.db.migrations.run:up"
db-migrate-down = "src.db.migrations.run:down"
db-migrate-down-all = "src.db.migrations.run:downall"
db-seed-local = "tests.lib.seed_local_db:seed_local_db"
create-erds = "bin.create_erds:main"
setup-postgres-db = "src.db.migrations.setup_local_postgres_db:setup_local_postgres_db"
setup-localstack = "bin.setup_localstack:main"
[tool.black]
line-length = 100
[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 100
[tool.ruff]
line-length = 100
# Some rules are considered preview-only, this allows them
# assuming we enabled them below
preview = true
[tool.ruff.lint]
# See: https://docs.astral.sh/ruff/rules/ for all possible rules
select = ["B", "C", "E", "F", "W", "B9"]
ignore = [
# too many leading '#' for block comment, we can format our comments however we want
"E266",
# Ignore line-too-long errors, assume the formatter handles that appropriately
"E501",
# Ignore rules regarding unecessary list / generator usage which complains about [e for e in MyEnum] #
"C4",
# Ignore rule that flags functions with many branches - sometimes we just have a lot of
# business rules that make sense to aggregate in one place.
"C901",
]
[tool.mypy]
# https://mypy.readthedocs.io/en/stable/config_file.html
color_output = true
error_summary = true
pretty = true
show_error_codes = true
show_column_numbers = true
show_error_context = true
namespace_packages = true
ignore_missing_imports = true
warn_unused_configs = true
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
no_implicit_optional = true
strict_equality = true
warn_no_return = true
warn_redundant_casts = true
warn_unreachable = true
warn_unused_ignores = true
plugins = ["pydantic.mypy"]
[tool.bandit]
# Ignore audit logging test file since test audit logging requires a lot of operations that trigger bandit warnings
exclude_dirs = ["./tests/src/logging/test_audit.py"]
[[tool.mypy.overrides]]
# Migrations are generated without "-> None"
# for the returns. Rather than require manually
# fixing this for every migration generated,
# disable the check for that folder.
module = "src.db.migrations.versions.*"
disallow_untyped_defs = false
[tool.pytest.ini_options]
# Ignore deprecation warnings in library code.
# When a library has addressed its deprecation issues and we've updated the
# library, we can remove the ignore filter for that library.
filterwarnings = [
"ignore::DeprecationWarning:botocore.*",
] # pytest-watch errors if the closing bracket is on it's own line
markers = [
"audit: mark a test as a security audit log test, to be run isolated from other tests",
]
[tool.coverage.run]
omit = [
# Decodelog is only used for formatting logs locally
"src/logging/decodelog.py",
# app_config only runs via the gunicorn script which doens't happen locally
"src/app_config.py",
# Migrations aren't run in tests
"src/db/migrations/**",
]
[tool.coverage.report]
fail_under = 80
exclude_lines = [
# Exclude abstract & overloaad methods from
# code coverage reports as they won't ever directly run
"@abc.abstractmethod",
"@abstractmethod",
"@typing.overload",
]