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

Incompatible with typing-extensions 4.6.x #1

Closed
snarfed opened this issue May 26, 2023 · 10 comments · Fixed by #2
Closed

Incompatible with typing-extensions 4.6.x #1

snarfed opened this issue May 26, 2023 · 10 comments · Fixed by #2

Comments

@snarfed
Copy link

snarfed commented May 26, 2023

Hi! First of all, thank you for building and maintaining all of these IPLD libraries. They're awesome!

You may have already noticed that typing-extensions v4.6.0 made a change that broke this lib. Specifically, this is what I get when I import bases with it:

>>> import bases
Traceback (most recent call last):
  File ".../bases/__init__.py", line 40, in <module>
    from . import encoding as encoding
  File ".../bases/encoding/__init__.py", line 293, in <module>
    base8 = FixcharBaseEncoding(alphabet.base8, pad_char="=", padding="include")
  File ".../bases/encoding/fixchar.py", line 106, in __init__
    validate(char_nbits, Union[int, Literal["auto"]])
  File ".../typing_validation/validation.py", line 635, in validate
    _validate_union(val, t)
  File ".../typing_validation/validation.py", line 515, in _validate_union
    validate(val, member_t)
  File ".../typing_validation/validation.py", line 691, in validate
    raise unsupported_type_error
ValueError: Unsupported validation for type typing_extensions.Literal['auto'].

Not an emergency. Thanks in advance for looking!

snarfed referenced this issue in snarfed/bridgy-fed May 26, 2023
v4.6.0 breaks bases (which multiformats etc use)

https://github.com/hashberg-io/bases/issues/3
@sg495 sg495 transferred this issue from hashberg-io/bases Jun 8, 2023
snarfed added a commit to snarfed/arroba that referenced this issue Jul 26, 2023
* run datastore emulator
* run flake8 to detect aliased test names
* pin typing-extensions to <4.6 for compatibility with multiformats
* use anonymous creds in ndb client

hashberg-io/typing-validation#1
@MarshalX
Copy link

is not compatible with pydantic v2. any updates?

snarfed added a commit to snarfed/lexrpc that referenced this issue Aug 17, 2023
@MarshalX
Copy link

MarshalX commented Sep 2, 2023

this seems a blocker for me. bump @sg495

@declension
Copy link

Blocking us too. Anyone found any workarounds for running Pydantic 2.x on Python <3.11 with this (or multiformats more generally)?

@MarshalX
Copy link

MarshalX commented Sep 11, 2023

@declension i just wrote my own and migrated https://github.com/MarshalX/python-libipld

@declension
Copy link

@declension i just wrote my own and migrated https://github.com/MarshalX/python-libipld

Thanks - different use case here I think but maybe I'll start working around too then

@MarshalX
Copy link

MarshalX commented Sep 11, 2023

@declension i just wrote my own and migrated https://github.com/MarshalX/python-libipld

Thanks - different use case here I think but maybe I'll start working around too then

feel free to contribute more functions that should be bond for your use case :)

dbluhm added a commit to dbluhm/typing-validation that referenced this issue Sep 28, 2023
Resolves hashberg-io#1.

This fix simply loads Literal from typing-extensions for python versions
less than 3.11.

Signed-off-by: Daniel Bluhm <[email protected]>
@snarfed
Copy link
Author

snarfed commented Oct 7, 2023

@sg495 identified the root cause here months ago in hashberg-io/multiformats#10 (comment) . any chance you all could get a fix for that in sometime soon? thank you in advance!

snarfed added a commit to snarfed/lexrpc that referenced this issue Oct 29, 2023
also pin typing-extensions to <4.6.0 due to hashberg-io/typing-validation#1
@makkus
Copy link

makkus commented Nov 1, 2023

For what its worth, I've been using the code from pull request #2 for the development version of the application I'm working on (Python 3.11, Pydantic >=2.0), and haven't seen any issues so far.

Having a published version that has this fix would be great though.

@sg495 sg495 closed this as completed in #2 Dec 18, 2023
@sg495
Copy link
Contributor

sg495 commented Dec 18, 2023

Apologies for the delay in this: personal issues have prevented me from keeping up with this over the past few months. I have now merged the pull request: I will run local tests and publish an updated version shortly.

@sg495 sg495 reopened this Dec 18, 2023
@sg495 sg495 closed this as completed in ea5f5fb Dec 18, 2023
@sg495
Copy link
Contributor

sg495 commented Dec 18, 2023

This has now been released on PyPI as v1.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 a pull request may close this issue.

5 participants