damnever / pigar

:coffee: A tool to generate requirements.txt for Python project, and more than that. (IT IS NOT A PACKAGE MANAGEMENT TOOL)
https://damnever.github.io/pigar/
BSD 3-Clause "New" or "Revised" License
1.61k stars 90 forks source link

Namespace packages get collapsed into a single package #174

Open ns-ggeorgiev opened 11 months ago

ns-ggeorgiev commented 11 months ago

Describe the bug When two or more packages share namespace, the tools seems to believe that all of the files in the namespace belong to one of the packages (it seems like the first one alphabetically)

To Reproduce Steps to reproduce the behavior:

  1. Create two packages as described here: https://packaging.python.org/en/latest/guides/packaging-namespace-packages/#pkgutil-style-namespace-packages

  2. Create app that imports files from both

  3. run the tool and observe the suggested list will not include one of the packages

Expected behavior All packages that have imports should be included.

damnever commented 11 months ago

Could you please provide an environment with the minimum requirements to reproduce this issue?