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


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

Re: Installing resource data files and finding them

Started byBen Finney <ben+python@benfinney.id.au>
First post2013-09-09 13:51 +1000
Last post2013-09-09 13:51 +1000
Articles 1 — 1 participant

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

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Installing resource data files and finding them Ben Finney <ben+python@benfinney.id.au> - 2013-09-09 13:51 +1000

#53853 — Re: Installing resource data files and finding them

FromBen Finney <ben+python@benfinney.id.au>
Date2013-09-09 13:51 +1000
SubjectRe: Installing resource data files and finding them
Message-ID<mailman.162.1378698694.5461.python-list@python.org>
Ben Finney <ben+python@benfinney.id.au> writes:

> I will need to change both the build configuration and the application
> code, so that instead it allows the resource files to be installed to
> an appropriate location on the target system, and seeks the data files
> in the correct location when run later.

I've used an ugly hack to work around this problem:

* Patch the ‘MANIFEST.in’ and ‘setup.py’ to omit all mention of the
  resource files. This makes the Python Distutils simply omit the
  resource files and not install them at all.

* Add a series of rules to the package builder to explicitly install the
  resource files to a temporary build location. Make sure these rules
  work for the multiple binary packages and for multiple builds.

* Install the resource files for each package to an FHS-compliant
  location outside the Python package.

* Make a symlink within each installed package to the resource location
  for the package.

That works for now. It's ugly and a maintenance burden, though: I would
hate to need to do this for resource files in every Python package.

> I had hoped to use Python's standard library (Distutils? Distribute?
> Something else?) to access the resources once installed to the correct
> location. This needs to allow the choice of location to be made at
> install-time, but discovered by the application at run-time.

Ideally I wouldn't need to subvert Distutils, but could somehow tell it
what I need and have it record the install-time decisions for the
run-time application's needs.

I'm still hoping there is a standard-library way to do this. Please let
me know.

-- 
 \     “You are welcome to visit the cemetery where famous Russian and |
  `\    Soviet composers, artists, and writers are buried daily except |
_o__)                   Thursday.” —Russian orthodox monastery, Moscow |
Ben Finney

[toc] | [standalone]


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


csiph-web