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


Groups > linux.debian.maint.python > #8140

Re: Amend Debian Python Proposal to Include More Python Metadata?

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Scott Kitterman <debian@kitterman.com>
Newsgroups linux.debian.maint.python
Subject Re: Amend Debian Python Proposal to Include More Python Metadata?
Date Sat, 23 Jan 2016 09:30:02 +0100
Message-ID <qU1K2-8qT-11@gated-at.bofh.it> (permalink)
References <qTopk-6qy-11@gated-at.bofh.it> <qTMhZ-62g-15@gated-at.bofh.it> <qU1Am-8nr-13@gated-at.bofh.it>
X-Mailbox-Line From debian-python-request@lists.debian.org Sat Jan 23 08:23:54 2016
Old-Return-Path <debian@kitterman.com>
X-Amavis-Spam-Status No, score=-12.08 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, LDO_WHITELIST=-5, MURPHY_DRUGS_REL8=0.02, PGPSIGNATURE=-5, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham autolearn_force=no
X-Policyd-Weight using cached result; rate: -5
Dkim-Signature v=1; a=rsa-sha256; c=simple/simple; d=kitterman.com; s=201409; t=1453537419; bh=a1RVH9L3mbnyFCqv11WNBxrTZ1aN7p/s7s+6iUaKt6k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oKic39R0Xw/y1r8y1223FDy0vIdrbYOW2qHAFeyI/Cxhr/OTuIfDQcqtmH5EUQztn CL11EhSowQaWxY3Yj8qYHhMGLu+guzSU/ulS5mIsR8zM5Ps+qpzvQ+wZkOmtlZUWUK +B2xwbduT5tn6al00xFWCmpMLIU6G5EjDKTSLows=
User-Agent KMail/4.13.3 (Linux/3.13.0-71-generic; KDE/4.13.3; x86_64; ; )
MIME-Version 1.0
Content-Type multipart/signed; boundary="nextPart1660666.KEKcLTMmWs"; micalg="pgp-sha256"; protocol="application/pgp-signature"
X-Mailing-List <debian-python@lists.debian.org> archive/latest/13463
List-ID <debian-python.lists.debian.org>
List-URL <https://lists.debian.org/debian-python/>
List-Archive https://lists.debian.org/msgid-search/15632703.zBbfEA3r1o@kitterma-e6430
Approved robomod@news.nic.it
Lines 140
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Date Sat, 23 Jan 2016 03:23:39 -0500
X-Original-Message-ID <15632703.zBbfEA3r1o@kitterma-e6430>
X-Original-References <AF6B8D2B-28CC-419A-96DF-180E235DAE60@stufft.io> <E54A8A20-09D4-4D04-BE78-C43E860761A5@stufft.io> <103827328.YrmivsYjLh@kitterma-e6430>
Xref csiph.com linux.debian.maint.python:8140

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Saturday, January 23, 2016 03:13:48 AM Scott Kitterman wrote:
> On Friday, January 22, 2016 10:54:54 AM Donald Stufft wrote:
> > > On Jan 22, 2016, at 10:36 AM, Piotr Ożarowski <piotr@debian.org> wrote:
> > > 
> > > to be honest, I still don't know what you're asking for. What do you
> > > want us to do? Patch 2.7's distutils?
> > 
> > Essentially, ensure that setuptools not distutils is used in a setup.py.
> > There are generally three kinds of setup.py files:
> > 
> > 1) Ones that use setuptools unconditionally - These ones you just leave
> > alone, they are already correct and you should already have a build
> > depends
> > on python-setuptools.
> > 2) Ones that conditionally use setuptools - These ones you just need to
> > satisfy whatever condition the setup.py uses to enable setuptools.
> > Typically this is just checking if setuptools is importable but sometimes
> > they use environment variables or similar.
> > 3) Ones that use distutils unconditionally - These ones you switch to
> > making them use setuptools instead of distutils.
> > 
> > Now, that’s the high level overview, there’s an easier, more automatic way
> > that could maybe just be added to pybuild (Not sure exactly how pybuild
> > 
> > works) where instead of invoking the setup.py as:
> >     python setup.py install (or whatever commands/args you’re passing)
> > 
> > You do it as (taken from pip):
> >     python -c "import setuptools,
> > 
> > tokenize;__file__='$PWD/setup.py';exec(compile(getattr(tokenize, 'open',
> > open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))” install
> > (or whatever commands/args you’re passing).
> > 
> > The thing is kind of ugly, but that will install things using setuptools
> > (just like pip does) regardless of if it imports setuptools or distutils
> > in
> > it’s setup.py file.
> 
> I decided to work on switching something I'm upstream for from distutils to
> setuptools today (since hey, it's the future) and discovered there aren't
> three kinds as listed above.  There are four:
> 
> 4) Packages that use distutils features that aren't available in setuptools
> and break horribly when switched.
> 
> As a result, I think I global change is a non-starter.
> 
> In my particular case, here's what I have (snipped from setup.py) to install
> man pages and a configuration file for an application written in python3:
> 
>     data_files=[(os.path.join('share', 'man', 'man1'),
>       ['policyd-spf.1']), (os.path.join('share', 'man', 'man5'),
>       ['policyd-spf.conf.5']), (os.path.join('/etc', 'python-policyd-spf'),
>       ['policyd-spf.conf']), (os.path.join('share', 'man', 'man5'),
>       ['policyd-spf.peruser.5'])],
> 
> The man pages end up in build/bdist.linux-x86_64/egg as does the config file
> if I remove the leading "/", but it still won't install it.
> 
> codesearch.debian.net claims 720 packages using data_files.  I doubt they
> are all using that pythonically, but they'll need to be checked for
> breakage.
> 
> The standard Google answer to the question of how to install man pages using
> setuptools seems to be use distutils.
> 
> No way can we do any automagic switching.

BTW, it's probably worth mentioning that this particularly burns because the 
setuptools describes this as a feature[1].

> Note, by the way, that this encapsulation of data files means that you can’t
> actually install data files to some arbitrary location on a user’s machine;
> this is a feature, not a bug. You can always include a script in your
> distribution that extracts and copies your the documentation or data files
> to a user-specified location, at their discretion.

Scott K

[1] http://pythonhosted.org/setuptools/setuptools.html#including-data-files

Back to linux.debian.maint.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Amend Debian Python Proposal to Include More Python Metadata? Donald Stufft <donald@stufft.io> - 2016-01-21 15:30 +0100
  Re: Amend Debian Python Proposal to Include More Python Metadata? Paul Tagliamonte <paultag@debian.org> - 2016-01-21 15:50 +0100
    Re: Amend Debian Python Proposal to Include More Python Metadata? Donald Stufft <donald@stufft.io> - 2016-01-21 16:10 +0100
      Re: Amend Debian Python Proposal to Include More Python Metadata? Scott Kitterman <debian@kitterman.com> - 2016-01-21 17:00 +0100
  Re: Amend Debian Python Proposal to Include More Python Metadata? Piotr Ożarowski <piotr@debian.org> - 2016-01-22 16:40 +0100
    Re: Amend Debian Python Proposal to Include More Python Metadata? Donald Stufft <donald@stufft.io> - 2016-01-22 17:00 +0100
      Re: Amend Debian Python Proposal to Include More Python Metadata? Piotr Ożarowski <piotr@debian.org> - 2016-01-22 17:20 +0100
        Re: Amend Debian Python Proposal to Include More Python Metadata? Paul Tagliamonte <paultag@debian.org> - 2016-01-22 17:50 +0100
          Re: Amend Debian Python Proposal to Include More Python Metadata? Piotr Ożarowski <piotr@debian.org> - 2016-01-22 18:20 +0100
        Re: Amend Debian Python Proposal to Include More Python Metadata? Donald Stufft <donald@stufft.io> - 2016-01-22 18:00 +0100
        Re: Amend Debian Python Proposal to Include More Python Metadata? Piotr Ożarowski <piotr@debian.org> - 2016-01-22 18:40 +0100
      Re: Amend Debian Python Proposal to Include More Python Metadata? Scott Kitterman <debian@kitterman.com> - 2016-01-22 18:00 +0100
        Re: Amend Debian Python Proposal to Include More Python Metadata? Donald Stufft <donald@stufft.io> - 2016-01-22 18:20 +0100
          Re: Amend Debian Python Proposal to Include More Python Metadata? Scott Kitterman <debian@kitterman.com> - 2016-01-22 18:50 +0100
            Re: Amend Debian Python Proposal to Include More Python Metadata? Fred Drake <fred@fdrake.net> - 2016-01-22 19:40 +0100
              Re: Amend Debian Python Proposal to Include More Python Metadata? Fred Drake <fred@fdrake.net> - 2016-01-22 19:50 +0100
                Re: Amend Debian Python Proposal to Include More Python Metadata? Scott Kitterman <debian@kitterman.com> - 2016-01-22 20:00 +0100
              Re: Amend Debian Python Proposal to Include More Python Metadata? Scott Kitterman <debian@kitterman.com> - 2016-01-22 19:50 +0100
      Re: Amend Debian Python Proposal to Include More Python Metadata? Scott Kitterman <debian@kitterman.com> - 2016-01-23 09:20 +0100
        Re: Amend Debian Python Proposal to Include More Python Metadata? Scott Kitterman <debian@kitterman.com> - 2016-01-23 09:30 +0100
  Re: Amend Debian Python Proposal to Include More Python Metadata? Barry Warsaw <barry@debian.org> - 2016-01-22 23:40 +0100
    Re: Amend Debian Python Proposal to Include More Python Metadata? Donald Stufft <donald@stufft.io> - 2016-01-23 00:00 +0100
      Re: Amend Debian Python Proposal to Include More Python Metadata? Barry Warsaw <barry@debian.org> - 2016-01-23 00:10 +0100
        Re: Amend Debian Python Proposal to Include More Python Metadata? Donald Stufft <donald@stufft.io> - 2016-01-23 00:20 +0100
      Re: Amend Debian Python Proposal to Include More Python Metadata? Scott Kitterman <debian@kitterman.com> - 2016-01-23 00:10 +0100
        Re: Amend Debian Python Proposal to Include More Python Metadata? Donald Stufft <donald@stufft.io> - 2016-01-23 00:30 +0100
          Re: Amend Debian Python Proposal to Include More Python Metadata? Scott Kitterman <debian@kitterman.com> - 2016-01-23 01:20 +0100
            Re: Amend Debian Python Proposal to Include More Python Metadata? Donald Stufft <donald@stufft.io> - 2016-01-23 02:00 +0100
          pip as distutils/setuptools/setup.py wrapper Piotr Ożarowski <piotr@debian.org> - 2016-01-26 19:30 +0100

csiph-web