-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsetup.py
70 lines (59 loc) · 2.26 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
import re
from setuptools import find_packages, setup
(__version__,) = re.findall('__version__ = "(.*)"', open("lark_cython/__init__.py").read())
# python .\setup.py build_ext --inplace
# Delayed import; https://stackoverflow.com/questions/37471313/setup-requires-with-cython
try:
from Cython.Build import cythonize
except ImportError:
def cythonize(*args, **kwargs):
from Cython.Build import cythonize
return cythonize(*args, **kwargs)
def parse_description():
"""
Parse the description in the README file
"""
from os.path import dirname, join, exists
readme_fpath = join(dirname(__file__), "README.md")
# This breaks on pip install, so check that it exists.
if exists(readme_fpath):
with open(readme_fpath, "r") as f:
text = f.read()
return text
return ""
setup(
name="lark-cython",
version=__version__,
packages=find_packages(),
ext_modules=cythonize("lark_cython/*.pyx"), # accepts a glob pattern
requires=["Cython"],
install_requires=["lark>=1.1.7", "cython>=3.0,<3.1", "Cython>=3.0,<3.1"],
setup_requires=["Cython"],
author="Erez Shinan",
author_email="[email protected]",
description="A Lark plugin that optimizes LALR parsing using Cython",
keywords="Lark LALR parser optimized Cython",
url="https://github.com/lark-parser/lark_cython",
long_description=parse_description(),
long_description_content_type="text/markdown",
license="MIT",
python_requires=">=3.6",
classifiers=[
# List of classifiers available at:
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"License :: OSI Approved :: MIT License",
# Supported Python versions
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
)