[Numpy-discussion] Guidance regarding build and testing

Ralf Gommers ralf.gommers at gmail.com
Sun Dec 21 12:27:36 EST 2014

On Sun, Dec 21, 2014 at 5:37 PM, Maniteja Nandana <
maniteja.modesty067 at gmail.com> wrote:

> Hello Ralf,
> On Sun, Dec 21, 2014 at 9:17 PM, Ralf Gommers <ralf.gommers at gmail.com>
> wrote:
>> Hi Maniteja,
>> On Sun, Dec 21, 2014 at 4:04 PM, Maniteja Nanda
>> You don't need a virtualenv. If you want to only run the tests and make
>> sure your changes pass the test suite, the easiest option is ``python
>> runtests.py`` in your numpy repo root dir. You can also run tests for a
>> particular module that way - see the docstring of runtests.py for more
>> details.
> Thank you for the help. I couldn't find a way out in many discussion
> threads. I saw the testing guide in the development workflow. As I
> understood 'tests/test_xxx.py' is used to test the 'xxx' function.

Almost. test_xxx.py contains tests for all functions in the file xxx.py

> If you want to use your modified numpy to for example import in IPython
>> and play with it, I would use an in-place build. So ``python setup.py
>> build_ext -i``, and then you can make python find that in-place build by
>> adding the repo to your PYTHONPATH or by running ``python setup.py
>> develop``. If you then make changes to Python code they're immediately
>> visible, if you change compiled code you have to rebuild in-place again.
Note that there is also a variant which does use virtualenvs documented at
https://github.com/scipy/scipy/blob/master/HACKING.rst.txt#faq (under "*How
do I set up a development version of SciPy in parallel to a released
version that I use to do my job/research?").*

> Cheers,
>> Ralf
>> As you told me , I have built a in-place copy of numpy and added it to
> the Python path.
> maniteja at ubuntu:~/FOSS/numpy$ echo $PYTHONPATH
> /home/maniteja/FOSS/numpy/numpy

Maybe that's one /numpy too many? If it's right, you should have a dir

> Correct me please if I am wrong. I don't think this is causing the desired
> change, since a simple print statement in *count* function in *ma* is not
> printing anything when creating an masked array object.

An easy way to check which numpy you're using is "import numpy;

> In addition to this, I had a doubt in which branch should I do the
> modifications, master or  testing branch in numpy. I used the testing
> branch to create the build because that the master branch keeps getting
> updated regularly. Would this be fine or should I use the master branch to
> create the build?

This is fine. You should not develop directly on your own master branch.
Rather, keep your master branch in sync with numpy master, and create a new
feature branch for every new feature that you want to work on.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20141221/7e01492c/attachment.html>

More information about the NumPy-Discussion mailing list