module import questions and question about pytest and module imports

Jean-Michel Pichavant jeanmichel at sequans.com
Mon Dec 8 10:56:51 EST 2014


----- Original Message -----
> From: "sam pendleton" <samp4040 at gmail.com>
> Having to put the garage package on the sys.path seems a little off,
> why wouldn't relative imports work?
> 
> Do most people somehow put their packages in sys.path when bundling
> their python packages up to be shared with setuptools or other python
> package managers? If so, how?

If it feels more natural to you, you can also update the env variable PYTHONPATH and add the path to your dev package.
That way you don't need to add python code.

But if you plan to distribute your package with setuptools, the solution would probably be to install your package before testing it (and probably use virtualenv).

JM


-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


More information about the Python-list mailing list