Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #15451 > unrolled thread

easy_install doesn't install non-package *.py file

Started byMakoto Kuwata <kwa@kuwata-lab.com>
First post2011-11-08 13:32 +0900
Last post2011-11-11 05:38 +0900
Articles 4 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  easy_install doesn't install non-package *.py file Makoto Kuwata <kwa@kuwata-lab.com> - 2011-11-08 13:32 +0900
    Re: easy_install doesn't install non-package *.py file Jonathan Hartley <tartley@tartley.com> - 2011-11-10 01:08 -0800
    Re: easy_install doesn't install non-package *.py file Jonathan Hartley <tartley@tartley.com> - 2011-11-10 01:08 -0800
      Re: easy_install doesn't install non-package *.py file Makoto Kuwata <kwa@kuwata-lab.com> - 2011-11-11 05:38 +0900

#15451 — easy_install doesn't install non-package *.py file

FromMakoto Kuwata <kwa@kuwata-lab.com>
Date2011-11-08 13:32 +0900
Subjecteasy_install doesn't install non-package *.py file
Message-ID<mailman.2530.1320726768.27778.python-list@python.org>
I got trouble about easy_install command.

My package:

  README.rst
  setup.py
  foobar/
  foobar/__init__.py
  foobar/data/
  foobar/data/template.py

In the above example, 'foobar/data/template.py' is just a
template data file (= not a python module file).
(notice that 'foobar/data/__init__.py' doesn't exist.)

In this case, 'foobar/data/template.py' file is NOT installed
when trying 'easy_install foobar'.
This is trouble what I got.

I found that:

* foobar.tar.gz created by 'easy_install sdist' contains
  'foobar/data/template.py' correctly.
* foobar.egg created by 'easy_install bdist' doesn't contain
  'foobar/data/template.py' file.

Question: how can I enforce easy_install command to
install 'foobar/data/template.py' (or non-package *.py file)?

--
regars,
makoto kuwata

[toc] | [next] | [standalone]


#15532

FromJonathan Hartley <tartley@tartley.com>
Date2011-11-10 01:08 -0800
Message-ID<mailman.2589.1320916100.27778.python-list@python.org>
In reply to#15451
Hey. I don't know the details, but your setup.py needs to use either the 'package_data' or the 'data_files' entry in the dict you pass to setup. These can specify files you want included in the sdist which aren't package files.

There are many complications with using them though. One of them in particular (I don't remember which one) installs the files you specify in a different place depending on whether the user is installing the sdist from local files (python setup.py install) or using pip, so be sure to test both ways. 

[toc] | [prev] | [next] | [standalone]


#15533

FromJonathan Hartley <tartley@tartley.com>
Date2011-11-10 01:08 -0800
Message-ID<5611883.2927.1320916092038.JavaMail.geo-discussion-forums@yqni5>
In reply to#15451
Hey. I don't know the details, but your setup.py needs to use either the 'package_data' or the 'data_files' entry in the dict you pass to setup. These can specify files you want included in the sdist which aren't package files.

There are many complications with using them though. One of them in particular (I don't remember which one) installs the files you specify in a different place depending on whether the user is installing the sdist from local files (python setup.py install) or using pip, so be sure to test both ways. 

[toc] | [prev] | [next] | [standalone]


#15560

FromMakoto Kuwata <kwa@kuwata-lab.com>
Date2011-11-11 05:38 +0900
Message-ID<mailman.2622.1320957535.27778.python-list@python.org>
In reply to#15533
On Thu, Nov 10, 2011 at 6:08 PM, Jonathan Hartley <tartley@tartley.com> wrote:
> Hey. I don't know the details, but your setup.py needs to use either the 'package_data' or the 'data_files' entry in the dict you pass to setup. These can specify files you want included in the sdist which aren't package files.
>
> There are many complications with using them though. One of them in particular (I don't remember which one) installs the files you specify in a different place depending on whether the user is installing the sdist from local files (python setup.py install) or using pip, so be sure to test both ways.

'package_data' is the solution for my trouble.
Thank you very much, Jonathan.

--
regards,
makoto kuwata

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web