Skip to content

Commit c0b9d02

Browse files
authored
Update test versions. (#892)
* Update test versions. * Fix numpy version. * Fix python version for tensorflow 2.11 and add some more python version tests. * Fix flake8 errors. * Get some more infos why py 3.11 is failing. * Fix python 3.11 exception cpaturing. * Missing escape.
1 parent e7bc7a7 commit c0b9d02

File tree

5 files changed

+105
-15
lines changed

5 files changed

+105
-15
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
fail_fast: true
22
repos:
33
- repo: https://github.com/psf/black
4-
rev: 22.3.0
4+
rev: 22.10.0
55
hooks:
66
- id: black
77
language_version: python3
8-
- repo: https://gitlab.com/pycqa/flake8
9-
rev: 4.0.1
8+
- repo: https://github.com/pycqa/flake8
9+
rev: 6.0.0
1010
hooks:
1111
- id: flake8
1212
exclude: ^(tests|examples|docs)/.*

azure-pipelines.yml

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ jobs:
1515
IMAGE_NAME: 'windows-latest'
1616
PYTHON_VERSION: '3.10'
1717
TOX_CMD: 'py310'
18+
Windows py311:
19+
IMAGE_NAME: 'windows-latest'
20+
PYTHON_VERSION: '3.11'
21+
TOX_CMD: 'py311'
1822
OSX py38:
1923
IMAGE_NAME: 'macOS-latest'
2024
PYTHON_VERSION: '3.8'
@@ -27,6 +31,10 @@ jobs:
2731
IMAGE_NAME: 'macOS-latest'
2832
PYTHON_VERSION: '3.10'
2933
TOX_CMD: 'py310'
34+
OSX py311:
35+
IMAGE_NAME: 'macOS-latest'
36+
PYTHON_VERSION: '3.11'
37+
TOX_CMD: 'py311'
3038
Linux py38:
3139
IMAGE_NAME: 'ubuntu-latest'
3240
PYTHON_VERSION: '3.8'
@@ -39,6 +47,10 @@ jobs:
3947
IMAGE_NAME: 'ubuntu-latest'
4048
PYTHON_VERSION: '3.10'
4149
TOX_CMD: 'py310'
50+
Linux py311:
51+
IMAGE_NAME: 'ubuntu-latest'
52+
PYTHON_VERSION: '3.11'
53+
TOX_CMD: 'py311'
4254
Linux numpy_120:
4355
IMAGE_NAME: 'ubuntu-latest'
4456
PYTHON_VERSION: '3.9'
@@ -55,6 +67,10 @@ jobs:
5567
IMAGE_NAME: 'ubuntu-latest'
5668
PYTHON_VERSION: '3.10'
5769
TOX_CMD: 'numpy-123'
70+
Linux numpy_124:
71+
IMAGE_NAME: 'ubuntu-latest'
72+
PYTHON_VERSION: '3.11'
73+
TOX_CMD: 'numpy-124'
5874
Linux tensorflow_27:
5975
IMAGE_NAME: 'ubuntu-latest'
6076
PYTHON_VERSION: '3.8'
@@ -67,22 +83,62 @@ jobs:
6783
IMAGE_NAME: 'ubuntu-latest'
6884
PYTHON_VERSION: '3.10'
6985
TOX_CMD: 'tensorflow-29'
70-
Linux setup:
86+
Linux tensorflow_210:
87+
IMAGE_NAME: 'ubuntu-latest'
88+
PYTHON_VERSION: '3.10'
89+
TOX_CMD: 'tensorflow-210'
90+
Linux tensorflow_211:
91+
IMAGE_NAME: 'ubuntu-latest'
92+
PYTHON_VERSION: '3.10'
93+
TOX_CMD: 'tensorflow-211'
94+
Linux setup 3.9:
7195
IMAGE_NAME: 'ubuntu-latest'
7296
PYTHON_VERSION: '3.9'
7397
TOX_CMD: 'setup'
74-
Linux flake8:
98+
Linux setup 3.10:
99+
IMAGE_NAME: 'ubuntu-latest'
100+
PYTHON_VERSION: '3.10'
101+
TOX_CMD: 'setup'
102+
Linux setup 3.11:
103+
IMAGE_NAME: 'ubuntu-latest'
104+
PYTHON_VERSION: '3.11'
105+
TOX_CMD: 'setup'
106+
Linux flake8 3.9:
75107
IMAGE_NAME: 'ubuntu-latest'
76108
PYTHON_VERSION: '3.9'
77109
TOX_CMD: 'flake8'
78-
Linux black:
110+
Linux flake8 3.10:
111+
IMAGE_NAME: 'ubuntu-latest'
112+
PYTHON_VERSION: '3.10'
113+
TOX_CMD: 'flake8'
114+
Linux flake8 3.11:
115+
IMAGE_NAME: 'ubuntu-latest'
116+
PYTHON_VERSION: '3.11'
117+
TOX_CMD: 'flake8'
118+
Linux black 3.9:
79119
IMAGE_NAME: 'ubuntu-latest'
80120
PYTHON_VERSION: '3.9'
81121
TOX_CMD: 'black'
82-
Linux coverage:
122+
Linux black 3.10:
123+
IMAGE_NAME: 'ubuntu-latest'
124+
PYTHON_VERSION: '3.10'
125+
TOX_CMD: 'black'
126+
Linux black 3.11:
127+
IMAGE_NAME: 'ubuntu-latest'
128+
PYTHON_VERSION: '3.11'
129+
TOX_CMD: 'black'
130+
Linux coverage 3.9:
83131
IMAGE_NAME: 'ubuntu-latest'
84132
PYTHON_VERSION: '3.9'
85133
TOX_CMD: 'coverage'
134+
Linux coverage 3.10:
135+
IMAGE_NAME: 'ubuntu-latest'
136+
PYTHON_VERSION: '3.10'
137+
TOX_CMD: 'coverage'
138+
Linux coverage 3.11:
139+
IMAGE_NAME: 'ubuntu-latest'
140+
PYTHON_VERSION: '3.11'
141+
TOX_CMD: 'coverage'
86142
pool:
87143
vmImage: $(IMAGE_NAME)
88144
steps:
@@ -107,3 +163,11 @@ jobs:
107163
inputs:
108164
versionSpec: '3.10'
109165
- bash: bash ./tests/check_pre_commit.sh
166+
- job: test_pre_commit_311
167+
pool:
168+
vmImage: 'ubuntu-latest'
169+
steps:
170+
- task: UsePythonVersion@0
171+
inputs:
172+
versionSpec: '3.11'
173+
- bash: bash ./tests/check_pre_commit.sh

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pep8ignore =
77
dist/* ALL
88
sacred.egg-info/* ALL
99
[flake8]
10-
ignore = D100,D101,D102,D103,D104,D105,D203,D401,F821,E722,E203,E501,N818 \
10+
ignore = D100,D101,D102,D103,D104,D105,D203,D401,F821,E722,E203,E501,N818,
1111
# flake8 default ignores:
1212
E121,E123,E126,E226,E24,E704,W503,W504
1313
max-complexity = 10

tests/test_exceptions.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ def test_chained_error():
151151
except SacredError as e:
152152
st = format_sacred_error(e, "usage")
153153
assert re.match(
154-
r"Traceback \(most recent calls WITHOUT Sacred internals\):\n File "
155-
+ r"\"[^\"]+?test_exceptions.py\", line \d+, in test_chained_error\n "
156-
+ r"print\(1 / 0\)\nZeroDivisionError: division by zero\n\nThe above "
157-
+ r"exception was the direct cause of the following exception:\n\nTraceback "
158-
+ r"\(most recent calls WITHOUT Sacred internals\):\n File \"[^\"]+?"
159-
+ r"test_exceptions.py\", line \d+, in test_chained_error\n raise "
154+
r"Traceback \(most recent calls WITHOUT Sacred internals\):\s+File "
155+
+ r"\"[^\"]+?test_exceptions.py\", line \d+, in test_chained_error\s+"
156+
+ r"print\(1 / 0\)\n(\s+~~\^~~\s+)?ZeroDivisionError: division by zero\n\n"
157+
+ r"The above exception was the direct cause of the following exception:\n"
158+
+ r"\nTraceback \(most recent calls WITHOUT Sacred internals\):\s+File "
159+
+ r"\"[^\"]+?test_exceptions.py\", line \d+, in test_chained_error\s+raise "
160160
+ r"SacredError\(\"Something bad happened\"\) from e\nsacred.utils."
161161
+ r"SacredError: Something bad happened\n",
162162
st,

tox.ini

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# and then run "tox" from this directory.
55

66
[tox]
7-
envlist = py38, py39, py310, setup, flake8, numpy-120, numpy-121, numpy-122, numpy-123, tensorflow-26, tensorflow-27, tensorflow-28, tensorflow-29
7+
envlist = py38, py39, py310, py311, setup, flake8, numpy-120, numpy-121, numpy-122, numpy-123, numpy-124, tensorflow-26, tensorflow-27, tensorflow-28, tensorflow-29, tensorflow-210, tensorflow-211
88

99
[testenv]
1010
deps =
@@ -45,6 +45,14 @@ deps =
4545
commands =
4646
pytest tests/test_config {posargs}
4747

48+
[testenv:numpy-124]
49+
basepython = python
50+
deps =
51+
-rdev-requirements.txt
52+
numpy~=1.24.0rc1
53+
commands =
54+
pytest tests/test_config {posargs}
55+
4856
[testenv:tensorflow-115]
4957
basepython = python
5058
deps =
@@ -90,6 +98,24 @@ commands =
9098
pytest tests/test_stflow tests/test_optional.py \
9199
{posargs}
92100

101+
[testenv:tensorflow-210]
102+
basepython = python
103+
deps =
104+
-rdev-requirements.txt
105+
tensorflow~=2.10.0
106+
commands =
107+
pytest tests/test_stflow tests/test_optional.py \
108+
{posargs}
109+
110+
[testenv:tensorflow-211]
111+
basepython = python
112+
deps =
113+
-rdev-requirements.txt
114+
tensorflow~=2.11.0
115+
commands =
116+
pytest tests/test_stflow tests/test_optional.py \
117+
{posargs}
118+
93119
[testenv:setup]
94120
basepython = python
95121
deps =

0 commit comments

Comments
 (0)