Bug 250586

Summary: cad/py-cq-editor: broken, requires spyder
Product: Ports & Packages Reporter: rsmith
Component: Individual Port(s)Assignee: Loïc Bartoletti <lbartoletti>
Status: Closed FIXED    
Severity: Affects Only Me CC: lbartoletti, ports
Priority: --- Flags: lbartoletti: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patch to fix the missing dependency. ports: maintainer-approval+

Description rsmith 2020-10-24 22:36:10 UTC
A freshly-built cq-editor does not work without spyder:

> cq-editor 
Traceback (most recent call last):
  File "/usr/local/bin/cq-editor", line 11, in <module>
    load_entry_point('CQ-editor==0.1.0', 'gui_scripts', 'cq-editor')()
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python3.9/site-packages/cq_editor/__main__.py", line 12, in <module>
    from .main_window import MainWindow
  File "/usr/local/lib/python3.9/site-packages/cq_editor/main_window.py", line 7, in <module>
    from .widgets.editor import Editor
  File "/usr/local/lib/python3.9/site-packages/cq_editor/widgets/editor.py", line 1, in <module>
    from spyder.widgets.sourcecode.codeeditor import  CodeEditor
ModuleNotFoundError: No module named 'spyder'

This is a pity, since spyder pulls in a ton of dependencies.
Comment 1 Loïc Bartoletti freebsd_committer freebsd_triage 2020-10-25 13:42:57 UTC
(In reply to rsmith from comment #0)

> This is a pity, since spyder pulls in a ton of dependencies.

devel/py-spyder? Really, but why?

Last time I wanted to update this port, I was stuck because of their version of Qt (they stayed at qt < 5.15 IIRC)
Comment 2 rsmith 2020-10-25 17:46:29 UTC
(In reply to Loïc Bartoletti from comment #1)

> devel/py-spyder? Really, but why?

Unless there is another spyder that I don't know about...

From the traceback, the editor in cq-editor inherts from spyder's CodeEditor class. 

See: https://github.com/spyder-ide/spyder/blob/3.x/spyder/widgets/sourcecode/codeeditor.py#L323
Comment 3 Loïc Bartoletti freebsd_committer freebsd_triage 2020-10-25 20:25:44 UTC
(In reply to rsmith from comment #2)
It doesn't make sense... Anyway. Does it work with spyder version 3 or must it be version 4? However, Spyder should be updated but needs some patches/hack. If you can or have time feel free to update it (and take maintainership)
Comment 4 Neal Nelson 2020-10-26 14:41:45 UTC
(In reply to rsmith from comment #0)
You are of course completely correct. This was the last of four ports I was working on, so I was caught by one of the downsides of dynamic languages and manually installing dependencies to get thing initially working.

Everything seems to work fine with the spyder in ports and I've been using it here without problems for a while now.

Poudriere seems to be taking all day to test the port, but I hope to submit the fix today or tomorrow.
Comment 5 rsmith 2020-10-27 06:01:43 UTC
(In reply to Loïc Bartoletti from comment #3)

For now, it uses spyder 3, although the dev repo has just switched to 4.
Comment 6 rsmith 2020-10-27 06:05:44 UTC
(In reply to Neal Nelson from comment #4)

Thanks. :-)
Comment 7 Neal Nelson 2020-10-27 08:09:31 UTC
Created attachment 219137 [details]
Patch to fix the missing dependency.

Do I need to open a new pr or is this enough?
Comment 8 Loïc Bartoletti freebsd_committer freebsd_triage 2020-10-29 15:34:28 UTC
(In reply to Neal Nelson from comment #7)

It's good enough. I'll push it tomorrow if it's OK with you.
Comment 9 Neal Nelson 2020-10-29 15:56:27 UTC
(In reply to Loïc Bartoletti from comment #8)

Please do. I don't want to have to do another poudriere test run as it took over a day to complete.
Comment 10 commit-hook freebsd_committer freebsd_triage 2020-10-31 08:09:30 UTC
A commit references this bug:

Author: lbartoletti
Date: Sat Oct 31 08:09:13 UTC 2020
New revision: 553743
URL: https://svnweb.freebsd.org/changeset/ports/553743

Log:
  cad/py-cq-editor: Add devel/py-spyder dependency

  cq-editor requires CodeEditor widget from py-spyder.

  PR:		250586
  Reported by:	rsmith@xs4all.nl
  Approved by:	Neal Nelson (maintainer)
  MFH:		2020Q4 (blanket, runtime fixes)

Changes:
  head/cad/py-cq-editor/Makefile
Comment 11 Loïc Bartoletti freebsd_committer freebsd_triage 2020-10-31 08:15:24 UTC
Committed, thanks!
Comment 12 commit-hook freebsd_committer freebsd_triage 2020-10-31 08:15:33 UTC
A commit references this bug:

Author: lbartoletti
Date: Sat Oct 31 08:14:47 UTC 2020
New revision: 553744
URL: https://svnweb.freebsd.org/changeset/ports/553744

Log:
  MFH: r553743

  cad/py-cq-editor: Add devel/py-spyder dependency

  cq-editor requires CodeEditor widget from py-spyder.

  PR:		250586
  Reported by:	rsmith@xs4all.nl
  Approved by:	Neal Nelson (maintainer)

  Approved by:	ports-secteam (blanket, runtime fix)

Changes:
_U  branches/2020Q4/
  branches/2020Q4/cad/py-cq-editor/Makefile