You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Background:
Here is a simple directory tree for illustration purpose.
.
├── script.py
└── wandb
In script.py. I have a line to import wandb, import wandb.
When I execute pipreqs on ./, it lists all packages but wandb. I guess it is due to pipreqs believes wandb is not an external dependency because of its presence in the directory. Perhaps it is recognised as a locally developed package.
However in this case, given wandb is a prevailing external package for deep learning and the local wandb folder is empty, it can be deduced that wandb is bound to be an external dependent. In fact, I think it is common that folder / file in the directory shares same name with some external packages. In such case, those packages will not be detected.
Trouble shooting: packages = imports - (set(candidates) & imports)
The case is due to the above line in function get_all_imports in pipreqs.py. Since wandb is the intersection between candidates and imports, it is finally eliminated from imports
Solution:
I believe that elements like wandb in this example are identified as risky, because they are not only registered in PyPI, but also filed locally. They should not be added to requirements.txt directly, which I totally agree. However, is it possible to add a feature to identify those risky packages and output them to another file? Additionally, printing debug info can also be considered.
If this idea is reasonable, I can contribute on that.
The text was updated successfully, but these errors were encountered:
Background:
Here is a simple directory tree for illustration purpose.
.
├── script.py
└── wandb
In script.py. I have a line to import wandb,
import wandb
.When I execute pipreqs on ./, it lists all packages but wandb. I guess it is due to pipreqs believes wandb is not an external dependency because of its presence in the directory. Perhaps it is recognised as a locally developed package.
However in this case, given wandb is a prevailing external package for deep learning and the local wandb folder is empty, it can be deduced that wandb is bound to be an external dependent. In fact, I think it is common that folder / file in the directory shares same name with some external packages. In such case, those packages will not be detected.
Trouble shooting:
packages = imports - (set(candidates) & imports)
The case is due to the above line in function get_all_imports in pipreqs.py. Since wandb is the intersection between candidates and imports, it is finally eliminated from imports
Solution:
I believe that elements like wandb in this example are identified as risky, because they are not only registered in PyPI, but also filed locally. They should not be added to requirements.txt directly, which I totally agree. However, is it possible to add a feature to identify those risky packages and output them to another file? Additionally, printing debug info can also be considered.
If this idea is reasonable, I can contribute on that.
The text was updated successfully, but these errors were encountered: