-
Notifications
You must be signed in to change notification settings - Fork 10
/
pyproject.toml
149 lines (130 loc) · 4.49 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
[tool.poetry]
name = "brave-search"
version = "0.2.0"
description = "Brave Search API wrapper"
authors = ["Kayvane Shakerifar"]
readme = "README.md"
homepage = "https://github.com/kayvane1/brave-api"
repository = "https://github.com/kayvane1/brave-api"
keywords = ['search', 'brave', 'api'] # noqa
packages = [
{ include = "brave", from = "src" },
]
[tool.poetry.build]
generate-setup-file = false
[tool.poetry.dependencies]
python = "^3.8"
requests = "^2.26.0"
httpx = ">=0.24.0, <0.26.0"
tenacity = "^8.2.3"
pydantic = "^2.5.2"
pytest-asyncio = "^0.23.2"
numpy = "^1.24.4"
[tool.poetry.group.test]
optional = true
[tool.poetry.group.test.dependencies]
pytest = "^7.1.1" # Allows for testing of the project
pytest-cov = "^4.0.0" # Allows to run coverage of the project
moto = "^3.1.6" # Allows for mocking of AWS services
coverage = "^7.3.3" # Allows for coverage of the project
[tool.poetry.group.lint]
optional = true
[tool.poetry.group.lint.dependencies]
flake8 = "^4.0.1" # Style Guide Enforcement
pyproject-flake8 = "^0.0.1-alpha.4" # Allows configuration of flake 8 from pyproject.toml
flake8-bugbear = "^22.3.23" # Finding likely bugs and design problems in your program.
flake8-print = "^4.0.0" # Check for print statements in python files.
flake8-docstrings = "^1.6.0" # Include checks provided by pep257.
flake8-annotations = "^2.8.0" # check for presence of type annotations in function definitions.
isort = "^5.10.1" # Sort imports
yamllint = "^1.26.3" # Linter for YAML files
bandit = {version = "^1.7.4", extras = ["toml"]} # Security linter
pre-commit = "^2.18.1" # Runs a pipeline before commiting code
black = "^22.6.0" # Python style checks
[tool.poetry.group.dev.dependencies]
ipykernel = "^6.24.0"
[build-system]
requires = ["poetry-core>=1.2.0rc1"]
build-backend = "poetry.core.masonry.api"
[tool.black]
line-length = 119
target-version = ['py39']
include = '\.pyi?$'
extend-exclude = '''
/(
\.eggs
| \.git
| \.venv
| \.env
| \.vscode
| build
| dist
| \.mypy_cache
)\
'''
[tool.isort]
profile = 'black'
force_single_line = true
combine_as_imports = true
lines_between_types = 1
lines_after_imports = 2
src_paths = ["src", "tests"]
line_length = 119
[tool.flake8]
max-line-length = 119
select = [ # Choose the flake8 errors to select globally here
"C", # McCabe complexity
"E", # pep8 errors
"W", # pep8 warnings
"F", # pyflakes errors
"N", # naming conventions
"B", # bugbear errors (needs plugin installed)
"ANN", # flake8 annotations errors (needs plugin installed)
"T", # flake8 print errors (needs plugin installed)
"D", # flake8 doscstrings errors (needs plugin installed)
"B950", # Line too long. It considers "max-line-length" but only triggers when exceeded by more than 10%.
]
ignore = [ # Choose the flake8 errors to ignore globally here
"E501", # Line too long (using B950 instead, which has 10% tolerance)
"D107", # Missing docstring in __init__
"D202", # No blank lines allowed after function docstring
"D400", # First line should end with a period
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package
"ANN003", # Missing type annotation for **kwargs
"ANN002", # Missing type annotation for **args
"ANN1", # Missing type annotation for self in methot or cls method
"W503", # Line break occurred before a binary operator
"E203", # Whitespace before ':'
"F403", # 'from module import *' used; unable to detect undefined names
]
per-file-ignores = [ # Choose the flake8 errors to ignore per file here
"*/__init__.py:F401", # Ignore imported but unused in __init__.py files
"tests/*:ANN,D", # Ignore Docstring and annotations on tests
]
exclude = [
".venv/*",
".vscode/*",
]
# See other flake8 extensions here: https://github.com/DmytroLitvinov/awesome-flake8-extensions
[tool.bandit]
skips = [ # Choose the bandit errors to ignore globally
"B101", # Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
"B104", # Possible binding to all interfaces
"B113", # Requests call without timeout
]
exclude_dirs = [
".venv",
]
[tool.pytest.ini_options]
minversion = "7.1"
addopts = """
--verbose
--color=yes
--assert=plain
--cov-report term
--cov=src
"""
testpaths = [
"tests",
]