File tree Expand file tree Collapse file tree 2 files changed +34
-9
lines changed
{{cookiecutter.module_name}} Expand file tree Collapse file tree 2 files changed +34
-9
lines changed Original file line number Diff line number Diff line change @@ -32,10 +32,10 @@ jobs:
32
32
python-version : ${{ matrix.python-version }}
33
33
34
34
- name : Install code
35
- run : python -m pip install .[test ]
35
+ run : python -m pip install .[linting ]
36
36
37
37
- name : Flake8 code
38
- run : python -m flake8
38
+ run : python -m flake8 -v
39
39
40
40
- 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"
16
16
17
17
[project .optional-dependencies ]
18
18
test = [
19
- {%- if cookiecutter.linting|lower == 'y' %}
20
- "mypy",
21
- "flake8",
22
- {%- endif %}
23
19
{%- if cookiecutter.testing|lower != 'none' %}
24
20
"pytest",
25
21
{%- endif %}
26
22
{%- if cookiecutter.testing|lower == 'pytest-cov' %}
27
23
"pytest-cov",
28
24
{%- endif %}
29
25
]
30
-
26
+ {% if cookiecutter.linting|lower == 'y' -%}
27
+ linting = [
28
+ " mypy" ,
29
+ " flake8" ,
30
+ ]
31
+ {% endif -%}
31
32
{% if cookiecutter.build_docs|lower == 'y' -%}
32
33
docs = [
33
34
" jupyter-book" ,
34
35
" jupytext" ,
35
36
]
36
37
{% 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
+ ]
37
47
38
48
{% if cookiecutter.testing|lower != 'none' %}
39
49
[tool .pytest .ini_options ]
@@ -50,4 +60,19 @@ addopts = [
50
60
testpaths = [
51
61
" tests"
52
62
]
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