tox icon indicating copy to clipboard operation
tox copied to clipboard

Use tomllib from the standard library on Python 3.11+

Open hroncok opened this issue 1 year ago • 2 comments

Fallback to tomli, which has the same API.

Fixes https://github.com/tox-dev/tox/issues/2462

Contribution checklist:

(also see CONTRIBUTING.rst for details)

  • [x] wrote descriptive pull request text
  • [ ] added/updated test(s)
  • [ ] updated/extended the documentation
  • [x] added relevant issue keyword in message body
  • [ ] added news fragment in changelog folder
    • fragment name: <issue number>.<type>.rst for example (588.bugfix.rst)
    • <type> is must be one of bugfix, feature, deprecation, breaking, doc, misc
    • if PR has no issue: consider creating one first or change it to the PR number after creating the PR
    • "sign" fragment with -- by :user:`<your username>`.
    • please, use full sentences with correct case and punctuation, for example:
      Fixed an issue with non-ascii contents in doctest text files -- by :user:`superuser`.
      
    • also see examples
  • [x] added yourself to CONTRIBUTORS (preserving alphabetical order)

hroncok avatar Jul 21 '22 14:07 hroncok

Looks good to me!

But neither tox nor gh actions run Python 3.11.

@gaborbernat What do you think? Are you ok with the changes? This would mean we need to run CI with Python 3.11 beta.

jugmac00 avatar Jul 25 '22 09:07 jugmac00

But neither tox nor gh actions run Python 3.11.

Yeah, we need to change that before we merge this. I'll add 3.11 to virtualenv today and then move to tox.

gaborbernat avatar Jul 25 '22 18:07 gaborbernat

Is the Python 2 compatibility no longer a concern?

hroncok avatar Aug 22 '22 07:08 hroncok

Is the Python 2 compatibility no longer a concern?

The information is split between the issue and the pr.

@gaborbernat The Python 2 comp was discussed at https://github.com/tox-dev/tox/issues/2462#issuecomment-1192926874

jugmac00 avatar Aug 22 '22 07:08 jugmac00

Seems we'll need to fallback to toml on python 2.

gaborbernat avatar Aug 22 '22 17:08 gaborbernat

Yes. See my fixup: Fallback to toml, not tomli, for Python 2 support commit which can still be seen here at github. It seems to have been erased away.

hroncok avatar Aug 22 '22 17:08 hroncok

Because you've fallen back to toml on Python 3.11 or less and not just Python 2. 🤔

gaborbernat avatar Aug 22 '22 18:08 gaborbernat

So you'd prefer a three-way split? I can do that, I just considered it a bit redundant.

hroncok avatar Aug 22 '22 18:08 hroncok

So you'd prefer a three-way split? I can do that, I just considered it a bit redundant.

Yes.

gaborbernat avatar Aug 22 '22 18:08 gaborbernat

Looks like 3.5 will also need toml. Will update this later today.

hroncok avatar Aug 22 '22 19:08 hroncok

This seems to work. At least on cpythons.

Let me know if you prefer to use toml also on 3.6 and pin tomli to 2+.

Let me know if you want me to rebase or squash somehow.

hroncok avatar Aug 22 '22 20:08 hroncok

Let me know if you prefer to use toml also on 3.6 and pin tomli to 2+.

I've done that now. Feel free to revert the commit.

hroncok avatar Aug 23 '22 12:08 hroncok