-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
43 lines (31 loc) · 965 Bytes
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env python
from setuptools import setup
from setuptools.command.develop import develop
from setuptools.command.install import install
def friendly(command_subclass):
"""
A decorator for classes subclassing one of the setuptools commands.
It modifies the run() method so that it prints a friendly greeting.
"""
orig_run = command_subclass.run
def modified_run(self):
print "Modified setup run"
orig_run(self)
command_subclass.run = modified_run
return command_subclass
@friendly
class CustomInstallCommand(install):
print "User instalation"
pass
setup(name='myPackage',
version='0.1',
description='My first python package',
author='Marcelo Santos',
author_email='[email protected]',
url='https://github.com/mefsantos/branch-testing',
packages=['.', 'modules'],
# Extension('foo', ['src/foo1.c', 'src/foo2.c']),
cmdclass={
'install': CustomInstallCommand,
},
)