Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 59 lines (49 sloc) 1.585 kb
d68561f @saxix initial commit
authored
1 #!/usr/bin/env python
2 from distutils.core import setup
3 from distutils.command.install import INSTALL_SCHEMES
4 import os
5 import bh as app
6
7 VERSION = RELEASE = app.get_version()
8 NAME = app.NAME
9
10
11 for scheme in INSTALL_SCHEMES.values():
12 scheme['data'] = scheme['purelib']
13
1679623 redis
Julien Aubert authored
14
d68561f @saxix initial commit
authored
15 def fullsplit(path, result=None):
16 """
17 Split a pathname into components (the opposite of os.path.join) in a
18 platform-neutral way.
19 """
20 if result is None:
21 result = []
22 head, tail = os.path.split(path)
23 if head == '':
24 return [tail] + result
25 if head == path:
26 return result
27 return fullsplit(head, [tail] + result)
28
29
1679623 redis
Julien Aubert authored
30 def scan_dir(target, _packages=None, _data_files=None):
d68561f @saxix initial commit
authored
31 packages = _packages or []
32 data_files = _data_files or []
33 for dir_path, dir_names, file_names in os.walk(target):
34 # Ignore dir_names that start with '.'
35 for i, dir_name in enumerate(dir_names):
1679623 redis
Julien Aubert authored
36 if dir_name.startswith('.'):
37 del dir_names[i]
d68561f @saxix initial commit
authored
38 if '__init__.py' in file_names:
39 packages.append('.'.join(fullsplit(dir_path)))
40 elif file_names:
41 data_files.append([dir_path, [os.path.join(dir_path, f) for f in file_names]])
42 return packages, data_files
43
44 packages, data_files = scan_dir('bh')
45
46 setup(
47 name=NAME,
48 version=RELEASE,
49 url='https://github.com/saxix/django-buildhost',
50 author='sax',
51 author_email='sax@os4d.org',
52 license='BSD',
53 packages=packages,
54 data_files=data_files,
55 platforms=['any'],
56 classifiers=[],
57 long_description=open('README').read()
58 )
Something went wrong with that request. Please try again.