forked from andreyfedoseev/django-static-precompiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
100 lines (82 loc) · 2.63 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
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import os
import re
import sys
if sys.version_info.major == 2:
install_requires = [
"Django>=1.7,<2.0",
]
elif sys.version_info.major == 3:
install_requires = [
"Django>=1.9",
]
else:
raise AssertionError()
if sys.version_info < (3, 5):
install_requires += [
"typing",
]
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
def read(fname):
path = os.path.join(os.path.dirname(__file__), fname)
if sys.version < '3':
return open(path).read()
return open(path, encoding="utf-8").read()
README = read('README.rst')
CHANGES = read('CHANGES.rst')
version = ""
with open("static_precompiler/__init__.py") as fd:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)
if not version:
raise RuntimeError('Cannot find version information')
setup(
name="django-static-precompiler",
packages=find_packages(),
version=version,
author="Andrey Fedoseev",
author_email="[email protected]",
url="https://github.com/andreyfedoseev/django-static-precompiler",
description="Django template tags to compile all kinds of static files "
"(SASS, LESS, Stylus, CoffeeScript, Babel, LiveScript, Handlebars).",
long_description="\n\n".join([README, CHANGES]),
classifiers=[
'Development Status :: 4 - Beta',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Topic :: Internet :: WWW/HTTP',
],
keywords=["sass", "scss", "less", "stylus", "css", "coffeescript", "javascript", "babel", "livescript",
"handlebars"],
install_requires=install_requires,
tests_require=[
"pytest",
"pytest-django",
"pretend",
"libsass",
],
extras_require={
'watch': ['watchdog'],
'libsass': ['libsass']
},
cmdclass={
"test": PyTest
},
)