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

Migrate to Python 3.12-bookworm image #86

Closed
devraj opened this issue Oct 6, 2023 · 1 comment
Closed

Migrate to Python 3.12-bookworm image #86

devraj opened this issue Oct 6, 2023 · 1 comment
Assignees

Comments

@devraj
Copy link
Member

devraj commented Oct 6, 2023

Is your feature request related to a problem? Please describe.
Python 3.12 (with Debian 12) is available on Dockerhub. We should move to using the latest version of the runtime to get the latest benefits of the language and updated operating system.

Describe the solution you'd like

  • Review release notes
  • Investigate what issues arise from the migration, see library compatibility. This will probably require rebuilding the image from scratch and adding versions of packages that work with Python 3.12
  • There's reasonable confidence that the application codebase

Describe alternatives you've considered
NA. This is just a regular update.

Additional context
greenlet failed to install on my initial attempt at this with the following trace:

6.799   copying src/greenlet/greenlet.c -> build/lib.linux-aarch64-cpython-312/greenlet
6.799   copying src/greenlet/greenlet.h -> build/lib.linux-aarch64-cpython-312/greenlet
6.799   copying src/greenlet/slp_platformselect.h -> build/lib.linux-aarch64-cpython-312/greenlet
6.799   copying src/greenlet/tests/_test_extension.c -> build/lib.linux-aarch64-cpython-312/greenlet/tests
6.799   copying src/greenlet/tests/_test_extension_cpp.cpp -> build/lib.linux-aarch64-cpython-312/greenlet/tests
6.799   copying src/greenlet/platform/setup_switch_x64_masm.cmd -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_aarch64_gcc.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_alpha_unix.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_amd64_unix.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_arm32_gcc.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_arm32_ios.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_csky_gcc.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_m68k_gcc.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_mips_unix.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_ppc64_aix.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_ppc64_linux.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_ppc_aix.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_ppc_linux.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_ppc_macosx.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_ppc_unix.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_riscv_unix.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_s390_unix.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_sparc_sun_gcc.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_x32_unix.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_x64_masm.asm -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_x64_masm.obj -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_x64_msvc.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_x86_msvc.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   copying src/greenlet/platform/switch_x86_unix.h -> build/lib.linux-aarch64-cpython-312/greenlet/platform
6.799   running build_ext
6.799   building 'greenlet._greenlet' extension
6.799   creating build/temp.linux-aarch64-cpython-312
6.799   creating build/temp.linux-aarch64-cpython-312/src
6.799   creating build/temp.linux-aarch64-cpython-312/src/greenlet
6.799   gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -I/tmp/tmpk_qm97_x/.venv/include -I/usr/local/include/python3.12 -c src/greenlet/greenlet.c -o build/temp.linux-aarch64-cpython-312/src/greenlet/greenlet.o
6.799   src/greenlet/greenlet.c: In function ‘g_switchstack’:
6.799   src/greenlet/greenlet.c:531:45: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘recursion_limit’; did you mean ‘py_recursion_limit’?
6.799     531 |         current->recursion_depth = (tstate->recursion_limit
6.799         |                                             ^~~~~~~~~~~~~~~
6.799         |                                             py_recursion_limit
6.799   src/greenlet/greenlet.c:532:47: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘recursion_remaining’; did you mean ‘c_recursion_remaining’?
6.799     532 |                                     - tstate->recursion_remaining);
6.799         |                                               ^~~~~~~~~~~~~~~~~~~
6.799         |                                               c_recursion_remaining
6.799   src/greenlet/greenlet.c:560:55: error: ‘_PyCFrame’ has no member named ‘use_tracing’
6.799     560 |         ts__g_switchstack_use_tracing = tstate->cframe->use_tracing;
6.799         |                                                       ^~
6.799   src/greenlet/greenlet.c:621:23: error: ‘_PyCFrame’ has no member named ‘use_tracing’
6.799     621 |         tstate->cframe->use_tracing = ts__g_switchstack_use_tracing;
6.799         |                       ^~
6.799   src/greenlet/greenlet.c:624:17: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘recursion_remaining’; did you mean ‘c_recursion_remaining’?
6.799     624 |         tstate->recursion_remaining = (tstate->recursion_limit
6.799         |                 ^~~~~~~~~~~~~~~~~~~
6.799         |                 c_recursion_remaining
6.799   src/greenlet/greenlet.c:624:48: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘recursion_limit’; did you mean ‘py_recursion_limit’?
6.799     624 |         tstate->recursion_remaining = (tstate->recursion_limit
6.799         |                                                ^~~~~~~~~~~~~~~
6.799         |                                                py_recursion_limit
6.799   src/greenlet/greenlet.c: In function ‘g_calltrace’:
6.799   src/greenlet/greenlet.c:105:51: error: ‘_PyCFrame’ has no member named ‘use_tracing’
6.799     105 | #define TSTATE_USE_TRACING(tstate) (tstate->cframe->use_tracing)
6.799         |                                                   ^~
6.799   src/greenlet/greenlet.c:654:5: note: in expansion of macro ‘TSTATE_USE_TRACING’
6.799     654 |     TSTATE_USE_TRACING(tstate) = 0;
6.799         |     ^~~~~~~~~~~~~~~~~~
6.799   src/greenlet/greenlet.c:105:51: error: ‘_PyCFrame’ has no member named ‘use_tracing’
6.799     105 | #define TSTATE_USE_TRACING(tstate) (tstate->cframe->use_tracing)
6.799         |                                                   ^~
6.799   src/greenlet/greenlet.c:657:5: note: in expansion of macro ‘TSTATE_USE_TRACING’
6.799     657 |     TSTATE_USE_TRACING(tstate) =
6.799         |     ^~~~~~~~~~~~~~~~~~
6.799   src/greenlet/greenlet.c: In function ‘g_initialstub’:
6.799   src/greenlet/greenlet.c:903:51: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘recursion_limit’; did you mean ‘py_recursion_limit’?
6.799     903 |     self->recursion_depth = (PyThreadState_GET()->recursion_limit
6.799         |                                                   ^~~~~~~~~~~~~~~
6.799         |                                                   py_recursion_limit
6.799   src/greenlet/greenlet.c:904:53: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘recursion_remaining’; did you mean ‘c_recursion_remaining’?
6.799     904 |                              - PyThreadState_GET()->recursion_remaining);
6.799         |                                                     ^~~~~~~~~~~~~~~~~~~
6.799         |                                                     c_recursion_remaining
6.799   error: command '/usr/bin/gcc' failed with exit code 1
6.799   
6.799 
6.799   at /usr/local/lib/python3.12/site-packages/poetry/installation/chef.py:147 in _prepare
6.800       143│ 
6.800       144│                 error = ChefBuildError("\n\n".join(message_parts))
6.800       145│ 
6.800       146│             if error is not None:
6.801     → 147│                 raise error from None
6.801       148│ 
6.801       149│             return path
6.801       150│ 
6.801       151│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
6.801 
6.801 Note: This error originates from the build backend, and is likely not a problem with poetry but with greenlet (1.1.3.post0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "greenlet (==1.1.3.post0)"'.
6.801 
------
failed to solve: process "/bin/sh -c poetry install --no-root" did not complete successfully: exit code: 1
@devraj devraj self-assigned this Oct 6, 2023
@devraj
Copy link
Member Author

devraj commented Oct 31, 2023

Awaiting pendulum migrating supporting PEP 517 builds, see pull request awaiting to be merged.

python-pendulum/pendulum#765

devraj added a commit that referenced this issue Nov 22, 2023
pendulum2.x does not support PEP517 and won't build in python3.12, there's a ticket
asking for a release to make it compatible with python 3.12
python-pendulum/pendulum#765

the project maintainers have commented on this ticket to say v2 will no longer get updates
https://github.com/sdispater/pendulum/issues/753\#issuecomment-1739202965

version3 has pre-releases available on github
https://github.com/sdispater/pendulum/releases/tag/3.0.0b1

this commit is now tracking the beta releases to see if there are any issues with
our existing code, and will join back with the stable v3 release as it becomes available

for large portion of it this should address our requirement for python3.12

note that the Dockerfile is update to track patch releases of the python image

REFS #86
@devraj devraj closed this as completed Nov 22, 2023
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

No branches or pull requests

1 participant