Skip to content

Commit 62f1281

Browse files
authored
Bumps pydantic to version 2.7.2 (#34)
1 parent 5e54f55 commit 62f1281

File tree

4 files changed

+31
-37
lines changed

4 files changed

+31
-37
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build-backend = 'setuptools.build_meta'
99
dependencies = [
1010
'numpy >= 1.20',
1111
'prettytable>=3.9.0',
12-
'pydantic>=2.4.2,<=2.6.4',
12+
'pydantic>=2.7.2',
1313
'StrEnum>=0.4.15; python_version<"3.11"',
1414
]
1515

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
numpy >= 1.20
22
prettytable >= 3.9.0
33
pybind11 >= 2.4
4-
pydantic >= 2.4.2, <= 2.6.4
4+
pydantic >= 2.7.2
55
pytest >= 7.4.0
66
pytest-cov >= 4.1.0
77
matplotlib >= 3.8.3

setup.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -146,28 +146,28 @@ def build_libraries(self, libraries):
146146

147147

148148
setup(
149-
name = 'RAT',
150-
version = __version__,
151-
author = '',
152-
author_email = '',
153-
url = 'https://github.com/RascalSoftware/python-RAT',
154-
description = 'Python extension for the Reflectivity Analysis Toolbox (RAT)',
155-
packages = find_packages(),
156-
include_package_data = True,
157-
package_data = {'': [get_shared_object_name(libevent[0])]},
158-
cmdclass = {'build_clib': BuildClib, 'build_ext': BuildExt},
159-
libraries = [libevent],
160-
ext_modules = ext_modules,
161-
python_requires = '>=3.9',
162-
install_requires = ['numpy >= 1.20', 'prettytable >= 3.9.0', 'pydantic >= 2.4.2, <= 2.6.4', 'matplotlib >= 3.8.3'],
163-
extras_require = {':python_version < "3.11"': ['StrEnum >= 0.4.15'],
164-
'Dev': ['pytest>=7.4.0', 'pytest-cov>=4.1.0'],
165-
'Matlab_latest': ['matlabengine'],
166-
'Matlab_2023b': ['matlabengine == 23.2.1'],
167-
'Matlab_2023a': ['matlabengine == 9.14.3'],
168-
'Matlab-2022b': ['matlabengine == 9.13.9'],
169-
'Matlab_2022a': ['matlabengine == 9.12.19'],
170-
'Matlab_2021b': ['matlabengine == 9.11.21'],
171-
'Matlab_2021a': ['matlabengine == 9.10.3']},
149+
name='RAT',
150+
version=__version__,
151+
author='',
152+
author_email='',
153+
url='https://github.com/RascalSoftware/python-RAT',
154+
description='Python extension for the Reflectivity Analysis Toolbox (RAT)',
155+
packages=find_packages(),
156+
include_package_data=True,
157+
package_data={'': [get_shared_object_name(libevent[0])]},
158+
cmdclass={'build_clib': BuildClib, 'build_ext': BuildExt},
159+
libraries=[libevent],
160+
ext_modules=ext_modules,
161+
python_requires='>=3.9',
162+
install_requires=['numpy >= 1.20', 'prettytable >= 3.9.0', 'pydantic >= 2.7.2', 'matplotlib >= 3.8.3'],
163+
extras_require={':python_version < "3.11"': ['StrEnum >= 0.4.15'],
164+
'Dev': ['pytest>=7.4.0', 'pytest-cov>=4.1.0'],
165+
'Matlab_latest': ['matlabengine'],
166+
'Matlab_2023b': ['matlabengine == 23.2.1'],
167+
'Matlab_2023a': ['matlabengine == 9.14.3'],
168+
'Matlab-2022b': ['matlabengine == 9.13.9'],
169+
'Matlab_2022a': ['matlabengine == 9.12.19'],
170+
'Matlab_2021b': ['matlabengine == 9.11.21'],
171+
'Matlab_2021a': ['matlabengine == 9.10.3']},
172172
zip_safe=False,
173173
)

tests/test_controls.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,12 @@ def test_calculate_property_setters(self, control_property: str, value: Any) ->
3737
setattr(self.calculate, control_property, value)
3838
assert getattr(self.calculate, control_property) == value
3939

40-
@pytest.mark.parametrize("var1, var2", [('test', True), ('ALL', 1), ("Contrast", 3.0)])
41-
def test_calculate_parallel_validation(self, var1: str, var2: Any) -> None:
40+
@pytest.mark.parametrize("value", ['test', 'ALL', 'Contrast', True, 1, 3.0])
41+
def test_calculate_parallel_validation(self, value: Any) -> None:
4242
"""Tests the parallel setter validation in Calculate class."""
4343
with pytest.raises(pydantic.ValidationError) as exp:
44-
setattr(self.calculate, 'parallel', var1)
44+
setattr(self.calculate, 'parallel', value)
4545
assert exp.value.errors()[0]['msg'] == "Input should be 'single', 'points' or 'contrasts'"
46-
with pytest.raises(pydantic.ValidationError) as exp:
47-
setattr(self.calculate, 'parallel', var2)
48-
assert exp.value.errors()[0]['msg'] == "Input should be a valid string"
4946

5047
@pytest.mark.parametrize("value", [5.0, 12])
5148
def test_calculate_calcSldDuringFit_validation(self, value: Union[int, float]) -> None:
@@ -54,15 +51,12 @@ def test_calculate_calcSldDuringFit_validation(self, value: Union[int, float]) -
5451
setattr(self.calculate, 'calcSldDuringFit', value)
5552
assert exp.value.errors()[0]['msg'] == "Input should be a valid boolean, unable to interpret input"
5653

57-
@pytest.mark.parametrize("var1, var2", [('test', True), ('iterate', 1), ("FINAL", 3.0)])
58-
def test_calculate_display_validation(self, var1: str, var2: Any) -> None:
54+
@pytest.mark.parametrize("value", ['test', 'iterate', "FINAL", True, 1, 3.0])
55+
def test_calculate_display_validation(self, value: Any) -> None:
5956
"""Tests the display setter validation in Calculate class."""
6057
with pytest.raises(pydantic.ValidationError) as exp:
61-
setattr(self.calculate, 'display', var1)
58+
setattr(self.calculate, 'display', value)
6259
assert exp.value.errors()[0]['msg'] == "Input should be 'off', 'iter', 'notify' or 'final'"
63-
with pytest.raises(pydantic.ValidationError) as exp:
64-
setattr(self.calculate, 'display', var2)
65-
assert exp.value.errors()[0]['msg'] == "Input should be a valid string"
6660

6761
@pytest.mark.parametrize("value, msg", [
6862
([5.0], "List should have at least 2 items after validation, not 1"),

0 commit comments

Comments
 (0)