Skip to content

Comments

Chore/1010 add support for python 314#1011

Draft
veenstrajelmer wants to merge 11 commits intomainfrom
chore/1010-add-support-for-python-314
Draft

Chore/1010 add support for python 314#1011
veenstrajelmer wants to merge 11 commits intomainfrom
chore/1010-add-support-for-python-314

Conversation

@veenstrajelmer
Copy link
Collaborator

@veenstrajelmer veenstrajelmer commented Nov 13, 2025

Description

  • Please include a summary of the change and which issue is fixed.

  • Please also include relevant motivation and context.

  • List any dependencies that are required for this change.

  • Fixes Add support for Python 3.14 #1010

Type of change

Check relevant points.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Please describe the tests that you ran to verify your changes.

  • Provide instructions so we can reproduce.

  • Please also list any relevant details for your test configuration

  • Test A

  • Test B

Checklist:

Prepare items below using:
[ ❌ ] (markdown: [ :x: ]) for TODO items
[ ✅ ] (markdown: [ :white_check_mark: ]) for DONE items
[ N/A ] for items that are not applicable for this PR.

  • updated version number in setup.py/pyproject.toml/environment.yml.
  • updated the lock file.
  • added changes to History.rst.
  • updated the latest version in README file.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • documentation are updated.

@veenstrajelmer veenstrajelmer linked an issue Nov 13, 2025 that may be closed by this pull request
@veenstrajelmer veenstrajelmer mentioned this pull request Nov 13, 2025
@veenstrajelmer
Copy link
Collaborator Author

veenstrajelmer commented Nov 13, 2025

Failing dependency installation (poetry error), so suggestion to first update the poetry version (#1013) and then rerun the tests in this PR.

@veenstrajelmer veenstrajelmer marked this pull request as draft November 13, 2025 13:21
@veenstrajelmer
Copy link
Collaborator Author

veenstrajelmer commented Nov 13, 2025

@sonarqubecloud
Copy link

@veenstrajelmer
Copy link
Collaborator Author

veenstrajelmer commented Nov 19, 2025

After updating the minimal lxml version from 5 to 6, the build on Python 3.14 is succesful. However, in the pytest step, there is an ImportError:

ImportError while loading conftest '/Users/runner/work/HYDROLIB-core/HYDROLIB-core/tests/conftest.py'.
tests/conftest.py:6: in <module>
    from hydrolib.core.dflowfm.bc.models import (
hydrolib/core/dflowfm/__init__.py:1: in <module>
    from .bc import *
hydrolib/core/dflowfm/bc/__init__.py:1: in <module>
    from .models import (
hydrolib/core/dflowfm/bc/models.py:22: in <module>
    from hydrolib.core.base.models import BaseModel, ModelSaveSettings
hydrolib/core/base/models.py:284: in <module>
    class FileModel(BaseModel, ABC):
.venv/lib/python3.14/site-packages/pydantic/v1/main.py:221: in __new__
    inferred = ModelField.infer(
.venv/lib/python3.14/site-packages/pydantic/v1/fields.py:504: in infer
    return cls(
.venv/lib/python3.14/site-packages/pydantic/v1/fields.py:434: in __init__
    self.prepare()
.venv/lib/python3.14/site-packages/pydantic/v1/fields.py:544: in prepare
    self._set_default_and_type()
.venv/lib/python3.14/site-packages/pydantic/v1/fields.py:576: in _set_default_and_type
    raise errors_.ConfigError(f'unable to infer type for attribute "{self.name}"')
E   pydantic.v1.errors.ConfigError: unable to infer type for attribute "filepath"
Error: Process completed with exit code 4.

Could this be resolved after the pydantic migration described in #732?

A similar error pops up when running only from hydrolib.core.base.models import BaseModel, but then also a warning is displayed: "c:\DATA\checkouts\hydrolib-core\hydrolib\core\base\models.py:15: UserWarning: Core Pydantic V1 functionality isn't compatible with Python 3.14 or greater.". So it seems that fixing #732 would indeed fix this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Python 3.14

1 participant