debugging during package development
Sebastian Luque
spluque at gmail.com
Sat Aug 1 09:22:11 EDT 2015
On Sat, 01 Aug 2015 15:30:34 +1000,
Ben Finney <ben+python at benfinney.id.au> wrote:
> Seb <spluque at gmail.com> writes:
>> With lots of debugging to do, the last thing I'd want is to worry
>> about the search path.
> Short answer: you need ‘python3 ./setup.py develop’.
> Medium-length answer: you need to add some infrastructure to get your
> project to the point where you can run ‘python3 ./setup.py develop’.
> Longer answer below.
>> So I've been searching for better ways to work, but I can't seem hit
>> the right keywords and come with all sorts of tangentially related
>> stuff.
> The Python module search path is an abstraction, with only a partial
> relationship to the location of modules files in the filesystem.
> The expectation is that a module (or a package of modules) will be
> *installed* to a location already in the module search path (with
> ‘python ./setup.py .
> This allows for cross-platform package management, especially on
> systems that don't have a working OS package manager. The trouble is
> that it does cause a significant learning curve for Python
> programmers, and is an ongoing sore point of Python.
>> I'm sure there must be some tool that sets up the development
>> environment when the package source is not on `sys.path`. Any advice
>> on this topic would be appreciated.
> What you need is to tell Distutils which Python modules form your
> project <URL:https://docs.python.org/3/library/distutils.html>.
> Once you've got a working ‘setup.py’ for your project, run ‘python3
> ./setup.py develop’ to allow your packages to be run in-place while
> you develop them.
This sounds exactly like what I was looking for. I was growing tired of
doing 'python setup.py install', every time I wanted to debug something.
The subpackages' modules have inter-dependencies, which require the
whole package to be in `sys.path`. Unfortunately, I have to stick with
Python 2.7...
Thank you,
--
Seb
More information about the Python-list
mailing list