sinoroc / tox-poetry-dev-dependencies

Tox plugin to help working with Poetry-based projects
https://pypi.org/project/tox-poetry-dev-dependencies/
Apache License 2.0
15 stars 3 forks source link

Use importlib.metadata if it exists #17

Closed jayvdb closed 4 years ago

jayvdb commented 4 years ago

Python 3.8 does not need importlib_metadata - it is part of stdlib as importlib.metadata.

  File "/usr/lib/python3.8/site-packages/tox_poetry_dev_dependencies/__init__.py", line 5, in <module>
    from . import _meta
  File "/usr/lib/python3.8/site-packages/tox_poetry_dev_dependencies/_meta.py", line 5, in <module>
    import importlib_metadata
ModuleNotFoundError: No module named 'importlib_metadata'
sinoroc commented 4 years ago

Why the stack trace? How did this happen? There is a mandatory dependency on importlib-metadata, I do not see how this could have happened.

sinoroc commented 4 years ago

@jayvdb Since importlib_metadata is used exclusively to provide the value for __version__, accodingly to PEP 396, and my impression is that no one actually relies on the presence of this value (additionally the PEP itself never went to the final stage), it might be worth it getting rid of __version__ entirely.

Is that something that would work for you?

Do you rely on PEP 396 (the presence of __version__), or are you aware of any project that does?

The maintainers of importlib-metadata themselves got rid of it in this change.

jayvdb commented 4 years ago

I use a different tox poetry plugin now.

sinoroc commented 4 years ago

I use a different tox poetry plugin now.

@jayvdb For info, which plugin are you using? I want to link to it in the README, so that people can find alternatives easily.

These are the ones I have so far:

sinoroc commented 4 years ago

For info, the removal of __version__ and thus the dependency on importlib-metadata has been released in v0.0.4.