-
Notifications
You must be signed in to change notification settings - Fork 56
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
Pydantic 2.4.2 dependencies throw deprecation warnings #99
Comments
We need to fix them here. |
Makes sense, thank you! Should I close this issue and create issues for |
I've already transferred to No need to create an issue on |
I see those deprecation warnings as errors + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pydantic-extra-types-2.1.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pydantic-extra-types-2.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.8.18, pytest-7.4.2, pluggy-1.3.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pydantic-extra-types-2.1.0
configfile: pyproject.toml
collected 799 items / 3 errors
==================================== ERRORS ====================================
__________________ ERROR collecting tests/test_mac_address.py __________________
/usr/lib/python3.8/site-packages/_pytest/runner.py:341: in from_call
result: Optional[TResult] = func()
/usr/lib/python3.8/site-packages/_pytest/runner.py:372: in <lambda>
call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/python3.8/site-packages/_pytest/python.py:536: in collect
self._inject_setup_module_fixture()
/usr/lib/python3.8/site-packages/_pytest/python.py:550: in _inject_setup_module_fixture
self.obj, ("setUpModule", "setup_module")
/usr/lib/python3.8/site-packages/_pytest/python.py:315: in obj
self._obj = obj = self._getobj()
/usr/lib/python3.8/site-packages/_pytest/python.py:533: in _getobj
return self._importtestmodule()
/usr/lib/python3.8/site-packages/_pytest/python.py:622: in _importtestmodule
mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:567: in import_path
importlib.import_module(module_name)
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1014: in _gcd_import
???
<frozen importlib._bootstrap>:991: in _find_and_load
???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:671: in _load_unlocked
???
/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
exec(co, module.__dict__)
tests/test_mac_address.py:9: in <module>
class Network(BaseModel):
/usr/lib/python3.8/site-packages/pydantic/_internal/_model_construction.py:184: in __new__
complete_model_class(
/usr/lib/python3.8/site-packages/pydantic/_internal/_model_construction.py:481: in complete_model_class
schema = cls.__get_pydantic_core_schema__(cls, handler)
/usr/lib/python3.8/site-packages/pydantic/main.py:576: in __get_pydantic_core_schema__
return __handler(__source)
/usr/lib/python3.8/site-packages/pydantic/_internal/_schema_generation_shared.py:82: in __call__
schema = self._handler(__source_type)
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:452: in generate_schema
schema = self._generate_schema(obj)
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:684: in _generate_schema
schema = self._post_process_generated_schema(self._generate_schema_inner(obj))
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:706: in _generate_schema_inner
return self._model_schema(obj)
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:525: in _model_schema
{k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()},
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:525: in <dictcomp>
{k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()},
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:870: in _generate_md_field_schema
common_field = self._common_field_schema(name, field_info, decorators)
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:923: in _common_field_schema
schema = self._apply_annotations(
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:1592: in _apply_annotations
schema = get_inner_schema(source_type)
/usr/lib/python3.8/site-packages/pydantic/_internal/_schema_generation_shared.py:82: in __call__
schema = self._handler(__source_type)
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:1571: in inner_handler
from_property = self._generate_schema_from_property(obj, obj)
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:600: in _generate_schema_from_property
schema = get_schema(
pydantic_extra_types/mac_address.py:27: in __get_pydantic_core_schema__
return core_schema.general_before_validator_function(
/usr/lib/python3.8/site-packages/typing_extensions.py:2359: in wrapper
warnings.warn(msg, category=category, stacklevel=stacklevel + 1)
E DeprecationWarning: `general_before_validator_function` is deprecated, use `with_info_before_validator_function` instead.
_________________ ERROR collecting tests/test_phone_numbers.py _________________
/usr/lib/python3.8/site-packages/_pytest/runner.py:341: in from_call
result: Optional[TResult] = func()
/usr/lib/python3.8/site-packages/_pytest/runner.py:372: in <lambda>
call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/python3.8/site-packages/_pytest/python.py:536: in collect
self._inject_setup_module_fixture()
/usr/lib/python3.8/site-packages/_pytest/python.py:550: in _inject_setup_module_fixture
self.obj, ("setUpModule", "setup_module")
/usr/lib/python3.8/site-packages/_pytest/python.py:315: in obj
self._obj = obj = self._getobj()
/usr/lib/python3.8/site-packages/_pytest/python.py:533: in _getobj
return self._importtestmodule()
/usr/lib/python3.8/site-packages/_pytest/python.py:622: in _importtestmodule
mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:567: in import_path
importlib.import_module(module_name)
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1014: in _gcd_import
???
<frozen importlib._bootstrap>:991: in _find_and_load
???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:671: in _load_unlocked
???
/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
exec(co, module.__dict__)
tests/test_phone_numbers.py:9: in <module>
class Something(BaseModel):
/usr/lib/python3.8/site-packages/pydantic/_internal/_model_construction.py:184: in __new__
complete_model_class(
/usr/lib/python3.8/site-packages/pydantic/_internal/_model_construction.py:481: in complete_model_class
schema = cls.__get_pydantic_core_schema__(cls, handler)
/usr/lib/python3.8/site-packages/pydantic/main.py:576: in __get_pydantic_core_schema__
return __handler(__source)
/usr/lib/python3.8/site-packages/pydantic/_internal/_schema_generation_shared.py:82: in __call__
schema = self._handler(__source_type)
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:452: in generate_schema
schema = self._generate_schema(obj)
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:684: in _generate_schema
schema = self._post_process_generated_schema(self._generate_schema_inner(obj))
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:706: in _generate_schema_inner
return self._model_schema(obj)
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:525: in _model_schema
{k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()},
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:525: in <dictcomp>
{k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()},
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:870: in _generate_md_field_schema
common_field = self._common_field_schema(name, field_info, decorators)
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:923: in _common_field_schema
schema = self._apply_annotations(
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:1592: in _apply_annotations
schema = get_inner_schema(source_type)
/usr/lib/python3.8/site-packages/pydantic/_internal/_schema_generation_shared.py:82: in __call__
schema = self._handler(__source_type)
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:1571: in inner_handler
from_property = self._generate_schema_from_property(obj, obj)
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:600: in _generate_schema_from_property
schema = get_schema(
pydantic_extra_types/phone_numbers.py:33: in __get_pydantic_core_schema__
return core_schema.general_after_validator_function(
/usr/lib/python3.8/site-packages/typing_extensions.py:2359: in wrapper
warnings.warn(msg, category=category, stacklevel=stacklevel + 1)
E DeprecationWarning: `general_after_validator_function` is deprecated, use `with_info_after_validator_function` instead.
________________ ERROR collecting tests/test_routing_number.py _________________
/usr/lib/python3.8/site-packages/_pytest/runner.py:341: in from_call
result: Optional[TResult] = func()
/usr/lib/python3.8/site-packages/_pytest/runner.py:372: in <lambda>
call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/python3.8/site-packages/_pytest/python.py:536: in collect
self._inject_setup_module_fixture()
/usr/lib/python3.8/site-packages/_pytest/python.py:550: in _inject_setup_module_fixture
self.obj, ("setUpModule", "setup_module")
/usr/lib/python3.8/site-packages/_pytest/python.py:315: in obj
self._obj = obj = self._getobj()
/usr/lib/python3.8/site-packages/_pytest/python.py:533: in _getobj
return self._importtestmodule()
/usr/lib/python3.8/site-packages/_pytest/python.py:622: in _importtestmodule
mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:567: in import_path
importlib.import_module(module_name)
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1014: in _gcd_import
???
<frozen importlib._bootstrap>:991: in _find_and_load
???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:671: in _load_unlocked
???
/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
exec(co, module.__dict__)
tests/test_routing_number.py:9: in <module>
class Model(BaseModel):
/usr/lib/python3.8/site-packages/pydantic/_internal/_model_construction.py:184: in __new__
complete_model_class(
/usr/lib/python3.8/site-packages/pydantic/_internal/_model_construction.py:481: in complete_model_class
schema = cls.__get_pydantic_core_schema__(cls, handler)
/usr/lib/python3.8/site-packages/pydantic/main.py:576: in __get_pydantic_core_schema__
return __handler(__source)
/usr/lib/python3.8/site-packages/pydantic/_internal/_schema_generation_shared.py:82: in __call__
schema = self._handler(__source_type)
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:452: in generate_schema
schema = self._generate_schema(obj)
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:684: in _generate_schema
schema = self._post_process_generated_schema(self._generate_schema_inner(obj))
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:706: in _generate_schema_inner
return self._model_schema(obj)
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:525: in _model_schema
{k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()},
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:525: in <dictcomp>
{k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()},
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:870: in _generate_md_field_schema
common_field = self._common_field_schema(name, field_info, decorators)
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:923: in _common_field_schema
schema = self._apply_annotations(
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:1592: in _apply_annotations
schema = get_inner_schema(source_type)
/usr/lib/python3.8/site-packages/pydantic/_internal/_schema_generation_shared.py:82: in __call__
schema = self._handler(__source_type)
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:1571: in inner_handler
from_property = self._generate_schema_from_property(obj, obj)
/usr/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py:600: in _generate_schema_from_property
schema = get_schema(
pydantic_extra_types/routing_number.py:20: in __get_pydantic_core_schema__
return core_schema.general_after_validator_function(
/usr/lib/python3.8/site-packages/typing_extensions.py:2359: in wrapper
warnings.warn(msg, category=category, stacklevel=stacklevel + 1)
E DeprecationWarning: `general_after_validator_function` is deprecated, use `with_info_after_validator_function` instead.
=========================== short test summary info ============================
ERROR tests/test_mac_address.py - DeprecationWarning: `general_before_validat...
ERROR tests/test_phone_numbers.py - DeprecationWarning: `general_after_valida...
ERROR tests/test_routing_number.py - DeprecationWarning: `general_after_valid...
!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!
============================== 3 errors in 1.67s =============================== |
When #101 is going to be merged? Can we expect this by the next release? Thank you! |
Hello everybody, |
Fixed 0ce9f20 |
It's fixed but not released. Thx! |
@Kludex Thx a lot for the new release! |
You are welcome. :) |
Initial Checks
Description
The list may not be complete, but I have found following warnings within
pydantic_extra_types
andpydantic_core
:Example Code
No response
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: