setup.py fails to build

Bug #625237 reported by Marco Clocchiatti
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Whyteboard
Fix Committed
Medium
Steven Sproat

Bug Description

I' tryng to make a gentoo ebuild for whyteboard program, to add at wiidea overlay (if you like).
here a (unofficial) proposal for my project : http://www.wiild.it/

I've problems to use setup.py from bazar, at this address:
EBZR_REPO_URI="http://bazaar.launchpad.net/~sproaty/whyteboard/development"

this is the bad behaviour:

>>> Unpacking source...
 * bzr update start -->
 * repository: http://bazaar.launchpad.net/~sproaty/whyteboard/development
Tree is up to date at revision 337 of branch http://bazaar.launchpad.net/~sproaty/whyteboard/development
 * exporting ...
>>> Source unpacked in /var/tmp/portage/x11-apps/whyteboard-9999/work
>>> Preparing source in /var/tmp/portage/x11-apps/whyteboard-9999/work/whyteboard-9999 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/x11-apps/whyteboard-9999/work/whyteboard-9999 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/x11-apps/whyteboard-9999/work/whyteboard-9999 ...
python2.6 setup.py build
/usr/lib64/python2.6/site-packages/wx-2.8-gtk2-unicode/wx/_core.py:14490: UserWarning: wxPython/wxWidgets release number mismatch
  warnings.warn("wxPython/wxWidgets release number mismatch")
Traceback (most recent call last):
  File "setup.py", line 4, in <module>
    from whyteboard import meta
  File "/var/tmp/portage/x11-apps/whyteboard-9999/work/whyteboard-9999/whyteboard/__init__.py", line 4, in <module>
    from whyteboard.gui import WhyteboardApp
  File "/var/tmp/portage/x11-apps/whyteboard-9999/work/whyteboard-9999/whyteboard/gui/__init__.py", line 6, in <module>
    from sheets import UndoSheetManager
ImportError: No module named sheets
 * ERROR: x11-apps/whyteboard-9999 failed:

Revision history for this message
Steven Sproat (sproaty) wrote :

whoops, my bad. I added a few files to my Bazaar version control system that had a few errors (no module..)

I'll fix this tonight.

However, the files in Bazaar's "trunk" repository are from the in-development version, which is not suitable for release, yet. If you would like to create the package, you can use the files from the latest version, which is 0.40.1 -- http://whyteboard.googlecode.com/files/whyteboard-0.40.1.tar.gz

Changed in whyteboard:
status: New → Confirmed
assignee: nobody → Steven Sproat (sproaty)
Revision history for this message
Steven Sproat (sproaty) wrote :

you can fix it temporarily by removing "from sheets import UndoSheetsManager" in __init__.py in /whyteboard/gui

Revision history for this message
Marco Clocchiatti (cloc3) wrote :

Thanks.

I'm working both around whyteboard-9999.ebuild and whyteboard-0.40.1.ebuild.

whyteboard-0.40.1.tar.gz does not contain any setup.py file.
so I'm currently extracting files from http://whyteboard.googlecode.com/files/whyteboard-0.40.1.deb
and coping them in the system.

I don't know if this is good, because it makes not easy to put files in the default gentoo path, which is /usr/lib/python<ver>/ .

Revision history for this message
Steven Sproat (sproaty) wrote :
Download full text (3.2 KiB)

shouldn't be too hard to come up with a setup based on 0.40.1's structure - it isn't as well packaged as the program is now.
This should do it, actually. The manifest doesn't need to change.

Let me know how it goes.

---

#!/usr/bin/env python

from distutils.core import setup
from whyteboard import meta

text = """
===========
Whyteboard
===========

Whyteboard is a free painting application for Linux, Windows and Mac. It is
suited towards creating visual presentations and for overlaying PDF images
with annotations

Features
=========

* Draw on a canvas using common tools: pen, rectangle, circle, text
* Annotate over PDF files
* Drawn shapes can be resized, moved, rotated and re-coloured
* Tabbed drawing: each tab represents a whiteboard "sheet". Each sheet has unlimited undo/redo operations
* Your drawing history can be replayed on a per-sheet basis
* Each sheet has a thumbnail of the canvas that updates as you draw
* Closed sheets can be re-opened, restoring their data
* Notes, similar to Post-It Notes. A tree in a side panel gives an overview of all notes
* Resize the canvas easily by dragging it around
* Embed an audio/video player onto the canvas
* Translated into many languages (French, German, Spanish, Italian, Galician, Russian, Dutch, and more)
"""

