On 2015-10-18 18:01, Steven D'Aprano wrote:
On Sun, Oct 18, 2015 at 08:07:07AM -0700, Alex Kleider wrote:
On 2015-10-17 19:49, Steven D'Aprano wrote:
>which will work from your package's callers, and from within the
>package
>itself provided the top level directory can be found within Python's
On Sun, Oct 18, 2015 at 08:07:07AM -0700, Alex Kleider wrote:
> On 2015-10-17 19:49, Steven D'Aprano wrote:
>
> >which will work from your package's callers, and from within the
> >package
> >itself provided the top level directory can be found within Python's
> >path. Within the package you can
Alex Kleider writes:
> Should I add the following to the end of my ~/.bashrc file?
> export PYTHONPATH="$PYTHONPATH:/home/alex/Py"
No, because the entry should only be in PYTHONPATH *if* you want imports
to come from that package.
So the advice is:
* For the run-time
Ben Finney writes:
> * Python will automatically add a ‘sys.path’ entry for the directory
> containing the script named on the command line. So this:
>
> $ cd ~/Projects/lorem/
> $ python3 ./setup.py test
>
> will run the ‘setup.py’ program with
On 2015-10-18 08:07, Alex Kleider wrote:
On 2015-10-17 19:49, Steven D'Aprano wrote:
which will work from your package's callers, and from within the
package
itself provided the top level directory can be found within Python's
path. Within the package you can also use relative imports, see
On 2015-10-17 19:49, Steven D'Aprano wrote:
which will work from your package's callers, and from within the
package
itself provided the top level directory can be found within Python's
path. Within the package you can also use relative imports, see the
docs for more detail.
How does one
Hello Alex,
How does one arrange so "the top level directory _can_ be found within
Python's path."?
>>>
>>> Is the answer to include the following at the beginning of each file?
>>>
>>> if not 'path/to/top/level/package/directory' in sys.path:
>>>
On 18/10/15 16:33, Alex Kleider wrote:
How does one arrange so "the top level directory _can_ be found within
Python's path."?
Is the answer to include the following at the beginning of each file?
if not 'path/to/top/level/package/directory' in sys.path:
On 2015-10-18 10:26, Alan Gauld wrote:
On 18/10/15 16:33, Alex Kleider wrote:
How does one arrange so "the top level directory _can_ be found
within
Python's path."?
Is the answer to include the following at the beginning of each file?
if not 'path/to/top/level/package/directory' in
James Hartley writes:
> In my current project, I am developing a package. It makes sense to
> embed tests throughout the package's directory structure as they
> should be part of the package & its distribution.
Yet, as you're finding, it also causes headaches.
First, know
On Sat, Oct 17, 2015 at 08:20:14PM -0500, James Hartley wrote:
> In my current project, I am developing a package. It makes sense to embed
> tests throughout the package's directory structure as they should be part
> of the package & its distribution. It may raise eyebrows that I have tests
>
In my current project, I am developing a package. It makes sense to embed
tests throughout the package's directory structure as they should be part
of the package & its distribution. It may raise eyebrows that I have tests
sprinkled through various directories, but there are reasons for keeping
12 matches
Mail list logo