Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Python 3.13: Remove use of Path as contexts #1331

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

Closed
Tracked by #1317
JoerivanEngelen opened this issue Dec 11, 2024 · 0 comments
Closed
Tracked by #1317

Python 3.13: Remove use of Path as contexts #1331

JoerivanEngelen opened this issue Dec 11, 2024 · 0 comments
Assignees

Comments

@JoerivanEngelen
Copy link
Contributor

JoerivanEngelen commented Dec 11, 2024

We are using Path objects as contexts in our code base, which does nothing since Python 3.9.

In Python 3.13 this will throw an error:

Image

@github-project-automation github-project-automation bot moved this to 📯 New in iMOD Suite Dec 11, 2024
@JoerivanEngelen JoerivanEngelen changed the title Fix failing import (Path as context manager) Python 3.13: Remove use of Path as context managers Dec 11, 2024
@JoerivanEngelen JoerivanEngelen changed the title Python 3.13: Remove use of Path as context managers Python 3.13: Remove use of Path as contexts Dec 11, 2024
github-merge-queue bot pushed a commit that referenced this issue Feb 4, 2025
Fixes #1317 and #1331

# Description
With `Numba` now also supporting python 3.13 we can also add 3.13
support to iMOD-python.
This PR adds a 3.13 environment to the pixi.toml and also adds an import
test of it to the TC pipelines.

One line of code had to be rwritten to be 3.13 compatible. The
`importlib.resources.files` no longer provides a context manager and has
to wrapped using the `importlib.resources.as_file` method

# Checklist
<!---
Before requesting review, please go through this checklist:
-->

- [ ] Links to correct issue
- [ ] Update changelog, if changes affect users
- [ ] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [ ] Unit tests were added
- [ ] **If feature added**: Added/extended example
@github-project-automation github-project-automation bot moved this from 📯 New to ✅ Done in iMOD Suite Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

No branches or pull requests

2 participants