Skip to content
This repository

Python3 setup.py install failiure #848

Merged
merged 2 commits into from over 2 years ago

3 participants

Jens H Nielsen Thomas Kluyver Fernando Perez
Jens H Nielsen

I have problems running python3 setup.py build on the latest git head using ubuntu 11.10.

2to3 fails with errors like:
Can't parse docstring in build/lib/IPython/core/usage.py line 195: ParseError: bad input: type=1, value='arg1', context=(' ', (195, 12))

This happens because of to different issues:
In IPython/parallel/client/view.py there is an unbalanced (

In IPython/core/usage.py the automagic docstrings are not valid python code (Thats the point I guess)
To fix this I changed the prompts from regular python prompts to ipython ones. But I guess the right fix should be to have 2to3 skip the parsing on these strings.

Thomas Kluyver
Collaborator

Odd, I'm building it semi regularly with Ubuntu 11.10, and I haven't had any problems.

Thomas Kluyver
Collaborator

OK, apparently it works differently outside a virtualenv for some reason. Not sure why, maybe it's a different version of distribute.

Anyway, these changes looks sensible. Thanks.

Fernando Perez
Owner

I don't see a problem here, but @takluyver is our resident py3 expert, so I'd like to leave the final call on this one up to him. But as far as I can tell, it's good to go, thanks! (though as a note, I did test python3 setup.py build on ubuntu 11.10 just now, and didn't see any errors; but further cleanups won't hurt in any case).

Thomas Kluyver takluyver merged commit 52688c2 into from October 09, 2011
Thomas Kluyver takluyver closed this October 09, 2011
Thomas Kluyver
Collaborator

Merged - thanks, Jens.

@fperez: It seems it works in a virtualenv, but not outside (at least for me). Maybe different versions of distribute are getting imported. Anyway, the changes make sense and don't break the test suite.

Fernando Perez
Owner

Weird: I wasn't running in a virtualenv, just running 'in plain sight' :) But in any case, I agree with you; I just wanted your OK on it given the py3 focus. Thanks!

Brian E. Granger ellisonbg referenced this pull request from a commit January 10, 2012
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
16  IPython/core/usage.py
@@ -192,15 +192,15 @@
192 192
     1. Auto-parentheses
193 193
         Callable objects (i.e. functions, methods, etc) can be invoked like
194 194
         this (notice the commas between the arguments):
195  
-            >>> callable_ob arg1, arg2, arg3
  195
+            In [1]: callable_ob arg1, arg2, arg3
196 196
         and the input will be translated to this:
197  
-            --> callable_ob(arg1, arg2, arg3)
  197
+            ------> callable_ob(arg1, arg2, arg3)
198 198
         You can force auto-parentheses by using '/' as the first character
199 199
         of a line.  For example:
200  
-            >>> /globals             # becomes 'globals()'
  200
+            In [1]: /globals             # becomes 'globals()'
201 201
         Note that the '/' MUST be the first character on the line!  This
202 202
         won't work:
203  
-            >>> print /globals    # syntax error
  203
+            In [2]: print /globals    # syntax error
204 204
 
205 205
         In most cases the automatic algorithm should work, so you should
206 206
         rarely need to explicitly invoke /. One notable exception is if you
@@ -220,16 +220,16 @@
220 220
     2. Auto-Quoting
221 221
         You can force auto-quoting of a function's arguments by using ',' as
222 222
         the first character of a line.  For example:
223  
-            >>> ,my_function /home/me   # becomes my_function("/home/me")
  223
+            In [1]: ,my_function /home/me   # becomes my_function("/home/me")
224 224
 
225 225
         If you use ';' instead, the whole argument is quoted as a single
226 226
         string (while ',' splits on whitespace):
227  
-            >>> ,my_function a b c   # becomes my_function("a","b","c")
228  
-            >>> ;my_function a b c   # becomes my_function("a b c")
  227
+            In [2]: ,my_function a b c   # becomes my_function("a","b","c")
  228
+            In [3]: ;my_function a b c   # becomes my_function("a b c")
229 229
 
230 230
         Note that the ',' MUST be the first character on the line!  This
231 231
         won't work:
232  
-            >>> x = ,my_function /home/me    # syntax error
  232
+            In [4]: x = ,my_function /home/me    # syntax error
233 233
 """
234 234
 
235 235
 interactive_usage_min =  """\
2  IPython/parallel/client/view.py
@@ -786,7 +786,7 @@ class LoadBalancedView(View):
786 786
 
787 787
     or targets can be specified, to restrict the potential destinations:
788 788
 
789  
-    >>> v = client.client.load_balanced_view(([1,3])
  789
+    >>> v = client.client.load_balanced_view([1,3])
790 790
 
791 791
     which would restrict loadbalancing to between engines 1 and 3.
792 792
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.