source: trunk/packages/xvm-authz-locker/setup.py @ 3001

Last change on this file since 3001 was 2989, checked in by broder, 15 years ago

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.

  • Property svn:executable set to *
File size: 951 bytes
RevLine 
[2602]1#!/usr/bin/python
2
3from os import path
4from email.utils import parseaddr
5from glob import glob
[2766]6from setuptools import setup
[2602]7
8try:
9    from debian_bundle.changelog import Changelog
10    from debian_bundle.deb822 import Deb822
11    version = Changelog(open(path.join(path.dirname(__file__), 'debian/changelog')).read()).\
12        get_version().full_version
13
14    maintainer_full = Deb822(open(path.join(path.dirname(__file__), 'debian/control')))['Maintainer']
15    maintainer, maintainer_email = parseaddr(maintainer_full)
16except:
17    version = '0.0.0'
18    maintainer, maintainer_email = parseaddr('Invirt project <invirt@mit.edu>')
19
20setup(
21    name='xvm.authz.locker',
22    version=version,
23    maintainer=maintainer,
24    maintainer_email=maintainer_email,
25   
[2989]26    py_modules = ['xvm.authz.locker'],
[2602]27    package_dir = {'': 'python'},
[2989]28
29    entry_points = {
30        'invirt.authz': [
31            'xvm-locker = xvm.authz.locker',
32            ],
33        },
[2602]34)
Note: See TracBrowser for help on using the repository browser.