-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
executable file
·29 lines (25 loc) · 1006 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
#!/usr/bin/env python3
import os
from distutils.core import setup
from distutils.command.build_py import build_py
from setuptools import find_packages
class build( build_py ):
def run( self ):
# get all the .py files, unless they end in _test.py
# we don't need testing files in our published product
for package in self.packages:
package_dir = self.get_package_dir( package )
modules = self.find_package_modules( package, package_dir )
for ( package2, module, module_file ) in modules:
assert package == package2
if os.path.basename( module_file ).endswith( '_test.py' ) or os.path.basename( module_file ) == 'tests.py':
continue
self.build_module( module, module_file, package )
setup( name='subcontractor',
version='1.0',
description='SubContractor, Doer of Contractor',
author='Peter Howe',
author_email='[email protected]',
packages=find_packages(),
cmdclass={ 'build_py': build }
)