Browse code

Merge pull request #287 from python-adaptive/update-pre-commit

github-actions[bot] authored on 07/08/2020 13:45:48 • GitHub committed on 07/08/2020 13:45:48
Showing 6 changed files
... ...
@@ -1,32 +1,33 @@
1 1
 repos:
2 2
 -   repo: https://github.com/pre-commit/pre-commit-hooks
3
-    rev: v2.4.0
3
+    rev: v3.2.0
4 4
     hooks:
5
-    -   id: trailing-whitespace
6
-    -   id: end-of-file-fixer
7
-    -   id: check-docstring-first
8
-    -   id: check-yaml
9
-    -   id: debug-statements
10
-    -   id: check-ast
5
+        -   id: check-docstring-first
6
+        -   id: check-ast
7
+        -   id: check-json
8
+        -   id: check-yaml
9
+        -   id: debug-statements
10
+        -   id: end-of-file-fixer
11
+        -   id: trailing-whitespace
11 12
 -   repo: https://github.com/ambv/black
12 13
     rev: 19.10b0
13 14
     hooks:
14 15
     - id: black
15 16
       language_version: python3.7
16 17
 -   repo: https://github.com/asottile/pyupgrade
17
-    rev: v1.25.2
18
+    rev: v2.7.2
18 19
     hooks:
19 20
     -   id: pyupgrade
20 21
         args: ['--py36-plus']
21 22
 -   repo: https://github.com/asottile/seed-isort-config
22
-    rev: v1.9.3
23
+    rev: v2.2.0
23 24
     hooks:
24 25
     -   id: seed-isort-config
25 26
 -   repo: https://github.com/pre-commit/mirrors-isort
26
-    rev: v4.3.21
27
+    rev: v5.3.2
27 28
     hooks:
28 29
     -   id: isort
29 30
 -   repo: https://gitlab.com/pycqa/flake8
30
-    rev: 3.7.9
31
+    rev: 3.8.3
31 32
     hooks:
32 33
     -   id: flake8
... ...
@@ -64,8 +64,8 @@ def ensure_plotly():
64 64
         import plotly
65 65
 
66 66
         if not _plotly_enabled:
67
-            import plotly.graph_objs
68 67
             import plotly.figure_factory
68
+            import plotly.graph_objs
69 69
             import plotly.offline
70 70
 
71 71
             # This injects javascript and should happen only once
... ...
@@ -161,8 +161,8 @@ def test_adding_points_and_skip_one_point():
161 161
 # XXX: This *should* pass (https://github.com/python-adaptive/adaptive/issues/55)
162 162
 @pytest.mark.xfail
163 163
 def test_tell_in_random_order(first_add_33=False):
164
-    from operator import attrgetter
165 164
     import random
165
+    from operator import attrgetter
166 166
 
167 167
     tol = 1e-10
168 168
     for f, a, b in ([f0, 0, 3], [f21, 0, 1], [f24, 0, 3], [f7, 0, 1]):
... ...
@@ -63,10 +63,11 @@ def test_triangulation_find_opposing_vertices_raises_if_simplex_is_invalid():
63 63
 
64 64
 
65 65
 def test_circumsphere():
66
-    from adaptive.learner.triangulation import circumsphere, fast_norm
67 66
     from numpy import allclose
68 67
     from numpy.random import normal, uniform
69 68
 
69
+    from adaptive.learner.triangulation import circumsphere, fast_norm
70
+
70 71
     def generate_random_sphere_points(dim, radius=0):
71 72
         """https://math.stackexchange.com/a/1585996"""
72 73
 
... ...
@@ -14,7 +14,7 @@
14 14
         "holoviews": ["1.9.1"],
15 15
         "scipy": ["0.19.1"],
16 16
         "ipyparallel": ["6.0.2"],
17
-        "sortedcontainers": ["1.5.7"],
17
+        "sortedcontainers": ["1.5.7"]
18 18
     },
19 19
     "benchmark_dir": "benchmarks",
20 20
     "env_dir": "env",
... ...
@@ -54,7 +54,7 @@ commands = pre-commit run --all-files --show-diff-on-failure
54 54
 
55 55
 [flake8]
56 56
 max-line-length = 100
57
-ignore = E501, W503, E203, E266
57
+ignore = E501, W503, E203, E266, E741
58 58
 max-complexity = 18
59 59
 select = B, C, E, F, W, T4, B9
60 60
 exclude = .git, .tox, __pycache__, dist