Skip to content
This repository was archived by the owner on Feb 12, 2023. It is now read-only.

Commit f5aebdd

Browse files
authored
Adds Poe and further configure some tools (#47)
Adds Poe and create some useful tasks, that are already specified in documentation. In addition, it further configures some tools as some issues were found during manual execution. Resolves: #42 Signed-off-by: George-Andrei Iosif <[email protected]>
1 parent 3212694 commit f5aebdd

File tree

1 file changed

+80
-5
lines changed

1 file changed

+80
-5
lines changed

pyproject.toml

Lines changed: 80 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ black = "^22.1.0"
4848
coverage = {extras = ["toml"], version = "^6.4.2"}
4949
coveralls = "^3.3.1"
5050
darglint = "^1.8.1"
51-
flake8 = "^5.0.1"
51+
flake8 = "^4.0.1"
5252
flake8-annotations = "^2.9.0"
5353
flake8-bandit = "^3.0.0"
5454
flake8-docstrings = "^1.6.0"
@@ -60,6 +60,7 @@ graphviz = "^0.20"
6060
isort = "^5.10.1"
6161
mypy = "^0.971"
6262
pep8-naming = "^0.13.0"
63+
poethepoet = "^0.16.0"
6364
pyenchant = "^3.2.2"
6465
pylint = "^2.13.5"
6566
pyproject-flake8 = "^0.0.1-alpha.4"
@@ -70,6 +71,13 @@ types-requests = "^2.27.30"
7071
[tool.black]
7172
line-length = 79
7273
preview = true
74+
include = '\.pyi?$'
75+
extend-exclude = """
76+
(
77+
^/.venv/*
78+
^/dist/*
79+
)
80+
"""
7381

7482
[tool.flake8]
7583
exclude = ".venv"
@@ -105,12 +113,20 @@ dictionaries = "en_US,python,technical"
105113
line_length = 79
106114
profile = "black"
107115
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
108-
known_first_party= ["src"]
109-
known_local_folder = ["src"]
116+
known_first_party= ["mutablesecurity"]
117+
known_local_folder = ["mutablesecurity"]
110118

111119
[tool.mypy]
112120
python_version = "3.9"
121+
files = [
122+
"mutablesecurity",
123+
"others",
124+
"tests"
125+
]
113126
show_error_codes = true
127+
namespace_packages = true
128+
explicit_package_bases = true
129+
ignore_missing_imports = true
114130

115131
[tool.pylint.MASTER]
116132
init-hook="import sys; sys.path.append('.')"
@@ -121,7 +137,9 @@ disable="missing-function-docstring"
121137
[tool.pytest.ini_options]
122138
pythonpath = [
123139
".",
124-
"src"
140+
"mutablesecurity",
141+
"others",
142+
"tests"
125143
]
126144

127145
[tool.pylint.SPELLING]
@@ -133,4 +151,61 @@ omit = [
133151
"mutablesecurity/solutions/implementations/*",
134152
"tests/*",
135153
"**/greenlet.py"
136-
]
154+
]
155+
156+
[tool.poe.tasks]
157+
158+
[tool.poe.tasks.lint_flake8]
159+
help = "Lint with flake8."
160+
cmd = "poetry run pflake8"
161+
162+
[tool.poe.tasks.lint_pylint]
163+
help = "Lint with pylint."
164+
cmd = "poetry run pylint --recursive=y --ignore=dist,.venv ."
165+
166+
[tool.poe.tasks.lint_mypy]
167+
help = "Lint with mypy."
168+
cmd = "poetry run mypy"
169+
170+
[tool.poe.tasks.lint]
171+
help = "Lint with all linters."
172+
sequence = ["lint_flake8", "lint_pylint", "lint_mypy"]
173+
174+
[tool.poe.tasks._test_first_chunk]
175+
help = "Run the first chunk of unit tests."
176+
cmd = """
177+
coverage run -m pytest
178+
-vv tests/
179+
--ignore=tests/solutions/test_invalid_commands.py;
180+
"""
181+
182+
[tool.poe.tasks._test_second_chunk]
183+
help = "Run the second chunk of unit tests."
184+
cmd = """
185+
coverage run -a -m pytest
186+
-vv tests/solutions/test_invalid_commands.py;
187+
"""
188+
189+
[tool.poe.tasks.test]
190+
help = "Run all the unit tests."
191+
sequence = ["_test_first_chunk", "_test_second_chunk"]
192+
193+
[tool.poe.tasks.coverage]
194+
help = "Report the coverage"
195+
cmd = "coverage report -m"
196+
197+
[tool.poe.tasks.covtest]
198+
help = "Run the unit tests and report the coverage."
199+
sequence = ["test", "coverage"]
200+
201+
[tool.poe.tasks.generate_specs]
202+
help = "Generate the solutions spec sheets in /tmp."
203+
cmd = "./others/spec_sheets_generation_script/generate.py /tmp"
204+
205+
[tool.poe.tasks.generate_api_call_graph]
206+
help = "Generate the API call graph."
207+
cmd = "./others/api_call_graph_script/generate.py"
208+
209+
[tool.poe.tasks.generate_readme]
210+
help = "Generate README.md."
211+
cmd = ".others/readme_generation_script/generate.py"

0 commit comments

Comments
 (0)