unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23780: guix import pypi jedi: weird backtrace, no proper error message
@ 2016-06-17  4:16 Danny Milosavljevic
  2016-06-17  4:41 ` Ben Woodcroft
  2016-06-17 12:43 ` bug#23780: [PATCH] import: pypi: do not fail when 'run_requires' is missing from the metadata Cyril Roelandt
  0 siblings, 2 replies; 7+ messages in thread
From: Danny Milosavljevic @ 2016-06-17  4:16 UTC (permalink / raw)
  To: 23780

$ guix import pypi jedi

Starting download of /tmp/guix-file.n01KoB
From https://pypi.python.org/packages/3a/37/629080b92b87bc65e3b1b4f5d539e22aa5dc45637eab0dd4b0cd8cf236c2/jedi-0.9.0.tar.gz...
 ….0.tar.gz  326KiB                 402KiB/s 00:01 [####################] 100.0%

Starting download of /tmp/guix-file.CbhRLk
From https://pypi.python.org/packages/c4/59/e48a369168a84c8aef9127c227fc3b9f53bc9c528b24c2cda20487bc2deb/jedi-0.9.0-py2.py3-none-any.whl...
 …py3-none-any.whl  154KiB          291KiB/s 00:01 [####################] 100.0%
Backtrace:
In ice-9/boot-9.scm:
 157: 19 [catch srfi-34 #<procedure 57736c0 at ice-9/eval.scm:416:20 ()> ...]
In ice-9/r4rs.scm:
  90: 18 [dynamic-wind #<procedure 5773570 at ice-9/eval.scm:416:20 ()> ...]
In ice-9/eval.scm:
 387: 17 [eval # #]
 387: 16 [eval # #]
 387: 15 [eval # #]
 387: 14 [eval # #]
 387: 13 [eval # #]
 387: 12 [eval # #]
 387: 11 [eval # #]
 387: 10 [eval # #]
 387: 9 [eval # #]
 387: 8 [eval # #]
 387: 7 [eval # #]
 411: 6 [eval # #]
In ice-9/r4rs.scm:
  90: 5 [dynamic-wind #<procedure 57d3900 at ice-9/eval.scm:416:20 ()> ...]
  90: 4 [dynamic-wind #<procedure 5c332a0 at ice-9/boot-9.scm:1133:2 _> ...]
In ice-9/boot-9.scm:
 867: 3 [call-with-input-file "jedi-0.9.0.dist-info/metadata.json" ...]
In ice-9/eval.scm:
 411: 2 [eval # #]
 387: 1 [eval # #]
In unknown file:
   ?: 0 [list-ref #f 0]

This stacktrace is ... unhelpful. I think there was a post somewhere where it detailed how to debug that but I can't find it again :(

$ cat metadata.json 
{"classifiers": ["Development Status :: 4 - Beta", "Environment :: Plugins", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Editors :: Integrated Development Environments (IDE)", "Topic :: Utilities"], "summary": "An autocompletion tool for Python that can be used for text editors.", "platform": "any", "generator": "bdist_wheel (0.24.0)", "metadata_version": "2.0", "version": "0.9.0", "extensions": {"python.details": {"contacts": [{"role": "author", "email": "davidhalter88@gmail.com", "name": "David Halter"}], "project_urls": {"Home": "https://github.com/davidhalter/jedi"}, "document_names": {"description": "DESCRIPTION.rst"}}}, "license": "MIT", "keywords": ["python", "completion", "refactoring", "vim"], "name": "jedi"}

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#23780: guix import pypi jedi: weird backtrace, no proper error message
  2016-06-17  4:16 bug#23780: guix import pypi jedi: weird backtrace, no proper error message Danny Milosavljevic
@ 2016-06-17  4:41 ` Ben Woodcroft
  2016-06-17 11:31   ` Danny Milosavljevic
  2016-06-17 12:43 ` bug#23780: [PATCH] import: pypi: do not fail when 'run_requires' is missing from the metadata Cyril Roelandt
  1 sibling, 1 reply; 7+ messages in thread
From: Ben Woodcroft @ 2016-06-17  4:41 UTC (permalink / raw)
  To: Danny Milosavljevic, 23780



On 17/06/16 14:16, Danny Milosavljevic wrote:
> $ guix import pypi jedi
>
> Starting download of /tmp/guix-file.n01KoB
>  From https://pypi.python.org/packages/3a/37/629080b92b87bc65e3b1b4f5d539e22aa5dc45637eab0dd4b0cd8cf236c2/jedi-0.9.0.tar.gz...
>   ….0.tar.gz  326KiB                 402KiB/s 00:01 [####################] 100.0%
>
> Starting download of /tmp/guix-file.CbhRLk
>  From https://pypi.python.org/packages/c4/59/e48a369168a84c8aef9127c227fc3b9f53bc9c528b24c2cda20487bc2deb/jedi-0.9.0-py2.py3-none-any.whl...
>   …py3-none-any.whl  154KiB          291KiB/s 00:01 [####################] 100.0%
> Backtrace:
> In ice-9/boot-9.scm:
>   157: 19 [catch srfi-34 #<procedure 57736c0 at ice-9/eval.scm:416:20 ()> ...]
> In ice-9/r4rs.scm:
>    90: 18 [dynamic-wind #<procedure 5773570 at ice-9/eval.scm:416:20 ()> ...]
> In ice-9/eval.scm:
>   387: 17 [eval # #]
>   387: 16 [eval # #]
>   387: 15 [eval # #]
>   387: 14 [eval # #]
>   387: 13 [eval # #]
>   387: 12 [eval # #]
>   387: 11 [eval # #]
>   387: 10 [eval # #]
>   387: 9 [eval # #]
>   387: 8 [eval # #]
>   387: 7 [eval # #]
>   411: 6 [eval # #]
> In ice-9/r4rs.scm:
>    90: 5 [dynamic-wind #<procedure 57d3900 at ice-9/eval.scm:416:20 ()> ...]
>    90: 4 [dynamic-wind #<procedure 5c332a0 at ice-9/boot-9.scm:1133:2 _> ...]
> In ice-9/boot-9.scm:
>   867: 3 [call-with-input-file "jedi-0.9.0.dist-info/metadata.json" ...]
> In ice-9/eval.scm:
>   411: 2 [eval # #]
>   387: 1 [eval # #]
> In unknown file:
>     ?: 0 [list-ref #f 0]
>
> This stacktrace is ... unhelpful. I think there was a post somewhere where it detailed how to debug that but I can't find it again :(
>
> $ cat metadata.json
> {"classifiers": ["Development Status :: 4 - Beta", "Environment :: Plugins", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Editors :: Integrated Development Environments (IDE)", "Topic :: Utilities"], "summary": "An autocompletion tool for Python that can be used for text editors.", "platform": "any", "generator": "bdist_wheel (0.24.0)", "metadata_version": "2.0", "version": "0.9.0", "extensions": {"python.details": {"contacts": [{"role": "author", "email": "davidhalter88@gmail.com", "name": "David Halter"}], "project_urls": {"Home": "https://github.com/davidhalter/jedi"}, "document_names": {"description": "DESCRIPTION.rst"}}}, "license": "MIT", "keywords": ["python", "completion", "refactoring", "vim"], "name": "jedi"}

I can confirm this. Running from the git repo gives a better stack trace 
(below). I think this might be due to the lack of "run_requires" in the 
json file. Do you think the solution might be to not require one? If so 
do you want to have a go at fixing this?

Thanks.

$ ./pre-inst-env guix import pypi jedi

Starting download of /tmp/guix-file.ohIhq3
From 
https://pypi.python.org/packages/3a/37/629080b92b87bc65e3b1b4f5d539e22aa5dc45637eab0dd4b0cd8cf236c2/jedi-0.9.0.tar.gz...
  ….0.tar.gz  326KiB                 175KiB/s 00:02 
[####################] 100.0%

Starting download of /tmp/guix-file.nXlt3z
From 
https://pypi.python.org/packages/c4/59/e48a369168a84c8aef9127c227fc3b9f53bc9c528b24c2cda20487bc2deb/jedi-0.9.0-py2.py3-none-any.whl...
  …py3-none-any.whl  154KiB          161KiB/s 00:01 
[####################] 100.0%
Backtrace:
In ice-9/boot-9.scm:
   63: 19 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
  432: 18 [eval # #]
In ice-9/boot-9.scm:
2401: 17 [save-module-excursion #<procedure 2586940 at 
ice-9/boot-9.scm:4045:3 ()>]
4050: 16 [#<procedure 2586940 at ice-9/boot-9.scm:4045:3 ()>]
1724: 15 [%start-stack load-stack ...]
1729: 14 [#<procedure 259cea0 ()>]
In unknown file:
    ?: 13 [primitive-load "/home/ben/git/guix/scripts/guix"]
In guix/ui.scm:
1209: 12 [run-guix-command import "pypi" "jedi"]
In guix/scripts/import.scm:
  110: 11 [guix-import "pypi" "jedi"]
In guix/scripts/import/pypi.scm:
   84: 10 [guix-import-pypi "jedi"]
In ice-9/boot-9.scm:
  157: 9 [catch srfi-34 #<procedure 5c5e360 at 
guix/import/pypi.scm:278:9 ()> ...]
In ice-9/r4rs.scm:
   90: 8 [dynamic-wind #<procedure 42120f0 at ice-9/eval.scm:416:20 ()> ...]
In guix/import/pypi.scm:
  267: 7 [#<procedure 40678a0 at guix/import/pypi.scm:247:3 (temp port)> 
"/tmp/guix-file.ohIhq3" ...]
  236: 6 [compute-inputs 
"https://pypi.python.org/packages/3a/37/629080b92b87bc65e3b1b4f5d539e22aa5dc45637eab0dd4b0cd8cf236c2/jedi-0.9.0.tar.gz" 
...]
  223: 5 [guess-requirements 
"https://pypi.python.org/packages/3a/37/629080b92b87bc65e3b1b4f5d539e22aa5dc45637eab0dd4b0cd8cf236c2/jedi-0.9.0.tar.gz" 
...]
In ice-9/r4rs.scm:
   90: 4 [dynamic-wind #<procedure 5ccb7e0 at ice-9/eval.scm:416:20 ()> ...]
In guix/import/pypi.scm:
  174: 3 [#<procedure 5ccab20 at guix/import/pypi.scm:191:5 (temp port)> 
"/tmp/guix-file.nXlt3z" ...]
In ice-9/boot-9.scm:
  867: 2 [call-with-input-file "jedi-0.9.0.dist-info/metadata.json" ...]
In guix/import/pypi.scm:
  178: 1 [#<procedure 4472d00 at guix/import/pypi.scm:175:17 (port)> 
#<input: jedi-0.9.0.dist-info/metadata.json 16>]
In unknown file:
    ?: 0 [list-ref #f 0]

ERROR: In procedure list-ref:
ERROR: In procedure list-ref: Wrong type argument in position 1: #f

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#23780: guix import pypi jedi: weird backtrace, no proper error message
  2016-06-17  4:41 ` Ben Woodcroft
@ 2016-06-17 11:31   ` Danny Milosavljevic
  2016-06-17 11:55     ` Cyril Roelandt
  0 siblings, 1 reply; 7+ messages in thread
From: Danny Milosavljevic @ 2016-06-17 11:31 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: 23780

Thanks!

I've asked the jedi maintainers, see <https://github.com/davidhalter/jedi/issues/733>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#23780: guix import pypi jedi: weird backtrace, no proper error message
  2016-06-17 11:31   ` Danny Milosavljevic
@ 2016-06-17 11:55     ` Cyril Roelandt
  0 siblings, 0 replies; 7+ messages in thread
From: Cyril Roelandt @ 2016-06-17 11:55 UTC (permalink / raw)
  To: 23780

On 06/17/2016 01:31 PM, Danny Milosavljevic wrote:
> Thanks!
> 
> I've asked the jedi maintainers, see <https://github.com/davidhalter/jedi/issues/733>
> 
> 

I quickly looked at the code, some of the dependencies are listed in
tox.ini (mostly those needed for testing), but there doesn't seem to be
anything in setup.py. Maybe there are no runtime requirements :)

Anyway, we should return an empty list when the 'run_requires' key is
missing from the JSON file.

Cyril.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#23780: [PATCH] import: pypi: do not fail when 'run_requires' is missing from the metadata.
  2016-06-17  4:16 bug#23780: guix import pypi jedi: weird backtrace, no proper error message Danny Milosavljevic
  2016-06-17  4:41 ` Ben Woodcroft
@ 2016-06-17 12:43 ` Cyril Roelandt
  2016-06-17 15:09   ` Ludovic Courtès
  1 sibling, 1 reply; 7+ messages in thread
From: Cyril Roelandt @ 2016-06-17 12:43 UTC (permalink / raw)
  To: 23780

* guix/import/pypi.scm (read-wheel-metadata): do not crash when 'run_requires'
is missing from the metadata.
---
 guix/import/pypi.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 70ef507..f08d948 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -175,8 +175,10 @@ cannot determine package dependencies"))
                  (lambda (port)
                    (let* ((metadata (json->scm port))
                           (run_requires (hash-ref metadata "run_requires"))
-                          (requirements (hash-ref (list-ref run_requires 0)
-                                                  "requires")))
+                          (requirements (if run_requires
+                                          (hash-ref (list-ref run_requires 0)
+                                                     "requires")
+                                          '())))
                      (map (lambda (r)
                             (python->package-name (clean-requirement r)))
                           requirements)))))
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#23780: [PATCH] import: pypi: do not fail when 'run_requires' is missing from the metadata.
  2016-06-17 12:43 ` bug#23780: [PATCH] import: pypi: do not fail when 'run_requires' is missing from the metadata Cyril Roelandt
@ 2016-06-17 15:09   ` Ludovic Courtès
  2016-06-28 21:11     ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2016-06-17 15:09 UTC (permalink / raw)
  To: Cyril Roelandt; +Cc: 23780

Cyril Roelandt <tipecaml@gmail.com> skribis:

> * guix/import/pypi.scm (read-wheel-metadata): do not crash when 'run_requires'
> is missing from the metadata.

[...]

> +                          (requirements (if run_requires
> +                                          (hash-ref (list-ref run_requires 0)
> +                                                     "requires")
> +                                          '())))

Please align the ‘if’ branches with the condition.  :-)

Otherwise LGTM, thanks for the quick fix!

Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#23780: [PATCH] import: pypi: do not fail when 'run_requires' is missing from the metadata.
  2016-06-17 15:09   ` Ludovic Courtès
@ 2016-06-28 21:11     ` Ludovic Courtès
  0 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2016-06-28 21:11 UTC (permalink / raw)
  To: Cyril Roelandt; +Cc: 23780-done

Fixed by Cyril in commit aebd383d04b351465cfb14e4fd0949b67d4b282e.

Ludo'.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-06-28 21:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-17  4:16 bug#23780: guix import pypi jedi: weird backtrace, no proper error message Danny Milosavljevic
2016-06-17  4:41 ` Ben Woodcroft
2016-06-17 11:31   ` Danny Milosavljevic
2016-06-17 11:55     ` Cyril Roelandt
2016-06-17 12:43 ` bug#23780: [PATCH] import: pypi: do not fail when 'run_requires' is missing from the metadata Cyril Roelandt
2016-06-17 15:09   ` Ludovic Courtès
2016-06-28 21:11     ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).