forked from Instagram/LibCST
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
41 lines (35 loc) · 1.07 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
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from os import environ
import setuptools
from setuptools_rust import Binding, RustExtension
def no_local_scheme(version: str) -> str:
return ""
setuptools.setup(
setup_requires=["setuptools-rust", "setuptools_scm"],
use_scm_version={
"write_to": "libcst/_version.py",
**(
{"local_scheme": no_local_scheme}
if "LIBCST_NO_LOCAL_SCHEME" in environ
else {}
),
},
packages=setuptools.find_packages(),
package_data={
"libcst": ["py.typed"],
"libcst.tests.pyre": ["*"],
"libcst.codemod.tests": ["*"],
},
test_suite="libcst",
rust_extensions=[
RustExtension(
"libcst.native",
path="native/libcst/Cargo.toml",
binding=Binding.PyO3,
)
],
zip_safe=False, # for mypy compatibility https://mypy.readthedocs.io/en/latest/installed_packages.html
)