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

Support Python 3.12 #195

Merged
merged 8 commits into from
Dec 12, 2023
Merged

Support Python 3.12 #195

merged 8 commits into from
Dec 12, 2023

Conversation

danielhollas
Copy link
Contributor

@danielhollas danielhollas commented Dec 7, 2023

The blocker here was the docker Python API dependency, old version relied on distutils package that was removed in Python 3.12. I also took this opportunity to upgrade test dependencies and some Github actions.

Closes #194

Copy link

codecov bot commented Dec 7, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1eedb9d) 86.32% compared to head (c68ef1e) 86.32%.

❗ Current head c68ef1e differs from pull request most recent head 7e26592. Consider uploading reports for the commit 7e26592 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #195   +/-   ##
=======================================
  Coverage   86.32%   86.32%           
=======================================
  Files           9        9           
  Lines         914      914           
=======================================
  Hits          789      789           
  Misses        125      125           
Flag Coverage Δ
py-3.10 86.21% <ø> (ø)
py-3.11 86.21% <ø> (ø)
py-3.12 86.21% <ø> (?)
py-3.8 86.16% <ø> (ø)
py-3.9 86.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@danielhollas danielhollas changed the title WIP: Support Python 3.12 Support Python 3.12 Dec 7, 2023
@danielhollas danielhollas marked this pull request as ready for review December 7, 2023 19:55
@danielhollas
Copy link
Contributor Author

FYI I couldn't upgrade pytest-asyncio to the latest version due to this error:

../../miniforge3/envs/aiidalab-launch/lib/python3.12/site-packages/_pytest/runner.py:341: in from_call
    result: Optional[TResult] = func()
../../miniforge3/envs/aiidalab-launch/lib/python3.12/site-packages/_pytest/runner.py:372: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
../../miniforge3/envs/aiidalab-launch/lib/python3.12/site-packages/_pytest/python.py:534: in collect
    return super().collect()
../../miniforge3/envs/aiidalab-launch/lib/python3.12/site-packages/_pytest/python.py:455: in collect
    res = ihook.pytest_pycollect_makeitem(
../../.local/lib/python3.12/site-packages/pluggy/_hooks.py:493: in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
../../.local/lib/python3.12/site-packages/pluggy/_manager.py:115: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
../../miniforge3/envs/aiidalab-launch/lib/python3.12/site-packages/pytest_asyncio/plugin.py:528: in pytest_pycollect_makeitem_convert_async_functions_to_subclass
    node_or_list_of_nodes = hook_result.get_result()
../../miniforge3/envs/aiidalab-launch/lib/python3.12/site-packages/pytest_asyncio/plugin.py:511: in pytest_pycollect_makeitem_preprocess_async_fixtures
    _preprocess_async_fixtures(collector, _HOLDER)
../../miniforge3/envs/aiidalab-launch/lib/python3.12/site-packages/pytest_asyncio/plugin.py:224: in _preprocess_async_fixtures
    event_loop_node = _retrieve_scope_root(collector, scope)
../../miniforge3/envs/aiidalab-launch/lib/python3.12/site-packages/pytest_asyncio/plugin.py:942: in _retrieve_scope_root
    raise pytest.UsageError(error_message)
E   _pytest.config.exceptions.UsageError: tests/test_profile.py is marked to be run in an event loop with scope class, but is not part of any class.

I also couldn't upgrade responses (which provides mocks for requests library) since the latest version bumped the minimum requests version. We could probably cleanly upgrade requests as well, but that's better done in a separate PR to test it more carefully.

@unkcpz
Copy link
Member

unkcpz commented Dec 8, 2023

I remember there are some issues with the latest docker API (v5->v6) on Macbook, I'll test it.

Copy link
Member

@unkcpz unkcpz left a comment

Choose a reason for hiding this comment

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

I test on my macbook air and it works fine. But mostly because I have a quite updated docker engine version (24.0.6).
Maybe there will be problems if the docker is from installing a very old docker desktop version. The docker community was quite active in supporting the apple silicon so I'd assume those are cases we shouldn't worry too much.

@unkcpz
Copy link
Member

unkcpz commented Dec 12, 2023

@danielhollas If you agree, I'll merge this PR and if users report there are problems with the docker version we start investigating on what is the minimal docker engine version that required and add it to the documentation.

@danielhollas
Copy link
Contributor Author

@unkcpz yeah, that sounds good to me, thanks for testing!

@unkcpz unkcpz merged commit 1aead4b into main Dec 12, 2023
17 checks passed
@unkcpz unkcpz deleted the py3.12 branch December 12, 2023 22:50
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.

Support Python 3.12
2 participants