pivy 0.6.2

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: pivy 0.6.2

Post by NormandC »

As far as I know, packaging a python module is not the same thing as packaging a program that needs to be compiled.

I've never packaged anything regarding python (that I recall).
looo wrote:
NormandC wrote:
All your terminal outputs are in German. I do not understand German, and quite frankly, I'm unwilling to hunt for translations. When I ask for help and post terminal output in French (because that's my system's locale), I always provide an English translation along with it.
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: pivy 0.6.2

Post by NormandC »

User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: pivy 0.6.2

Post by looo »

thanks for the information @NormandC.

I found this one: https://github.com/astraw/stdeb
This is a nice package which aims at creating debs for python-source. For simpler python-packages creating a deb should be as simple as this:
https://github.com/astraw/stdeb#quickst ... make-a-deb

But for more difficult one with special dependencies I think running the processes separately is easier:
https://github.com/astraw/stdeb#quickst ... compile-it

the first step (py2dsc pivy.tar.gz) went quite smooth. After that step I modified the control file to have listed the additional dependencies.

Now the problem is with this step:

Code: Select all

dpkg-buildpackage -rfakeroot -uc -us
Swig reports about some missing includes:

Code: Select all

Inventor/SbString.h:41: Error: Unable to find 'cstdio'
/usr/include/Inventor/SbByteBuffer.h:20: Error: Unable to find 'cstring'
/usr/include/Inventor/elements/SoGLMultiTextureImageElement.h:37: Error: Unable to find 'cstdlib'
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: pivy 0.6.2

Post by looo »

Running the stdeb-commands directly on the git source didn't worke for pivy (headers are not copied properly), and somehow this conflicted my other approaches. After cleaning everything again, I was successfully with building from a compressed file.
Building this on 17.04 does work. Building with docker 14.04 works only for coin. Somehow pivy isn't satisfied with the available soqt libraries there. But a deb for coin with python3.4 was produced, and I have successfully imported coin from the docker-container. It's now uploaded to github: https://github.com/looooo/pivy/releases ... -1_all.deb

but somehow the coin_test fails:

Code: Select all

/projects/pivy/tests# python3 coin_tests.py
Traceback (most recent call last):
  File "coin_tests.py", line 1222, in <module>
    unittest.main(verbosity=4)
  File "/usr/lib/python3.4/unittest/main.py", line 92, in __init__
    self.parseArgs(argv)
  File "/usr/lib/python3.4/unittest/main.py", line 139, in parseArgs
    self.createTests()
  File "/usr/lib/python3.4/unittest/main.py", line 143, in createTests
    self.test = self.testLoader.loadTestsFromModule(self.module)
  File "/usr/lib/python3.4/unittest/loader.py", line 78, in loadTestsFromModule
    if isinstance(obj, type) and issubclass(obj, case.TestCase):
NameError: Unknown C global variable
seems to be related to an older swig version:
https://github.com/looooo/pivy/blob/mas ... is.yml#L11

ps.:
the uploaded package is updated to swig3.0.
the tests now report a pointer conversation problem... (this seems to be specific to python3.4) There were some changes regarding pointer conversation recently, so maybe this is allready fixed in current master. I will have a try later.

Code: Select all

testSFVec4f (__main__.FieldSetValue)
check setValue for SoSFVec4f ... ok
testSoRotation (__main__.FieldSetValue) ... *** Error in `python3.4': free(): invalid pointer: 0x00000000031cc3a8 ***
Aborted (core dumped)
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: pivy 0.6.2

Post by triplus »

looo wrote: Sun Jun 11, 2017 9:43 pm Sorry for my dumb questions, but all I know about debian packaging is that is difficult... :D
Welcome to the club.
The source or the compiled/installed files?
You created debian source package. Two tarballs and one .dsc file. You likely only extracted the tarball with debian folder in it and run the command to build the package in that folder. And that is why when you attempted to build the package it didn't find the files. As in addition the content of the tarball with the Pivy source in it wasn't extracted/provided.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: pivy 0.6.2

Post by triplus »

Hi @looo.

I went one step back and rather used Ubuntu 16.04 provided python-pivy source package (source code repository needs to be enabled):

Code: Select all

mkdir pivy
cd pivy
apt-get source python-pivy
cd pivy-0.5.0~v609hg
After i downloaded Pivy as a .zip package from your GitHub account and extracted it in cd pivy-0.5.0~v609hg folder by overwriting existing files/folders.

Code: Select all

dch -i
I only changed version information and went after the build:

Code: Select all

sudo apt-get build-dep python-pivy
debuild -i -us -uc -b
That resulted in .deb package being produced successfully.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: pivy 0.6.2

Post by looo »

triplus wrote:You created debian source package. Two tarballs and one .dsc file. You likely only extracted the tarball with debian folder in it and run the command to build the package in that folder. And that is why when you attempted to build the package it didn't find the files. As in addition the content of the tarball with the Pivy source in it wasn't extracted/provided.
I see now what you were referring to. But anyway the stdeb is a nice tool, which simplifies this process a lot. At least it opens the door to Debian-packaging for me a bit. So the next steps are:

1. finally create the 0.6.2 release on github
2. create a deb from 0.6.2 for trusty and test it
3. Upload to the ppa

While 1 and 2 are pretty simple now, I have no idea about the 3rd step.

- Does a manually build package satisfy the freecad-standarts?
- How to upload the package?
- Is adding the freecad-ppa to the travis setup possible? (necessary if pivy is pushed to the freecad-ppa)
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: pivy 0.6.2

Post by looo »

triplus wrote:I went one step back and rather used Ubuntu 16.04 provided python-pivy source package (source code repository needs to be enabled):
Ah, thats nice.No problems with signature? Was soqt build too? Looks like this is the better approach to produce the deb...
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: pivy 0.6.2

Post by triplus »

My suggestion would be create a Launchpad account and test from there onwards. You will need to create a key and things like that anyway. Reuse the existing source package as much as you can would be my advice. On how to upload it and what version information to use and things like that. And how to set up from where to get the code for build. Ask FreeCAD PPA maintainers as they did this a lot of times in the past already for FreeCAD. Procedure should be more or less the same.

P.S. As for (when using Python 3):

Code: Select all

from pivy import coin
Any opinion on that?
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: pivy 0.6.2

Post by looo »

triplus wrote:

Code: Select all

from pivy import coin
Any opinion on that?
I don't see the issue.
Post Reply