ssorgatem / video4fuze

Automatically exported from code.google.com/p/video4fuze
GNU General Public License v3.0
0 stars 0 forks source link

Please include a setup.py #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
n/a

What is the expected output? What do you see instead?
setup.py to place all items in the correct place based on the local os.

What version of the product are you using? On what operating system?
svn r54

Please provide any additional information below.
http://docs.python.org/distutils/setupscript.html

Here's a jumping off point for you.  Note that I have no python experience
so I assembled this following the website above as I was trying to package
this for LinHES (http://linhes.org).  This "works for me" after I change
the source video4fuze/GUI to video4fuze/video4fuzegui.  GUI was not
descriptive enough in the python libraries for my tastes.

#!/usr/bin/env python

from distutils.core import setup

setup (name='video4fuze',
       version='54-1',
       description='A tool to make videos compatable with the San Disk Sana
Fuze media player.',
       url='http://code.google.com/p/video4fuze',
       license=['GPL3' 'CCPL'],
       packages=['video4fuzegui'],
       scripts=['fuze.py', 'video4fuze.pyw', 'p2fuze.py', 'video4fuze_rc.py',
                'vthumb.py'],
       data_files=[('share/video4fuze/translations',
                   ['translations/v4f_ca.qm',
                    'translations/v4f_ca.qm',
                    'translations/v4f_ca.ts',
                    'translations/v4f_de.qm',
                    'translations/v4f_de.ts',
                    'translations/v4f_en.qm',
                    'translations/v4f_en.ts',
                    'translations/v4f_es.qm',
                    'translations/v4f_es.ts']),
                   ('share/video4fuze/icons',
                   ['icons/black.png',
                    'icons/blue.png',
                    'icons/red.png'])]
      )

Original issue reported on code.google.com by hansonor...@verizon.net on 23 Apr 2010 at 8:53

GoogleCodeExporter commented 9 years ago
Actually, there's no "correct place" at all, and less based on the local OS. 
You can
run video4fuze from whereever you want. If you want to package it for a 
distribution,
you can look at the layout of the .deb packages as a suggestion, but you just 
need to
put it all together anywhere, and put in your path a script that cd's into
video4fuze's directory and launches video4fuze.pyw.

Yep, GUI is not descriptive because it's not  supposed to be used outside 
video4fuze.
If you have an application ina folder with its name, and a subfolder named 
GUI... I
find it pretty descriptive. The same for the "translations" folder. Why not
"video4fuzetranslations"? And why not "video4fuzeicons"?

The png files aren't actually needed for distribution; they are compiled in
video4fuze_rc.py. Also, you write translations/v4f_ca.qm twice, and the .ts 
files
aren't needed also (they are the source from the .qm files). And the version is
wrong, it should be 0.5+svnr54 or something like that, otherwise it seems as if 
it
were version 54, where it's revision 54.

As for now, I don't have time enough to even code, so making a setup.py for
video4fuze is way too low-priority in my TODO list. I don't have any 
experiencemaking
setup-py files, either, so I won't do it.

But if you're willing to do it and test and maintain it, feel free to do it; 
post it
here and if it works with latest svn I will  include it in svn and next 
release's
tarball.

PD: I suppose you know that packaging from subversion means all sort of broken
functionality and sudden changes between revisions. I don't know what's the 
current
functionality status in video4fuze's subversions, but I think I left it 
relatively
stable, but mind you that this stability isn't permanent. 

Original comment by ssorga...@gmail.com on 23 Apr 2010 at 10:37

GoogleCodeExporter commented 9 years ago
"Actually, there's no "correct place" at all, and less based on the local OS."

What I should have said is that using setup.py is the "python way" of 
installing.  It
will place the python modules in the proper place based on distribution specific
settings.  i.e. the lib directory is often prefixed by /usr.  So the modules 
will get
installed under something similar to /usr/lib/pythonX.Y/<module_name>.  In my
specific case, the GUI module gets installed under
/usr/lib/python2.6/site-packages/video4fuzegui.  I thought that having
/usr/lib/python2.6/site-packages/GUI would not tell someone much about what that
module is used for.  As I stated renameing it was a personal preference.

"Yep, GUI is not descriptive because it's not  supposed to be used outside
video4fuze. If you have an application ina folder with its name, and a subfolder
named GUI... I find it pretty descriptive. The same for the "translations" 
folder.
Why not "video4fuzetranslations"? And why not "video4fuzeicons"?"

As I stated, the renaming of GUI to video4fuzegui was a personal preference -- 
not an
attack on your hierarchy.  I was mentioning it for completeness.  As you can 
see in
the code I posted, translations and icons are installed in
share/video4fuze/translations.  They're in subdirs of a folder with the app 
name.

Re: png and ts files.  Thanks for that info.

"But if you're willing to do it and test and maintain it, feel free to do it; 
post it
here and if it works with latest svn I will  include it in svn and next 
release's
tarball."

If I get it working properly, with your unmodified code, I will.

Re: packaging from subversion... I'm aware it's in flux.  I just wanted the 
latest
code and based on what I read it seemed safe.

Original comment by hansonor...@verizon.net on 23 Apr 2010 at 11:23

GoogleCodeExporter commented 9 years ago
Anyway, the problem is that I don't think the GUI module should go in
/usr/lib/python2.6/site-packages/ or so, because it is not intended to be used 
in any
other application, and therefore it should remain in a "private" location.

As an example, wicd (http://wicd.sourceforge.net/) installs to /usr/share/wicd 
the
modules "daemon", "curses", and "gtk"; meant only to be used inside wicd, and
therefore not in the global python path.

The setup.py install method is more a cross-platform way of distributing 
modules or
applications providing externally-accesible modules (such as eric, py2exe or 
so.)

So, well, a setup.py is still possible, but I would not provide the GUI module 
as a
package, I think it would fit better in the data_files section of it. Mmm, and I
think it can be powerful enough to even download and compile fuzemux ;)

Original comment by ssorga...@gmail.com on 24 Apr 2010 at 11:09

GoogleCodeExporter commented 9 years ago
"Anyway, the problem is that I don't think the GUI module should go in
/usr/lib/python2.6/site-packages/ or so, because it is not intended to be used 
in any
other application, and therefore it should remain in a "private" location."

Ok, I'm with you now. :)

Here's a setup.py that "works for me" under a linux enviornment (LinHES -- Arch 
Linux
based)

Original comment by hansonor...@verizon.net on 26 Apr 2010 at 9:49

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you, now it looks fine ;)

Now you can expect v4f 0.5.1 with a setup.py :)

Now that I see it, it may even help in the creation of .deb packages and so. I 
should
investigate about it.

Original comment by ssorga...@gmail.com on 26 Apr 2010 at 10:36

GoogleCodeExporter commented 9 years ago
I'm getting an error on line 37 of setup.py

error: can't copy 'dist/video4fuze': doesn't exist or not a regular file

Original comment by hansonor...@verizon.net on 27 Apr 2010 at 1:30

GoogleCodeExporter commented 9 years ago
Ooops, sorry, I forgot that file ;).

Original comment by ssorga...@gmail.com on 27 Apr 2010 at 9:01