Skip to content
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

Update python to current supported versions. Also add experimental support for next python release #5503

Closed
wants to merge 8 commits into from

Conversation

Fale
Copy link

@Fale Fale commented Nov 13, 2024

Description

Bump python version in the CI to current versions.

.github/workflows/ci.yaml Outdated Show resolved Hide resolved
@Fale
Copy link
Author

Fale commented Nov 15, 2024

I've added back 3.9 and 3.10. Also I've pushed 3.12 to be ok to fail, since now it is failing. The best scenario would be to have up to 3.13 working properly, considering that 3.13 is already in Fedora 41 (released last month) and very soon other distros will move to it

@snejus
Copy link
Member

snejus commented Nov 15, 2024

I see that you're dropping support for Python 3.8 - note that this needs a bit more effort:

  1. Looking through the release notes, checking the codebase against any removals/deprecations and updating the codebase accordingly.
  2. Typing updates: we should use pyupgrade to align types used in the codebase with what Python 3.9 supports.
  3. Update of Python constraints in the package.
  4. Relevant updates in the documentation.
  5. And finally the changelog note.

That's a couple of things just off the top of my head - there's likely a couple of others.

Are you happy to go ahead with the above or would you like to limit the scope of this PR to simply add support for the most recent version without removing Python 3.8?

@Fale
Copy link
Author

Fale commented Nov 16, 2024

I've added back 3.8.

The reason why I removed it in the first place was that it is EOL, but I don't mind it being there. The part I'm interested into is the support to the newest versions. I don't have anything against the old versions :).

@snejus
Copy link
Member

snejus commented Nov 16, 2024

Deps installation on Python 3.12+ seems to be failing due to numpy 1.24.4 which does not support Python 3.12. It added support in 1.26.0, however in the same release it also removed support for Python 3.8.

Poetry resolved this numpy version because we are still supporting Python 3.8. Just tried setting minimum python version to 3.9 in the package and resolved the dependencies - numpy indeed gets upgraded, which should resolve this issue.

I will shortly submit a PR that removes Python 3.8 support and fixes this issue for you.

@snejus snejus mentioned this pull request Nov 17, 2024
3 tasks
@Fale
Copy link
Author

Fale commented Nov 17, 2024

Thanks a lot :)

As soon as the other PR is merged, I'll rebase this one :)

@snejus
Copy link
Member

snejus commented Nov 23, 2024

Thanks a lot :)

As soon as the other PR is merged, I'll rebase this one :)

I think you may be able to adjust the base branch for this PR to point to drop-py38 branch. Once that PR it's merged, the base will automatically reset to master.

@Fale
Copy link
Author

Fale commented Nov 23, 2024

Thanks! I've rebased on the drop-py38 branch. It now works properly on py3.12 but not yet with py3.13. I'm not sure if we want to move py3.13 to be ok to fail or you think it makes more sense to fix the compatibility to py3.13 directly

@Fale Fale changed the base branch from master to drop-py38 November 23, 2024 09:05
@snejus
Copy link
Member

snejus commented Nov 23, 2024

Thanks! I've rebased on the drop-py38 branch. It now works properly on py3.12 but not yet with py3.13. I'm not sure if we want to move py3.13 to be ok to fail or you think it makes more sense to fix the compatibility to py3.13 directly

I guess we'd need to understand why is that issue occurring: if you want to try to fix it you will have to wrestle with Poetry a bit and find out why is that dependency installation failing.

As far as I remember, this may have to do with scipy - I think googling up that error may give some clues about what's going on.

@Fale
Copy link
Author

Fale commented Nov 24, 2024

It seems like there is an issue with numba. We are importing 0.60.0 (the latest released one), while 0.61.0 will have Python 3.13 support. The first rc should be released in the coming days.

@snejus
Copy link
Member

snejus commented Dec 2, 2024

@Fale sounds good. Feel free to review #5508 if you have time - if all good I will merge it in.

@snejus
Copy link
Member

snejus commented Dec 2, 2024

Alternatively, you can also split this into two PRs:

  1. Add support for 3.10 and 3.11, base it on the current master
  2. Add support for 3.12, base it on drop-py38.

…pport for python 3.13 and the next python release

Ensure that llvm and openblas are present, seems it seems they are not in some cases.
@Fale Fale force-pushed the update-ci-python branch from 6c879cd to 75f2b85 Compare December 3, 2024 23:04
@Fale
Copy link
Author

Fale commented Dec 3, 2024

I've moved the 3.13 to be ok to fail so that this can be merged. We can work on 3.13 support when numba 0.61.0 gets released :).

Thanks a lot :)

@snejus
Copy link
Member

snejus commented Dec 4, 2024

I bet that numba will get fixed before #5508 is reviewed and ready to merge 😁 I think that's the main bottleneck here.

snejus added a commit that referenced this pull request Dec 10, 2024
- Drop support for EOL Python 3.8 making Python 3.9 the minimum
supported version

- Take advantage of Python 3.9+ type hint syntax by:
  - Using `list[T]` instead of `List[T]` etc. from typing module
  - Using `Type | None` syntax for unions instead of `Union[Type, None]`
  - Moving collection type hints from `typing` to `collections.abc`
  - Using `TYPE_CHECKING` guard for runtime import optimization

Note: in #5503 we found that we cannot support Python 3.12 unless we
upgrade our minimum support Python to 3.9.
@snejus snejus deleted the branch beetbox:drop-py38 December 10, 2024 06:54
@snejus snejus closed this Dec 10, 2024
@Fale Fale mentioned this pull request Dec 10, 2024
@snejus
Copy link
Member

snejus commented Dec 10, 2024

Oh I stupidly removed the drop-py38 immediately after the merge and GitHub did not have time to change the base to masster and thus closed this PR since its base disappeared.

Apologies!!

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.

2 participants