setup(
    name = 'Whyteboard',
    version = meta.version,
    author = 'Steven Sproat',
    author_email = '<email address hidden>',
    url = 'http://whyteboard.org',
    license = 'GPL v3',
    description = 'A simple drawing program that can be used to annotate PDF files',
    long_description = text,

    package_dir = {'whyteboard': 'whyteboard',
                   'whyteboard.lib': 'whyteboard/lib',},

    packages = ['whyteboard', 'whyteboard.lib'],
    py_modules = ['whyteboard'],
    scripts = ['whyteboard.py'],

    classifiers=[
          'Development Status :: 4 - Beta',
          'Environment :: MacOS X',
          'Environment :: Win32 (MS Windows)',
          'Environment :: X11 Applications',
          'Intended Audience :: End Users/Desktop',
          'Intended Audience :: Education',
          'License :: OSI Approved :: GNU General Public License (GPL)',
          'Natural Language :: Arabic',
          'Natural Language :: Chinese (Traditional)',
          'Natural Language :: Czech',
          'Natural Language :: Dutch',
          'Natural Language :: French',
          'Natural Language :: German',
          'Natural Language :: Hindi',
          'Natural Language :: Italian',
          'Natural Language :: Japanese',
          'Natural Language :: Portuguese',
          'Natural Language :: Russian',
          'Natural Language :: Spanish',
          'Operating System :: OS Independent',
          'Programming Language :: Python',
          'Programming Language :: Python :: 2.5',
          'Programming Language :: Python :: 2.6',
          'Programming Language :: Python :: 2.7',
          'Topic :: Multimedia',
          'Topic :: Multimedia :: Graphics',
          'Topic :: Multimedia :: Graphics :: Editors',
          'Topic :: Multimedia :: Graphics :: Editors :: Raster-Based',
          'Topic :: Multimedia :: Graphics :: Presentation',
          'Topic ...

Read more...

Revision history for this message
Steven Sproat (sproaty) wrote :

I've also committed a fix for the broken setup script in trunk - still a few things I'd like to release but I need to test it more.

You're Italian, right? If you use any "non-English" characters in your directory, like á etc, can you test saving the program. Also if you were previously getting OSErrors when saving files, do you mind seeing if that fixes anything?

I just need to test more stuff on Windows before I release. Feedback on what's still broken and what's fixed would be appreciated if you have the time.

Best regards,
Steven

Revision history for this message
Marco Clocchiatti (cloc3) wrote :

I've no problems with italian characters, nor wrinting inside the whiteboard, nor using them in the save path:

cloc3@s939 ~ $ echo $LC_ALL && ls sòlòlèttéréìtalìanè.wtbd
it_IT.UTF-8
sòlòlèttéréìtalìanè.wtbd

 curl -v -d http://www.cloc3.net/ardesia/sòlòlèttéréìtalìanè.wtbd http://www.cloc3.net/ardesia/sòlòlèttéréìtalìanè.wtbd >sòlòlèttéréìtalìanè.wtbd

:)

Revision history for this message
Marco Clocchiatti (cloc3) wrote :

using your setup.py, all the ebuild code reduces to:

src_prepare () {
 cp ${FILESDIR}/setup.py .
}

if you insert setup.py in tarball, also the src_prepare section may it be avoided.

just a little issue.
the script /usr/bin/whyteboard.py should be substituted with a symlink to /usr/lib64/python2.6/site-packages/whyteboard.py

with this manual adjustment, an error occurs on startup, related to pubsub:

cloc3@s939 /usr/lib/python2.6/site-packages $ whyteboard.py
/usr/lib64/python2.6/site-packages/wx-2.8-gtk2-unicode/wx/_core.py:14490: UserWarning: wxPython/wxWidgets release number mismatch
  warnings.warn("wxPython/wxWidgets release number mismatch")
Traceback (most recent call last):
  File "/usr/bin/whyteboard.py", line 50, in <module>
    from whyteboard.gui import WhyteboardApp
  File "/usr/lib64/python2.6/site-packages/whyteboard/gui.py", line 45, in <module>
    from lib.pubsub import pub
ImportError: No module named pubsub

in my system, a file pubsub.py exists in wxpython:
s939 whyteboard # qfile pubsub.py
dev-python/wxpython (/usr/lib64/python2.6/site-packages/wx-2.8-gtk2-unicode/wx/lib/pubsub.py)
dev-python/wxpython (/usr/lib64/python2.6/site-packages/wx-2.8-gtk2-unicode/wxPython/lib/pubsub.py)

but the program seems unable to find it.

Revision history for this message
Steven Sproat (sproaty) wrote :

just a little issue.
the script /usr/bin/whyteboard.py should be substituted with a symlink to /usr/lib64/python2.6/site-packages/whyteboard.py

yes, that's something I do in my Debian package installer.

re: pubsub, you may have to specify it in the setup.py package list.

                   'whyteboard.lib.pubsub': 'whyteboard/lib/pubsub',
                   'whyteboard.lib.pubsub.core': 'whyteboard/lib/pubsub/core',
                   'whyteboard.lib.pubsub.utils': 'whyteboard/lib/pubsub/utils',

I'm not using the one from wxPython.

Steven Sproat (sproaty)
Changed in whyteboard:
importance: Undecided → Medium
status: Confirmed → Fix Committed
Revision history for this message
Marco Clocchiatti (cloc3) wrote :

ok.

now I have a working gentoo ebuild for whyteboard-0.40.1.

just two exthetical problems:

1. whyteboard needs the folder images.
    I've trained the ebuild to copy it by hands.
    so the program works, but the gentoo path for whyteboard images looks bad, because it is
/usr/lib64/python2.6/site-packages/images. if any new packages should do the same, may it be impossible to mantain the system. for example, if a second python packages needs an icon named /usr/lib64/python2.6/site-packages/images/icons/cursor.png, the package should fail to build to avoid file-conflicts.

2. I don't understand way, but the symlink in /usr/bin does not work, but needs to substituted with a bash script such this:

#!/bin/bash
python /usr/lib/python2.6/site-packages/whyteboard.py

Revision history for this message
Steven Sproat (sproaty) wrote :

okay. I haven't 100% finished the setup stuff - I played with it for a while, but it's not totally working.

With my Debian packages, I run a custom set of commands to copy the program to /usr/lib/whyteboard, which is where the program expects its image resource to live if the program is launched from the /usr/bin symlink.
That's something I should fix I guess by trying to follow through the symlink.

I'll have the setup stuff sorted by the time 0.41 is released.

Revision history for this message
Marco Clocchiatti (cloc3) wrote :

Well, I'm having a look here: http://docs.python.org/py3k/distutils/setupscript.html#installing-package-data
because I'm not an expert programmer.
In my opinion, distutils have some limit in installing data files, because is not possibile to move a directory tree, but only a list of simple files. so, any attemp to move images dir, with all subdirecories fails for me.

anyway, I think is not important to do this with setup.py, with a cp command or with a makefile. the only thing to have care should be the path of images dir, to be moved inside whyteboard dir,

I've tested this little change in a few files, and it seems working:
 path = os.path.join(self.gui.util.get_path(), "whyteboard/images", "whyteboard/icons", "")

Revision history for this message
Marco Clocchiatti (cloc3) wrote :

a copy of my gentoo ebuild for whyteboard-0.40.1 is available here:

http://www.cloc3.net/wiidea/whyteboard-0.40.1.tar.bz2
cloc3@s939 ~/overlays $ md5sum whyteboard.tar.bz2
8eac99b839ca8c1f60befd0387e5315e whyteboard.tar.bz2

please have a look to dependencies and to files/* .

Revision history for this message
Steven Sproat (sproaty) wrote :

yeah the images should be moved into the whyteboard folder.

The proper fix would be to make get_path() return the correct path all the time rather than modifying every file that calls that function.

That file gave me a 404 error.

Revision history for this message
Steven Sproat (sproaty) wrote :

I've just committed a fix to get_path() that will follow through symbolic links to resolve where the application is installed to. So a file "whyteboard" in /usr/bin that's a symbolic link to /usr/lib/python2.5/site-packages/whyteboard will attempt to load all the image files from the /usr/lib... directory.

I have 2 days off work now to try and get a new release out. There aren't many things to fix now, and with a fixed setup script in place it should be easier for you to build whyteboard via "python setup.py install"

I can also get the program up on Pypi, then.

regards,
Steve

Revision history for this message
Marco Clocchiatti (cloc3) wrote :

sorry for long delay.

a gentoo ebuild is now inserted in this overlay:
http://www.cloc3.net/wiidea/wiidea.tar.bz2
http://www.cloc3.net/wiidea/wiidea.tar.bz2.sha1

no more setup.sh seem needed in last version.

links seems working today :) .
tank's a lot.

Revision history for this message
Steven Sproat (sproaty) wrote :

Cool, can this bug now be considered fixed?

So there's a working gentoo build for Whyteboard -- is there any way to somehow get this into the official distribution somehow? Would be interesting and also very cool :D

Revision history for this message
Marco Clocchiatti (cloc3) wrote :

fixed? may it be.

wiidea is my first overlay, and I don't know if it is well written.
anyway, this is may gentoo bug:
http://bugs.gentoo.org/show_bug.cgi?id=334809

may it be usefull to up developers, because I thing they are completly forgetting of mine :) ...

Revision history for this message
Marco Clocchiatti (cloc3) wrote :

because of bug #678114, I've built a new source package for whyteboard.
this is the location:

http://www.cloc3.net/wiidea/whyteboard-0.41.1.tar.gz

cloc3@s939 ~/overlays $ sha1sum whyteboard-0.41.1.tar.gz
08f09952243055094406343b6f88d7b5762fa1bf whyteboard-0.41.1.tar.gz

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.