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

Skip to content

[Bug] - iMOD Python breaks upon import with Python 3.13 #1317

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
3 of 4 tasks
JoerivanEngelen opened this issue Dec 2, 2024 · 3 comments Β· Fixed by #1404
Closed
3 of 4 tasks

[Bug] - iMOD Python breaks upon import with Python 3.13 #1317

JoerivanEngelen opened this issue Dec 2, 2024 · 3 comments Β· Fixed by #1404
Assignees
Labels
bug Something isn't working
Milestone

Comments

@JoerivanEngelen
Copy link
Contributor

JoerivanEngelen commented Dec 2, 2024

Bug description
Python 3.13 has been released since 1 month. I got a report from that iMOD Python broke import with Python 3.13.

Steps to reproduce

  1. What error message do you get?

Image

  1. Can you create a minimum reproducible example?
    # script.py
    import imod

Desktop (please complete the following information):

  • OS: [e.g. Windows 11]
  • iMOD Python Version [e.g. 0.18.0]

Additional context
Add any other context about the problem here. The more information you can
provide us, the quicker we respond and fix the problem.

Refinement

@JoerivanEngelen JoerivanEngelen added the bug Something isn't working label Dec 2, 2024
@github-project-automation github-project-automation bot moved this to πŸ“― New in iMOD Suite Dec 2, 2024
@JoerivanEngelen JoerivanEngelen moved this from πŸ“― New to 🀝 Accepted in iMOD Suite Dec 3, 2024
@JoerivanEngelen JoerivanEngelen added this to the v1.0 release milestone Dec 3, 2024
@JoerivanEngelen JoerivanEngelen moved this from 🀝 Accepted to πŸ“Refined in iMOD Suite Dec 9, 2024
@Manangka Manangka moved this from πŸ“Refined to πŸ— In Progress in iMOD Suite Dec 10, 2024
@Manangka
Copy link
Collaborator

@JoerivanEngelen I looked into it and we are not able to support python 3.13 just yet.
The import of imod fails when it tries to install the dependencies, specifically when it installs the Numba package.
Numba doesn't support python 3.13 because on of its dependecies doesnt support it yet.

For now we can only clearly mention in the documentation that we don't support 3.13 at the moment

@JoerivanEngelen
Copy link
Contributor Author

JoerivanEngelen commented Dec 11, 2024

Ah thanks for looking into this. In my quick search on the internet I read that numba already has some pre-releases out for python 3.13, so I expect it won't take too long for them to release a new version that supports python 3.13.

I must say this error message looks quite clumsy though, since apparently Path objects cannot be used as contexts since python 3.9(!). It's also throwing warnings. I'll create a subissue for this specific error, as it is still worthy to fix but maybe less critical now. We can already fix this in preparation of the next numba release.

@Manangka Manangka moved this from πŸ— In Progress to 🧐 In Review in iMOD Suite Dec 13, 2024
@Manangka Manangka moved this from 🧐 In Review to πŸ— In Progress in iMOD Suite Dec 13, 2024
@JoerivanEngelen
Copy link
Contributor Author

JoerivanEngelen commented Jan 28, 2025

Update: Recently Numba got a release that supports Python 3.13. See https://numba.readthedocs.io/en/stable/release/0.61.0-notes.html

@Manangka Manangka moved this from πŸ— In Progress to 🧐 In Review in iMOD Suite Feb 4, 2025
@Manangka Manangka mentioned this issue Feb 4, 2025
5 tasks
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 🧐 In Review 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
bug Something isn't working
Projects
Status: βœ… Done
Development

Successfully merging a pull request may close this issue.

2 participants