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

pyreverse: pyreverse doesn't link sub-classes to an abstract class #2479

Closed
rahul1990gupta opened this issue Sep 6, 2018 · 4 comments · Fixed by #4856
Closed

pyreverse: pyreverse doesn't link sub-classes to an abstract class #2479

rahul1990gupta opened this issue Sep 6, 2018 · 4 comments · Fixed by #4856
Labels
Bug 🪲 pyreverse Related to pyreverse component
Milestone

Comments

@rahul1990gupta
Copy link

rahul1990gupta commented Sep 6, 2018

Steps to reproduce

  1. Run git clone [email protected]:pixelogik/NearPy.git
  2. Run cd nearpy/storage
  3. Run pyreverse -o .png .
  4. Open classes_No_Name..png

Current behavior

You will see a UML diagram like this.This has three classes RedisStorage, MemoryStorage and an abstract class Storage. See the diagram here.
https://drive.google.com/file/d/1MQ8igLIhNIfVUM0VyXfrcFYdOwDs6V0f/view?usp=sharing

Expected behavior

classes RedisStorage and MemoryStorage should inherit from abstract class Storage

Pylint version

pylint (1.1.0)

@PCManticore PCManticore added Bug 🪲 pyreverse Related to pyreverse component labels Sep 9, 2018
@umed
Copy link

umed commented Nov 14, 2018

is there any news?

@PCManticore
Copy link
Contributor

@ovegug No news, no one got to work on this issue (and not a lot of work was done on pylint recently as well)

@rahul1990gupta
Copy link
Author

If I get some time, I can start working on it. Will post updates on the thread. :D

@levitsky
Copy link

levitsky commented Jan 5, 2019

I noticed when you are building from inside the package (nearpy/storage in your example) the inheritance is lost. This is reproducible even for empty classes.
If you go up two times and build the diagram for all of nearpy, you get the correct inheritance in the output. However, it's not sufficient to get out of storage and run pyreverse -o png storage, at least in this case.

I am having a similar problem with another package, pyteomics, where parts of inheritance relations are not shown for some of the classes.

mbyrnepr2 added a commit to mbyrnepr2/pylint that referenced this issue Aug 16, 2021
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 2.10.0, 2.10.1, 2.10.2, 2.10.x Aug 16, 2021
mbyrnepr2 added a commit to mbyrnepr2/pylint that referenced this issue Sep 27, 2021
- Keep only required code inside the context manager block

Closes pylint-dev#2479
mbyrnepr2 added a commit to mbyrnepr2/pylint that referenced this issue Sep 27, 2021
- Use the fix_import_path context manager in the existing pyreverse
tests

    Closes pylint-dev#2479
mbyrnepr2 added a commit to mbyrnepr2/pylint that referenced this issue Sep 27, 2021
- Style refactor:
   - Use a constant for the path
   - Move the constants closer to the top of the module

Closes pylint-dev#2479
mbyrnepr2 added a commit to mbyrnepr2/pylint that referenced this issue Sep 27, 2021
- Add a test for the fix_import_path context manager
  to ensure the project root directory is in sys.path

Closes pylint-dev#2479
mbyrnepr2 added a commit to mbyrnepr2/pylint that referenced this issue Sep 27, 2021
- Rm class
- sys.path -> list(sys.path)

Closes pylint-dev#2479
mbyrnepr2 added a commit to mbyrnepr2/pylint that referenced this issue Sep 27, 2021
- Prevent re-defining from outer scope

Closes pylint-dev#2479
mbyrnepr2 added a commit to mbyrnepr2/pylint that referenced this issue Sep 28, 2021
mbyrnepr2 added a commit to mbyrnepr2/pylint that referenced this issue Sep 28, 2021
- Add a type-hint & docstrings

Closes pylint-dev#2479
mbyrnepr2 added a commit to mbyrnepr2/pylint that referenced this issue Sep 29, 2021
mbyrnepr2 added a commit to mbyrnepr2/pylint that referenced this issue Sep 29, 2021
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 2.13.x, 2.12.0 Oct 17, 2021
Pierre-Sassoulas pushed a commit that referenced this issue Oct 17, 2021
* pyreverse - Add project modules to sys.path

- Use the fix_import_path context manager in the existing pyreverse
tests
- Style refactor:
   - Use a constant for the path
   - Move the constants closer to the top of the module
- Add a test for the fix_import_path context manager
  to ensure the project root directory is in sys.path
- Prevent re-defining from outer scope
- Add a type-hint & docstrings

Closes #2479
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 pyreverse Related to pyreverse component
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants