thebjorn / pydeps

Python Module Dependency graphs
https://pydeps.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
1.8k stars 114 forks source link

empty result with WARNING: SKIPPING ILLEGAL MODULE_NAME: D:.test.a #209

Closed Yunchuan-Xu closed 9 months ago

Yunchuan-Xu commented 9 months ago

[Environment]

(venv) PS D:\> pydeps --version
pydeps v1.12.18

[Directory Structure] D:\test\ ├─ a.py └─ b.py

[Case]

(venv) PS D:\> pydeps .\test\
dummymodule.py:139: WARNING: SKIPPING ILLEGAL MODULE_NAME: D:.test.a
dummymodule.py:139: WARNING: SKIPPING ILLEGAL MODULE_NAME: D:.test.b

The output svg does not contain any graph elements.

thebjorn commented 9 months ago

Hi @Yunchuan-Xu and thank you for your interest in pydeps.

The test directory is not a valid module (you'll need an __init__.py file). To get any output you'll need to have imports in the files, eg. (https://pypi.org/project/yamldirs/):

c:\srv\tmp\pydeps209> yamldirs test
test:
  __init__.py: ''
  a.py: |
    from . import b
  b.py: |
    from . import a
c:\srv\tmp\pydeps209> pydeps -Tpng test

(-Tpng because github doesn't like pasted svgs..) gives me

test

Yunchuan-Xu commented 9 months ago

@thebjorn Now it works. Thanks for your explanation!