Skip to content
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

pip-3.3 install nose? #652

Closed
samueljohn opened this issue Mar 14, 2013 · 20 comments
Closed

pip-3.3 install nose? #652

samueljohn opened this issue Mar 14, 2013 · 20 comments

Comments

@samueljohn
Copy link

More a question (because I am just starting to get my personal stuff over to python3).

When I pip-3.3 install nose, I see some warnings about the print statement but I thought that would be ok since it seems to be related to some plugins - and this is stated in the README.

However, it seems pip3 installs nose "successfully" (it claims) but nosetests-3.3 does not run.

nosetests-3.3 -h
<snip>
  File "/homebrew/lib/python3.3/site-packages/nose/core.py", line 143
    print "%s version %s" % (os.path.basename(sys.argv[0]), __version__)
                        ^
SyntaxError: invalid syntax

So my question? Do I have to build it from source via python3 setup.py install to get a working nosetests-3.3? I assumed that pip-3.3 just calls python3 setup.py underneath.

Please enlighten me. Thanks!

@jszakmeister
Copy link
Contributor

What version of nose are you installing?

@jszakmeister
Copy link
Contributor

BTW, nose uses 2to3 to convert the source from Python 2 to Python 3. It looks like homebrew didn't run through that process, which means its recipe is probably broken.

@samueljohn
Copy link
Author

Yeah, I am actually working on Homebrew to include Python 2.x and 3.x support. (Right now, we only support 2.x bindings. Shame on us).

Our python3 formula installs distribute and pip (and to avoid name clashes, we rename it pip3). Am I doing it wrong? Are you suspecting the Python 3 formula, or the distrubute/pip, we install during the user says brew install python3 to be broken?

We don't have a nose formula. The policy is: What can be installed with pip, shall not be brewed.

pip3 freeze
distribute==0.6.35
nose==1.2.1

@samueljohn
Copy link
Author

The content of pip-3.3 begins like this:

#!/homebrew/Cellar/python3/3.3.0/bin/python3.3
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==1.3.1','console_scripts','pip'
<snip>

So pip3 correctly has the python3.3 executable in the shebang.

And pip3 --version

pip3 --version
pip 1.3.1 from /homebrew/lib/python3.3/site-packages/pip-1.3.1-py3.3.egg (python 3.3)

It looks like pip should know then that it is on 3.x, right?

I am checking right now if the issue is perhaps because the 2to3 is from python 2.7 and has python2.7 it's shebang...

@samueljohn
Copy link
Author

Already during pip3 install nose, I get this:

pip3 install nose
Downloading/unpacking nose
  Running setup.py egg_info for package nose

    no previously-included directories found matching 'doc/.build'
Installing collected packages: nose
  Running setup.py install for nose
      File "/homebrew/lib/python3.3/site-packages/nose/config.py", line 66
        except ConfigParser.Error, exc:
                                 ^
    SyntaxError: invalid syntax

<snip>
Successfully installed nose
Cleaning up...

Should I ask the pip people?

@jszakmeister
Copy link
Contributor

Well, I can say a few things. Proper Python 3.3 support is not available in Nose 1.2.1. Nose 1.3.0 will have it, but we're currently blocked on an issue. I also noticed that our included version of distribute_setup.py is a bit out-of-date. The packaged version has some bugs, and doesn't appear to work correctly for Python 3.3.

@samueljohn
Copy link
Author

Alright, can you point me to the related issues, so I can have my 👀 on them?

