<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>t+1 - Latest Comments in Need help with data files and setup.py</title><link>http://tplus1.disqus.com/</link><description></description><atom:link href="http://tplus1.disqus.com/need_help_with_data_files_and_setuppy/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Sat, 19 Sep 2009 06:12:02 -0000</lastBuildDate><item><title>Re: Need help with data files and setup.py</title><link>http://blog.tplus1.com/index.php/2009/04/21/need-help-with-data-files-and-setuppy/#comment-16916632</link><description>&lt;p&gt;Where as with 'scripts' you need to use #!/usr/bin/env python -- which requires that the user's environment conform to the application (e.g. on some terminals on my computer this might point to a Python 3 install, and on another terminal it's supporting an old Python 2.3 based app). It also requires that you install the library files into a specific Python's site-packages, and that also has downsides.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">cosmetic dentists surrey</dc:creator><pubDate>Sat, 19 Sep 2009 06:12:02 -0000</pubDate></item><item><title>Re: Need help with data files and setup.py</title><link>http://blog.tplus1.com/index.php/2009/04/21/need-help-with-data-files-and-setuppy/#comment-8597888</link><description>&lt;p&gt;Also consider providing an installer for your application instead. It may be overkill for command-line app with only a couple files which the user needs to customize ... but distutils and setuptools are focused on just managing Python packagaes. If you want to install a python-based application it's nice to have a proper installer. Buildout makes a nice cross-platform install tool - although again that maybe overkill, and you could have a simple '&lt;a href="http://install-pitz-instance.py" rel="nofollow"&gt;install-pitz-instance.py&lt;/a&gt;' script or such that handles copying the files into a user-editable location.&lt;/p&gt;

&lt;p&gt;Also, using entry points is more preferable than using the distutils 'scripts' metadata. The advantage of entry points is that you can write-out the script at install time such that it has a shebang that is hard-coded to a particular Python install and location of the pitz package files. Where as with 'scripts' you need to use #!/usr/bin/env python -- which requires that the user's environment conform to the application (e.g. on some terminals on my computer this might point to a Python 3 install, and on another terminal it's supporting an old Python 2.3 based app). It also requires that you install the library files into a specific Python's site-packages, and that also has downsides.&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Kevin Teague</dc:creator><pubDate>Thu, 23 Apr 2009 00:31:30 -0000</pubDate></item><item><title>Re: Need help with data files and setup.py</title><link>http://blog.tplus1.com/index.php/2009/04/21/need-help-with-data-files-and-setuppy/#comment-8580635</link><description>&lt;p&gt;is installing in "pitz-0.1dev-py2.6.egg" as oposed to just "pitz" the default??&lt;/p&gt;

&lt;p&gt;I thought only easy_install does it like that?&lt;/p&gt;

&lt;p&gt;&lt;a href="http://pip.py" rel="nofollow"&gt;pip.py&lt;/a&gt; OTOH shouldn't do it.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">damjan</dc:creator><pubDate>Wed, 22 Apr 2009 14:52:58 -0000</pubDate></item><item><title>Re: Need help with data files and setup.py</title><link>http://blog.tplus1.com/index.php/2009/04/21/need-help-with-data-files-and-setuppy/#comment-8568529</link><description>&lt;p&gt;OK, now I think I get it.  To pull the stuff out, I gotta use pkg_resources.  Then that library finds the data, regardless of where it might be.&lt;/p&gt;

&lt;p&gt;Thanks for the help.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Matt Wilson</dc:creator><pubDate>Wed, 22 Apr 2009 09:34:52 -0000</pubDate></item><item><title>Re: Need help with data files and setup.py</title><link>http://blog.tplus1.com/index.php/2009/04/21/need-help-with-data-files-and-setuppy/#comment-8560954</link><description>&lt;p&gt;This is the way I have done it in the past: &lt;a href="http://peak.telecommunity.com/DevCenter/setuptools#accessing-data-files-at-runtime" rel="nofollow"&gt;http://peak.telecommunity.com/...&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">David Stanek</dc:creator><pubDate>Tue, 21 Apr 2009 23:45:04 -0000</pubDate></item><item><title>Re: Need help with data files and setup.py</title><link>http://blog.tplus1.com/index.php/2009/04/21/need-help-with-data-files-and-setuppy/#comment-8560750</link><description>&lt;p&gt;Thanks for the help.  I started this task by reading those docs.  My problem is that the files that I describe in data_files get installed to a bizarre place:&lt;/p&gt;

&lt;p&gt;$ cd ~/virtualenvs/scratch/lib/&lt;br&gt;$ find -type f -name '*.sample'&lt;br&gt;./python2.6/site-packages/pitz-0.1dev-py2.6.egg/share/pitz/tracpitz.py.sample&lt;br&gt;./python2.6/site-packages/pitz-0.1dev-py2.6.egg/share/pitz/agilepitz.py.sample&lt;/p&gt;

&lt;p&gt;So it isn't clear how I can find those files from a script later.  pitz-0.1dev is not likely to be a fixed location.  And same with py2.6.egg.&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Matt Wilson</dc:creator><pubDate>Tue, 21 Apr 2009 23:34:31 -0000</pubDate></item><item><title>Re: Need help with data files and setup.py</title><link>http://blog.tplus1.com/index.php/2009/04/21/need-help-with-data-files-and-setuppy/#comment-8560389</link><description>&lt;p&gt;Have you looked at this: &lt;a href="http://peak.telecommunity.com/DevCenter/setuptools#including-data-files" rel="nofollow"&gt;http://peak.telecommunity.com/...&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">David Stanek</dc:creator><pubDate>Tue, 21 Apr 2009 23:16:01 -0000</pubDate></item></channel></rss>
