jmwright / cadquery-freecad-module

A module-workbench combo that adds a CadQuery editor to FreeCAD
GNU Lesser General Public License v3.0
120 stars 36 forks source link

Embedded libs are breaking Plot module again #157

Open hasecilu opened 1 month ago

hasecilu commented 1 month ago

Similarly as I commented on https://github.com/jmwright/cadquery-freecad-module/pull/154#issuecomment-1894439763 the embedded libraries conflict with the new versions that should be used on FreeCAD and break plot capabilities

Just commenting this lines makes, plot work again. Alternatively also deleting this WB fixes the problem.

# sys.path.insert(0, libs_dir_path)

I think would be nice to prepare this WB for 1.0 making it to use system libraries.

https://wiki.freecad.org/Package_Metadata

I think it nwould be something lika this:

  <content>
    <workbench>
      <classname>CadQueryWorkbench</classname>
      <subdirectory>./</subdirectory>
      <icon>/CQGui/Resources/icons/CQ_Logo.svg</icon>
      <depend type="python">fpdf2</depend>
      <depend type="python">certifi</depend>
      <depend type="python">chardet</depend>
      <depend type="python">docutils</depend>
      <depend type="python">future</depend>
      <depend type="python">idna</depend>
      <depend type="python">jinja2</depend>
      <depend type="python">markupsafe</depend>
      <depend type="python">pint</depend>
      <depend type="python">requests</depend>
      <depend type="python">tinydb</depend>
      <depend type="python">urllib3</depend>
    </workbench>
  </content>
jmwright commented 3 weeks ago

@hasecilu So this needs a package.xml file (with the contents shown above) in the root of the repository?

hasecilu commented 3 weeks ago

Yes, in the workbenches I have done I have not needed to do it (add dependencies) but this WB seems to need it. There are examples files on the Wiki.

Also you may need to send a patch to FreeCAD addon repo to add the packages to the allowedlist: https://github.com/FreeCAD/FreeCAD-addons/blob/master/ALLOWED_PYTHON_PACKAGES.txt

In that case you can consult Chris H. there, he knows more about it.

jmwright commented 3 weeks ago

@hasecilu This workbench has not been updated for a long time and is a major version behind the current version of CadQuery. I'm not sure how much I want to encourage people to use it until it's updated. No ETA on when it will be updated.