Tests folder installed in site-packages
See original GitHub issueDescribe the bug
I am not sure if this is a bug or something weird I am not understanding but when I installed the package, the tests folder was installed within site-packages
instead of within this library folder which is causing that anything with my project’s tests module is not importable. Within site-packages I can see the datamodel_code_generator
library but then I noticed that there is a tests
which is in conflict with my project’s tests
module.
Since I am using conda I have a pth file for my project’s modules there and they do not take priority over site-packages ones. This is causing that when I try to import something from tests like from tests.blah import Blah
it will say that tests.blah
does not exist because it is trying to find it within the tests module of datamodel-code-generator
.
To Reproduce
I just installed the package in a conda environment as normal. This caused the tests folder to be within site-packages
instead of contained within its own package.
Expected behavior I would expect that the tests of the code generator are contained within the code generator package when installed. This can cause any project that is not setting their own modules via sys.path or PYTHONPATH to have conflicts if they have a module named tests they need to import. Since conda supports pth files within site-packages to define where to find local modules for a given environment this can be an issue for anyone using conda.
Version:
- OS: MacOS 11.4
- Python version: 3.8.5
- datamodel-code-generator version: 0.11.7
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Great thanks!
@jaraqueffdc @gaborbernat I have fixed the problem 🎉