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


Groups > comp.lang.python > #57772

Re: How to find where data files are installed for my Python program

From Ben Finney <ben+python@benfinney.id.au>
Subject Re: How to find where data files are installed for my Python program
Date 2013-10-28 10:13 +1100
References <00704f33-7e7f-4ccf-b28b-69776d2e237d@googlegroups.com> <526C7FEF.7020206@islandtraining.com> <CAPTjJmqVz8PidbbjXbSn=6M42m=LZg3JBh1mKQr7-FuiqzbOUQ@mail.gmail.com> <mailman.1637.1382848122.18130.python-list@python.org> <bd3ve5F6cjjU1@mid.individual.net>
Newsgroups comp.lang.python
Message-ID <mailman.1668.1382915597.18130.python-list@python.org> (permalink)

Show all headers | View raw


Gregory Ewing <greg.ewing@canterbury.ac.nz> writes:

> Ben Finney wrote:
> > On systems conforming to the Filesystem Hierarchy Standard, it's
> > forbidden: programs go in a platform-specific location
> > <URL:http://refspecs.linuxfoundation.org/FHS_2.3/fhs-2.3.html#USRLIBLIBRARIESFORPROGRAMMINGANDPA>,
> > while platform-independent data files go in a separate location
> > <URL:http://refspecs.linuxfoundation.org/FHS_2.3/fhs-2.3.html#USRSHAREARCHITECTUREINDEPENDENTDATA>.
>
> But Python code itself is platform-independent, so it should count as
> data for the purposes of the FHS, shouldn't it?

True in most cases, but not all (think extension modules, compiled to
architecture-specific bytecode). But you're right, I over-simplified.

The FHS specifies that the first location isn't only for
platform-specific files, but is also for “object files, libraries, and
internal binaries that are not intended to be executed directly by users
or shell scripts”.

The second location is for “all read-only architecture independent data
files” (where the context makes it clear that “data files” is exclusive
of program files).

So, whether Python bytecode is platform-specific or not, it is relegated
by the FHS to a separate location from data files. The separation
requirement remains, and Python's distutils doesn't support it.

What Python facilities do we have for supporting both install-time
decisions about package install layout, and run-time requirements to
find the files wherever they were installed?

-- 
 \         “Two paradoxes are better than one; they may even suggest a |
  `\                                         solution.” —Edward Teller |
_o__)                                                                  |
Ben Finney

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Function for the path of the script? Peter Cacioppi <peter.cacioppi@gmail.com> - 2013-10-26 19:23 -0700
  Re: Function for the path of the script? Skip Montanaro <skip.montanaro@gmail.com> - 2013-10-26 21:42 -0500
  Re: Function for the path of the script? Gary Herron <gary.herron@islandtraining.com> - 2013-10-26 19:52 -0700
  Re: Function for the path of the script? Chris Angelico <rosuav@gmail.com> - 2013-10-27 14:01 +1100
    Re: Function for the path of the script? Grant Edwards <invalid@invalid.invalid> - 2013-10-28 14:49 +0000
      Re: Function for the path of the script? Chris Angelico <rosuav@gmail.com> - 2013-10-29 01:59 +1100
      Re: Function for the path of the script? rurpy@yahoo.com - 2013-10-28 21:00 -0700
        Re: Function for the path of the script? Steven D'Aprano <steve@pearwood.info> - 2013-10-29 05:27 +0000
          Re: Function for the path of the script? Grant Edwards <invalid@invalid.invalid> - 2013-10-29 14:31 +0000
  Re: Function for the path of the script? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-27 03:42 +0000
  Re: Function for the path of the script? Ben Finney <ben+python@benfinney.id.au> - 2013-10-27 15:10 +1100
    Re: Function for the path of the script? Roy Smith <roy@panix.com> - 2013-10-27 09:38 -0400
    Re: Function for the path of the script? Grant Edwards <invalid@invalid.invalid> - 2013-10-28 14:58 +0000
      Re: Function for the path of the script? Ben Finney <ben+python@benfinney.id.au> - 2013-10-29 09:50 +1100
        Re: Function for the path of the script? Grant Edwards <invalid@invalid.invalid> - 2013-10-29 14:26 +0000
  How to find where data files are installed for my Python program (was: Function for the path of the script?) Ben Finney <ben+python@benfinney.id.au> - 2013-10-27 15:28 +1100
    Re: How to find where data files are installed for my Python program (was: Function for the path of the script?) rurpy@yahoo.com - 2013-10-26 22:18 -0700
    Re: How to find where data files are installed for my Python program Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-10-27 20:58 +1300
      Re: How to find where data files are installed for my Python program Ian Kelly <ian.g.kelly@gmail.com> - 2013-10-27 09:50 -0600
      Re: How to find where data files are installed for my Python program Ben Finney <ben+python@benfinney.id.au> - 2013-10-28 10:13 +1100
      Re: How to find where data files are installed for my Python program Ben Finney <ben+python@benfinney.id.au> - 2013-10-28 10:31 +1100
      Re: How to find where data files are installed for my Python program Chris Angelico <rosuav@gmail.com> - 2013-10-28 10:58 +1100
      Re: How to find where data files are installed for my Python program Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-28 00:34 +0000
      Re: How to find where data files are installed for my Python program Chris Angelico <rosuav@gmail.com> - 2013-10-28 17:51 +1100
        Re: How to find where data files are installed for my Python program Roy Smith <roy@panix.com> - 2013-10-28 08:51 -0400
          Re: How to find where data files are installed for my Python program Chris Angelico <rosuav@gmail.com> - 2013-10-29 00:06 +1100
  Re: How to find where data files are installed for my Python program (was: Function for the path of the script?) Chris Angelico <rosuav@gmail.com> - 2013-10-27 16:49 +1100
  Re: Function for the path of the script? Peter Cacioppi <peter.cacioppi@gmail.com> - 2013-10-28 15:57 -0700
  Re: Function for the path of the script? Peter Cacioppi <peter.cacioppi@gmail.com> - 2013-10-28 22:56 -0700

csiph-web