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

Fix mypy implicit reexport error #133

Closed
markedwards opened this issue May 25, 2021 · 8 comments
Closed

Fix mypy implicit reexport error #133

markedwards opened this issue May 25, 2021 · 8 comments

Comments

@markedwards
Copy link

If you try to import from_dict with no_implicit_reexport enabled in mypy, you get an error:

Module 'dacite' does not explicitly export attribute 'from_dict'; implicit reexport disabled

This is easily fixed by simply defining __all__ in dacite/__init__.py. I'm happy to do a PR if it helps.

@Akuli
Copy link

Akuli commented Jun 6, 2021

Alternatively, from dacite.core import from_dict as from_dict (yes, the same name repeated).

@markedwards
Copy link
Author

markedwards commented Jun 6, 2021

Alternatively, from dacite.core import from_dict as from_dict (yes, the same name repeated).

You can just do from dacite.core import from_dict. But in any case this should be fixed.

@Akuli
Copy link

Akuli commented Jun 6, 2021

And it turns out that the star import doesn't really work either: python/mypy#10198 (comment)

@Akuli
Copy link

Akuli commented Jun 6, 2021

mypy.ini workaround:

# https://github.com/konradhalas/dacite/issues/133
[mypy-dacite]
implicit_reexport = True

@gitpushdashf
Copy link

I'm also running into this. Thanks for opening the issue.

@konradhalas
Copy link
Owner

hi @markedwards - thank you for reporting this issue. Should be fixed in a7834ba

@jessestricker
Copy link

jessestricker commented Jul 17, 2022

As the fix is not released on PyPI yet, here is workaround for a pyproject.toml:

# https://github.com/konradhalas/dacite/issues/133
[[tool.mypy.overrides]]
module = "dacite"
implicit_reexport = true

(adapted from @Akuli)

alvarobartt added a commit to alvarobartt/investiny that referenced this issue Sep 30, 2022
Following recommendations provided by @jessestricker at konradhalas/dacite#133
@ghost
Copy link

ghost commented Jan 4, 2023

tests/azure_devops/variable_groups/test_service.py:6: error: Module "lib_team_services_common.azure_devops.services" does not explicitly export attribute "VariableGroupService"; implicit reexport disabled
this is the error , would you please help me fixing it

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

5 participants