@@ -48,7 +48,7 @@ black = "^22.1.0"
4848coverage = {extras = [" toml" ], version = " ^6.4.2" }
4949coveralls = " ^3.3.1"
5050darglint = " ^1.8.1"
51- flake8 = " ^5 .0.1"
51+ flake8 = " ^4 .0.1"
5252flake8-annotations = " ^2.9.0"
5353flake8-bandit = " ^3.0.0"
5454flake8-docstrings = " ^1.6.0"
@@ -60,6 +60,7 @@ graphviz = "^0.20"
6060isort = " ^5.10.1"
6161mypy = " ^0.971"
6262pep8-naming = " ^0.13.0"
63+ poethepoet = " ^0.16.0"
6364pyenchant = " ^3.2.2"
6465pylint = " ^2.13.5"
6566pyproject-flake8 = " ^0.0.1-alpha.4"
@@ -70,6 +71,13 @@ types-requests = "^2.27.30"
7071[tool .black ]
7172line-length = 79
7273preview = true
74+ include = ' \.pyi?$'
75+ extend-exclude = """
76+ (
77+ ^/.venv/*
78+ ^/dist/*
79+ )
80+ """
7381
7482[tool .flake8 ]
7583exclude = " .venv"
@@ -105,12 +113,20 @@ dictionaries = "en_US,python,technical"
105113line_length = 79
106114profile = " black"
107115sections = [" 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 ]
112120python_version = " 3.9"
121+ files = [
122+ " mutablesecurity" ,
123+ " others" ,
124+ " tests"
125+ ]
113126show_error_codes = true
127+ namespace_packages = true
128+ explicit_package_bases = true
129+ ignore_missing_imports = true
114130
115131[tool .pylint .MASTER ]
116132init-hook =" import sys; sys.path.append('.')"
@@ -121,7 +137,9 @@ disable="missing-function-docstring"
121137[tool .pytest .ini_options ]
122138pythonpath = [
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