Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Packaging software for Cheeseshop and Debian

 
   Soft32 Home -> Linux -> Python RSS
Next:  its free for debian-python@lists.debian.org  
Author Message
Ben Finney

External


Since: Mar 02, 2007
Posts: 5



(Msg. 1) Posted: Wed Oct 10, 2007 10:20 pm
Post subject: Packaging software for Cheeseshop and Debian
Archived from groups: linux>debian>maint>python (more info?)

Howdy all,

In the thread Message-ID: <87y7enxx7d.fsf DeleteThis @benfinney.id.au>, I asked
about package-private modules interacting with setuptools and the
Debian Python policy. In retrospect it seems I've got some more
fundamental learning to do.

I'm not well-versed in Python setuptools or distutils, so I'm probably
making many mistakes. I've read the documentation for both, but it's
not gelling in my mind.

Moreover, I want to package software using setuptools *and* package
the same software for Debian. Hence, I run into the issues familiar to
most on this list, where the practices of setuptools users and
developers clash with the practices of Debian packaging.

There doesn't seem to be a great deal of common ground: most of what
the setuptools folks recommend is contradicted by what the Debian
packagers of Python software recommend. No doubt both have their good
and bad arguments for their way of doing things.

Meanwhile, I'm stuck trying to learn how to satisfy both, because
complying with active conventions and standards is valuable enough to
work at.


So, I ask for help with this specific package, in the hope that I can
learn more general lessons about packaging software for both Python's
Cheeseshop and the Debian package system.

<URL:http://cheeseshop.python.org/pypi/gracie/>
<URL:http://pypi.python.org/packages/source/g/gracie/gracie-0.2.5.tar.gz>

When I run './setup.py bdist_egg', I get an egg containing *only* the
modules, not the program 'bin/gracied'. What am I doing wrong that is
omitting the program from the package? How do I ensure that it will be
installed properly from the package?

Also, when installing this package, the destination for the modules is
the system 'site-packages' directory. These modules, though, are
specific to this package and its programs; I'd prefer to have them
installed to a different place, but have no idea how to specify that
as part of the package metadata or in the 'setup.py'.

(I'm *not* talking about the install-time option of *overriding* the
default location, but rather to set the location default in the
'setup.py' or other package configuration.)


As for packaging this for Debian, what do I need to do in addition to
addressing the above? Bear in mind that I intend to continue
maintaining this as a setuptools package "upstream", for two reasons:
I want the benefits of setuptools as already described elsewhere, and
I want to know how to do this when I'm *not* the upstream developer.

Thanks for reading, and I hope my learning process can be instructive
to others.

--
\ "Once consumers can no longer get free music, they will have to |
`\ buy the music in the formats we choose to put out." -- Steve |
_o__) Heckler, VP of Sony Music, 2001 |
Ben Finney


--
To UNSUBSCRIBE, email to debian-python-REQUEST DeleteThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster DeleteThis @lists.debian.org
Back to top
Login to vote
Ben Finney

External


Since: May 17, 2007
Posts: 102



(Msg. 2) Posted: Wed Oct 17, 2007 2:00 am
Post subject: Re: Packaging software for Cheeseshop and Debian [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ben Finney <ben.TakeThisOut@benfinney.id.au> writes:

> In the thread Message-ID: <87y7enxx7d.fsf.TakeThisOut@benfinney.id.au>, I asked
> about package-private modules interacting with setuptools and the
> Debian Python policy. In retrospect it seems I've got some more
> fundamental learning to do.
>
> I'm not well-versed in Python setuptools or distutils, so I'm probably
> making many mistakes. I've read the documentation for both, but it's
> not gelling in my mind.

This continues to be the case, in the absence of any informative
response. Does no-one have answers to these questions that seem
fundamental for packaging Python programs in a way friendly to Debian?

--
\ "I would rather be exposed to the inconveniences attending too |
`\ much liberty than those attending too small a degree of it." |
_o__) —Thomas Jefferson |
Ben Finney


--
To UNSUBSCRIBE, email to debian-python-REQUEST.TakeThisOut@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.TakeThisOut@lists.debian.org
Back to top
Login to vote
Ben Finney

External


Since: May 17, 2007
Posts: 102



(Msg. 3) Posted: Sun Oct 21, 2007 9:20 pm
Post subject: Re: Packaging software for Cheeseshop and Debian [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Sam Clegg <sam.TakeThisOut@superduper.net> writes:

> On Thu, 2007-10-11 at 11:08 +1000, Ben Finney wrote:
> > So, I ask for help with this specific package, in the hope that I
> > can learn more general lessons about packaging software for both
> > Python's Cheeseshop and the Debian package system.
>
> From the looks of your package I don't suppose you're looking for
> such a simple answer but the normal way to package executable
> scripts would be to specify "scripts = ['bin/gracied']" in your
> setup,py

Thank you for your reply.

Okay, now that I have that, the program is detected and installed in
the correct location ('/usr/bin/gracied').

Unfortunately, it doesn't run, failing with an ImportError. The
modules are not installed to '/usr/lib/pythonX.Y/...', but only to
'/usr/share/pycentral/gracie/site-packages/gracie/' which isn't on the
system path for Python modules.

A 'find /' for the modules shows that they *only* exist in that
location. Isn't 'python-central' supposed to automatically put them in
the version-specific locations?

> I don't know if setuptools or distutils supports packaging private
> modules.

Then what is meant by the Python policy speaking of such things?

> Is there a particular reason you want to keep it private and not
> installed it alongside other python modules?

The modules are not packaged to be a 'python-gracie' system library
module; instead, they're in support of a specific application only. I
was under the impression that the Debian Python steering team wants to
discourage installing application-specific libraries to the
system-library location.

--
\ "If you continue running Windows, your system may become |
`\ unstable." -- Microsoft, Windows 95 BSOD message |
_o__) |
Ben Finney


--
To UNSUBSCRIBE, email to debian-python-REQUEST.TakeThisOut@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.TakeThisOut@lists.debian.org
Back to top
Login to vote
Bernd Zeimetz

External


Since: Dec 16, 2006
Posts: 123



(Msg. 4) Posted: Wed Oct 24, 2007 5:10 am
Post subject: Re: Packaging software for Cheeseshop and Debian [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> I develop and package webcheck [0] (a python application with private
> modules). I put all stuff in /usr/share/webcheck and use python-support
> for compiling the stuff there. I ship an /usr/bin/webcheck symlink
> to /usr/share/webcheck/webcheck.py. This seems to work fine.

You can also drop a python script to /usr/bin directly - python doesn;t
try to create .pyc files there, even when runnign as root.

>>> I don't know if setuptools or distutils supports packaging private
>>> modules.
>> Then what is meant by the Python policy speaking of such things?
>
> I have only recently had a look at distutils [1] and have the impression
> that it is only meant for stuff that should end up in the system python
> path (please correct me if I'm wrong).

distutils and setuptools are able to do the same thing, usually you can
just exchange them - with the difference that setuptools is broken most
of the time imho.



--
Bernd Zeimetz
<bernd RemoveThis @bzed.de> <http://bzed.de/>


--
To UNSUBSCRIBE, email to debian-python-REQUEST RemoveThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster RemoveThis @lists.debian.org
Back to top
Login to vote
Ben Finney

External


Since: May 17, 2007
Posts: 102



(Msg. 5) Posted: Wed Oct 24, 2007 5:50 am
Post subject: Re: Packaging software for Cheeseshop and Debian [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Arthur de Jong <adejong RemoveThis @debian.org> writes:

> I develop and package webcheck [0] (a python application with
> private modules). I put all stuff in /usr/share/webcheck and use
> python-support for compiling the stuff there.

Thanks for this response. Unfortunately I've looked at 'webcheck', and
it doesn't teach me how to use Python's distutils to achieve this
(since, as you note, it doesn't use either of them).

My goal is to learn how to package software such that it conforms as
much as possible both to Python packaging convention and Debian
packaging policy.

For the former, that means 'distutils' and, increasingly,
'setuptools'. Hence, packages that don't use either of them aren't
what I need. Thank you for your encouragement anyway!

--
\ "Holy bouncing boiler-plated fits, Batman!" -- Robin |
`\ |
_o__) |
Ben Finney


--
To UNSUBSCRIBE, email to debian-python-REQUEST RemoveThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster RemoveThis @lists.debian.org
Back to top
Login to vote
Simon McVittie

External


Since: Jan 29, 2007
Posts: 5



(Msg. 6) Posted: Wed Oct 24, 2007 6:10 am
Post subject: Re: Packaging software for Cheeseshop and Debian [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 24 Oct 2007 at 10:03:09 +0200, Bernd Zeimetz wrote:
> > I develop and package webcheck [0] (a python application with private
> > modules). I put all stuff in /usr/share/webcheck and use python-support
> > for compiling the stuff there. I ship an /usr/bin/webcheck symlink
> > to /usr/share/webcheck/webcheck.py. This seems to work fine.
>
> You can also drop a python script to /usr/bin directly - python doesn;t
> try to create .pyc files there, even when runnign as root.

This isn't because it's /usr/bin, it's because the file is the main
executable. Python only auto-compiles imported modules, not the
executable itself (i.e. the script on the python command line):

smcv@carbon% cat > foo.py
import bar
print "foo loaded"
smcv@carbon% cat > bar.py
print "bar loaded"
smcv@carbon% python foo.py
bar loaded
foo loaded
smcv@carbon% ls
bar.py bar.pyc foo.py

Also, Python treats symlinks just like real files:

smcv@carbon% ln -s bar.py symlink.py
smcv@carbon% cat > symlink-loader.py
import symlink
print "symlink-loader loaded"
smcv@carbon% python symlink-loader.py
bar loaded
symlink-loader loaded
smcv@carbon% ls --classify
bar.py bar.pyc foo.py symlink-loader.py symlink.py@ symlink.pyc

(Note the existence of symlink.pyc - Python doesn't dereference the
symlink when deciding where to write the pyc file.)

Regards,
Simon
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: OpenPGP key: http://www.pseudorandom.co.uk/2003/contact/ or pgp.net

iD8DBQFHHwsVWSc8zVUw7HYRAquhAJwLDwYoGTMNCKmze6cyIC5NyYo6fgCdF/fY
WPde99fRIqWDOgH14yMwqvs=
=Hm79
-----END PGP SIGNATURE-----


--
To UNSUBSCRIBE, email to debian-python-REQUEST.DeleteThis@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.DeleteThis@lists.debian.org
Back to top
Login to vote
Bernd Zeimetz

External


Since: Dec 16, 2006
Posts: 123



(Msg. 7) Posted: Wed Oct 24, 2007 6:30 am
Post subject: Re: Packaging software for Cheeseshop and Debian [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Simon McVittie wrote:
> On Wed, 24 Oct 2007 at 10:03:09 +0200, Bernd Zeimetz wrote:
>>> I develop and package webcheck [0] (a python application with private
>>> modules). I put all stuff in /usr/share/webcheck and use python-support
>>> for compiling the stuff there. I ship an /usr/bin/webcheck symlink
>>> to /usr/share/webcheck/webcheck.py. This seems to work fine.
>> You can also drop a python script to /usr/bin directly - python doesn;t
>> try to create .pyc files there, even when runnign as root.
>
> This isn't because it's /usr/bin, it's because the file is the main
> executable.

Right, that was worded confusing, indeed.

--
Bernd Zeimetz
<bernd.RemoveThis@bzed.de> <http://bzed.de/>


--
To UNSUBSCRIBE, email to debian-python-REQUEST.RemoveThis@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.RemoveThis@lists.debian.org
Back to top
Login to vote
Bernd Zeimetz

External


Since: Dec 16, 2006
Posts: 123



(Msg. 8) Posted: Wed Oct 24, 2007 6:40 am
Post subject: Re: Packaging software for Cheeseshop and Debian [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> Thanks for this response. Unfortunately I've looked at 'webcheck', and
> it doesn't teach me how to use Python's distutils to achieve this
> (since, as you note, it doesn't use either of them).

Instead of looking at packages you should read the distutils documentation.

--
Bernd Zeimetz
<bernd.DeleteThis@bzed.de> <http://bzed.de/>


--
To UNSUBSCRIBE, email to debian-python-REQUEST.DeleteThis@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.DeleteThis@lists.debian.org
Back to top
Login to vote
Ben Finney

External


Since: May 17, 2007
Posts: 102



(Msg. 9) Posted: Wed Oct 24, 2007 9:20 am
Post subject: Re: Packaging software for Cheeseshop and Debian [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

(Bernd, please preserve attribution lines so we know who wrote what
quoted material.)

Bernd Zeimetz <bernd DeleteThis @bzed.de> writes:

> > Thanks for this response. Unfortunately I've looked at 'webcheck',
> > and it doesn't teach me how to use Python's distutils to achieve
> > this (since, as you note, it doesn't use either of them).
>
> Instead of looking at packages you should read the distutils
> documentation.

I've read the distutils documentation; it's not very helpful. I've
also read the setuptools documentation, which is even less helpful
since it assumes a thorough knowledge of distutils.

I've also read the Debian Python policy, which doesn't mesh that well
with either the distutils or setuptools understanding that I've
gained.

Presumably it *is* possible to take Python packages that use
setuptools, and package them such that they conform with both Python
practice and Debian Python policy. Is that incorrect?

What packages in Debian can people recommend that use setuptools
properly, and are packaged in accordance with the latest Debian Python
policy?

Or is it simply the case that no packages meet that description?

--
\ "No wonder I'm all confused; one of my parents was a woman, the |
`\ other was a man." -- Ashleigh Brilliant |
_o__) |
Ben Finney


--
To UNSUBSCRIBE, email to debian-python-REQUEST DeleteThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster DeleteThis @lists.debian.org
Back to top
Login to vote
Ben Finney

External


Since: May 17, 2007
Posts: 102



(Msg. 10) Posted: Sun Oct 28, 2007 6:00 pm
Post subject: Re: Packaging software for Cheeseshop and Debian [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Sam Clegg <sam DeleteThis @superduper.net> writes:

> On Wed, 2007-10-24 at 22:10 +1000, Ben Finney wrote:
> > What packages in Debian can people recommend that use setuptools
> > properly, and are packaged in accordance with the latest Debian
> > Python policy?
> >
> > Or is it simply the case that no packages meet that description?
>
> I'm sure there are lots of simple packages of modules and/or scripts
> that use only distutils and conform perfectly to the debian policy.

My searching has been in vain so far. I'd love to be proven wrong so
that I can learn from an existing package.

> I'm sure there are people on this list who know more about
> setuptools who should be able to help you out more.

This thread has been active for weeks so far with no such people
making themselves known yet. Perhaps there are no people knowledgeable
about setuptools on this list?

If that's wrong, please chime in!

--
\ "I was in the first submarine. Instead of a periscope, they had |
`\ a kaleidoscope. 'We're surrounded.'" -- Steven Wright |
_o__) |
Ben Finney


--
To UNSUBSCRIBE, email to debian-python-REQUEST DeleteThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster DeleteThis @lists.debian.org
Back to top
Login to vote
Display posts from previous:   
Related Topics:
booting from software-RAID1 with debian on nslu2 - Hi, I have been running a software-RAID1-root for a few months now. After an upgrade of the kernel, the initramfs was....

software patents warning on debian.org - Hi, can someone place a warning about software patents on debian.org? I think it's very important that debian.org..

First Draft proposal for modification of Debian Free Softw.. - A few things first: 1. I am not a Debian Developer, so I can not formally propose a GR or a foundational document..

Packaging with RPM? - I'm using RedHat FC3 and I'm little bit new to the RPM in term of creating packaging. I understood (from the tutorials)...

Packaging with RPM? - I'm using RedHat FC3 and I'm little bit new to the RPM in term of creating packaging. I understood (from the tutorials)...

Packaging with RPM? - I'm using RedHat FC3 and I'm little bit new to the RPM in term of creating packaging. I understood (from the tutorials)...
       Soft32 Home -> Linux -> Python All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 Windows
  Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]