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

Replace toml with tomllib #10

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Replace toml with tomllib #10

wants to merge 1 commit into from

Conversation

robin-nitrokey
Copy link
Member

The Python 3.11 standard library provides tomllib for parsing TOML files. As even Debian stable ships Python 3.11, we should be fine with using it instead of the third-party toml dependency.

The Python 3.11 standard library provides tomllib for parsing TOML
files.  As even Debian stable ships Python 3.11, we should be fine with
using it instead of the third-party toml dependency.
{ name = "host_cryptogram", type = "[u8; 8]" }
{ name = "host_cryptogram", type = "[u8; 8]" },
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wait does that mean that the previous toml libraries accepted invalid input?

Copy link
Member Author

Choose a reason for hiding this comment

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

At least the generated file did not change. I haven’t looked into the details yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don’t see a good reason why toml would have accepted that. But it also looks like the package is not maintained anymore. So if we ever need toml support before Python 3.11 in the future, we should prefer tomli over toml.

@robin-nitrokey
Copy link
Member Author

Nevermind, Ubuntu 22.04 LTS is still on 3.10. :(

@sosthene-nitrokey
Copy link
Collaborator

Debian 12 has python 3.11: https://packages.debian.org/bookworm/python3.11

@robin-nitrokey
Copy link
Member Author

Sorry, I don’t get it. Isn’t that what I wrote above?

@sosthene-nitrokey
Copy link
Collaborator

This means we could use a debian-based image no?

@robin-nitrokey
Copy link
Member Author

For pynitrokey, we always try to support the latest Ubuntu LTS. Arguably, this is mostly relevant for end-user applications, but for me it is easier to only keep track of one minimum Python version for all projects. But if you’d like to migrate se05x already, we could indeed use a Debian-based image or just install Python 3.11 with the setup-python action.

@sosthene-nitrokey
Copy link
Collaborator

The next ubuntu LTS is 2 weeks away so I would just keep this as draft and keep a reminder to update then

@robin-nitrokey robin-nitrokey marked this pull request as draft April 12, 2024 09:20
sosthene-nitrokey added a commit that referenced this pull request Apr 16, 2024
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