-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathsetup.py
More file actions
55 lines (52 loc) · 1.62 KB
/
setup.py
File metadata and controls
55 lines (52 loc) · 1.62 KB
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
import os
from setuptools import setup, find_packages
from setuptools_rust import RustExtension
# Get the project version from the Rust crate to ensure they are always in sync.
cargo_toml_path = os.path.join(os.path.dirname(__file__), "src/pyspector/_rust_core/Cargo.toml")
with open(cargo_toml_path, "r") as f:
for line in f:
if line.startswith("version ="):
version = line.strip().split("=")[1].strip().strip('"')
break
else:
raise RuntimeError("Could not find version in Cargo.toml")
with open("README.md", encoding="utf-8") as f:
long_description = f.read()
setup(
name="pyspector",
version=version,
author="ParzivalHack",
keywords="static analysis security python rust",
description="A high-performance, security-focused static analysis tool for Python, powered by Rust.",
long_description=long_description,
long_description_content_type="text/markdown",
license="MIT",
packages=find_packages(where="src"),
package_dir={"": "src"},
rust_extensions=[
RustExtension(
"pyspector._rust_core",
path=cargo_toml_path,
)
],
python_requires=">=3.8",
install_requires=[
"click>=8.0",
"toml>=0.10",
"requests>=2.25",
"sarif-om>=1.0",
"jinja2>=3.0",
"textual>=0.60",
'importlib_resources; python_version < "3.9"',
],
entry_points={
"console_scripts": [
"pyspector = pyspector.cli:cli",
],
},
include_package_data=True,
package_data={
"pyspector": ["rules/*.toml"],
},
zip_safe=False,
)