Re: Easy install / setuptools

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gabriel Genellina

    Re: Easy install / setuptools

    En Thu, 29 May 2008 06:29:00 -0300, <Dominique.Holz warth@ch.delaru e.com>
    escribió:
    I'm trying to figure out the "best" way to distribute my own python
    packages. Basicly, what I want is to have something like an
    "installer. exe" (on windows) which puts my package under
    Python/Lib/site-packages (so that it can be found via the PYTHONPATH).
    >
    I've played around a bit with "easy install" and "setuptools " and the
    .egg format. I've already managed to create a "myPackage. egg" file with
    setup tools and "install" (it's just a copying) it ito the site-packages
    directory using "easy install".
    You don't need setuptools at all. Just write a setup.py file using the
    standard distutils module, and execute:

    python setup.py bdist_wininst

    It will create an executable installer. A simple setup.py script looks
    like this:

    ---begin setup.py---
    from distutils.core import setup

    setup(name='My Package',
    version='1.0',
    description='Th is is the description of myPackage',
    packages=['myPackage'],
    )
    ---end setup.py---

    Read the "Distributi ng Python Modules" document in your Python
    installation, or at <http://docs.python.org/dist/dist.html>
    What I was wondering now is if there's a way to actually EXTRACT the egg
    file and put the extracted file (i.e. the .py file) under site-packages.
    And not the .egg?
    Well... don't use an egg in the first place :)
    The problem with egg files is that you can't use
    "open(os.path.j oin(os.path.dir name(__file__), 'myFile')" and I'd need to
    rewrite such code which I'd like to avoid if possible. Also, I don't
    know whether leaving the python scripts packed inside the egg file is
    slower for execution or not...
    There are many other problems with egg files... (did I menction that I
    hate eggs?)

    --
    Gabriel Genellina

  • John Nagle

    #2
    Re: Easy install / setuptools

    Gabriel Genellina wrote:
    En Thu, 29 May 2008 06:29:00 -0300, <Dominique.Holz warth@ch.delaru e.com>
    escribió:
    >
    >I'm trying to figure out the "best" way to distribute my own python
    >packages.
    >
    Well... don't use an egg in the first place :)
    "easy install" usually isn't. It tends to do the wrong thing,
    then leave things in a confused state. Too many things have to
    be set up right before "easy install" works easily.

    "python setup.py" is the de-facto standard.

    Yes, there's no really good, standard solution for Python
    installation.

    John Nagle

    Comment

    Working...