forked from andreyfedoseev/django-static-precompiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
87 lines (70 loc) · 2.41 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
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import os
import re
import sys
if os.environ.get('USER', '') == 'vagrant':
# Workaround for http://bugs.python.org/issue8876
del os.link
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"],
tests_require=[
"pytest",
"pytest-django",
"pretend",
"libsass",
],
extras_require={
'watch': ['watchdog'],
'libsass': ['libsass']
},
cmdclass={
"test": PyTest
},
)