From 5f5bda7c3b60eca33af5f9782a27832ca1c4eb37 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Fri, 5 Feb 2010 11:20:58 -0500 Subject: [PATCH] Select an authz module using setuptools' entry points mechainsm. Instead of having each authz package install an invirt.authz module, have them install modules under their own namespace. In their setup.py, they should indicate that their authz module provides a unique name within the invirt.authz entry point group. The new invirt.authz module (part of invirt-base) then gets a name from the configuration and uses that to find the module. svn path=/trunk/packages/xvm-authz-locker/; revision=2989 --- debian/changelog | 7 +++++++ debian/control | 2 -- python/{invirt/authz.py => xvm/authz/locker.py} | 0 setup.py | 8 +++++++- 4 files changed, 14 insertions(+), 3 deletions(-) rename python/{invirt/authz.py => xvm/authz/locker.py} (100%) diff --git a/debian/changelog b/debian/changelog index e4ea2a9..0ad4170 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +xvm-authz-locker (0.0.3) unstable; urgency=low + + * Go back to having an xvm.authz.locker module, but use entry points to + find it. + + -- Evan Broder Fri, 05 Feb 2010 09:38:05 -0500 + xvm-authz-locker (0.0.2) unstable; urgency=low * Install the authz module as invirt.authz, instead of xvm.authz.locker diff --git a/debian/control b/debian/control index fe71df1..cfe51dc 100644 --- a/debian/control +++ b/debian/control @@ -9,8 +9,6 @@ Package: xvm-authz-locker Architecture: all Depends: ${python:Depends}, ${misc:Depends}, invirt-base, python-afs Provides: ${python:Provides}, invirt-authz -Conflicts: invirt-authz -Replaces: invirt-authz Breaks: invirt-base (<< 0.0.28~) XB-Python-Version: ${python:Versions} Description: Authorization module for XVM diff --git a/python/invirt/authz.py b/python/xvm/authz/locker.py similarity index 100% rename from python/invirt/authz.py rename to python/xvm/authz/locker.py diff --git a/setup.py b/setup.py index 919774f..01fecbb 100755 --- a/setup.py +++ b/setup.py @@ -23,6 +23,12 @@ setup( maintainer=maintainer, maintainer_email=maintainer_email, - py_modules = ['invirt.authz'], + py_modules = ['xvm.authz.locker'], package_dir = {'': 'python'}, + + entry_points = { + 'invirt.authz': [ + 'xvm-locker = xvm.authz.locker', + ], + }, ) -- 1.7.9.5