Pylint: Pyreverse: working without without __init__.py files

Created on 22 Feb 2019  ยท  4Comments  ยท  Source: PyCQA/pylint

This ability already requested in https://github.com/PyCQA/pylint/issues/842, But I think it's only for Pylint, not Pyreverse.

With PEP 420 -- Implicit Namespace Packages I can work seamlessly without ever needed the __init__.py files. But when it comes to generating class diagram with Pyreverse, I have to add them unless it didn't work

My current dirty-solution is to add __init__.py to all my project folder temporarily, then stash them back and forth. Indeed it's not convenience experience.

Hope Pyreverse will work without __init__.py

Step to reproduce

With this directory structure

Myproject.py
โ”œโ”€โ”€ Controllers
โ”œโ”€โ”€ Model
โ”œโ”€โ”€ Resources
โ”‚ย ย  โ”œโ”€โ”€ img
โ”‚ย ย  โ””โ”€โ”€ ui
โ””โ”€โ”€ Views

and $ pyreverse -my -A -o png -p myprojectname .

Thank you for Pyreverse.

enhancement topic-pyreverse

Most helpful comment

Is anyone still looking into this? Haven't spend much time on it yet but explicit namespacing seems to be enforced in the function defined here

https://github.com/PyCQA/pylint/blob/30b2ae713eb4453b305407772b29ea68d7c3d074/pylint/pyreverse/inspector.py#L332

More specifically in line:

https://github.com/PyCQA/pylint/blob/30b2ae713eb4453b305407772b29ea68d7c3d074/pylint/pyreverse/inspector.py#L354

Do you agree? I might be interested to pick up this issue

All 4 comments

Sounds like a good suggestion, thanks for reporting it!

We give a lot of hope to Pyreverse. Hope I can contribute back.

I don't know why in such tremendous amount of library in Python ecosystem, where choosing between them is so confusing. We have one and the only UML generating library that works. Other lib last release is years years ago.

Thanks for the kind words @azzamsa If you want to open a PR, I'd be happy to review or offer suggestions.

Is anyone still looking into this? Haven't spend much time on it yet but explicit namespacing seems to be enforced in the function defined here

https://github.com/PyCQA/pylint/blob/30b2ae713eb4453b305407772b29ea68d7c3d074/pylint/pyreverse/inspector.py#L332

More specifically in line:

https://github.com/PyCQA/pylint/blob/30b2ae713eb4453b305407772b29ea68d7c3d074/pylint/pyreverse/inspector.py#L354

Do you agree? I might be interested to pick up this issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pylint-bot picture pylint-bot  ยท  3Comments

pylint-bot picture pylint-bot  ยท  3Comments

lancelote picture lancelote  ยท  3Comments

ethanchewy picture ethanchewy  ยท  3Comments

jrial picture jrial  ยท  3Comments