ewjoachim / pypitoken

Creation & manipulation of PyPI tokens
http://pypitoken.readthedocs.io/en/latest/
MIT License
12 stars 1 forks source link

Handle new Caveat format #132

Closed di closed 1 year ago

di commented 1 year ago

We introduced a new caveat format in https://github.com/pypi/warehouse/pull/11903, which currently pypitoken can't handle:

>>> token.restrictions
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/di/git/ewjoachim/pypitoken/pypitoken/token.py", line 671, in restrictions
    return [
  File "/home/di/git/ewjoachim/pypitoken/pypitoken/token.py", line 672, in <listcomp>
    Restriction.load_json(caveat=caveat.caveat_id)
  File "/home/di/git/ewjoachim/pypitoken/pypitoken/token.py", line 137, in load_json
    return cls.load(caveat=caveat_obj)
  File "/home/di/git/ewjoachim/pypitoken/pypitoken/token.py", line 118, in load
    raise exceptions.LoaderError(
pypitoken.exceptions.LoaderError: Could not find matching Restriction for [4, '89e9fdb4-1a5f-49d4-8bc5-d5840a14a311']
ewjoachim commented 1 year ago

Yay ! I'm working on it :)

ewjoachim commented 1 year ago

Version 6 introduces quite a few breaking changes, but adds the new caveats :)

https://pypitoken.readthedocs.io/en/latest/howto.html#version-6-x-upgrade