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

Allow support for Python 3.12 #146

Merged
merged 5 commits into from
Dec 5, 2023
Merged

Allow support for Python 3.12 #146

merged 5 commits into from
Dec 5, 2023

Conversation

Tenzer
Copy link
Contributor

@Tenzer Tenzer commented Oct 9, 2023

Python 3.12 was released on 2023-10-02, and this extension should work in the new version without any code changes. The configuration for the project, however, doesn't allow it to be installed on Python 3.12, but this fixes that.

Note: This doesn't remove support for Python 3.7 even though that has reached end-of-life. Let me know if you'd like me to remove support for that here as well.

@Tenzer
Copy link
Contributor Author

Tenzer commented Oct 31, 2023

The CI run at least shows frozenlist needs to be updated - which requires dropping Python 3.7 support, otherwise, Poetry won't select the latest version of the package because they have dropped 3.7 support. I, by the way, noticed b1e949a, so I guess dropping support for Python 3.7 is okay since it's not being tested anyway.

yarl also needs to be updated. aio-libs/yarl#881 has been merged to add support for Python 3.12 but there's no release with those changes yet, so I guess this probably will have to wait until they have made a new release.

@guilhermef
Copy link
Member

@Tenzer, we can drop 3.7 support. It was already removed from the Thumbor main project.
Thanks for the contribution.

@guilhermef
Copy link
Member

@Tenzer , I'm removing Python 3.7 on #153

@Tenzer Tenzer requested a review from a team as a code owner November 1, 2023 09:09
@Tenzer
Copy link
Contributor Author

Tenzer commented Nov 1, 2023

I got a bit further with this now but hit a couple of other roadblocks:

  1. Scipy needs to be updated to at least version 1.11.2 for wheels to be available for Python 3.12 (release). It has, however, already dropped support for Python 3.8, meaning we also need to drop Python 3.8 support, otherwise, Poetry won't allow Scipy 1.11.2 to be installed.
  2. aiohttp is a dependency of aiobotocore. They do have Python 3.12 support but it's only available as a prerelease in version 3.9.0b0. They are working on getting that released properly, tracked in ** 3.9 Beta testing ** aio-libs/aiohttp#7675.

Python 3.12 was released on 2023-10-02 and this extension should work in the
new version without any code changes. The configuration for the project however
doesn't allow it to be installed on Python 3.12, but this fixes that.
@Tenzer
Copy link
Contributor Author

Tenzer commented Dec 4, 2023

I have rebased the changes and dropped Python 3.8 support in order to get the updated Scipy that works with Python 3.12. Tests are successful for me now.

@coveralls
Copy link

coveralls commented Dec 4, 2023

Pull Request Test Coverage Report for Build 7086600018

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 91.545%

Totals Coverage Status
Change from base Build 7015833363: 0.0%
Covered Lines: 314
Relevant Lines: 343

💛 - Coveralls

@guilhermef
Copy link
Member

I have rebased the changes and dropped Python 3.8 support in order to get the updated Scipy that works with Python 3.12. Tests are successful for me now.

@Tenzer , this might be an issue, since Thumbor still supports Python3.8.

@guilhermef
Copy link
Member

@Tenzer, you can pin Python 3.8 to scipy 1.10.1 and the others with a newer version.
https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies

This still follows the version ranges specified inside `pyproject.toml` but
means we get version of the dependencies that work with Python 3.12.
This required bumping the minimum Python version 3.8.1 since that's what flake8
requires as the minimum requirement: PyCQA/flake8#1741.
This is in order to maintain support for Python 3.8 while still being able to
use more recent versions of the dependencies that incorporate Python 3.12
support.
@Tenzer
Copy link
Contributor Author

Tenzer commented Dec 4, 2023

Good idea. I have kept the version range the same for Python 3.8 support for now, but we can bump that if you want. Python 3.9+ are using the version of NumPy and SciPy that has 3.12 support.

@guilhermef guilhermef merged commit 6781fcf into thumbor:main Dec 5, 2023
9 checks passed
@guilhermef
Copy link
Member

Thanks for the contribution @Tenzer

@Tenzer
Copy link
Contributor Author

Tenzer commented Dec 5, 2023

You're welcome!

@Tenzer Tenzer deleted the python-3.12 branch December 5, 2023 08:54
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.

None yet

3 participants