-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
206 lines (183 loc) · 6.33 KB
/
Copy pathpyproject.toml
File metadata and controls
206 lines (183 loc) · 6.33 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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
[build-system]
requires = ["meson-python >= 0.17", "meson >= 1.6", "nanobind >= 2.0"]
build-backend = "mesonpy"
[project]
name = "flatline"
version = "0.1.3.dev0"
description = "Python wrapper around the Ghidra decompiler"
readme = { file = "README.md", content-type = "text/markdown" }
authors = [{ name = "patacca" }]
maintainers = [{ name = "patacca", email = "patacca@autistici.org" }]
requires-python = ">= 3.13"
license = "GPL-3.0-or-later"
license-files = ["LICENSE", "THIRD_PARTY_NOTICES"]
keywords = ["ghidra", "decompiler", "reverse engineering", "binary analysis"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: C++",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Security",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"ghidra-sleigh",
"networkx",
]
[project.urls]
Homepage = "https://github.com/patacca/flatline"
Repository = "https://github.com/patacca/flatline"
Issues = "https://github.com/patacca/flatline/issues"
Documentation = "https://patacca.github.io/flatline/"
Changelog = "https://github.com/patacca/flatline/blob/main/CHANGELOG.md"
[project.scripts]
flatline-xray = "flatline.xray.__main__:_cli_entry"
[project.optional-dependencies]
test = [
"networkx",
"pytest >= 8.0",
"PyYAML >= 6.0",
]
lint = [
"ruff >= 0.9",
"clang-format >= 22.1.1",
]
docs = [
"mkdocs-material >= 9.0",
"mkdocstrings[python] >= 0.24",
"mike >= 2.0",
]
dev = [
"flatline[test,lint]",
"build >= 1.2",
"tox >= 4.0",
"jsonschema >= 4.0",
]
# -- pytest ----------------------------------------------------------------
[tool.pytest.ini_options]
testpaths = ["tests"]
norecursedirs = ["third_party/ogdf", "third_party/libavoid_src"]
markers = [
"unit: Pure-logic tests with no native dependencies (U-xxx)",
"contract: Schema/type stability tests (C-xxx)",
"integration: End-to-end with real decompiler (I-xxx)",
"regression: Output/latency stability baselines (R-xxx)",
"negative: Error-path / rejection tests (N-xxx)",
"requires_native: Needs compiled flatline._flatline_native importable in this test env",
"slow: Long-running tests (perf budgets, batch loops); skipped from default fast runs",
]
# Show skip reasons in short summary; verbose on CI
addopts = "-ra"
# -- ruff ------------------------------------------------------------------
[tool.ruff]
target-version = "py314"
line-length = 99
src = ["src", "tests", "tools"]
extend-exclude = ["third_party/ogdf", "third_party/libavoid_src"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"UP", # pyupgrade
"B", # flake8-bugbear
"SIM", # flake8-simplify
"RUF", # ruff-specific (includes RUF001-003: ambiguous unicode)
"PLC2401", # non-ascii-name
"PLC2403", # non-ascii-import-name
]
[tool.ruff.lint.isort]
combine-as-imports = true
known-first-party = ["flatline", "flatline_dev"]
# -- meson-python ----------------------------------------------------------
[tool.meson-python.args]
setup = ["--vsenv"]
# -- cibuildwheel ----------------------------------------------------------
[tool.cibuildwheel]
build = "cp313-* cp314-*"
skip = "*-win32 *-win_arm64 *-musllinux_*"
build-frontend = "build"
config-settings = {setup-args = ["-Dnative_bridge=enabled", "--vsenv"]}
test-command = "python {project}/tools/flatline_dev/wheel_smoke.py"
[tool.cibuildwheel.linux]
archs = "x86_64 aarch64"
manylinux-x86_64-image = "manylinux_2_28"
manylinux-aarch64-image = "manylinux_2_28"
before-all = "yum install -y zlib-devel"
[tool.cibuildwheel.windows]
archs = "AMD64"
before-build = "pip install delvewheel"
repair-wheel-command = "delvewheel repair -w {dest_dir} {wheel}"
[tool.cibuildwheel.macos]
archs = "x86_64 arm64"
before-all = "brew uninstall --ignore-dependencies llvm@18 2>/dev/null || true; brew install zlib"
[tool.cibuildwheel.macos.environment]
MACOSX_DEPLOYMENT_TARGET = "11.0"
# -- tox -------------------------------------------------------------------
[tool.tox]
requires = ["tox >= 4.0"]
env_list = ["py313", "py314", "lint"]
skip_missing_interpreters = true
[tool.tox.env_run_base]
package = "wheel"
wheel_build_env = ".pkg-{env_name}"
extras = ["test"]
commands = [
["pytest", { replace = "posargs", default = ["-ra"], extend = true }],
]
[tool.tox.env.dev]
package = "skip"
extras = []
# Mirrors [project.optional-dependencies].test; duplicated because
# package = "skip" prevents using extras.
deps = ["networkx", "pytest >= 8.0", "PyYAML >= 6.0"]
set_env = {PYTHONPATH = "{toxinidir}/src:{toxinidir}/tools"}
commands = [
["pytest",
"tests/unit/test_compliance_spec.py",
"tests/unit/test_footprint_spec.py",
"tests/unit/test_artifact_audit_spec.py",
{ replace = "posargs", default = ["-ra"], extend = true }],
]
[tool.tox.env.lint]
package = "skip"
extras = []
# Mirrors [project.optional-dependencies].lint; duplicated because
# package = "skip" prevents using extras.
deps = ["ruff >= 0.9", "clang-format >= 22.1.1"]
commands = [
["ruff", "check", "src/", "tests/", "tools/"],
["ruff", "format", "--check", "src/", "tests/", "tools/"],
["python", "tools/flatline_dev/check_clang_format.py"],
]
allowlist_externals = []
[tool.tox.env.fmt]
package = "skip"
extras = []
deps = ["ruff >= 0.9"]
commands = [
["ruff", "check", "--fix", "src/", "tests/", "tools/"],
["ruff", "format", "src/", "tests/", "tools/"],
]
[tool.tox.env.py313]
base_python = "python3.13"
[tool.tox.env.py314]
base_python = "python3.14"
# Host-feasibility lanes must fail hard if the native bridge does not build.
[tool.tox.env.py314-native]
base_python = "python3.14"
wheel_build_env = ".pkg-py314-native"
set_env = {FLATLINE_REQUIRE_NATIVE_BRIDGE = "1"}
[tool.tox.env.".pkg-py314-native"]
base_python = "python3.14"
pass_env = ["VCPKG_INSTALLATION_ROOT"]
config_settings_prepare_metadata_for_build_wheel = {"setup-args" = "-Dnative_bridge=enabled"}
config_settings_build_wheel = {"setup-args" = "-Dnative_bridge=enabled"}