File tree Expand file tree Collapse file tree
{{cookiecutter.module_name}} Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,10 +32,10 @@ jobs:
3232 python-version : ${{ matrix.python-version }}
3333
3434 - name : Install code
35- run : python -m pip install .[test ]
35+ run : python -m pip install .[linting ]
3636
3737 - name : Flake8 code
38- run : python -m flake8
38+ run : python -m flake8 -v
3939
4040 - name : Mypy check
41- run : python -m mypy
41+ run : python -m mypy -v
Original file line number Diff line number Diff line change @@ -16,24 +16,34 @@ readme = "README.md"
1616
1717[project .optional-dependencies ]
1818test = [
19- {%- if cookiecutter.linting|lower == 'y' %}
20- "mypy",
21- "flake8",
22- {%- endif %}
2319{%- if cookiecutter.testing|lower != 'none' %}
2420 "pytest",
2521{%- endif %}
2622{%- if cookiecutter.testing|lower == 'pytest-cov' %}
2723 "pytest-cov",
2824{%- endif %}
2925]
30-
26+ {% if cookiecutter.linting|lower == 'y' -%}
27+ linting = [
28+ " mypy" ,
29+ " flake8" ,
30+ ]
31+ {% endif -%}
3132{% if cookiecutter.build_docs|lower == 'y' -%}
3233docs = [
3334 " jupyter-book" ,
3435 " jupytext" ,
3536]
3637{% endif -%}
38+ all = [
39+ " {{cookiecutter.module_name}}[test]" ,
40+ {%- if cookiecutter.linting|lower == 'y' %}
41+ "{{cookiecutter.module_name}}[linting]",
42+ {%- endif %}
43+ {%- if cookiecutter.build_docs|lower == 'y' %}
44+ "{{cookiecutter.module_name}}[docs]"
45+ {%- endif %}
46+ ]
3747
3848{% if cookiecutter.testing|lower != 'none' %}
3949[tool .pytest .ini_options ]
@@ -50,4 +60,19 @@ addopts = [
5060testpaths = [
5161 " tests"
5262]
53- {% endif -%}
63+ {% endif -%}
64+
65+ {%- if cookiecutter.linting|lower == 'y' %}
66+ [tool .mypy ]
67+ ignore_missing_imports = true
68+ # Folders to exclude
69+ exclude = [
70+ " docs/" ,
71+ " build/"
72+ ]
73+ # Folder to check with mypy
74+ files = [
75+ " src" ,
76+ " tests"
77+ ]
78+ {% endif -%}
You can’t perform that action at this time.
0 commit comments