Skip to content

Conversation

LecrisUT
Copy link

@LecrisUT LecrisUT commented Sep 2, 2025

Pull Request Checklist

  • I’ve read the guidelines for contributing.
  • I updated AUTHORS.txt and CHANGES.txt (if the change is non-trivial) and documentation (if applicable).
  • I tested my changes.

Description

This is a quick PR to move the dependency from toml to tomllib/tomli + tomli-w. The old dependency has not been maintained for a while and downstream packagers have deprecated it and it will soon be removed.

Related fedora change: https://fedoraproject.org/wiki/Changes/DeprecatePythonToml (this is quite old and most of the dependencies have been resolved, we are dealing now with the remaining leftovers)

Copy link
Contributor

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

This is a breaking change, but I think it's OK. @Kwpolska what do you think; also do we have a policy on such breaking changes?

Co-authored-by: Felix Fontein <felix@fontein.de>
Comment on lines +84 to +85
"tomli;python_version<'3.11'",
"tomli-w",
Copy link
Member

Choose a reason for hiding this comment

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

Please specify a minimum version. The one available in Debian stable or Ubuntu LTS will probably be the best option.

Copy link
Author

Choose a reason for hiding this comment

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

Seems fairly arbitrary, I would prefer to leave it to upstream to decide on a minimum. I generally do not add bounds until I find the need for one at which point I document the need for it. It is too easy for the bounds to become out-of-sync with the actual usage in the code itself (although there are CI tricks to test the lower-bounds)

Copy link
Member

Choose a reason for hiding this comment

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

We consider minimums necessary to avoid issues when people come with ancient versions and expect things to work.

Copy link
Contributor

Choose a reason for hiding this comment

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

The only versions packaged for non-EOL versions of Ubuntu (22.04+) and Debian (Bookworm+) is 1.0.0. So tomli-w>=1.0.0 should definitely be fine.

Also we're using tomli-w in exactly one line, and the usage there has apparently been supported by tomli-w since its first release (0.1.0) according to the changelog (https://github.com/hukkin/tomli-w/blob/master/CHANGELOG.md).

Copy link
Author

Choose a reason for hiding this comment

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

Same for tomli for that matter. They were made to be compatible up to only a few interface changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

How about setting both >=1.0.0 then?

Comment on lines +84 to +85
"tomli;python_version<'3.11'",
"tomli-w",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"tomli;python_version<'3.11'",
"tomli-w",
"tomli>=1.0;python_version<'3.11'",
"tomli-w>=1.0",

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.

3 participants