Ticket #1047 (assigned task)

Opened 2 years ago

Last modified 2 years ago

orangeqt - make installation possible with setup.py

Reported by: marko Owned by: Noughmad
Milestone: 2.6 Component: other
Severity: major Keywords:
Cc: Blocking:
Blocked By:

Description

We are trying to make orange installable with setup.py, but as for now it does not support orangeqt.

Ales hinted, that we will probably need to make a new setup.py for orangeqt.

Attachments

orangeqt-setup-build.diff Download (7.2 KB) - added by Noughmad 2 years ago.

Change History

comment:1 Changed 2 years ago by miha

  • Owner changed from miha to Noughmad
  • Status changed from new to assigned

comment:2 Changed 2 years ago by Noughmad

Yes, I see.

SIP can be used from a setup.py script as described in their docs:  http://www.riverbankcomputing.co.uk/static/Docs/sip4/distutils.html.

And yes, it needs to pass a special parameter as 'build_ext', so I don't know if the same file can compile all libraries. I'll see what I can do, can you give me a timeframe?

comment:3 Changed 2 years ago by miha

The task is planned for Orange 2.6. We are just about to release the 2.5 version, next one is planned in two months.

Don't bother with a common setup.py for all Orange libraries. Anže volunteered to merge them later.

Changed 2 years ago by Noughmad

comment:4 Changed 2 years ago by Noughmad

I manage to compile the library by bypassing CMake, running MOC manually and using sipdistutils. It works (for me, at least), but still has problems.

  • The pyxtract_build_ext class inherits from sipdistutils.build_ext, as I don't know of a way of specifying different build_ext classes for the same project. This only adds some unnecessary work to the script, so it's not a big deal.
  • The Qt library paths and include directories are hardcoded, and only work on Linux.
  • It requires PyQt4 at build-time. It's used only to determine the Qt version, so I think it can be replaced by the earliest supported version (4.6?) and this requirement can be dropped.
  • No error handling or reporting for when Qt or other requirements are not found

The second one is the biggest problem, but I can't find a reliable way of locating the Qt libraries from Python. On Linux we can use pkg-config, but I have no idea about other platform. This is also the reason why I used CMake in the first place.

I'm attaching a patch. I can't commit to the hg repository, but I don't think this should go in in its current state anyway.

comment:5 Changed 2 years ago by anze

I created a fork for this ( https://bitbucket.org/anze/orange-setupqt). I used the latest version of Orange, applied your patch and made it work on (my) mac. Location of Qt is read from PyQt config, which works of my computer.

Can you clone it and check if it still works on your computer?

comment:6 Changed 2 years ago by anze

  • Milestone changed from Future to 2.6

comment:7 Changed 2 years ago by ales

Based on Anze's fork orangeqt can now be build and installed (r7602a3f6b71e) using the main setup.py by specifically running build_pyqt_ext command

python setup.py build_pyqt_ext install

(can also be passed –sip-opts)

It can also be build and installed standalone using setup.py in source/orangeqt

With some magic sip-opts it builds on debian, mac osx and windows.

Noughmad, Marko, Anze, Miha can you please test on your OS of choice?

Note: See TracTickets for help on using tickets.