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


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

Re: Application libraries private, Distutils metadata available for console scripts and introspection

From Ben Finney <ben+debian@benfinney.id.au>
Newsgroups linux.debian.maint.python
Subject Re: Application libraries private, Distutils metadata available for console scripts and introspection
Date 2015-09-01 08:10 +0200
Message-ID <q3MVA-6v2-5@gated-at.bofh.it> (permalink)
References <q3JXI-21j-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Ben Finney <ben+debian@benfinney.id.au> writes:

> The application has “console scripts” defined in the Distutils
> `entry_points` mapping:
>
>     $ cat ./setup.py
>     […]
>         entry_points={
>             'console_scripts': [
>                 "foo=FooApp.foo:main",
>                 ],
>             },
>     […]
>
> which installs command-line programs at `/usr/bin/foo`, for example.
> Good.

In an earlier message, a workaround was offered specifically for the
case of user commands (“scripts”): don't use entry points, instead make
symlinks from ‘/usr/share/FooApp/lorem/dolor.py’ to ‘/usr/bin/foo’.

That isn't sufficient, for several reasons:

* A ‘console_script’ entry point specifies a specific function within
  the module. Running the module file as ‘__main__’ isn't always a
  replacement for that.

* Distutils clobbers the execute bit on module files when installing
  them, so telling Debhelper to just make a symlink still doesn't result
  in an executable command.

* This doesn't address the problem that ‘pkg_resources’ still can't find
  the application's distribution metadata.

  Other queries to `pkg_resources` for this application's distribution,
  for example to get the distribution version or homepage URL, will also
  fail.

Would it be correct design for Pybuild to place Python libraries in one
location and the Distutils metadata in a different location; the former
private, the latter available at least to the application itself?

I don't quite know how that would work, but it sounds like what I'd
expect if we're going to have sensible “application private modules in
‘/usr/share/FooApp/’ where they aren't public” behaviour.

-- 
 \     “As scarce as truth is, the supply has always been in excess of |
  `\                                       the demand.” —Josh Billings |
_o__)                                                                  |
Ben Finney

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


Thread

Application libraries private, Distutils metadata available for console scripts and introspection Ben Finney <ben+debian@benfinney.id.au> - 2015-09-01 05:00 +0200
  Re: Application libraries private, Distutils metadata available for  console scripts and introspection Robert Collins <robertc@robertcollins.net> - 2015-09-01 06:50 +0200
    Re: Application libraries private, Distutils metadata available for console scripts and introspection Ben Finney <ben+debian@benfinney.id.au> - 2015-09-01 07:40 +0200
      Re: Application libraries private, Distutils metadata available for  console scripts and introspection Robert Collins <robertc@robertcollins.net> - 2015-09-01 09:40 +0200
  Re: Application libraries private, Distutils metadata available for console scripts and introspection Ben Finney <ben+debian@benfinney.id.au> - 2015-09-01 08:10 +0200
    Re: Application libraries private, Distutils metadata available for  console scripts and introspection Piotr Ożarowski <piotr@debian.org> - 2015-09-01 12:20 +0200
  Re: Application libraries private, Distutils metadata available for console scripts and introspection Ben Finney <ben+debian@benfinney.id.au> - 2015-09-02 10:40 +0200
    Re: Application libraries private, Distutils metadata available for  console scripts and introspection Robert Collins <robertc@robertcollins.net> - 2015-09-02 11:10 +0200
      Re: Application libraries private, Distutils metadata available for  console scripts and introspection Karsten Hilbert <Karsten.Hilbert@gmx.net> - 2015-09-02 11:20 +0200
        Re: Application libraries private, Distutils metadata available for  console scripts and introspection Robert Collins <robertc@robertcollins.net> - 2015-09-02 13:30 +0200
        Re: Application libraries private, Distutils metadata available for  console scripts and introspection Barry Warsaw <barry@debian.org> - 2015-09-02 15:50 +0200
      Re: Application libraries private, Distutils metadata available for console scripts and introspection Ben Finney <ben+debian@benfinney.id.au> - 2015-09-02 12:50 +0200
        Re: Application libraries private, Distutils metadata available for  console scripts and introspection Robert Collins <robertc@robertcollins.net> - 2015-09-02 13:30 +0200
      Re: Application libraries private, Distutils metadata available for  console scripts and introspection Barry Warsaw <barry@debian.org> - 2015-09-02 15:50 +0200
    Re: Application libraries private, Distutils metadata available for  console scripts and introspection Piotr Ożarowski <piotr@debian.org> - 2015-09-03 00:20 +0200

csiph-web