As a work-a-round, what would you suggest? Shipping a newer devel version of distribute maybe?
Do you have a branch of nose that I can use for my personal testing right now (I want to assure homebrew's python3 support is going to work, so I need nose to test numpy/scipy and things)

@jszakmeister
Copy link
Contributor

I created a ticket for the problem: #655. I also created a new pull request to package a newer distribute_setup.py (#656). Hopefully, once they are fixed/pulled, we can get 1.3.0 out-the-door. #655 has been a pain to track down though, so it may still be a while yet. I'd say using master is a good test candidate right now though.

@samueljohn
Copy link
Author

Thanks @jszakmeister!

I guess the distribute_setup.py is only used if people don't have a distribute installed, right?
Because homebrew ships the latest stable distribute and pip, I'll try to just python3 setup.py install in the nose sources. I'll try the master branch.

@jszakmeister
Copy link
Contributor

That's the intent, yes. Let me know if master is failing for you too. It works for me, so I suspect it will for you as well.

@samueljohn
Copy link
Author

Do I need to run 2to3 --write . before I do python3 setup.py install in the nose sources (master)?

@samueljohn
Copy link
Author

Yep seems so. After I did the 2to3 run, I can install and import as written above.
But without my manual 2to3 python3 complains when I attempt to import nose (with print syntax)

@samueljohn
Copy link
Author

Ach sorry, my fuckup. I was still in the sources, so import nose did prefer the local one ...

@jszakmeister
Copy link
Contributor

Right. python3 setup.py install should be running 2to3. It does for me:

:: python3.3 setup.py install
running install
running bdist_egg
running egg_info
writing dependency_links to nose.egg-info/dependency_links.txt
writing top-level names to nose.egg-info/top_level.txt
writing nose.egg-info/PKG-INFO
writing entry points to nose.egg-info/entry_points.txt
reading manifest file 'nose.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'nose.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-intel/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/nose
# ... snip ...
Fixing build/lib/nose/__init__.py build/lib/nose/__main__.py build/lib/nose/case.py build/lib/nose/commands.py build/lib/nose/config.py build/lib/nose/core.py build/lib/nose/exc.py build/lib/nose/failure.py build/lib/nose/importer.py build/lib/nose/inspector.py build/lib/nose/loader.py build/lib/nose/proxy.py build/lib/nose/pyversion.py build/lib/nose/result.py build/lib/nose/selector.py build/lib/nose/suite.py build/lib/nose/twistedtools.py build/lib/nose/util.py build/lib/nose/ext/__init__.py build/lib/nose/ext/dtcompat.py build/lib/nose/plugins/__init__.py build/lib/nose/plugins/allmodules.py build/lib/nose/plugins/attrib.py build/lib/nose/plugins/base.py build/lib/nose/plugins/builtin.py build/lib/nose/plugins/capture.py build/lib/nose/plugins/collect.py build/lib/nose/plugins/cover.py build/lib/nose/plugins/debug.py build/lib/nose/plugins/deprecated.py build/lib/nose/plugins/doctests.py build/lib/nose/plugins/errorclass.py build/lib/nose/plugins/failuredetail.py build/lib/nose/plugins/isolate.py build/lib/nose/plugins/logcapture.py build/lib/nose/plugins/manager.py build/lib/nose/plugins/multiprocess.py build/lib/nose/plugins/plugintest.py build/lib/nose/plugins/printmethods.py build/lib/nose/plugins/prof.py build/lib/nose/plugins/skip.py build/lib/nose/plugins/testid.py build/lib/nose/plugins/xunit.py build/lib/nose/sphinx/__init__.py build/lib/nose/sphinx/pluginopts.py build/lib/nose/tools/__init__.py build/lib/nose/tools/nontrivial.py build/lib/nose/tools/trivial.py
Skipping implicit fixer: buffer
Skipping implicit fixer: idioms
Skipping implicit fixer: set_literal
Skipping implicit fixer: ws_comma
Fixing build/lib/nose/__init__.py build/lib/nose/__main__.py build/lib/nose/case.py build/lib/nose/commands.py build/lib/nose/config.py build/lib/nose/core.py build/lib/nose/exc.py build/lib/nose/failure.py build/lib/nose/importer.py build/lib/nose/inspector.py build/lib/nose/loader.py build/lib/nose/proxy.py build/lib/nose/pyversion.py build/lib/nose/result.py build/lib/nose/selector.py build/lib/nose/suite.py build/lib/nose/twistedtools.py build/lib/nose/util.py build/lib/nose/ext/__init__.py build/lib/nose/ext/dtcompat.py build/lib/nose/plugins/__init__.py build/lib/nose/plugins/allmodules.py build/lib/nose/plugins/attrib.py build/lib/nose/plugins/base.py build/lib/nose/plugins/builtin.py build/lib/nose/plugins/capture.py build/lib/nose/plugins/collect.py build/lib/nose/plugins/cover.py build/lib/nose/plugins/debug.py build/lib/nose/plugins/deprecated.py build/lib/nose/plugins/doctests.py build/lib/nose/plugins/errorclass.py build/lib/nose/plugins/failuredetail.py build/lib/nose/plugins/isolate.py build/lib/nose/plugins/logcapture.py build/lib/nose/plugins/manager.py build/lib/nose/plugins/multiprocess.py build/lib/nose/plugins/plugintest.py build/lib/nose/plugins/printmethods.py build/lib/nose/plugins/prof.py build/lib/nose/plugins/skip.py build/lib/nose/plugins/testid.py build/lib/nose/plugins/xunit.py build/lib/nose/sphinx/__init__.py build/lib/nose/sphinx/pluginopts.py build/lib/nose/tools/__init__.py build/lib/nose/tools/nontrivial.py build/lib/nose/tools/trivial.py
Skipping implicit fixer: buffer
Skipping implicit fixer: idioms
Skipping implicit fixer: set_literal
Skipping implicit fixer: ws_comma
# ... snip ...
installing package data to build/bdist.macosx-10.6-intel/egg
running install_data
creating build/bdist.macosx-10.6-intel/egg/man
creating build/bdist.macosx-10.6-intel/egg/man/man1
copying nosetests.1 -> build/bdist.macosx-10.6-intel/egg/man/man1
creating build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying nose.egg-info/PKG-INFO -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying nose.egg-info/SOURCES.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying nose.egg-info/dependency_links.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying nose.egg-info/entry_points.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying nose.egg-info/not-zip-safe -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying nose.egg-info/top_level.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
creating 'dist/nose-1.3.0-py3.3.egg' and adding 'build/bdist.macosx-10.6-intel/egg' to it
removing 'build/bdist.macosx-10.6-intel/egg' (and everything under it)
Processing nose-1.3.0-py3.3.egg
creating /Users/jszakmeister/.virtualenvs/nose-3.3-pristine/lib/python3.3/site-packages/nose-1.3.0-py3.3.egg
Extracting nose-1.3.0-py3.3.egg to /Users/jszakmeister/.virtualenvs/nose-3.3-pristine/lib/python3.3/site-packages
Adding nose 1.3.0 to easy-install.pth file
Installing nosetests-3.3 script to /Users/jszakmeister/.virtualenvs/nose-3.3-pristine/bin
Installing nosetests script to /Users/jszakmeister/.virtualenvs/nose-3.3-pristine/bin

Installed /Users/jszakmeister/.virtualenvs/nose-3.3-pristine/lib/python3.3/site-packages/nose-1.3.0-py3.3.egg
Processing dependencies for nose==1.3.0
Finished processing dependencies for nose==1.3.0

@samueljohn
Copy link
Author

Yes, it does (however in your and my log, I cannot find "2to3", so I assume it is doing this silently).

However, the good things is: I can successfully call numpy.test() with the current master (1.3.0) of nose installed from the sources with python3 setup.py install. (I did not run the nose self tests. Tell me how to do, and I'll do. A simple guess nose.test() did not)

@samueljohn
Copy link
Author

Remove the "However". I meant "Cool, and the good thing is..." :-)

So I just wait for 1.3.0 release, so pip3 install nose works.

@jszakmeister
Copy link
Contributor

It is a bit silent... the "Fixing" lines from python3 setup.py install are 2to3 running. If you run python3 selftest.py, it should run the nose test suite.

@samueljohn
Copy link
Author

Ok, got it.

In case you are interested: On Mac OS X 10.8.2 with a python 3.3 from homebrew, I get 4 failures:
https://gist.github.com/samueljohn/5168751

@jszakmeister
Copy link
Contributor

/me grumbles. Python 3.3 introduced Namespace Packages (PEP 420), and it seems our function test support area has a directory called coverage that's being imported as the coverage module. I pushed up a PR with a fix in #657.

@samueljohn
Copy link
Author

Awesome. Thanks. What I take from this is: our homebrew python3 is alright and nose is almost fine and ready to use in python 3.3. At least numpy.test() does not use the coverage stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants