[fixed] Arch/Bin/Draft V0.19 "No module named 'DraftLayer'"

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
nic
Posts: 136
Joined: Thu Apr 18, 2019 1:14 pm
Location: France

[fixed] Arch/Bin/Draft V0.19 "No module named 'DraftLayer'"

Post by nic »

Hello,

I hope I'm in the correct forum...

I cannot switch to Bim and Arch WB anymore. I guess it's linked to last Layers addition by Yorik.When I download ``src/Mod/Draft/DraftLayer.py`` to ``/usr/share/freecad-daily/Mod/Draft``, everything looks fine. I therefore suspect a packaging issue...

Anyway, here is the full Traceback from the view report:
No module named 'DraftLayer'
Traceback (most recent call last):
File "<string>", line 70, in Initialize
File "/usr/share/freecad-daily/Mod/Draft/DraftTools.py", line 41, in <module>
import sys, os, FreeCAD, FreeCADGui, WorkingPlane, math, re, Draft, Draft_rc, DraftVecUtils
File "/usr/share/freecad-daily/Mod/Draft/Draft.py", line 74, in <module>
import DraftLayer

Version:



OS: Ubuntu 18.10 (i3/i3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.6.8
Qt version: 5.11.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/Switzerland (fr_CH)
% apt-cache policy "freecad-daily"
freecad-daily:
Installé : 0.19~pre1~201906062118~ubuntu18.10.1
Candidat : 0.19~pre1~201906062118~ubuntu18.10.1
Table de version :
*** 0.19~pre1~201906062118~ubuntu18.10.1 500
500 http://ppa.launchpad.net/freecad-mainta ... ily/ubuntu cosmic/main amd64 Packages
500 http://ppa.launchpad.net/freecad-mainta ... ily/ubuntu cosmic/main i386 Packages
100 /var/lib/dpkg/status
** EDIT ** fixed with "0.19~pre1~201906091812~ubuntu18.10.1"
Last edited by nic on Mon Jun 10, 2019 4:58 am, edited 1 time in total.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Arch/Bin/Draft V0.19 "No module named 'DraftLayer'"

Post by Kunda1 »

yorik wrote:
CC @yorik
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
yorik
Founder
Posts: 13664
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Arch/Bin/Draft V0.19 "No module named 'DraftLayer'"

Post by yorik »

This is strange, everything is correct on the FreeCAD side...

I cant find the PPA recipe, but it is unlikely that it specifies filenames manually?
kkremitzki wrote:@kkremitzki
User avatar
kkremitzki
Veteran
Posts: 2515
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Arch/Bin/Draft V0.19 "No module named 'DraftLayer'"

Post by kkremitzki »

yorik wrote: Fri Jun 07, 2019 3:53 pm This is strange, everything is correct on the FreeCAD side...

I cant find the PPA recipe, but it is unlikely that it specifies filenames manually?
kkremitzki wrote:@kkremitzki
No, it does exactly that, because we want to separate the different types of files by package to help out the build infrastructure. If, for example, new Python files are added, they need to be added to this file:
https://salsa.debian.org/science-team/f ... me.install

So if people were to make pull requests against that repo to update debian/*.install files for their new packages it would be picked up automatically by the daily builds.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Arch/Bin/Draft V0.19 "No module named 'DraftLayer'"

Post by abdullah »

kkremitzki wrote: Fri Jun 07, 2019 5:02 pm If, for example, new Python files are added, they need to be added to this file:
https://salsa.debian.org/science-team/f ... me.install
So everytime a developer adds a py file, for example in the Path WB or the FEM WB, a PR must be done to the repo in salsa.debian.org. Is this right?

If it is like this, is there a procedure to be followed to do that PR?

Not that I am Python competent, but I did not know this. Maybe some other Developers are not aware either, so maybe it is good to raise some awareness...
User avatar
kkremitzki
Veteran
Posts: 2515
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Arch/Bin/Draft V0.19 "No module named 'DraftLayer'"

Post by kkremitzki »

abdullah wrote: Fri Jun 07, 2019 5:49 pm
kkremitzki wrote: Fri Jun 07, 2019 5:02 pm If, for example, new Python files are added, they need to be added to this file:
https://salsa.debian.org/science-team/f ... me.install
So everytime a developer adds a py file, for example in the Path WB or the FEM WB, a PR must be done to the repo in salsa.debian.org. Is this right?

If it is like this, is there a procedure to be followed to do that PR?

Not that I am Python competent, but I did not know this. Maybe some other Developers are not aware either, so maybe it is good to raise some awareness...
Where possible, specific listings of .py files can be replaced, judiciously, with *'s in the paths, so long as we don't end up with files getting sucked up into the wrong packages. Python runtime files should stay in freecad-runtime, images, icons, etc, and other common resources should go in freecad-common, shared library files should go in libfreecad-pythonX-0.19, etc.

Anyone can create an account on Salsa and open a merge request just like you would a pull request on Github. I think they even have an interface for editing files directly on the website so you may not even need to clone anything. Once you create a merge request I should get notified in which case I'll review and merge, which will automatically get synced into the next daily build.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Arch/Bin/Draft V0.19 "No module named 'DraftLayer'"

Post by abdullah »

Thanks Kurt!
kkremitzki wrote: Fri Jun 07, 2019 8:31 pm Where possible, specific listings of .py files can be replaced, judiciously, with *'s in the paths, so long as we don't end up with files getting sucked up into the wrong packages. Python runtime files should stay in freecad-runtime, images, icons, etc, and other common resources should go in freecad-common, shared library files should go in libfreecad-pythonX-0.19, etc.
Well, non-automatised deployment is quite a hurdle. Specially because we run daily builds. Applying what you have just written, maybe it can be compartmentalised per workbench directory level, so having something like:

Code: Select all

usr/share/freecad-daily/Mod/Draft/*.py
usr/share/freecad-daily/Mod/Fem/*.py
usr/share/freecad-daily/Mod/Fem/femresult/*.py
usr/share/freecad-daily/Mod/Fem/femobjects/*.py
The rationale behind it is that *.py may only be runtime, if I understood it correctly, still a change to packaging is only necessary when a new directory is created.

This idea might be extended to other categories too (if it makes sense).

In any case, you are the packaging master. So I fully trust whatever you decide :)
kkremitzki wrote: Fri Jun 07, 2019 8:31 pm Anyone can create an account on Salsa and open a merge request just like you would a pull request on Github. I think they even have an interface for editing files directly on the website so you may not even need to clone anything. Once you create a merge request I should get notified in which case I'll review and merge, which will automatically get synced into the next daily build.
Ok. Duly noted. :)
User avatar
yorik
Founder
Posts: 13664
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Arch/Bin/Draft V0.19 "No module named 'DraftLayer'"

Post by yorik »

Hmm I indeed wasn't aware of this either... It's a wonder such error hasn't appeared earlier (some parts of Draft have been split out of monstrous Draft.py and DraftTools.py already).
abdullah wrote: Fri Jun 07, 2019 8:55 pm In any case, you are the packaging master. So I fully trust whatever you decide :)

kkremitzki wrote: ↑
07 Jun 2019, 17:31
Anyone can create an account on Salsa and open a merge request just like you would a pull request on Github. I think they even have an interface for editing files directly on the website so you may not even need to clone anything. Once you create a merge request I should get notified in which case I'll review and merge, which will automatically get synced into the next daily build.

Ok. Duly noted. :)
Duly noted as well :) I'll open a PR for this one (if you didn't do it already) and the next ones

*EDIT* PR: https://salsa.debian.org/science-team/f ... requests/7
User avatar
kkremitzki
Veteran
Posts: 2515
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Arch/Bin/Draft V0.19 "No module named 'DraftLayer'"

Post by kkremitzki »

yorik wrote: Sun Jun 09, 2019 5:21 pm *EDIT* PR: https://salsa.debian.org/science-team/f ... requests/7
Thanks, I've merged it and triggered a manual import on Launchpad (https://code.launchpad.net/~freecad-mai ... ecad-salsa) and triggered a manual build for the daily builds recipe (https://code.launchpad.net/~freecad-mai ... dual-build)
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
nic
Posts: 136
Joined: Thu Apr 18, 2019 1:14 pm
Location: France

Re: Arch/Bin/Draft V0.19 "No module named 'DraftLayer'"

Post by nic »

Fixed with with PPA version 0.19~pre1~201906091812~ubuntu18.10.1! Thanks
Post Reply