-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
71 lines (58 loc) · 1.86 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
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import io
import re
import subprocess
from os import path
from setuptools import find_packages, setup
from setuptools.command.sdist import sdist as base_sdist
from setuptools.command.bdist_egg import bdist_egg as base_bdist_egg
from wagtailfontawesome import __version__
with open('README.rst', 'r') as readme:
long_description = readme.read()
class assets_mixin:
def compile_assets(self):
try:
subprocess.check_call(['npm', 'run', 'build'])
except (OSError, subprocess.CalledProcessError) as e:
print('Error compiling assets: ' + str(e))
raise SystemExit(1)
class sdist(base_sdist, assets_mixin):
def run(self):
self.compile_assets()
base_sdist.run(self)
class bdist_egg(base_bdist_egg, assets_mixin):
def run(self):
self.compile_assets()
base_bdist_egg.run(self)
setup(
name='wagtailfontawesome',
version=__version__,
description='Add FontAwesome icons to StreamField.',
long_description=long_description,
url='https://gitlab.com/alexgleason/wagtailfontawesome',
author='Alex Gleason',
author_email='[email protected]',
license='MIT',
classifiers=[
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
'Topic :: Internet :: WWW/HTTP',
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
],
keywords='development',
packages=find_packages(),
include_package_data=True,
install_requires=[
"wagtail>=1.4.0",
"Django>=1.7.1",
],
cmdclass={
'sdist': sdist,
'bdist_egg': bdist_egg,
},
)