I'm writing a Python package and I have the code in my Documents
folder under a subfolder named myPackage
(for sake of argument).
Whilst developing the modules in this package I've been writing test code at the bottom of the script and running/adding/modifying as the code develops. I essentially now want to test my code from outside the package now (because of a weird bug that would be essentially impossible to explain) by writing other scripts that use myPackage in the way that its intended to be run.
The problem is that the code is not importable from its current location and I don't want to add it to the PythonPath
variable because this will cause namespace clashes down the line, after installing in the site-packages directory using PyPI.
So my question is how do other people deal with this problem?
- Do you create and develop code directly in the site-packages directory?
- Would you add the 'Documents/myPackage' path temporarily (or permanently) to the PATH variable?
- Are there any packages specifically designed to deal with this type of problem?