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


Groups > comp.lang.python > #62674

discover contents of a namespace package

Path csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <brecht@mos6581.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.020
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'installed.': 0.07; 'namespace': 0.09; 'pep': 0.09; 'python': 0.11; 'optional': 0.16; 'received:72.5': 0.16; 'received:72.5.230': 0.16; 'received:sender1.zohomail.com': 0.16; 'received:zohomail.com': 0.16; 'trying': 0.19; 'packages.': 0.19; 'package.': 0.24; 'installed': 0.27; "doesn't": 0.30; "i'm": 0.30; 'this.': 0.32; 'regular': 0.32; 'created': 0.35; 'but': 0.35; 'there': 0.35; 'described': 0.36; 'charset:us-ascii': 0.36; 'thanks': 0.36; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'skip:u 10': 0.60; 'manually': 0.60; 'header:Message-Id:1': 0.63; 'discover': 0.82
Date Tue, 24 Dec 2013 12:57:47 +0100
From Brecht Machiels <brecht@mos6581.org>
To python-list@python.org
Subject discover contents of a namespace package
X-Mailer Sylpheed 3.3.0 (GTK+ 2.24.22; x86_64-unknown-linux-gnu)
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-ZohoMailClient External
X-Zoho-Virus-Status 2
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4587.1387886261.18130.python-list@python.org> (permalink)
Lines 12
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1387886261 news.xs4all.nl 2861 [2001:888:2000:d::a6]:43688
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:62674

Show key headers only | View raw


Hello,

I'm trying to use namespace packages (as described by PEP 420) to manage optional components of my Python package.

I would like to discover which optional components are installed. Unfortunately, I have not found a straightforward way to do this. For regular packages, pkgutil.walk_packages() does this, but this doesn't work for namespace packages. Is there a way to discover the installed contents of a namespace package without manually reading the filesystem?

Is there a way to do this using namespace packages created using pkgutil or pkg_resources?

Thanks
-- 
Brecht Machiels

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


Thread

discover contents of a namespace package Brecht Machiels <brecht@mos6581.org> - 2013-12-24 12:57 +0100

csiph-web