Skip to content

feat: update to Python 3.14 - #671

Merged
isteinbrecher merged 10 commits into
beamme-py:mainfrom
isteinbrecher:python_3_14
Jul 8, 2026
Merged

feat: update to Python 3.14#671
isteinbrecher merged 10 commits into
beamme-py:mainfrom
isteinbrecher:python_3_14

Conversation

@isteinbrecher

Copy link
Copy Markdown
Collaborator

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).

@isteinbrecher
isteinbrecher temporarily deployed to cubit_secrets_trusted July 8, 2026 08:13 — with GitHub Actions Inactive
@isteinbrecher
isteinbrecher marked this pull request as draft July 8, 2026 08:13
@davidrudlstorfer

Copy link
Copy Markdown
Collaborator

This is the corresponding issue to the fail in the code check PyCQA/docformatter#340

@davidrudlstorfer

Copy link
Copy Markdown
Collaborator

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

@davidrudlstorfer

Copy link
Copy Markdown
Collaborator

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

@isteinbrecher

Copy link
Copy Markdown
Collaborator Author

@isteinbrecher If you want i can update all pre-commit hooks for this PR

Yes please. Other than that, I think we can merge this.

@isteinbrecher
isteinbrecher temporarily deployed to cubit_secrets_trusted July 8, 2026 08:24 — with GitHub Actions Inactive
@isteinbrecher

Copy link
Copy Markdown
Collaborator Author

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

We can do that, I just don't fully understand what requirements we would not need anymore.

And I would also directly include #463 to close it

Sounds good to me! So we drop 3.10 support? (Totally fine)

@isteinbrecher

Copy link
Copy Markdown
Collaborator Author

@davidrudlstorfer you can directly push to the branch on my fork or reopen your original PR, whatever is easier.

@davidrudlstorfer
davidrudlstorfer temporarily deployed to cubit_secrets_trusted July 8, 2026 08:58 — with GitHub Actions Inactive
@davidrudlstorfer

Copy link
Copy Markdown
Collaborator

@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

@davidrudlstorfer
davidrudlstorfer temporarily deployed to cubit_secrets_trusted July 8, 2026 09:35 — with GitHub Actions Inactive
@isteinbrecher
isteinbrecher temporarily deployed to cubit_secrets_trusted July 8, 2026 09:52 — with GitHub Actions Inactive
@isteinbrecher

isteinbrecher commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

I think you would be rather quick to fix this

Done, I pushed the changes.

@isteinbrecher
isteinbrecher had a problem deploying to cubit_secrets_trusted July 8, 2026 09:58 — with GitHub Actions Failure
@davidrudlstorfer

Copy link
Copy Markdown
Collaborator

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

@isteinbrecher

Copy link
Copy Markdown
Collaborator Author

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 cubitpy are required for general testing (just the python packages, not Coreform). Similar to how we need the fourc packages (i.e., FourCIPP) for testing. In the actually BeamMe code we guard agains usage of CubitPy without it being installed (we actually don't do that for FourCIPP, but that is another topic).

So CubitPy is basically handled the same as FourCIPP. Not needed for the core BeamMe functionality, but required for testing.

I see three options:

  • Add guards in testing for not installed packages. But that would mean that we would have to further split up which tests are run when. Not my favourite.
  • Simply change the one part of the readme to something like pip install -e .[dev,fourc,cubitpy]
  • Add all packages that are required for testing to the dev package list. This would be my preferred solution.

I am curious on your thoughts. But I would adapt this in a separate PR to not make this one too broad.

@isteinbrecher isteinbrecher left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a look and are there even any cases of the issue #463 left in the code base?

Comment thread README.md Outdated
@davidrudlstorfer

Copy link
Copy Markdown
Collaborator

I will push the fixes for #463 and the remaining stuff in a second

@davidrudlstorfer
davidrudlstorfer temporarily deployed to cubit_secrets_trusted July 8, 2026 11:46 — with GitHub Actions Inactive
@davidrudlstorfer

Copy link
Copy Markdown
Collaborator

So now i changed quite a lot and I think it is done

  • please just check the individual commits, they should be pretty self explanatory :)

  • the biggest change is the formatting change that no longer an empty line is there after a docstring, this is actually Python standard

  • I updated the deps also in this PR directly (following Document support for self-referential extras pypa/pip#11296)

  • I also introduced the two new all tests and all test build wheels success stages. Now the requirements for the PRs/branch protection simplified a lot and we do no longer need to change the Github settings once we change the Python versions or something else

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 🥳

Comment thread .github/workflows/testing.yml Outdated
@davidrudlstorfer
davidrudlstorfer temporarily deployed to cubit_secrets_trusted July 8, 2026 12:01 — with GitHub Actions Inactive
@davidrudlstorfer

Copy link
Copy Markdown
Collaborator

@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 :)

@davidrudlstorfer
davidrudlstorfer marked this pull request as ready for review July 8, 2026 12:13
Copilot AI review requested due to automatic review settings July 8, 2026 12:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 to tuple/list and collections.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; Dictdict; 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.

Comment thread src/beamme/core/geometry_set.py
Comment thread tests/integration/test_integration_four_c.py Outdated
Comment thread src/beamme/mesh_creation_functions/applications/beam_stent.py Outdated
Comment thread .pre-commit-config.yaml Outdated
Comment thread .typos.toml Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 143 out of 144 changed files in this pull request and generated no new comments.

@davidrudlstorfer
davidrudlstorfer temporarily deployed to cubit_secrets_trusted July 8, 2026 12:29 — with GitHub Actions Inactive

@isteinbrecher isteinbrecher left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidrudlstorfer thanks for all the changes, look very good, this definitely should lead to another BeamMe release (0.3.0?)

Comment thread pyproject.toml
Comment thread .github/workflows/testing.yml
@isteinbrecher
isteinbrecher merged commit 95740da into beamme-py:main Jul 8, 2026
15 checks passed
@isteinbrecher
isteinbrecher deleted the python_3_14 branch July 8, 2026 13:23
@davidrudlstorfer

Copy link
Copy Markdown
Collaborator

@isteinbrecher AMAZING that all pipelines including publishing pipelines ran through 😍

really happy about that:)

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.

3 participants