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

feat: python 3.12 support #6773

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Laikulo
Copy link
Contributor

@Laikulo Laikulo commented Dec 31, 2024

Entirely just some adjustments to dependencies.
Based on initial analysis by Sineos over at the discourse: https://klipper.discourse.group/t/discuss-python-versions/20942/10

@Laikulo
Copy link
Contributor Author

Laikulo commented Dec 31, 2024

Import test succeeds, runs on a multi-mcu test box with kinematics: None

Signed-off-by: Aaron Haun <[email protected]>
@Laikulo
Copy link
Contributor Author

Laikulo commented Jan 1, 2025

Regression tests pass on py3.12, with fresh dicts built on buster.
py_3_12_tests.txt

@Laikulo Laikulo marked this pull request as ready for review January 1, 2025 00:37
@Laikulo Laikulo changed the title Draft: feat: python 3.12 support feat: python 3.12 support Jan 1, 2025
@nefelim4ag
Copy link
Contributor

BTW:

$ ~/klippy-env/bin/python3 -m pip list | grep setup
setuptools         75.1.0
$ ~/klippy-env/bin/python3 -m pip list | grep python-can
python-can         3.3.4
$ ~/klippy-env/bin/python3 --version
Python 3.12.6

But of course, the correct versions are better,
If there are green light on 3.12, I can reinstall Klipper with those if it helps with testing and even migrate back to USB-CAN to cover python-can.

@KevinOConnor
Copy link
Collaborator

Thanks for looking at this. In general it seems fine. I'd just like to confirm that we do need to pin these versions and that there isn't some version of setuptools and python-can that works with a wide variety of python versions?

Cheers,
-Kevin

@Laikulo
Copy link
Contributor Author

Laikulo commented Jan 16, 2025

Setuptools isn't needed at all on older versions, it provides a backfill for distutils, which has been removed.
python-can after 4.x doesn't support py2.x, and 3.x doesn't appear to work on py3.12. It might be possible to give a wider selector, I did strict equality, as that is how all the others were specified.

@KevinOConnor
Copy link
Collaborator

Okay, thanks. So we have to specify two different versions for python-can (one for <3.12 and one for >3.12). I didn't understand your answer about setuptools though - there is not a version of setuptools we can reasonably use across all python versions? (It's fine if the answer is yes - I just want to be sure I understand the change.)

Cheers,
-Kevin

@Laikulo
Copy link
Contributor Author

Laikulo commented Jan 17, 2025

It's more that we don't need setuptools in prior versions, because the functionality that it is adding was part of the standard distribution.

https://peps.python.org/pep-0632/

Setuptools contains compatibility shims that allows the use of the distutils package and modules.

@KevinOConnor
Copy link
Collaborator

I think it'd be preferable to have every instance be pinned to a single version of setuptools, even if not all instances need it. It's just easier for debugging and troubleshooting if all instances are running as much of the same code as possible.

I understand if we can't pin a single version though - so that's my main question - do you know if we can pin a single version of setuptools?

Thanks again,
-Kevin

@flowerysong
Copy link
Contributor

flowerysong commented Jan 19, 2025

AFAIK the requirement is either to upgrade python-can or to install setuptools (which old versions of python-can rely on for reasons unrelated to distutils.) Both should not be necessary.

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.

4 participants