-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
83 lines (67 loc) · 2.31 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
import sys
from setuptools import setup, Extension
from distutils.command.sdist import sdist
from distutils.command.build_ext import build_ext
import distutils.cmd
import luastyle
with open('README.rst') as file:
long_description = file.read()
pyx_ext_modules = [Extension("luastyle.indenter",
sources=["luastyle/indenter.pyx", "luastyle/indenter.pxd"],
language='c++')]
ext_modules = [Extension('luastyle.indenter',
sources=['luastyle/indenter.cpp'],
libraries=["stdc++"],
extra_compile_args=['-std=c++11'],
include_dirs=[],
define_macros=[])]
class BuildExt(build_ext):
def run(self):
#import Cython
#import Cython.Build
#Cython.Build.cythonize(pyx_ext_modules, verbose=True)
build_ext.run(self)
class CythonizeCommand(distutils.cmd.Command):
description = 'Cythonize cython files'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import Cython.Build
Cython.Build.cythonize(pyx_ext_modules, verbose=True, language_level=3, annotate=True)
class Sdist(sdist):
def __init__(self, *args, **kwargs):
import Cython.Build
Cython.Build.cythonize(pyx_ext_modules, verbose=True, language_level=3)
sdist.__init__(self, *args, **kwargs)
setup(
name='luastyle',
version=luastyle.__version__,
description='A lua code formatter in Python !',
long_description=long_description,
url='https://github.com/boolangery/py-lua-style',
download_url='https://github.com/boolangery/py-lua-style/archive/' + luastyle.__version__ + '.tar.gz',
author='Eliott Dumeix',
author_email='[email protected]',
license='MIT',
packages=['luastyle', 'luastyle.tests'],
zip_safe=False,
classifiers=[
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7'
],
install_requires=['luaparser>=2.0'],
entry_points={
'console_scripts': [
'luastyle = luastyle.__main__:main'
]
},
ext_modules=ext_modules,
cmdclass={
'build_ext': BuildExt,
'sdist': Sdist,
'cythonize': CythonizeCommand,
}
)