forked from dabapps/django-email-as-username
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·51 lines (41 loc) · 1.37 KB
/
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
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from distutils.core import setup
import emailusernames
version = emailusernames.__version__
if sys.argv[-1] == 'publish':
os.system("python setup.py sdist upload")
print "You probably want to also tag the version now:"
print " git tag -a %s -m 'version %s'" % (version, version)
print " git push --tags"
sys.exit()
def get_packages(root):
"""
Return root package and all sub-packages.
"""
return [x[0] for x in os.walk(root)
if os.path.exists(os.path.join(x[0], '__init__.py'))]
def get_package_data(root):
"""
Return all files under the root package, that are not in a
package themselves.
"""
walk = [(x[0].replace(root + os.sep, '', 1), x[2])
for x in os.walk(root)
if not os.path.exists(os.path.join(x[0], '__init__.py'))]
file_list = []
for base, files in walk:
file_list.extend([os.path.join(base, file) for file in files])
return {root: file_list}
setup(
name='django-email-as-username',
version=version,
description='User authentication with email addresses instead of usernames.',
author='Tom Christie',
url='https://github.com/dabapps/django-email-as-username',
packages=get_packages('emailusernames'),
package_data=get_package_data('emailusernames'),
license='BSD',
)