Bug 1364727 - Add python scripting ability to kicad
Summary: Add python scripting ability to kicad
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: kicad
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jaromír Cápík
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-06 16:41 UTC by maarten
Modified: 2019-01-09 12:54 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-08 16:14:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Use wxGTK3 and add Python scripting (24.37 KB, text/plain)
2016-08-06 16:41 UTC, maarten
no flags Details

Description maarten 2016-08-06 16:41:44 UTC
Created attachment 1188214 [details]
Use wxGTK3 and add Python scripting

Description of problem:
KiCad allows Python scripts to access pcbnew and the footprint editor to automate things.
The current packaged kicad version has no scripting support.
e.g. The footpring wizard does not work in the current packaged kicad.
See file:///usr/share/doc/kicad/help/en/pcbnew.html#_kicad_scripting_reference of kicad-doc for more examples.
This documentation seems outdated.


Version-Release number of selected component (if applicable):
kicad-4.0.2-2.fc24.x86_64

How reproducible:
Always

Steps to Reproduce:
- Example 1:
  1. Open KiCad
  2. Open Footprint Editor
  3. Click on the ''New footprint using the footprint wizard button'
- Example 2:
  1. start python2 in the terminal
  2. $ import pcbnew
  OR
     $ import kicad

Actual results:
- Example 1:
  The button does not exist.

- Example 2:
  "ImportError: No module named pcbnew"

Expected results:
- Example 1:
  1. Footprint Wizard starts
  2. Able to select a Footprint Generator (SOIC, BGA, QFP, ...)
- Example 2:
  The module has been imported and can be used

Additional info:
The attached patch adds the python support to kicad.spec.

Please note:
- Only python 2.x is supported. Python3 is explicitly disabled in the CMakeLists.txt file.
- I've switched compat-wxGTK3-gtk2-devel to compat-wxGTK3-devel
  (https://github.com/KiCad/fedora-packaging/blob/master/kicad.spec.template also uses that version)
- For providing the kicad module, I use a git checkout of the https://github.com/KiCad/kicad-python repository.
- I added a python-kicad package that will provide the python support.
- The python-kicad and the kicad can be installed seperately. But the scripting support of kicad will only work if they are both installed. So python-kicad has no dependency on kicad.

Please review.

Comment 1 Lubomir Rintel 2016-10-18 16:11:26 UTC
Thanks for the patch. However, I don't believe it's a good idea to apply this at the moment. The python ABI hasn't been stabilized or released.
The upstream should include this first. And probably also address the python3 issue.

Also, we don't use the gtk3 version of wxGTK3 for no reason. -- the GTK3-based one doesn't render eeschema correctly. That is a show stopper.

Comment 2 jnavratil 2016-12-26 22:03:13 UTC
I'm using kicad 4.0.4 and have the same problem - no pcbnew.py.  I will be following the example and attempt to install kicad-python from the github.

However, in response to Comment 1, I refer one to....

http://kicad-pcb.org/download/source/

...in which the Kicad maintainers note....


You [packagers] are encouraged to enable the python scripting, even though it is not enabled by default with the following additional Cmake options.

-DKICAD_SCRIPTING=ON -DKICAD_SCRIPTING_MODULES=ON -DKICAD_SCRIPTING_WXPYTHON=ON

It has been decided to do so such that packagers will enable it on a case by case basis. >>> If you package for linux you are expected to enable python scripting. <<<

Comment 3 Fedora End Of Life 2017-07-25 22:16:38 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 4 Fedora End Of Life 2017-08-08 16:14:54 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.