feat: update to Python 3.14 - #671
Conversation
|
This is the corresponding issue to the fail in the code check PyCQA/docformatter#340 |
|
There is a newer version available of docformatter already, so we just need to update. @isteinbrecher If you want i can update all pre-commit hooks for this PR |
|
Additionally I would include a small "ensure all tests pass" workflow like in 4C and FourCIPP, then we can remove the individual requirements for the workflow And I would also directly include #463 to close it |
Yes please. Other than that, I think we can merge this. |
We can do that, I just don't fully understand what requirements we would not need anymore.
Sounds good to me! So we drop 3.10 support? (Totally fine) |
|
@davidrudlstorfer you can directly push to the branch on my fork or reopen your original PR, whatever is easier. |
b571ac9 to
1e9e528
Compare
|
@isteinbrecher could you maybe briefly look into the new mypy warnings? src/beamme/core/mesh.py:910: error: Argument 1 to "append" of "list" has incompatible type "int | None"; expected "int" [arg-type]
src/beamme/space_time/beam_to_space_time.py:279: error: Unsupported operand types for + ("None" and "int") [operator]
src/beamme/space_time/beam_to_space_time.py:279: note: Left operand is of type "int | None"
src/beamme/four_c/model_importer.py:599: error: "type" has no attribute "element_type" [attr-defined]I think you would be rather quick to fix this Other than that i updated all pre-commit hooks. A lot of changes occur due to the new docstring formatting (changed to black line length which is compatible with ruff) Other than that I needed to add to comments due to this issue PyCQA/docformatter#350 |
Done, I pushed the changes. |
|
One question: I currently installed a new python 3.14 env for testing and i only installed dev and fourc (as in the readme stated) Then it fails because cubitpy is necessary in the result comparison and if this is fixed it also fails because netcdf is missing. This should probably be guarded somehow? Or is cubitpy now a required dependency? I would aim that this is not a required dependency |
With the latest changes, the packages installed with So CubitPy is basically handled the same as FourCIPP. Not needed for the core BeamMe functionality, but required for testing. I see three options:
I am curious on your thoughts. But I would adapt this in a separate PR to not make this one too broad. |
isteinbrecher
left a comment
There was a problem hiding this comment.
I had a look and are there even any cases of the issue #463 left in the code base?
|
I will push the fixes for #463 and the remaining stuff in a second |
b38d943 to
6ee37f4
Compare
|
So now i changed quite a lot and I think it is done
I am still unsure on how to continue with our dev requirements. I think that beamme should be testable also without cubitpy (at least a minimum set of tests like the core). Currently one cannot even execute pytest because it fails immediately. Now also #463 is also closed (see commits) And I think this would then be a new BeamMe release 🥳 |
7ea954e to
2f70a80
Compare
2f70a80 to
43d90fa
Compare
|
@isteinbrecher ready from my side, I cannot request your review because you are the PR author and my review is worthless here so you can force merge once you are happy :) |
There was a problem hiding this comment.
Pull request overview
This PR updates the project to target Python 3.14 (and sets the supported range to 3.11–3.14), aligning packaging metadata, CI workflows, and development tooling accordingly. It also includes broad typing/docstring formatting churn (largely typing.* → built-in generics / collections.abc and docformatter-driven reflow) across src/, tests/, and utilities.
Changes:
- Bump Python support to 3.11–3.14: update
pyproject.toml, CI matrices, and website build workflow to use 3.14. - Simplify/reshape extras and installation instructions to rely on
[dev], and refresh pre-commit hook versions. - Large-scale formatting + typing modernization across code/tests (docstrings reflowed;
typing.Tuple/List/Callable/...migrated totuple/listandcollections.abc).
Reviewed changes
Copilot reviewed 143 out of 144 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/prepare_docs.py | Docstring reflow (formatting only). |
| utils/validate_4C_files.py | Docstring reflow (formatting only). |
| utils/logo.py | Docstring/blank-line formatting cleanup. |
| utils/check_python_imports.py | Docstring reflow; formatting cleanup. |
| tests/performance/test_performance_space_time.py | Docstring/blank-line formatting cleanup. |
| tests/performance/test_performance_mesh_creation_functions_beam_parametric_curve.py | Docstring reflow; formatting cleanup. |
| tests/other/test_other_examples.py | Docstring reflow; formatting cleanup. |
| tests/other/test_other_create_input_files.py | Blank-line formatting cleanup. |
| tests/other/test_other_create_cubit_input_files.py | Docstring reflow; formatting cleanup. |
| tests/integration/test_integration_space_time.py | Docstring reflow; formatting cleanup. |
| tests/integration/test_integration_mesh_creation_functions_nurbs.py | Blank-line formatting cleanup. |
| tests/integration/test_integration_mesh_creation_functions_beam_splinepy.py | Blank-line formatting cleanup. |
| tests/integration/test_integration_mesh_creation_functions_beam_parametric_curve.py | Docstring reflow; formatting cleanup. |
| tests/integration/test_integration_mesh_creation_functions_beam_node_continuation.py | Blank-line formatting cleanup. |
| tests/integration/test_integration_mesh_creation_functions_beam_helix.py | Blank-line formatting cleanup. |
| tests/integration/test_integration_mesh_creation_functions_beam_generic.py | Docstring reflow; formatting cleanup. |
| tests/integration/test_integration_mesh_creation_functions_beam_arc.py | Docstring reflow; formatting cleanup. |
| tests/integration/test_integration_mesh_creation_functions_beam_applications.py | Docstring reflow; formatting cleanup. |
| tests/integration/test_integration_geometric_search.py | Docstring reflow; formatting cleanup. |
| tests/integration/test_integration_four_c.py | Docstring reflow (and typo introduced). |
| tests/integration/test_integration_four_c_solid_shell_thickness_direction.py | Docstring reflow; formatting cleanup. |
| tests/integration/test_integration_four_c_simulation.py | Typing import modernization; docstring/comment edits; minor typo fix in comment. |
| tests/integration/test_integration_four_c_model_importer.py | Docstring reflow; formatting cleanup. |
| tests/integration/test_integration_four_c_material.py | Docstring reflow; formatting cleanup. |
| tests/integration/test_integration_four_c_locsys_condition.py | Docstring reflow; formatting cleanup. |
| tests/integration/test_integration_four_c_input_file.py | Docstring reflow; formatting cleanup. |
| tests/integration/test_integration_four_c_header_functions.py | Docstring reflow; formatting cleanup. |
| tests/integration/test_integration_four_c_element_beam.py | Docstring reflow; formatting cleanup. |
| tests/integration/test_integration_four_c_beam_potential.py | Docstring reflow; formatting cleanup. |
| tests/integration/test_integration_four_c_beam_interaction_conditions.py | Docstring reflow; formatting cleanup. |
| tests/integration/test_integration_cosserat_curve.py | Blank-line formatting cleanup. |
| tests/integration/test_integration_core_mesh.py | Docstring reflow; formatting cleanup. |
| tests/integration/test_integration_core_mesh_visualization.py | Blank-line formatting cleanup. |
| tests/integration/test_integration_core_geometry_set.py | Docstring reflow; formatting cleanup. |
| tests/integration/test_integration_abaqus.py | Docstring reflow; formatting cleanup. |
| tests/create_test_models.py | Docstring reflow; formatting cleanup. |
| tests/conftest.py | Typing import modernization; add type annotations to module globals; docstring reflow. |
| tests/conftest_test_object_generators.py | Typing import modernization; Dict→dict; docstring reflow. |
| tests/conftest_result_comparison.py | Typing import modernization; docstring reflow. |
| tests/conftest_performance_tests.py | Typing import modernization; type annotation for performance log; docstring reflow. |
| tests/beamme/utils/test_beamme_utils_nodes.py | Blank-line formatting cleanup. |
| tests/beamme/utils/test_beamme_utils_environment.py | Blank-line formatting cleanup. |
| tests/beamme/utils/test_beamme_utils_data_structures.py | Blank-line formatting cleanup. |
| tests/beamme/mesh_creation_functions/test_beamme_mesh_creation_functions_nurbs_utils.py | Docstring reflow; formatting cleanup. |
| tests/beamme/mesh_creation_functions/test_beamme_mesh_creation_functions_nurbs_generic.py | Docstring reflow; formatting cleanup. |
| tests/beamme/mesh_creation_functions/test_beamme_mesh_creation_functions_beam_splinepy.py | Docstring reflow; formatting cleanup. |
| tests/beamme/mesh_creation_functions/test_beamme_mesh_creation_functions_beam_parametric_curve.py | Docstring reflow; formatting cleanup. |
| tests/beamme/mesh_creation_functions/test_beamme_mesh_creation_functions_beam_node_continuation.py | Docstring reflow; formatting cleanup. |
| tests/beamme/mesh_creation_functions/test_beamme_mesh_creation_functions_beam_generic.py | Docstring reflow; formatting cleanup. |
| tests/beamme/geometric_search/test_beamme_geometric_search_utils.py | Blank-line formatting cleanup. |
| tests/beamme/four_c/test_beamme_four_c_run_four_c.py | Docstring reflow; formatting cleanup. |
| tests/beamme/four_c/test_beamme_four_c_material.py | Blank-line formatting cleanup. |
| tests/beamme/four_c/test_beamme_four_c_function_utility.py | Docstring reflow; formatting cleanup. |
| tests/beamme/four_c/test_beamme_four_c_dbc_monitor.py | Docstring reflow; formatting cleanup. |
| tests/beamme/four_c/test_beamme_four_c_beam_interaction_conditions.py | Docstring reflow; formatting cleanup. |
| tests/beamme/cosserat_curve/test_beamme_cosserat_curve.py | Docstring reflow; formatting cleanup. |
| tests/beamme/core/test_beamme_core_rotations.py | Docstring reflow; formatting cleanup. |
| tests/beamme/core/test_beamme_core_node.py | Blank-line formatting cleanup. |
| tests/beamme/core/test_beamme_core_mesh.py | Docstring reflow; formatting cleanup. |
| tests/beamme/core/test_beamme_core_mesh_utils.py | Blank-line formatting cleanup. |
| tests/beamme/core/test_beamme_core_geometry_set.py | Typing import modernization; docstring reflow. |
| tests/beamme/core/test_beamme_core_coupling.py | Docstring reflow; formatting cleanup. |
| src/beamme/utils/nodes.py | Docstring reflow; formatting cleanup. |
| src/beamme/utils/environment.py | Typing modernization (tuple); docstring reflow. |
| src/beamme/utils/data_structures.py | Typing import modernization (collections.abc.Callable). |
| src/beamme/space_time/beam_to_space_time.py | Typing modernization (Callable, tuple, type[...]); add cast for indexing. |
| src/beamme/mesh_creation_functions/nurbs_utils.py | Blank-line formatting cleanup. |
| src/beamme/mesh_creation_functions/nurbs_geometries.py | Docstring reflow; minor docstring spacing adjustments. |
| src/beamme/mesh_creation_functions/nurbs_generic.py | Docstring reflow; formatting cleanup. |
| src/beamme/mesh_creation_functions/beam_splinepy.py | Docstring reflow; formatting cleanup. |
| src/beamme/mesh_creation_functions/beam_parametric_curve.py | Typing modernization (Callable, type[...]); docstring reflow. |
| src/beamme/mesh_creation_functions/beam_node_continuation.py | Docstring reflow; formatting cleanup. |
| src/beamme/mesh_creation_functions/beam_line.py | Blank-line formatting cleanup. |
| src/beamme/mesh_creation_functions/beam_helix.py | Docstring reflow; formatting cleanup. |
| src/beamme/mesh_creation_functions/beam_generic.py | Typing modernization (Callable, type[...]); docstring reflow. |
| src/beamme/mesh_creation_functions/beam_arc.py | Blank-line formatting cleanup. |
| src/beamme/mesh_creation_functions/applications/beam_wire.py | Docstring reflow; formatting cleanup. |
| src/beamme/mesh_creation_functions/applications/beam_stent.py | Docstring reflow (but indentation regression inside docstring). |
| src/beamme/mesh_creation_functions/applications/beam_honeycomb.py | Docstring reflow; formatting cleanup. |
| src/beamme/mesh_creation_functions/applications/beam_fibers_in_rectangle.py | Docstring reflow; formatting cleanup. |
| src/beamme/geometric_search/utils.py | Blank-line formatting cleanup. |
| src/beamme/geometric_search/scipy.py | Blank-line formatting cleanup. |
| src/beamme/geometric_search/find_close_points.py | Docstring reflow; formatting cleanup. |
| src/beamme/geometric_search/cython.py | Docstring reflow; formatting cleanup. |
| src/beamme/geometric_search/arborx.py | Docstring reflow; formatting cleanup. |
| src/beamme/four_c/solid_shell_thickness_direction.py | Typing modernization (list[...]); docstring reflow. |
| src/beamme/four_c/run_four_c.py | Docstring reflow; formatting cleanup. |
| src/beamme/four_c/model_importer.py | Typing modernization (tuple); add _Element import for typed dict; docstring reflow. |
| src/beamme/four_c/material.py | Docstring reflow; formatting cleanup. |
| src/beamme/four_c/locsys_condition.py | Typing modernization (list[...]); docstring reflow. |
| src/beamme/four_c/input_file.py | Typing modernization (collections.abc.Callable, Self); docstring reflow. |
| src/beamme/four_c/input_file_mappings.py | Docstring reflow; formatting cleanup. |
| src/beamme/four_c/input_file_dump_functions.py | Typing modernization (KeysView, list); docstring reflow. |
| src/beamme/four_c/header_functions.py | Typing modernization (list[...]); docstring reflow. |
| src/beamme/four_c/function_utility.py | Typing modernization (list[...]); docstring reflow. |
| src/beamme/four_c/element_solid.py | Blank-line formatting cleanup. |
| src/beamme/four_c/element_data.py | Docstring reflow; formatting cleanup. |
| src/beamme/four_c/element_beam.py | Docstring reflow; formatting cleanup. |
| src/beamme/four_c/dbc_monitor.py | Docstring reflow; formatting cleanup. |
| src/beamme/four_c/beam_potential.py | Blank-line formatting cleanup. |
| src/beamme/four_c/beam_interaction_conditions.py | Docstring reflow; formatting cleanup. |
| src/beamme/cosserat_curve/warping_along_cosserat_curve.py | Typing modernization (tuple); docstring reflow. |
| src/beamme/cosserat_curve/cosserat_curve.py | Typing modernization (tuple); docstring reflow. |
| src/beamme/cosserat_curve/init.py | Docstring reflow; formatting cleanup. |
| src/beamme/core/nurbs_patch.py | Typing modernization (collections.abc.Iterator); docstring reflow. |
| src/beamme/core/node.py | Docstring reflow; formatting cleanup. |
| src/beamme/core/mesh_utils.py | Typing modernization (tuple/dict/list); docstring reflow. |
| src/beamme/core/mesh_representation.py | Typing modernization (collections.abc.Iterable); docstring reflow. |
| src/beamme/core/material.py | Docstring reflow; formatting cleanup. |
| src/beamme/core/geometry_set.py | Typing modernization attempt + adds __future__ import (currently invalid syntax). |
| src/beamme/core/function.py | Docstring reflow; formatting cleanup. |
| src/beamme/core/element.py | Blank-line formatting cleanup. |
| src/beamme/core/element_beam.py | Blank-line formatting cleanup. |
| src/beamme/core/coupling.py | Docstring reflow; formatting cleanup. |
| src/beamme/core/container.py | Docstring reflow; formatting cleanup; adds comment workaround. |
| src/beamme/core/conf.py | Docstring reflow; formatting cleanup. |
| src/beamme/core/boundary_condition.py | Typing modernization (dict); docstring reflow. |
| src/beamme/core/base_mesh_item.py | Docstring reflow; formatting cleanup; adds comment workaround. |
| src/beamme/core/init.py | Docstring reflow; formatting cleanup. |
| src/beamme/abaqus/material.py | Docstring reflow; formatting cleanup. |
| src/beamme/abaqus/input_file.py | Docstring reflow; formatting cleanup. |
| src/beamme/abaqus/beam.py | Docstring reflow; formatting cleanup. |
| src/beamme/abaqus/init.py | Docstring reflow; formatting cleanup. |
| README.md | Update supported Python versions + installation instructions/extras wording. |
| pyproject.toml | Add requires-python >=3.11; adjust [project.optional-dependencies] dev chain. |
| examples/utils/example_1_utils.py | Docstring/blank-line formatting cleanup. |
| examples/example_1_finite_rotations.ipynb | Minor formatting in a print statement. |
| .typos.toml | Add DISCRET to typos allowlist. |
| .pre-commit-config.yaml | Bump pre-commit hook versions; tweak docformatter args. |
| .github/workflows/website.yml | Switch website build to Python 3.14. |
| .github/workflows/testing.yml | Update test matrix to 3.11/3.14; adjust install extras; add “alls-green” aggregator job. |
| .github/workflows/testing_protected.yml | Adjust install extras to [dev]. |
| .github/workflows/documentation.yml | Adjust install extras to [dev]. |
| .github/workflows/build_sdist_build_test_wheels_PR_and_merge.yml | Update wheel build/test target to Python 3.14; add “alls-green” aggregator job. |
| .github/workflows/build_sdist_build_test_wheels_nightly_and_publish_release.yml | Update nightly matrix to include 3.14 and drop 3.10. |
| .github/actions/wheel_test/action.yml | Update wheel install extras to [dev]. |
| .github/actions/source_distribution_build/action.yml | Switch sdist build to Python 3.14. |
| .github/actions/setup_python_environment/action.yml | Default Python version to 3.14. |
| .github/actions/install_beamme/action.yml | Default install command to .[dev]. |
| .github/actions/code_check/action.yml | Update install extras to [dev]. |
| .binder/Dockerfile | Update editable install extras to [dev]. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
isteinbrecher
left a comment
There was a problem hiding this comment.
@davidrudlstorfer thanks for all the changes, look very good, this definitely should lead to another BeamMe release (0.3.0?)
|
@isteinbrecher AMAZING that all pipelines including publishing pipelines ran through 😍 really happy about that:) |
Reopen https://github.com/beamme-py/beamme/pull/620/changes to check if python 3.14 works (splinepy is now available ein 3.14 isosuite/splinepy#494, thanks @clemens-fricke).