debugging during package development
ben+python at benfinney.id.au
Sat Aug 1 07:30:34 CEST 2015
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
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
\ “I think it would be a good idea.” —Mohandas K. Gandhi (when |
`\ asked what he thought of Western civilization) |
More information about the Python-list