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

For which python version? 3.6 or 3.8 #12

Closed
wyleung opened this issue Mar 28, 2020 · 5 comments
Closed

For which python version? 3.6 or 3.8 #12

wyleung opened this issue Mar 28, 2020 · 5 comments

Comments

@wyleung
Copy link

wyleung commented Mar 28, 2020

Hi @mhadam ,

I found some differences in your docker files https://github.com/mhadam/clutch/blob/master/docker/clutch.df and the poetry config here https://github.com/mhadam/clutch/blob/master/pyproject.toml

Is your intent to make this compatible with python3.6 or is the intend to make it work for python 3.8 only?

I'm facing issues with the typing and dataclasses dependencies ... (trying to resolve them in my fork) ..

Many thanks for reviving this project!

@mhadam
Copy link
Owner

mhadam commented Mar 28, 2020

Hi @wyleung !

I'm leaning towards supporting 3.8 first - if there's a major need for 3.6 I'm open to supporting it (there's ways to do this AFAIK but I haven't looked that much into it).

I was hoping for the rewrite to leverage the typing features that landed in Python recently, and stuff like TypedDict is >=3.8.

I'm in the process of rewriting some of the response marshaling code, so I'll try to think about how to handle version compatibility while I'm doing that.

Although - if you're completely roadblocked with using the library, there's still the legacy version (1.0.6) which should be compatible with Python 2 and 3.

In the meantime, I'll update the version compatibility to >=3.8 for the time being since you're right, the library will throw errors.

Thanks again for using the library and let me know if you're running into any other issues.

@sndrtj
Copy link

sndrtj commented Mar 30, 2020

Hi there,

The typing-extensions package allows older python versions to use TypedDict as well. One could maybe add it as an optional dependency, and then import TypedDict as the following:

try:
   from typing import TypedDict
except ImportError:
   from typing_extensions import TypedDict

That does not address the dataclasses issue though, so this solution is strictly python >= 3.7 only.

@mhadam
Copy link
Owner

mhadam commented Mar 30, 2020

I'm in the process of rewriting the response code to use Pydantic, which has it's own class for typing data BaseModel (and seems to offer 3.6 compatibility).

And thanks, I'll do that for TypedDict. I should be able to do the same thing with dataclasses for 3.6.

Poetry also lets me define dependencies for certain versions of Python.

@mhadam
Copy link
Owner

mhadam commented Apr 4, 2020

hey @wyleung & @sndrtj ,

some bad news: I doubt clutch will support 3.6. I've finished up on some work using pydantic in the codebase, and I'm using generic models and found out they only support 3.7+.

It'd be nice if there was a way to workaround how I've used them, but otherwise we're stuck with 3.7+.

At the moment I've released 3.0.0.pre3, so you can try it out with:

pip install --pre transmission-clutch==3.0.0.dev3

Let me know if you have any ideas of how to workaround the generic model code (it's used in connection.py). Otherwise I'll close this issue out soon when I release v3.

@wyleung
Copy link
Author

wyleung commented Apr 6, 2020

@mhadam thank you for your reaction.
I've some experience using pydantic (with python 3.6) but never touched the generic models.

With my own fork, I'm able to use your library ... (using typing_extensions) ... I'll keep an eye to this project and see how I can contribute.

@mhadam mhadam closed this as completed Apr 24, 2020
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

No branches or pull requests

3 participants