forked from OnroerendErfgoed/atramhasis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
118 lines (103 loc) · 3.54 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import os
import distutils.file_util
import subprocess
from setuptools import setup, find_packages, distutils, Command
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.rst')) as f:
README = f.read()
with open(os.path.join(here, 'CHANGES.rst')) as f:
CHANGES = f.read()
def copy_files_scaffolds(filename, output_dir):
source_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), filename))
dest_dir = os.path.join(os.path.dirname(__file__), 'atramhasis', 'scaffolds', output_dir, filename + '_tmpl')
distutils.file_util.copy_file(source_dir, dest_dir, update=True)
def dojo_build():
print('-'*50)
print('==> check npm dependencies')
libs = str(subprocess.check_output(["npm", "list", "-g", "bower", "grunt-cli"]))
if 'bower' in libs:
bower = True
print('bower OK')
else:
bower = False
print('bower KO, use \'npm install -g bower\' to install')
if 'grunt-cli' in libs:
gruntcli = True
print('grunt-cli OK')
else:
gruntcli = False
print('grunt-cli KO, use \'npm install -g grunt-cli\' to install')
if bower and gruntcli:
print('==> running grunt build')
subprocess.call(["grunt", "-v", "build"], cwd="atramhasis/static/admin")
print('-'*50)
class PrepareScaffold(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
copy_files_scaffolds("requirements.txt", "atramhasis_demo")
copy_files_scaffolds("requirements-dev.txt", "atramhasis_demo")
copy_files_scaffolds("requirements.txt", "atramhasis_scaffold")
copy_files_scaffolds("requirements-dev.txt", "atramhasis_scaffold")
dojo_build()
requires = [
'pyramid',
'pyramid_debugtoolbar',
'pyramid_tm',
'SQLAlchemy',
'transaction',
'zope.sqlalchemy',
'waitress',
'skosprovider',
'skosprovider_sqlalchemy',
'skosprovider_rdf',
'pyramid_skosprovider',
'pyramid_jinja2',
'alembic',
'babel',
'colander',
'requests',
'dogpile.cache',
'six'
]
setup(name='atramhasis',
version='0.3.0',
description='A web based editor for thesauri adhering to the SKOS specification.',
long_description=README + '\n\n' + CHANGES,
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python",
"Framework :: Pyramid",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4"
],
author='Flanders Heritage Agency',
author_email='[email protected]',
url='http://atramhasis.readthedocs.org',
keywords='web wsgi pyramid skos thesaurus',
license='GPLv3',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
test_suite='atramhasis',
install_requires=requires,
entry_points="""\
[paste.app_factory]
main = atramhasis:main
[console_scripts]
initialize_atramhasis_db = atramhasis.scripts.initializedb:main
[pyramid.scaffold]
atramhasis_scaffold=atramhasis.scaffolds:AtramhasisTemplate
atramhasis_demo=atramhasis.scaffolds:AtramhasisDemoTemplate
""",
cmdclass={
'prepare': PrepareScaffold
}
)