-
-
Notifications
You must be signed in to change notification settings - Fork 11k
Cannot run tests after python setup.py build_ext -i
#6569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Apart from the error, why are you building inplace? |
just doing "git clean -xdf; ./runtests.py" should work (the runtests.py On Mon, Oct 26, 2015 at 5:36 PM, Charles Harris notifications@github.com
Nathaniel J. Smith -- http://vorpus.org |
The main reason I used Secondly: I could use a Thanks, that does work nicely. I had gotten around it by editing the |
@wackywendell Looks like the documentation could use an update (hint). I suppose inplace builds do have their uses, but generally I've preferred What was your hacky fix? |
I think that "Building in-place" section should probably be revised or removed or something... certainly the suggestion to do |
I think @rkern, among others, used to be a proponent. That was in the early paleolithic age, maybe 7 years ago, and odd artifacts from that primitive time are occasionally discovered in ancient strata. |
I use @njsmith If you are using |
I use in-place builds every day, it's essential functionality for development imho. Note that using I don't see the point in removing info on As an example of why it's useful: imagine that you have the latest numpy release (now 1.10.1) installed, and want to test if your scipy built against 1.10.1 also works when run against master. What's the easiest way: build numpy in-place and add the path to (and before anyone suggests it: no, virtualenvs are not a valid alternative) |
python runtests.py --shell |
That might be of use, thanks. Not sure it helps 100% with my example (because then you're inside an interpreter so cannot run Scipy's runtests.py I think), but it or even beter |
I'm not saying the section should be deleted, I'm saying it should be
|
@rgommers: it spawns an unix shell, not python. (getting off-topic for this discussion..) |
The question about |
Wow, this is pretty obscure actually. The code does essentially:
And the output of
It's due to using |
Fixing this is less urgent than I thought, because the failure only happens for
We're planning to delete Opinions? |
Maybe you've already figured this out, but that Where is I don't understand the details of why |
Also, I believe its triggered by calling $ git clean -xdf
$ python setup.py build_ext -i
[... normal build, I think ...]
$ python setup.py build_ext -i
Running from numpy source directory.
Traceback (most recent call last):
File "setup.py", line 263, in <module>
setup_package()
File "setup.py", line 247, in setup_package
from numpy.distutils.core import setup
File "/home/wendell/code/numpy/numpy/distutils/__init__.py", line 21, in <module>
from numpy.testing import Tester
File "/home/wendell/code/numpy/numpy/testing/__init__.py", line 14, in <module>
from .utils import *
File "/home/wendell/code/numpy/numpy/testing/utils.py", line 17, in <module>
from numpy.core import float32, empty, arange, array_repr, ndarray
File "/home/wendell/code/numpy/numpy/core/__init__.py", line 59, in <module>
test = Tester().test
File "/home/wendell/code/numpy/numpy/testing/nosetester.py", line 180, in __init__
if raise_warnings is None and '.dev0' in np.__version__:
AttributeError: module 'numpy' has no attribute '__version__' |
this isn't possible, because
that seems to work
yeah I misread the traceback; there's identical |
@wackywendell do you want to submit a PR or should I? |
Either way! You said you'd take it, so I think its yours. I didn't mean to try and take it from you, I just spent a while when I made the report trying to find a way around it. If you'd prefer, I can take it, although I'm less familiar with the process or the inner workings of |
I know, you were only being very helpful:) It'll only take me a couple of minutes, but since you did the hard work I thought that you might like to submit the fix. |
Thanks, actually, I wouldn't mind; it would mean a little to be a bit of a numpy contributor (especially now that I'm on the job market), and I guess another PR to your name would just be a drop in the bucket. I'll submit a PR. |
great! |
BUG: Fix for #6569, allowing build_ext --inplace
(cherry picked from commit 02b42d4)
Fixed by a76c275. |
* 'master' of https://github.com/numpy/numpy: (384 commits) BUG: fix MANIFEST.in for removal of a file in numpygh-8047. DOC: Release notes for Numpy 1.10.2. MAINT: remove useless files with outdated info from repo root and doc/. MAINT: fix mistake in doc upload rule TST: attempt to make test_load_refcount deterministic BUG: Fix for numpy#6569, allowing build_ext --inplace TST: Added regression test empty percentile, in ref to numpy#6530 and numpy#6553 TST: Added tests for empty partition and argpartition BUG: revert view safety checks TST: Remove tests of view safety checks (see next commit) BUG: Revert some import * fixes in f2py. BUG: Fixed partition errors on empty input. Closes numpy#6530 DOC: import "numpy for matlab users" from the wiki DOC: reorganize user guide a bit + import "tentative numpy tutorial" from wiki DOC: remove placeholders and incompleteness warnings MAINT: minor update to "make upload" doc build command. BUG: error in broadcast_arrays with as_strided array BUG: fix inner() by copying if needed to enforce contiguity DOC: clarify usage of 'argparse' return value. BUG: Make median work for empty arrays (issue numpy#6462) ...
Here is what I mean:
The issue is pretty clear:
When
numpy/__init__.py
is loaded, under some conditions it will not set the__version__
variable; these conditions occur when you do not use avirtualenv
orpython setup.py install
, and just try and runruntests.py
. After 7b438fa (PR),nosetester.py
tries to access this__version__
variable, which doesn't exist and so it crashes.CC @rgommers @charris?
The text was updated successfully, but these errors were encountered: