Building / making an application

Discussion in 'Python' started by Peter Chant, Aug 2, 2009.

  1. Peter Chant

    Peter Chant Guest

    What is a good way to do this? There are instructions on making modules at:

    http://docs.python.org/distutils/setupscript.html

    however, what do you do if you don't want a module? I'm thinking of where
    I'd like to split the code into several files and have a build / setup
    script put it together and install it somewhere such as /usr/local/bin.
    I'm interested in what the standard way of doing this is.

    Thanks,

    Pete



    --
    http://www.petezilla.co.uk
    Peter Chant, Aug 2, 2009
    #1
    1. Advertising

  2. Peter Chant

    Krishnakant Guest

    On Sun, 2009-08-02 at 20:21 +0100, Peter Chant wrote:
    > What is a good way to do this? There are instructions on making modules at:
    >
    > http://docs.python.org/distutils/setupscript.html
    >
    > however, what do you do if you don't want a module? I'm thinking of where
    > I'd like to split the code into several files and have a build / setup
    > script put it together and install it somewhere such as /usr/local/bin.
    > I'm interested in what the standard way of doing this is.
    >

    Have you considered creating a deb or rpm package for your application?
    Most of the documentation for deb or rpm will talk about make files.
    But even a distutil based python package (with a setup.py) can be made
    into a deb package.
    Then the your requirement will be satisfied at least for most gnu/linux
    based distros.

    happy hacking.
    Krishnakant.
    Krishnakant, Aug 2, 2009
    #2
    1. Advertising

  3. Peter Chant

    Peter Chant Guest

    Krishnakant wrote:


    > Have you considered creating a deb or rpm package for your application?
    > Most of the documentation for deb or rpm will talk about make files.
    > But even a distutil based python package (with a setup.py) can be made
    > into a deb package.
    > Then the your requirement will be satisfied at least for most gnu/linux
    > based distros.


    I'm a slacker, so what I would do would be to make a slack build, the
    slackbuild would take the source and build that. The stage I am at is
    the "how to build the source" stage. Don't really intend to get as far as
    distribution specific packages.

    What I could do is create a script in the source root directory (that sounds
    a bit overblown) that simply concatenates together all the python files in
    the right order and perhaps copies the result to /usr/local/bin or /usr/bin
    as appropriate. Is that the right way to go? It looks like distutils is
    appropriate only for modules.

    OTOH it might be appropriate to put the bulk of an application in a module
    and have a function calling it the only part of the main script.

    Pete

    --
    http://www.petezilla.co.uk
    Peter Chant, Aug 2, 2009
    #3
  4. Peter Chant schrieb:
    > Krishnakant wrote:
    >
    >
    >> Have you considered creating a deb or rpm package for your application?
    >> Most of the documentation for deb or rpm will talk about make files.
    >> But even a distutil based python package (with a setup.py) can be made
    >> into a deb package.
    >> Then the your requirement will be satisfied at least for most gnu/linux
    >> based distros.

    >
    > I'm a slacker, so what I would do would be to make a slack build, the
    > slackbuild would take the source and build that. The stage I am at is
    > the "how to build the source" stage. Don't really intend to get as far as
    > distribution specific packages.
    >
    > What I could do is create a script in the source root directory (that sounds
    > a bit overblown) that simply concatenates together all the python files in
    > the right order and perhaps copies the result to /usr/local/bin or /usr/bin
    > as appropriate. Is that the right way to go? It looks like distutils is
    > appropriate only for modules.
    >
    > OTOH it might be appropriate to put the bulk of an application in a module
    > and have a function calling it the only part of the main script.


    You should consider using setuptools. Then you get an egg that people
    can install, and you can define "console_scripts"-entry-points which
    will be installed into /usr/local/bin or similar locations.

    Diez
    Diez B. Roggisch, Aug 2, 2009
    #4
  5. Peter Chant

    Peter Chant Guest

    Diez B. Roggisch wrote:


    > You should consider using setuptools. Then you get an egg that people
    > can install, and you can define "console_scripts"-entry-points which
    > will be installed into /usr/local/bin or similar locations.


    Interesting, I think I need to have a play with that. The cross platform
    bit could be useful as well.

    Pete

    --
    http://www.petezilla.co.uk
    Peter Chant, Aug 2, 2009
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nigil
    Replies:
    3
    Views:
    382
    Jim Blizzard [MSFT]
    Oct 1, 2003
  2. Chris Welch
    Replies:
    1
    Views:
    325
    S. Justin Gengo
    Nov 25, 2003
  3. Nick
    Replies:
    20
    Views:
    714
    Alvin Bruney
    Jan 7, 2004
  4. Replies:
    5
    Views:
    1,865
    Andrew Thompson
    Jan 12, 2005
  5. Midex
    Replies:
    24
    Views:
    905
Loading...

Share This Page