Skip to content

Commit 6123369

Browse files
committed
TST: Run flake8 outside of pytest.
1 parent d09bfdf commit 6123369

File tree

4 files changed

+127
-126
lines changed

4 files changed

+127
-126
lines changed

.flake8

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
[flake8]
2+
ignore =
3+
# Normal default
4+
E121,E123,E126,E226,E24,E704,W503,W504,
5+
# Additional ignores:
6+
E111, E114, E115, E116, E122, E124, E125, E127, E128, E129, E131,
7+
E265, E266,
8+
E305, E306,
9+
E722, E741,
10+
F401, F403, F811, F841,
11+
# Some new flake8 ignores:
12+
N801, N802, N803, N806, N812,
13+
14+
exclude =
15+
.git
16+
build
17+
# External files.
18+
versioneer.py
19+
tools/gh_api.py
20+
tools/github_stats.py
21+
22+
per-file-ignores =
23+
setup.py: E402
24+
setupext.py: E302, E501
25+
26+
tools/compare_backend_driver_results.py: E501
27+
tools/subset.py: E221, E231, E251, E261, E302, E501, E701
28+
29+
matplotlib/_cm.py: E202, E203
30+
matplotlib/_mathtext_data.py: E203, E261
31+
matplotlib/backend_bases.py: E225
32+
matplotlib/backends/_backend_tk.py: E203, E222, E225, E231, E271, E301, E303, E401, E501, E701
33+
matplotlib/backends/backend_agg.py: E261, E302, E303, E701
34+
matplotlib/backends/backend_cairo.py: E203, E221, E261, E303, E402, E711
35+
matplotlib/backends/backend_gtk3.py: E203, E221, E222, E225, E251, E261, E501
36+
matplotlib/backends/backend_macosx.py: E231, E261
37+
matplotlib/backends/backend_pgf.py: E303, E731
38+
matplotlib/backends/backend_ps.py: E203, E225, E228, E231, E261, E262, E302, E303, E501, E701
39+
matplotlib/backends/backend_svg.py: E203, E225, E228, E231, E261, E302, E501
40+
matplotlib/backends/qt_editor/formlayout.py: E301, E501
41+
matplotlib/backends/tkagg.py: E231, E302, E701
42+
matplotlib/backends/windowing.py: E301, E302
43+
matplotlib/font_manager.py: E203, E221, E225, E251, E261, E262, E302, E501
44+
matplotlib/fontconfig_pattern.py: E201, E203, E221, E222, E225, E302
45+
matplotlib/legend_handler.py: E201, E501
46+
matplotlib/mathtext.py: E201, E202, E203, E211, E221, E222, E225, E231, E251, E261, E301, E302, E303, E402, E501
47+
matplotlib/patheffects.py: E231
48+
matplotlib/projections/geo.py: E203, E221, E231, E261, E502
49+
matplotlib/pylab.py: E501
50+
matplotlib/pyplot.py: E201, E202, E221, E222, E225, E231, E251, E261, E302, E501, E701
51+
matplotlib/rcsetup.py: E203, E225, E261, E302, E501
52+
matplotlib/sphinxext/mathmpl.py: E302
53+
matplotlib/sphinxext/only_directives.py: E302
54+
matplotlib/sphinxext/plot_directive.py: E261, E302, E402
55+
matplotlib/tests/test_image.py: E225, E231, E251, E302, E501
56+
matplotlib/tests/test_lines.py: E231, E261
57+
matplotlib/tests/test_mathtext.py: E261, E501
58+
matplotlib/transforms.py: E201, E202, E203, E501
59+
matplotlib/tri/triinterpolate.py: E201, E221
60+
matplotlib/type1font.py: E731
61+
62+
mpl_toolkits/__init__.py: E261
63+
mpl_toolkits/axes_grid/axes_divider.py: E501
64+
mpl_toolkits/axes_grid/axes_rgb.py: E302, E501
65+
mpl_toolkits/axes_grid1/axes_divider.py: E402, E501
66+
mpl_toolkits/axes_grid1/axes_grid.py: E225
67+
mpl_toolkits/axes_grid1/axes_rgb.py: E231
68+
mpl_toolkits/axes_grid1/axes_size.py: E261, E501
69+
mpl_toolkits/axes_grid1/colorbar.py: E225, E231, E261, E262, E302, E303, E501, E701
70+
mpl_toolkits/axes_grid1/inset_locator.py: E501
71+
mpl_toolkits/axes_grid1/mpl_axes.py: E303, E501
72+
mpl_toolkits/axes_grid1/parasite_axes.py: E225, E231, E302, E303, E501
73+
mpl_toolkits/axisartist/angle_helper.py: E201, E203, E221, E222, E225, E231, E251, E261, E262, E302, E303, E501
74+
mpl_toolkits/axisartist/axis_artist.py: E201, E202, E221, E225, E228, E231, E251, E261, E262, E302, E303, E402, E501, E701, E711
75+
mpl_toolkits/axisartist/axisline_style.py: E231, E261, E262, E302, E303
76+
mpl_toolkits/axisartist/axislines.py: E225, E231, E261, E303, E501
77+
mpl_toolkits/axisartist/clip_path.py: E225, E302, E303, E501
78+
mpl_toolkits/axisartist/floating_axes.py: E225, E231, E261, E262, E302, E303, E402, E501
79+
mpl_toolkits/axisartist/grid_finder.py: E231, E261, E302, E303, E402
80+
mpl_toolkits/axisartist/grid_helper_curvelinear.py: E225, E231, E261, E262, E271, E302, E303, E501
81+
mpl_toolkits/mplot3d/art3d.py: E203, E222, E225, E231
82+
mpl_toolkits/mplot3d/axes3d.py: E203, E231, E303, E402, E501, E701
83+
mpl_toolkits/mplot3d/axis3d.py: E231, E302
84+
mpl_toolkits/mplot3d/proj3d.py: E231, E302, E303
85+
mpl_toolkits/tests/test_axes_grid1.py: E201, E202
86+
mpl_toolkits/tests/test_mplot3d.py: E231, E302
87+
88+
doc/**: E302, E501
89+
doc/conf.py: E402
90+
tutorials/**: E402, E501
91+
92+
examples/**: E501, E402
93+
examples/images_contours_and_fields/tricontour_demo.py: E201
94+
examples/images_contours_and_fields/tripcolor_demo.py: E201
95+
examples/images_contours_and_fields/triplot_demo.py: E201
96+
examples/misc/table_demo.py: E201
97+
examples/pyplots/annotate_transform.py: E228, E251
98+
examples/pyplots/annotation_polar.py: E231
99+
examples/pyplots/auto_subplots_adjust.py: E231, E261, E302
100+
examples/pyplots/boxplot_demo_pyplot.py: E231
101+
examples/pyplots/compound_path_demo.py: E231
102+
examples/pyplots/fig_axes_customize_simple.py: E261
103+
examples/pyplots/pyplot_formatstr.py: E231
104+
examples/pyplots/pyplot_mathtext.py: E231
105+
examples/pyplots/pyplot_simple.py: E231
106+
examples/pyplots/pyplot_two_subplots.py: E302
107+
examples/pyplots/text_commands.py: E231
108+
examples/pyplots/text_layout.py: E231
109+
examples/pyplots/whats_new_98_4_fancy.py: E225, E261, E302
110+
examples/pyplots/whats_new_98_4_fill_between.py: E225
111+
examples/pyplots/whats_new_98_4_legend.py: E228
112+
examples/pyplots/whats_new_99_spines.py: E231, E261

.travis.yml

+11-5
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ env:
6363
- NPROC=2
6464
- OPENBLAS_NUM_THREADS=1
6565
- PYTHONFAULTHANDLER=1
66-
- PYTEST_ADDOPTS="-rawR --maxfail=50 --timeout=350 --durations=25 --cov-report= --cov=lib -n $NPROC"
66+
- PYTEST_ADDOPTS="-rawR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n $NPROC"
67+
- RUN_FLAKE8=
6768

6869
matrix:
6970
include:
@@ -77,8 +78,8 @@ matrix:
7778
- python: 3.6
7879
env:
7980
- DELETE_FONT_CACHE=1
80-
- PYTEST_ADDOPTS="$PYTEST_ADDOPTS --flake8"
8181
- EXTRAREQS='-r requirements/testing/travis36.txt'
82+
- RUN_FLAKE8=1
8283
- python: "nightly"
8384
env: PRE=--pre
8485
- os: osx
@@ -156,9 +157,14 @@ before_script: |
156157
rm -rf ~/.cache/matplotlib
157158
fi
158159
159-
script: |
160-
echo "Calling pytest with the following arguments: $PYTEST_ADDOPTS"
161-
python -mpytest
160+
script:
161+
- |
162+
echo "Calling pytest with the following arguments: $PYTEST_ADDOPTS"
163+
python -mpytest
164+
- |
165+
if [[ $RUN_FLAKE8 == 1 ]]; then
166+
flake8 --statistics && echo "Flake8 passed without any issues!"
167+
fi
162168
163169
before_cache: |
164170
rm -rf $HOME/.cache/matplotlib/tex.cache

pytest.ini

+1-119
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,8 @@
11
[pytest]
2-
testpaths = lib examples
2+
testpaths = lib
33
python_files = test_*.py
44

55
markers =
66
backend: Set alternate Matplotlib backend temporarily.
77
network: Mark a test that uses the network.
88
style: Set alternate Matplotlib style temporarily.
9-
10-
flake8-ignore =
11-
* E111 E114 E115 E116 E121 E122 E123 E124 E125 E126 E127 E128 E129 E131 E226 E240 E241 E242 E243 E244 E245 E246 E247 E248 E249 E265 E266 E305 E306 E704 E722 E741 F401 F403 F811 F841 W503
12-
13-
setup.py E402
14-
setupext.py E301 E302 E501
15-
16-
versioneer.py ALL # External file.
17-
tools/gh_api.py ALL # External file.
18-
tools/github_stats.py ALL # External file.
19-
20-
tools/subset.py E221 E231 E251 E261 E302 E501 E701 E703
21-
22-
matplotlib/backends/qt_editor/formlayout.py E301 E402 E501
23-
matplotlib/backends/backend_agg.py E225 E228 E231 E261 E301 E302 E303 E701
24-
matplotlib/backends/backend_cairo.py E203 E211 E221 E231 E261 E272 E302 E303 E401 E402 E701 E711
25-
matplotlib/backends/backend_gtk3.py E201 E202 E203 E211 E221 E222 E225 E231 E251 E261 E262 E301 E302 E401 E402 E501 E701
26-
matplotlib/backends/backend_macosx.py E222 E225 E231 E261 E701 E711
27-
matplotlib/backends/backend_pgf.py E261 E302 E303 E731
28-
matplotlib/backends/backend_ps.py E202 E203 E225 E228 E231 E261 E262 E271 E301 E302 E303 E401 E402 E501 E701
29-
matplotlib/backends/backend_svg.py E203 E221 E225 E228 E231 E261 E302 E401 E501
30-
matplotlib/backends/backend_template.py E302 E303
31-
matplotlib/backends/_backend_tk.py E201 E202 E203 E222 E225 E231 E251 E271 E301 E302 E303 E401 E501 E701 W293
32-
matplotlib/backends/tkagg.py E231 E302 E701
33-
matplotlib/backends/windowing.py E301 E302
34-
matplotlib/backend_bases.py E225 E712
35-
matplotlib/projections/__init__.py E302
36-
matplotlib/projections/geo.py E203 E221 E231 E261 E302 E402 E502
37-
matplotlib/sphinxext/mathmpl.py E302
38-
matplotlib/sphinxext/only_directives.py E302
39-
matplotlib/sphinxext/plot_directive.py E261 E301 E302 E401 E402
40-
matplotlib/testing/decorators.py E301 E303
41-
matplotlib/testing/jpl_units/__init__.py E201 E202 E302
42-
matplotlib/testing/jpl_units/Duration.py E201 E202 E302
43-
matplotlib/testing/jpl_units/Epoch.py E201 E202 E203 E302 E501
44-
matplotlib/testing/jpl_units/EpochConverter.py E201 E202 E251 E302 E711
45-
matplotlib/testing/jpl_units/StrConverter.py E201 E202 E221 E302 E303
46-
matplotlib/testing/jpl_units/UnitDbl.py E201 E202 E203
47-
matplotlib/testing/jpl_units/UnitDblConverter.py E201 E202 E203 E251 E302 E711
48-
matplotlib/testing/jpl_units/UnitDblFormatter.py E201 E202 E251 E302
49-
matplotlib/tests/test_image.py E225 E231 E251 E302 E303 E501
50-
matplotlib/tests/test_lines.py E231 E261
51-
matplotlib/tests/test_mathtext.py E261 E302 E501
52-
matplotlib/tri/triinterpolate.py E201 E221
53-
matplotlib/_cm.py E101 E202 E203 W191
54-
matplotlib/_mathtext_data.py E203 E231 E261
55-
matplotlib/font_manager.py E201 E203 E221 E225 E228 E231 E251 E261 E262 E302 E402 E501
56-
matplotlib/fontconfig_pattern.py E201 E203 E221 E222 E225 E302 E401 E501
57-
matplotlib/legend_handler.py E201 E301 E303 E501
58-
matplotlib/mathtext.py E201 E202 E203 E211 E221 E222 E225 E228 E231 E251 E261 E301 E302 E303 E401 E402 E501
59-
matplotlib/patheffects.py E231
60-
matplotlib/pylab.py E401 E402 E501
61-
matplotlib/pyplot.py E201 E202 E203 E221 E222 E225 E231 E251 E261 E302 E303 E501 E701 E713
62-
matplotlib/rcsetup.py E203 E225 E261 E302 E501
63-
matplotlib/stackplot.py E251
64-
matplotlib/transforms.py E201 E202 E203 E302 E501
65-
matplotlib/type1font.py E222 E731
66-
67-
mpl_toolkits/axes_grid/axes_divider.py E501
68-
mpl_toolkits/axes_grid/axes_grid.py E225 E302
69-
mpl_toolkits/axes_grid/axes_rgb.py E302 E501
70-
mpl_toolkits/axes_grid/parasite_axes.py E501
71-
mpl_toolkits/axes_grid1/axes_divider.py E402 E501
72-
mpl_toolkits/axes_grid1/axes_grid.py E225 W391
73-
mpl_toolkits/axes_grid1/axes_rgb.py E231 E501
74-
mpl_toolkits/axes_grid1/axes_size.py E225 E261 E302 E303 E501
75-
mpl_toolkits/axes_grid1/colorbar.py E225 E231 E261 E262 E302 E303 E501 E701
76-
mpl_toolkits/axes_grid1/inset_locator.py E501
77-
mpl_toolkits/axes_grid1/mpl_axes.py E302 E303 E501
78-
mpl_toolkits/axes_grid1/parasite_axes.py E225 E231 E302 E303 E402 E501
79-
mpl_toolkits/axisartist/angle_helper.py E201 E203 E221 E222 E225 E231 E251 E261 E262 E302 E303 E402 E501
80-
mpl_toolkits/axisartist/axes_grid.py E225 E302
81-
mpl_toolkits/axisartist/axis_artist.py E201 E202 E221 E225 E228 E231 E251 E261 E262 E302 E303 E402 E501 E701 E702 E711
82-
mpl_toolkits/axisartist/axisline_style.py E231 E261 E262 E302 E303
83-
mpl_toolkits/axisartist/axislines.py E225 E231 E261 E262 E302 E303 E501 E711
84-
mpl_toolkits/axisartist/clip_path.py E225 E228 E302 E303 E501 E502
85-
mpl_toolkits/axisartist/floating_axes.py E201 E225 E231 E261 E262 E271 E302 E303 E402 E501
86-
mpl_toolkits/axisartist/grid_finder.py E231 E261 E302 E303 E402
87-
mpl_toolkits/axisartist/grid_helper_curvelinear.py E221 E225 E231 E251 E261 E262 E271 E302 E303 E501
88-
mpl_toolkits/mplot3d/art3d.py E203 E222 E225 E231
89-
mpl_toolkits/mplot3d/axes3d.py E203 E225 E231 E271 E303 E402 E501 E502 E701
90-
mpl_toolkits/mplot3d/axis3d.py E201 E202 E203 E222 E231 E302 E303 E502
91-
mpl_toolkits/mplot3d/proj3d.py E231 E302 E303
92-
mpl_toolkits/tests/test_axes_grid1.py E201 E202
93-
mpl_toolkits/tests/test_mplot3d.py E231 E302
94-
mpl_toolkits/__init__.py E261
95-
mpl_toolkits/exceltools.py E201 E202 E225 E228 E302 E303 E501 E701
96-
mpl_toolkits/gtktools.py E221 E222 E225 E228 E231 E251 E261 E301 E302 E303 E401 E501 E701
97-
98-
doc/* E302 E501
99-
tutorials/* E402 E501
100-
101-
examples/* E501 E402
102-
examples/misc/table_demo.py E201
103-
examples/images_contours_and_fields/tricontour_demo.py E201
104-
examples/images_contours_and_fields/tripcolor_demo.py E201
105-
examples/images_contours_and_fields/triplot_demo.py E201
106-
examples/pyplots/align_ylabels.py E231
107-
examples/pyplots/annotate_transform.py E228 E251
108-
examples/pyplots/annotation_basic.py E231
109-
examples/pyplots/annotation_polar.py E231
110-
examples/pyplots/auto_subplots_adjust.py E231 E261 E302 W391
111-
examples/pyplots/boxplot_demo_pyplot.py E231
112-
examples/pyplots/compound_path_demo.py E231
113-
examples/pyplots/fig_axes_customize_simple.py E261
114-
examples/pyplots/pyplot_formatstr.py E231
115-
examples/pyplots/pyplot_mathtext.py E231
116-
examples/pyplots/pyplot_simple.py E231
117-
examples/pyplots/pyplot_two_subplots.py E302
118-
examples/pyplots/text_commands.py E231
119-
examples/pyplots/text_layout.py E231
120-
examples/pyplots/whats_new_1_subplot3d.py W391
121-
examples/pyplots/whats_new_98_4_fancy.py E225 E261 E302
122-
examples/pyplots/whats_new_98_4_fill_between.py E225
123-
examples/pyplots/whats_new_98_4_legend.py E228
124-
examples/pyplots/whats_new_99_axes_grid.py E225 E231 E302 E303
125-
examples/pyplots/whats_new_99_spines.py E231 E261
126-
examples/shapes_and_collections/artist_reference.py E203

requirements/testing/travis36.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Extra pip requirements for the travis python 3.6 build
22

3-
pandas<0.21.0
3+
flake8
4+
flake8-per-file-ignores
45
jupyter
5-
pytest-flake8
6+
pandas<0.21.0

0 commit comments

Comments
 (0)