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

Peerdependency Dataclasses does compromise Python 3.7 and Python 3.8 support (AttributeError: module 'typing' has no attribute '_ClassVar') #142

Closed
vleandersson opened this issue Mar 15, 2021 · 1 comment

Comments

@vleandersson
Copy link

vleandersson commented Mar 15, 2021

Overview
There is a known issue, that occurs with many of the packages using Dataclasses where installing Dataclasses actually disrupts the native dataclasses shipped with >Python 3.7.

Example:
When using Pandas v. 1.2.3 together with darwin-py v. 0.5.15 you will encounter the error AttributeError: module 'typing' has no attribute '_ClassVar' due to the usage of @dataclasses.dataclass in pandas/io/common.

Suggested solution

  • Deploy a breaking change and lose official support for Python 3.6.
  • Add instructions of installing dataclassess 0.6 manually if running on Python 3.6 or below

Workaround
Install package without deps (pip3 install --no-deps) and then manually install all missing dependencies for darwin-py

Downside: A lot of work

How to replicate
I've done this in Docker, as this allows me to run in a clean environment.

  1. Spin up a Buster docker image with Python 3.8
  2. Install darwin-py==0.5.15
  3. Install pandas==1.2.3
  4. Import pandas (as pd)
  5. Run the docker container
@andreaazzini
Copy link
Member

Hi @vleandersson,

We've had an internal discussion recently, and we have decided we are going to drop support for Python 3.6 at the end of the year. That coincides with the final release of Python 3.6. https://www.python.org/dev/peps/pep-0494/#id15

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

2 participants