-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
87 lines (75 loc) · 2.57 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import os, sys
from setuptools import setup, find_packages, Command
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
class RunTests(Command):
description = "Run the django test suite from the testproj dir."
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
this_dir = os.getcwd()
testproj_dir = os.path.join(this_dir, "test_project")
os.chdir(testproj_dir)
sys.path.append(testproj_dir)
from django.core.management import execute_manager
os.environ["DJANGO_SETTINGS_MODULE"] = 'test_project.settings'
settings_file = os.environ["DJANGO_SETTINGS_MODULE"]
settings_mod = __import__(settings_file, {}, {}, [''])
execute_manager(settings_mod, argv=[
__file__, "test", "form_designer"])
os.chdir(this_dir)
if 'sdist' in sys.argv:
# clear compiled mo files before building the distribution
walk = os.walk(os.path.join(os.getcwd(), 'form_designer/locale'))
for dirpath, dirnames, filenames in walk:
if not filenames:
continue
if 'django.mo' in filenames:
os.unlink(os.path.join(dirpath, 'django.mo'))
print 'unlink', os.path.join(dirpath, 'django.mo')
else:
# if django is there, compile the po files to mo,
try:
import django
except ImportError:
pass
else:
dir = os.getcwd()
os.chdir(os.path.join(dir, 'form_designer'))
os.system('django-admin.py compilemessages')
os.chdir(dir)
setup(
name='django-form-designer',
version='0.0.0',
description='Rich form designer for django',
author='James Pic',
author_email='[email protected]',
url='http://github.com/yourlabs/django-form-designer',
packages=find_packages(),
cmdclass={'test': RunTests},
include_package_data=True,
zip_safe=False,
long_description=read('README.rst'),
license='MIT',
keywords='django forms',
install_requires=[
'django',
'django-polymodels',
'django-rules',
'django-picklefield',
'django-forms-bootstrap',
'django-crispy-forms',
],
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Topic :: Software Development :: Libraries :: Python Modules',
]
)