-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathsetup.py
45 lines (40 loc) · 1.56 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
from setuptools import setup
VERSION = '1.5-alpha'
PKGNAME = "pyrlang-term"
MODULENAME = "term"
DESCR = 'Erlang term and External Term Format codec in Python and native Rust extension'
AUTHOR = 'Erlang Solutions Ltd and S2HC Sweden AB'
AUTHOR_EMAIL = '[email protected], [email protected]'
URL = "https://github.com/Pyrlang/Term"
with open("README.md", "r", encoding='utf-8') as fp:
LONG_DESCRPTION = fp.read()
LONG_DESCRPTION_CONTENT_TYPE = "text/markdown"
try:
from setuptools_rust import Binding, RustExtension
setup(name=PKGNAME,
version=VERSION,
url=URL,
description=DESCR,
long_description=LONG_DESCRPTION,
long_description_content_type=LONG_DESCRPTION_CONTENT_TYPE,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
rust_extensions=[RustExtension("term.native_codec_impl",
binding=Binding.RustCPython)],
packages=[MODULENAME],
# rust extensions are not zip safe, just like C-extensions.
zip_safe=False)
except Exception as e:
print("----------------------------")
print("Rust build failed, continue with Python slow implementation only")
print("error was:", e)
print("----------------------------")
setup(name=PKGNAME,
version=VERSION,
url=URL,
description=DESCR,
long_description=LONG_DESCRPTION,
long_description_content_type=LONG_DESCRPTION_CONTENT_TYPE,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
packages=[MODULENAME])