Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stickler config #25

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .stickler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
linters:
flake8:
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ install:

script:
- if [[ $TEST_TARGET == 'default' ]]; then
python -m iris.tests.runner --default-tests --system-tests --print-failed-images --num-processors=8;
python -m iris.tests.runner --default-tests --system-tests --print-failed-images --num-processors=3;
fi
- if [[ $TEST_TARGET == 'example' ]]; then
python -m iris.tests.runner --example-tests --print-failed-images --num-processors=8;
python -m iris.tests.runner --example-tests --print-failed-images --num-processors=3;
fi

# Capture install-dir: As a test command must be last for get Travis to check
Expand All @@ -131,8 +131,10 @@ script:
# affect any downstream functionality but causes the build to fail
# spuriously. The echo-backtick workaround gets around this error,
# which should be investigated further in the future.
- if [[ $TEST_TARGET == 'doctest' ]]; then
- >
if [[ $TEST_TARGET == 'doctest' ]]; then
cd $INSTALL_DIR/docs/iris;
echo 'image.cmap: viridis' > matplotlibrc;
echo `make clean html`;
make doctest;
fi
Expand Down
2 changes: 1 addition & 1 deletion docs/iris/src/_templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
// Only use first 5 images
for (var i = 0; i < 5; i++) {
var img = images[i];
$ss.append('<a href="'+img[2]+'"><img src="'+img[1]+'" class="slideshowImage"/></a>');
$ss.append('<a href="'+img[2]+'" style="background-color: white;" ><img src="'+img[1]+'" class="slideshowImage"/></a>');
}

$ss.cycle({
Expand Down
6 changes: 4 additions & 2 deletions lib/iris/tests/runner/_runner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) British Crown Copyright 2010 - 2016, Met Office
# (C) British Crown Copyright 2010 - 2017, Met Office
#
# This file is part of Iris.
#
Expand Down Expand Up @@ -127,7 +127,9 @@ def finalize_options(self):
if self.stop:
print('Stopping tests after the first error or failure')
if self.num_processors is None:
self.num_processors = multiprocessing.cpu_count() - 1
# Choose a magic number that works reasonably well for the default
# number of processes.
self.num_processors = (multiprocessing.cpu_count() + 1) // 4 + 1
else:
self.num_processors = int(self.num_processors)

Expand Down
48 changes: 48 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[flake8]
ignore = E402,\ # Due to conditional imports
E226 # Due to whitespace around operators (e.g. 2*x + 3)
exclude = */iris/std_names.py,\
*/iris/fileformats/cf.py,\
*/iris/fileformats/dot.py,\
*/iris/fileformats/pp_load_rules.py,\
*/iris/fileformats/rules.py,\
*/iris/fileformats/um_cf_map.py,\
*/iris/fileformats/_pyke_rules/compiled_krb/*,\
*/iris/io/__init__.py,\
*/iris/io/format_picker.py,\
*/iris/tests/__init__.py,\
*/iris/tests/pp.py,\
*/iris/tests/stock.py,\
*/iris/tests/system_test.py,\
*/iris/tests/test_analysis.py,\
*/iris/tests/test_analysis_calculus.py,\
*/iris/tests/test_basic_maths.py,\
*/iris/tests/test_cartography.py,\
*/iris/tests/test_cdm.py,\
*/iris/tests/test_cell.py,\
*/iris/tests/test_cf.py,\
*/iris/tests/test_constraints.py,\
*/iris/tests/test_coord_api.py,\
*/iris/tests/test_coord_categorisation.py,\
*/iris/tests/test_coordsystem.py,\
*/iris/tests/test_cube_to_pp.py,\
*/iris/tests/test_file_load.py,\
*/iris/tests/test_file_save.py,\
*/iris/tests/test_grib_save.py,\
*/iris/tests/test_grib_save_rules.py,\
*/iris/tests/test_hybrid.py,\
*/iris/tests/test_intersect.py,\
*/iris/tests/test_io_init.py,\
*/iris/tests/test_iterate.py,\
*/iris/tests/test_load.py,\
*/iris/tests/test_merge.py,\
*/iris/tests/test_pp_cf.py,\
*/iris/tests/test_pp_module.py,\
*/iris/tests/test_pp_stash.py,\
*/iris/tests/test_pp_to_cube.py,\
*/iris/tests/test_quickplot.py,\
*/iris/tests/test_std_names.py,\
*/iris/tests/test_unit.py,\
*/iris/tests/test_uri_callback.py,\
*/iris/tests/test_util.py