fluidattacks_core_filesystem 13.0.0__tar.gz → 15.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/PKG-INFO +1 -1
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/fluidattacks_core/filesystem/defaults.py +20 -0
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/fluidattacks_core/filesystem/partitioning.py +46 -6
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/pyproject.toml +1 -1
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/tests/test_partitioning.py +171 -2
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/uv.lock +1 -1
- fluidattacks_core_filesystem-13.0.0/build/default.nix +0 -19
- fluidattacks_core_filesystem-13.0.0/build/filter.nix +0 -13
- fluidattacks_core_filesystem-13.0.0/flake.lock +0 -303
- fluidattacks_core_filesystem-13.0.0/flake.nix +0 -29
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/.envrc +0 -0
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/.gitignore +0 -0
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/fluidattacks_core/filesystem/__init__.py +0 -0
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/fluidattacks_core/filesystem/detection.py +0 -0
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/fluidattacks_core/filesystem/language.py +0 -0
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/fluidattacks_core/filesystem/parts.py +0 -0
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/fluidattacks_core/filesystem/projects.py +0 -0
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/fluidattacks_core/filesystem/py.typed +0 -0
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/import-linter.cfg +0 -0
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/mypy.ini +0 -0
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/ruff.toml +0 -0
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/tests/__init__.py +0 -0
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/tests/data/partitioning_snapshot.golden.json +0 -0
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/tests/test_defaults.py +0 -0
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/tests/test_extract_db.py +0 -0
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/tests/test_language_detection.py +0 -0
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/tests/test_partitioning_snapshot.py +0 -0
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/tests/test_parts.py +0 -0
- {fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/tests/test_projects.py +0 -0
|
@@ -12,6 +12,7 @@ __all__ = [
|
|
|
12
12
|
"TEST_DATA_DIRS",
|
|
13
13
|
"TEST_FILES",
|
|
14
14
|
"TEST_GLOBS",
|
|
15
|
+
"TEST_SCAFFOLD_GLOBS",
|
|
15
16
|
"VCS_DIRS",
|
|
16
17
|
"Language",
|
|
17
18
|
"MarkerSet",
|
|
@@ -28,6 +29,9 @@ class WorkspaceSpec(TypedDict):
|
|
|
28
29
|
claims: frozenset[str]
|
|
29
30
|
|
|
30
31
|
|
|
32
|
+
BUNDLE_DIR_GLOBS = ["*.xcodeproj", "*.xcworkspace"]
|
|
33
|
+
|
|
34
|
+
|
|
31
35
|
WORKSPACE_MARKERS: dict[str, WorkspaceSpec] = {
|
|
32
36
|
"gradle": {
|
|
33
37
|
"declares": frozenset({"settings.gradle", "settings.gradle.kts"}),
|
|
@@ -527,4 +531,20 @@ TEST_DATA_DIRS = [
|
|
|
527
531
|
]
|
|
528
532
|
|
|
529
533
|
|
|
534
|
+
TEST_SCAFFOLD_GLOBS = [
|
|
535
|
+
"test",
|
|
536
|
+
"tests",
|
|
537
|
+
"test-*",
|
|
538
|
+
"tests-*",
|
|
539
|
+
"*-test",
|
|
540
|
+
"*-tests",
|
|
541
|
+
"*-test-*",
|
|
542
|
+
"*-tests-*",
|
|
543
|
+
"acceptancetest",
|
|
544
|
+
"acceptancetests",
|
|
545
|
+
"example",
|
|
546
|
+
"examples",
|
|
547
|
+
]
|
|
548
|
+
|
|
549
|
+
|
|
530
550
|
EXTENDED_EXCLUDE_DIRS = [*EXCLUDE_DIRS, *TEST_DATA_DIRS, *VCS_DIRS]
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
|
+
import re
|
|
4
5
|
import stat
|
|
5
6
|
from collections import Counter
|
|
6
7
|
from collections.abc import Sequence
|
|
7
8
|
from dataclasses import dataclass
|
|
8
|
-
from fnmatch import fnmatch
|
|
9
|
+
from fnmatch import fnmatch, fnmatchcase
|
|
9
10
|
from pathlib import Path
|
|
10
11
|
from typing import TYPE_CHECKING
|
|
11
12
|
|
|
12
|
-
from .defaults import EXTENDED_EXCLUDE_DIRS
|
|
13
|
+
from .defaults import BUNDLE_DIR_GLOBS, EXTENDED_EXCLUDE_DIRS, TEST_SCAFFOLD_GLOBS
|
|
13
14
|
from .detection import (
|
|
14
15
|
declared_workspaces,
|
|
15
16
|
detect_anchor_language,
|
|
@@ -30,6 +31,10 @@ PotentialPart = tuple[Path, frozenset[Path], str | None]
|
|
|
30
31
|
|
|
31
32
|
_ROOT_PATH_MARKER = Path()
|
|
32
33
|
|
|
34
|
+
_WORD_BOUNDARY: re.Pattern[str] = re.compile(
|
|
35
|
+
r"[^0-9a-zA-Z]+|(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])"
|
|
36
|
+
)
|
|
37
|
+
|
|
33
38
|
|
|
34
39
|
def _generate_part_name(path: Path, root_path: Path) -> str:
|
|
35
40
|
if path == root_path:
|
|
@@ -86,23 +91,58 @@ def _claiming_kinds(dir_path: Path, workspaces: Mapping[Path, frozenset[str]]) -
|
|
|
86
91
|
return frozenset(kinds)
|
|
87
92
|
|
|
88
93
|
|
|
94
|
+
def _is_bundle_name(name: str) -> bool:
|
|
95
|
+
return any(fnmatch(name, pattern) for pattern in BUNDLE_DIR_GLOBS)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def _normalized_dir_name(name: str) -> str:
|
|
99
|
+
return "-".join(part for part in _WORD_BOUNDARY.split(name) if part).lower()
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def _is_scaffold_name(name: str) -> bool:
|
|
103
|
+
normalized = _normalized_dir_name(name)
|
|
104
|
+
return any(fnmatchcase(normalized, pattern) for pattern in TEST_SCAFFOLD_GLOBS)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def _is_pruned(name: str, exclude_dirs: Collection[str]) -> bool:
|
|
108
|
+
return any(fnmatch(name, pattern) for pattern in exclude_dirs) or _is_scaffold_name(name)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def _within_bundle(dir_path: Path, root_path: Path) -> bool:
|
|
112
|
+
current = dir_path
|
|
113
|
+
while current != root_path:
|
|
114
|
+
if _is_bundle_name(current.name):
|
|
115
|
+
return True
|
|
116
|
+
if current == current.parent:
|
|
117
|
+
return False
|
|
118
|
+
current = current.parent
|
|
119
|
+
return False
|
|
120
|
+
|
|
121
|
+
|
|
89
122
|
def _anchor_names(
|
|
90
123
|
dir_path: Path,
|
|
91
124
|
filenames: Sequence[str],
|
|
92
125
|
workspaces: Mapping[Path, frozenset[str]],
|
|
126
|
+
root_path: Path,
|
|
93
127
|
) -> tuple[str, ...]:
|
|
128
|
+
if _within_bundle(dir_path, root_path):
|
|
129
|
+
return ()
|
|
94
130
|
kinds = _claiming_kinds(dir_path, workspaces)
|
|
95
131
|
if not kinds:
|
|
96
132
|
return tuple(filenames)
|
|
97
133
|
return tuple(name for name in filenames if not is_claimed_manifest(name, kinds))
|
|
98
134
|
|
|
99
135
|
|
|
100
|
-
def _discover_potential_parts(listing: DirListing) -> tuple[PotentialPart, ...]:
|
|
136
|
+
def _discover_potential_parts(listing: DirListing, root_path: Path) -> tuple[PotentialPart, ...]:
|
|
101
137
|
workspaces = _workspace_kinds_by_dir(listing)
|
|
102
138
|
return tuple(
|
|
103
139
|
(dir_path, _find_config_files(dir_path, filenames), language.value)
|
|
104
140
|
for dir_path, filenames in listing
|
|
105
|
-
if (
|
|
141
|
+
if (
|
|
142
|
+
language := detect_anchor_language(
|
|
143
|
+
_anchor_names(dir_path, filenames, workspaces, root_path)
|
|
144
|
+
)
|
|
145
|
+
)
|
|
106
146
|
is not None
|
|
107
147
|
)
|
|
108
148
|
|
|
@@ -223,7 +263,7 @@ def _build_single_root_tree(root_path: Path, listing: DirListing) -> PartTree:
|
|
|
223
263
|
|
|
224
264
|
|
|
225
265
|
def decide_part_tree(root_path: Path, listing: DirListing) -> PartTree:
|
|
226
|
-
potential_parts = _discover_potential_parts(listing)
|
|
266
|
+
potential_parts = _discover_potential_parts(listing, root_path)
|
|
227
267
|
if not potential_parts:
|
|
228
268
|
return _build_single_root_tree(root_path, listing)
|
|
229
269
|
|
|
@@ -268,7 +308,7 @@ def _is_member_file(path: Path) -> bool:
|
|
|
268
308
|
def _walk_listing(root_path: Path, exclude_dirs: Collection[str]) -> DirListing:
|
|
269
309
|
listing: list[tuple[Path, tuple[str, ...]]] = []
|
|
270
310
|
for current, dirs, filenames in os.walk(root_path):
|
|
271
|
-
dirs[:] = sorted(d for d in dirs if not
|
|
311
|
+
dirs[:] = sorted(d for d in dirs if not _is_pruned(d, exclude_dirs))
|
|
272
312
|
directory = Path(current)
|
|
273
313
|
kept = (name for name in filenames if _is_member_file(directory / name))
|
|
274
314
|
listing.append((directory, tuple(sorted(kept))))
|
|
@@ -4,6 +4,7 @@ from pathlib import Path
|
|
|
4
4
|
import pytest
|
|
5
5
|
|
|
6
6
|
from fluidattacks_core.filesystem import build_part_tree
|
|
7
|
+
from fluidattacks_core.filesystem.defaults import MANIFEST_MARKERS, TEST_SCAFFOLD_GLOBS
|
|
7
8
|
from fluidattacks_core.filesystem.partitioning import (
|
|
8
9
|
DirListing,
|
|
9
10
|
PotentialPart,
|
|
@@ -13,6 +14,8 @@ from fluidattacks_core.filesystem.partitioning import (
|
|
|
13
14
|
_discover_potential_parts,
|
|
14
15
|
_find_config_files,
|
|
15
16
|
_generate_part_name,
|
|
17
|
+
_is_scaffold_name,
|
|
18
|
+
_normalized_dir_name,
|
|
16
19
|
_owning_part,
|
|
17
20
|
decide_part_tree,
|
|
18
21
|
)
|
|
@@ -40,6 +43,67 @@ _GRADLE_MODULES = (
|
|
|
40
43
|
)
|
|
41
44
|
|
|
42
45
|
|
|
46
|
+
def test_a_directory_name_normalises_across_separators_and_humps() -> None:
|
|
47
|
+
assert _normalized_dir_name("Test") == "test"
|
|
48
|
+
assert _normalized_dir_name("__tests__") == "tests"
|
|
49
|
+
assert _normalized_dir_name("acceptance-test") == "acceptance-test"
|
|
50
|
+
assert (
|
|
51
|
+
_normalized_dir_name("acceptanceTestTransactionInformation")
|
|
52
|
+
== "acceptance-test-transaction-information"
|
|
53
|
+
)
|
|
54
|
+
assert _normalized_dir_name("TESTData") == "test-data"
|
|
55
|
+
assert _normalized_dir_name("e2eTests") == "e2e-tests"
|
|
56
|
+
assert _normalized_dir_name("") == ""
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def test_a_scaffold_name_is_recognised_regardless_of_its_spelling() -> None:
|
|
60
|
+
spellings = (
|
|
61
|
+
"test",
|
|
62
|
+
"Test",
|
|
63
|
+
"TEST",
|
|
64
|
+
"tests",
|
|
65
|
+
"Tests",
|
|
66
|
+
"__tests__",
|
|
67
|
+
"acceptance-test",
|
|
68
|
+
"AcceptanceTest",
|
|
69
|
+
"acceptancetest",
|
|
70
|
+
"acceptanceTestTransactionInformation",
|
|
71
|
+
"unit-tests",
|
|
72
|
+
"IntegrationTests",
|
|
73
|
+
"example",
|
|
74
|
+
"Example",
|
|
75
|
+
"examples",
|
|
76
|
+
)
|
|
77
|
+
assert [name for name in spellings if not _is_scaffold_name(name)] == []
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def test_a_production_name_that_merely_contains_test_is_not_a_scaffold() -> None:
|
|
81
|
+
survivors = (
|
|
82
|
+
"latest",
|
|
83
|
+
"Latest",
|
|
84
|
+
"contest",
|
|
85
|
+
"protest",
|
|
86
|
+
"attestation",
|
|
87
|
+
"testimonials",
|
|
88
|
+
"validateStatus",
|
|
89
|
+
"delegatestatus",
|
|
90
|
+
"MyExample",
|
|
91
|
+
"Testcontainers",
|
|
92
|
+
)
|
|
93
|
+
assert [name for name in survivors if _is_scaffold_name(name)] == []
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def test_no_manifest_name_reads_as_a_scaffold_directory() -> None:
|
|
97
|
+
excluded = sorted(
|
|
98
|
+
name for names in MANIFEST_MARKERS.values() for name in names if _is_scaffold_name(name)
|
|
99
|
+
)
|
|
100
|
+
assert excluded == []
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def test_no_scaffold_glob_is_path_shaped() -> None:
|
|
104
|
+
assert [pattern for pattern in TEST_SCAFFOLD_GLOBS if "/" in pattern] == []
|
|
105
|
+
|
|
106
|
+
|
|
43
107
|
def test_part_names_are_posix_relative_paths() -> None:
|
|
44
108
|
assert _generate_part_name(_ROOT, _ROOT) == "."
|
|
45
109
|
assert _generate_part_name(_ROOT / "web", _ROOT) == "web"
|
|
@@ -53,7 +117,7 @@ def test_config_files_are_found_by_name_and_glob() -> None:
|
|
|
53
117
|
|
|
54
118
|
|
|
55
119
|
def test_only_directories_holding_a_manifest_become_parts() -> None:
|
|
56
|
-
discovered = _discover_potential_parts(_LISTING)
|
|
120
|
+
discovered = _discover_potential_parts(_LISTING, _ROOT)
|
|
57
121
|
assert [(path, language) for path, _, language in discovered] == [
|
|
58
122
|
(_ROOT, "Python"),
|
|
59
123
|
(_ROOT / "web", "JavaScript"),
|
|
@@ -61,7 +125,7 @@ def test_only_directories_holding_a_manifest_become_parts() -> None:
|
|
|
61
125
|
|
|
62
126
|
|
|
63
127
|
def test_a_lone_hint_does_not_make_a_potential_part() -> None:
|
|
64
|
-
assert _discover_potential_parts(((_ROOT / "tools", ("mypy.ini", "tox.ini")),)) == ()
|
|
128
|
+
assert _discover_potential_parts(((_ROOT / "tools", ("mypy.ini", "tox.ini")),), _ROOT) == ()
|
|
65
129
|
|
|
66
130
|
|
|
67
131
|
def test_hierarchy_nests_parts_under_their_nearest_ancestor() -> None:
|
|
@@ -288,6 +352,39 @@ def test_a_gradle_module_without_a_settings_file_anchors_alone() -> None:
|
|
|
288
352
|
assert sorted(tree.parts) == [".", "deployment/acceptance-test"]
|
|
289
353
|
|
|
290
354
|
|
|
355
|
+
def test_an_xcode_bundle_does_not_anchor_beside_its_project() -> None:
|
|
356
|
+
listing = (
|
|
357
|
+
(_ROOT, ("pubspec.yaml",)),
|
|
358
|
+
(_ROOT / "app" / "ios", ("Podfile",)),
|
|
359
|
+
(_ROOT / "app" / "ios" / "Runner.xcodeproj", ("project.pbxproj",)),
|
|
360
|
+
(_ROOT / "app" / "ios" / "Runner.xcworkspace", ("project.pbxproj",)),
|
|
361
|
+
)
|
|
362
|
+
|
|
363
|
+
assert sorted(decide_part_tree(_ROOT, listing).parts) == [".", "app/ios"]
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
def test_a_manifest_nested_inside_a_bundle_does_not_anchor() -> None:
|
|
367
|
+
listing = (
|
|
368
|
+
(_ROOT, ("Podfile",)),
|
|
369
|
+
(_ROOT / "Runner.xcodeproj", ("project.pbxproj",)),
|
|
370
|
+
(_ROOT / "Runner.xcodeproj" / "project.xcworkspace", ("Package.swift",)),
|
|
371
|
+
)
|
|
372
|
+
|
|
373
|
+
assert sorted(decide_part_tree(_ROOT, listing).parts) == ["."]
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
def test_a_root_named_like_a_bundle_still_anchors() -> None:
|
|
377
|
+
root = Path("/Thing.xcodeproj")
|
|
378
|
+
|
|
379
|
+
assert sorted(decide_part_tree(root, ((root, ("project.pbxproj",)),)).parts) == ["."]
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
def test_a_swift_package_outside_a_bundle_still_anchors() -> None:
|
|
383
|
+
listing = ((_ROOT, ("README",)), (_ROOT / "lib", ("Package.swift",)))
|
|
384
|
+
|
|
385
|
+
assert sorted(decide_part_tree(_ROOT, listing).parts) == [".", "lib"]
|
|
386
|
+
|
|
387
|
+
|
|
291
388
|
def _write(root: Path, files: list[str]) -> None:
|
|
292
389
|
for name in files:
|
|
293
390
|
path = root / name
|
|
@@ -423,6 +520,78 @@ def test_a_mock_directory_does_not_anchor_a_part(tmp_path: Path) -> None:
|
|
|
423
520
|
assert [part.name for part in build_part_tree(tmp_path).get_all_parts()] == ["."]
|
|
424
521
|
|
|
425
522
|
|
|
523
|
+
def test_a_capitalised_test_directory_does_not_anchor_a_part(tmp_path: Path) -> None:
|
|
524
|
+
_write(tmp_path, ["go.mod", "Test/package.json", "Tests/pyproject.toml"])
|
|
525
|
+
|
|
526
|
+
assert [part.name for part in build_part_tree(tmp_path).get_all_parts()] == ["."]
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
def test_an_acceptance_test_module_does_not_anchor_a_part(tmp_path: Path) -> None:
|
|
530
|
+
_write(
|
|
531
|
+
tmp_path,
|
|
532
|
+
[
|
|
533
|
+
"settings.gradle",
|
|
534
|
+
"build.gradle",
|
|
535
|
+
"deployment/acceptance-test/settings.gradle",
|
|
536
|
+
"deployment/acceptance-test/build.gradle",
|
|
537
|
+
],
|
|
538
|
+
)
|
|
539
|
+
|
|
540
|
+
assert [part.name for part in build_part_tree(tmp_path).get_all_parts()] == ["."]
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
def test_a_camel_case_test_directory_does_not_anchor_a_part(tmp_path: Path) -> None:
|
|
544
|
+
_write(tmp_path, ["go.mod", "acceptanceTestTransactionInformation/pom.xml"])
|
|
545
|
+
|
|
546
|
+
assert [part.name for part in build_part_tree(tmp_path).get_all_parts()] == ["."]
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
def test_a_flutter_example_app_does_not_anchor_a_part(tmp_path: Path) -> None:
|
|
550
|
+
_write(
|
|
551
|
+
tmp_path,
|
|
552
|
+
[
|
|
553
|
+
"pubspec.yaml",
|
|
554
|
+
"example/pubspec.yaml",
|
|
555
|
+
"example/lib/main.dart",
|
|
556
|
+
"example/android/app/build.gradle",
|
|
557
|
+
],
|
|
558
|
+
)
|
|
559
|
+
|
|
560
|
+
assert [part.name for part in build_part_tree(tmp_path).get_all_parts()] == ["."]
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
def test_a_production_directory_that_reads_like_a_test_still_anchors(tmp_path: Path) -> None:
|
|
564
|
+
_write(
|
|
565
|
+
tmp_path,
|
|
566
|
+
[
|
|
567
|
+
"go.mod",
|
|
568
|
+
"latest/package.json",
|
|
569
|
+
"attestation/pyproject.toml",
|
|
570
|
+
"contest/Gemfile",
|
|
571
|
+
"testimonials/Cargo.toml",
|
|
572
|
+
],
|
|
573
|
+
)
|
|
574
|
+
|
|
575
|
+
names = sorted(part.name for part in build_part_tree(tmp_path).get_all_parts())
|
|
576
|
+
|
|
577
|
+
assert names == [".", "attestation", "contest", "latest", "testimonials"]
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
def test_a_test_directory_is_not_a_member(tmp_path: Path) -> None:
|
|
581
|
+
_write(tmp_path, ["go.mod", "Test/a.go", "acceptance-test/b.go", "example/c.dart"])
|
|
582
|
+
|
|
583
|
+
every_file = {p for part in build_part_tree(tmp_path).get_all_parts() for p in part.files}
|
|
584
|
+
|
|
585
|
+
assert every_file == {Path("go.mod")}
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
def test_a_root_named_like_a_test_suite_still_anchors(tmp_path: Path) -> None:
|
|
589
|
+
root = tmp_path / "tests"
|
|
590
|
+
_write(root, ["go.mod", "main.go"])
|
|
591
|
+
|
|
592
|
+
assert [part.name for part in build_part_tree(root).get_all_parts()] == ["."]
|
|
593
|
+
|
|
594
|
+
|
|
426
595
|
@pytest.mark.skipif(_NO_ROOT, reason="root bypasses directory permissions")
|
|
427
596
|
def test_an_unreadable_root_is_loud_rather_than_empty(tmp_path: Path) -> None:
|
|
428
597
|
root = tmp_path / "repo"
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{ src, workspace_root }:
|
|
2
|
-
{
|
|
3
|
-
inherit src workspace_root;
|
|
4
|
-
root_path = "develops/fluidattacks-core/python/filesystem";
|
|
5
|
-
module_name = "fluidattacks_core";
|
|
6
|
-
pypi_token = {
|
|
7
|
-
method = "oidc";
|
|
8
|
-
};
|
|
9
|
-
override = {
|
|
10
|
-
checks = {
|
|
11
|
-
basedpyright = false;
|
|
12
|
-
};
|
|
13
|
-
configs = {
|
|
14
|
-
import_linter = ../import-linter.cfg;
|
|
15
|
-
mypy = ../mypy.ini;
|
|
16
|
-
ruff = ../ruff.toml;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
}
|
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"nodes": {
|
|
3
|
-
"flake-parts": {
|
|
4
|
-
"inputs": {
|
|
5
|
-
"nixpkgs-lib": "nixpkgs-lib"
|
|
6
|
-
},
|
|
7
|
-
"locked": {
|
|
8
|
-
"lastModified": 1762810396,
|
|
9
|
-
"narHash": "sha256-dxFVgQPG+R72dkhXTtqUm7KpxElw3u6E+YlQ2WaDgt8=",
|
|
10
|
-
"owner": "hercules-ci",
|
|
11
|
-
"repo": "flake-parts",
|
|
12
|
-
"rev": "0bdadb1b265fb4143a75bd1ec7d8c915898a9923",
|
|
13
|
-
"type": "github"
|
|
14
|
-
},
|
|
15
|
-
"original": {
|
|
16
|
-
"owner": "hercules-ci",
|
|
17
|
-
"repo": "flake-parts",
|
|
18
|
-
"type": "github"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"nix_filter": {
|
|
22
|
-
"locked": {
|
|
23
|
-
"lastModified": 1757882181,
|
|
24
|
-
"narHash": "sha256-+cCxYIh2UNalTz364p+QYmWHs0P+6wDhiWR4jDIKQIU=",
|
|
25
|
-
"owner": "numtide",
|
|
26
|
-
"repo": "nix-filter",
|
|
27
|
-
"rev": "59c44d1909c72441144b93cf0f054be7fe764de5",
|
|
28
|
-
"type": "github"
|
|
29
|
-
},
|
|
30
|
-
"original": {
|
|
31
|
-
"owner": "numtide",
|
|
32
|
-
"repo": "nix-filter",
|
|
33
|
-
"type": "github"
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"nixpkgs": {
|
|
37
|
-
"locked": {
|
|
38
|
-
"lastModified": 1758690382,
|
|
39
|
-
"narHash": "sha256-NY3kSorgqE5LMm1LqNwGne3ZLMF2/ILgLpFr1fS4X3o=",
|
|
40
|
-
"owner": "nixos",
|
|
41
|
-
"repo": "nixpkgs",
|
|
42
|
-
"rev": "e643668fd71b949c53f8626614b21ff71a07379d",
|
|
43
|
-
"type": "github"
|
|
44
|
-
},
|
|
45
|
-
"original": {
|
|
46
|
-
"owner": "nixos",
|
|
47
|
-
"ref": "nixos-unstable",
|
|
48
|
-
"repo": "nixpkgs",
|
|
49
|
-
"type": "github"
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
"nixpkgs-lib": {
|
|
53
|
-
"locked": {
|
|
54
|
-
"lastModified": 1761765539,
|
|
55
|
-
"narHash": "sha256-b0yj6kfvO8ApcSE+QmA6mUfu8IYG6/uU28OFn4PaC8M=",
|
|
56
|
-
"owner": "nix-community",
|
|
57
|
-
"repo": "nixpkgs.lib",
|
|
58
|
-
"rev": "719359f4562934ae99f5443f20aa06c2ffff91fc",
|
|
59
|
-
"type": "github"
|
|
60
|
-
},
|
|
61
|
-
"original": {
|
|
62
|
-
"owner": "nix-community",
|
|
63
|
-
"repo": "nixpkgs.lib",
|
|
64
|
-
"type": "github"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
"nixpkgs_2": {
|
|
68
|
-
"locked": {
|
|
69
|
-
"lastModified": 1758690382,
|
|
70
|
-
"narHash": "sha256-NY3kSorgqE5LMm1LqNwGne3ZLMF2/ILgLpFr1fS4X3o=",
|
|
71
|
-
"owner": "nixos",
|
|
72
|
-
"repo": "nixpkgs",
|
|
73
|
-
"rev": "e643668fd71b949c53f8626614b21ff71a07379d",
|
|
74
|
-
"type": "github"
|
|
75
|
-
},
|
|
76
|
-
"original": {
|
|
77
|
-
"owner": "nixos",
|
|
78
|
-
"ref": "nixos-unstable",
|
|
79
|
-
"repo": "nixpkgs",
|
|
80
|
-
"type": "github"
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
"nixpkgs_3": {
|
|
84
|
-
"locked": {
|
|
85
|
-
"lastModified": 1761373498,
|
|
86
|
-
"narHash": "sha256-Q/uhWNvd7V7k1H1ZPMy/vkx3F8C13ZcdrKjO7Jv7v0c=",
|
|
87
|
-
"owner": "nixos",
|
|
88
|
-
"repo": "nixpkgs",
|
|
89
|
-
"rev": "6a08e6bb4e46ff7fcbb53d409b253f6bad8a28ce",
|
|
90
|
-
"type": "github"
|
|
91
|
-
},
|
|
92
|
-
"original": {
|
|
93
|
-
"owner": "nixos",
|
|
94
|
-
"ref": "nixos-unstable",
|
|
95
|
-
"repo": "nixpkgs",
|
|
96
|
-
"type": "github"
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
"nixpkgs_flake": {
|
|
100
|
-
"locked": {
|
|
101
|
-
"lastModified": 1778253243,
|
|
102
|
-
"narHash": "sha256-KkH2QvU6iRLDTGGEwH5jnMqHWj4zMTuHxi1S1zdr01w=",
|
|
103
|
-
"owner": "nixos",
|
|
104
|
-
"repo": "nixpkgs",
|
|
105
|
-
"rev": "4fcda7103530b23c5ca44286344912082aad4220",
|
|
106
|
-
"type": "github"
|
|
107
|
-
},
|
|
108
|
-
"original": {
|
|
109
|
-
"owner": "nixos",
|
|
110
|
-
"repo": "nixpkgs",
|
|
111
|
-
"type": "github"
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
"pyproject-build-systems": {
|
|
115
|
-
"inputs": {
|
|
116
|
-
"nixpkgs": "nixpkgs",
|
|
117
|
-
"pyproject-nix": "pyproject-nix",
|
|
118
|
-
"uv2nix": "uv2nix"
|
|
119
|
-
},
|
|
120
|
-
"locked": {
|
|
121
|
-
"lastModified": 1761781027,
|
|
122
|
-
"narHash": "sha256-YDvxPAm2WnxrznRqWwHLjryBGG5Ey1ATEJXrON+TWt8=",
|
|
123
|
-
"owner": "pyproject-nix",
|
|
124
|
-
"repo": "build-system-pkgs",
|
|
125
|
-
"rev": "795a980d25301e5133eca37adae37283ec3c8e66",
|
|
126
|
-
"type": "github"
|
|
127
|
-
},
|
|
128
|
-
"original": {
|
|
129
|
-
"owner": "pyproject-nix",
|
|
130
|
-
"repo": "build-system-pkgs",
|
|
131
|
-
"type": "github"
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
"pyproject-nix": {
|
|
135
|
-
"inputs": {
|
|
136
|
-
"nixpkgs": [
|
|
137
|
-
"python_builder",
|
|
138
|
-
"pyproject-build-systems",
|
|
139
|
-
"nixpkgs"
|
|
140
|
-
]
|
|
141
|
-
},
|
|
142
|
-
"locked": {
|
|
143
|
-
"lastModified": 1758265079,
|
|
144
|
-
"narHash": "sha256-amLaLNwKSZPShQHzfgmc/9o76dU8xzN0743dWgvYlr8=",
|
|
145
|
-
"owner": "nix-community",
|
|
146
|
-
"repo": "pyproject.nix",
|
|
147
|
-
"rev": "02e9418fd4af638447dca4b17b1280da95527fc9",
|
|
148
|
-
"type": "github"
|
|
149
|
-
},
|
|
150
|
-
"original": {
|
|
151
|
-
"owner": "nix-community",
|
|
152
|
-
"repo": "pyproject.nix",
|
|
153
|
-
"type": "github"
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
"pyproject-nix_2": {
|
|
157
|
-
"inputs": {
|
|
158
|
-
"nixpkgs": "nixpkgs_2"
|
|
159
|
-
},
|
|
160
|
-
"locked": {
|
|
161
|
-
"lastModified": 1762427963,
|
|
162
|
-
"narHash": "sha256-CkPlAbIQ87wmjy5qHibfzk4DmMGBNqFer+lLfXjpP5M=",
|
|
163
|
-
"owner": "pyproject-nix",
|
|
164
|
-
"repo": "pyproject.nix",
|
|
165
|
-
"rev": "4540ea004e04fcd12dd2738d51383d10f956f7b9",
|
|
166
|
-
"type": "github"
|
|
167
|
-
},
|
|
168
|
-
"original": {
|
|
169
|
-
"owner": "pyproject-nix",
|
|
170
|
-
"repo": "pyproject.nix",
|
|
171
|
-
"type": "github"
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
"pyproject-nix_3": {
|
|
175
|
-
"inputs": {
|
|
176
|
-
"nixpkgs": [
|
|
177
|
-
"python_builder",
|
|
178
|
-
"uv2nix",
|
|
179
|
-
"nixpkgs"
|
|
180
|
-
]
|
|
181
|
-
},
|
|
182
|
-
"locked": {
|
|
183
|
-
"lastModified": 1760402624,
|
|
184
|
-
"narHash": "sha256-jF6UKLs2uGc2rtved8Vrt58oTWjTQoAssuYs/0578Z4=",
|
|
185
|
-
"owner": "pyproject-nix",
|
|
186
|
-
"repo": "pyproject.nix",
|
|
187
|
-
"rev": "84c4ea102127c77058ea1ed7be7300261fafc7d2",
|
|
188
|
-
"type": "github"
|
|
189
|
-
},
|
|
190
|
-
"original": {
|
|
191
|
-
"owner": "pyproject-nix",
|
|
192
|
-
"repo": "pyproject.nix",
|
|
193
|
-
"type": "github"
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
"python_builder": {
|
|
197
|
-
"inputs": {
|
|
198
|
-
"nix_filter": "nix_filter",
|
|
199
|
-
"nixpkgs_flake": "nixpkgs_flake",
|
|
200
|
-
"pyproject-build-systems": "pyproject-build-systems",
|
|
201
|
-
"pyproject-nix": "pyproject-nix_2",
|
|
202
|
-
"shell-helpers": "shell-helpers",
|
|
203
|
-
"uv2nix": "uv2nix_2"
|
|
204
|
-
},
|
|
205
|
-
"locked": {
|
|
206
|
-
"dir": "common/utils/python-builder",
|
|
207
|
-
"lastModified": 1787078362,
|
|
208
|
-
"narHash": "sha256-HYL7Rn6SuNjYxkt/PwFLksZjsauCiY+ENbOWryLsIlw=",
|
|
209
|
-
"ref": "refs/heads/trunk",
|
|
210
|
-
"rev": "09fd25a13309eb5e3b5b2a061bb340df3ae5d281",
|
|
211
|
-
"shallow": true,
|
|
212
|
-
"type": "git",
|
|
213
|
-
"url": "ssh://git@gitlab.com/fluidattacks/universe"
|
|
214
|
-
},
|
|
215
|
-
"original": {
|
|
216
|
-
"dir": "common/utils/python-builder",
|
|
217
|
-
"rev": "09fd25a13309eb5e3b5b2a061bb340df3ae5d281",
|
|
218
|
-
"shallow": true,
|
|
219
|
-
"type": "git",
|
|
220
|
-
"url": "ssh://git@gitlab.com/fluidattacks/universe"
|
|
221
|
-
}
|
|
222
|
-
},
|
|
223
|
-
"root": {
|
|
224
|
-
"inputs": {
|
|
225
|
-
"python_builder": "python_builder"
|
|
226
|
-
}
|
|
227
|
-
},
|
|
228
|
-
"shell-helpers": {
|
|
229
|
-
"inputs": {
|
|
230
|
-
"flake-parts": "flake-parts",
|
|
231
|
-
"nixpkgs": [
|
|
232
|
-
"python_builder",
|
|
233
|
-
"nixpkgs_flake"
|
|
234
|
-
]
|
|
235
|
-
},
|
|
236
|
-
"locked": {
|
|
237
|
-
"dir": "common/utils/shell-helpers",
|
|
238
|
-
"lastModified": 1762806066,
|
|
239
|
-
"narHash": "sha256-Wz99Fl7SpPU1NkTHJ36XOo6DjOEAMXCw3ThRABOS2Hs=",
|
|
240
|
-
"ref": "refs/heads/trunk",
|
|
241
|
-
"rev": "d73cfdc7ae9e7f547e22a4481d4c2ccce38b26a8",
|
|
242
|
-
"shallow": true,
|
|
243
|
-
"type": "git",
|
|
244
|
-
"url": "ssh://git@gitlab.com/fluidattacks/universe"
|
|
245
|
-
},
|
|
246
|
-
"original": {
|
|
247
|
-
"dir": "common/utils/shell-helpers",
|
|
248
|
-
"rev": "d73cfdc7ae9e7f547e22a4481d4c2ccce38b26a8",
|
|
249
|
-
"shallow": true,
|
|
250
|
-
"type": "git",
|
|
251
|
-
"url": "ssh://git@gitlab.com/fluidattacks/universe"
|
|
252
|
-
}
|
|
253
|
-
},
|
|
254
|
-
"uv2nix": {
|
|
255
|
-
"inputs": {
|
|
256
|
-
"nixpkgs": [
|
|
257
|
-
"python_builder",
|
|
258
|
-
"pyproject-build-systems",
|
|
259
|
-
"nixpkgs"
|
|
260
|
-
],
|
|
261
|
-
"pyproject-nix": [
|
|
262
|
-
"python_builder",
|
|
263
|
-
"pyproject-build-systems",
|
|
264
|
-
"pyproject-nix"
|
|
265
|
-
]
|
|
266
|
-
},
|
|
267
|
-
"locked": {
|
|
268
|
-
"lastModified": 1758933732,
|
|
269
|
-
"narHash": "sha256-HAmm1GBS1myZCFuog0DC2ZLaynvZtiUI2Crmo+cdQI0=",
|
|
270
|
-
"owner": "pyproject-nix",
|
|
271
|
-
"repo": "uv2nix",
|
|
272
|
-
"rev": "273ce18f913d8559e0d04f820d724308966d7c4d",
|
|
273
|
-
"type": "github"
|
|
274
|
-
},
|
|
275
|
-
"original": {
|
|
276
|
-
"owner": "pyproject-nix",
|
|
277
|
-
"repo": "uv2nix",
|
|
278
|
-
"type": "github"
|
|
279
|
-
}
|
|
280
|
-
},
|
|
281
|
-
"uv2nix_2": {
|
|
282
|
-
"inputs": {
|
|
283
|
-
"nixpkgs": "nixpkgs_3",
|
|
284
|
-
"pyproject-nix": "pyproject-nix_3"
|
|
285
|
-
},
|
|
286
|
-
"locked": {
|
|
287
|
-
"lastModified": 1761872265,
|
|
288
|
-
"narHash": "sha256-i25GRgp2vUOebY70L3NTAgkd+Pr1hnn5xM3qHxH0ONU=",
|
|
289
|
-
"owner": "pyproject-nix",
|
|
290
|
-
"repo": "uv2nix",
|
|
291
|
-
"rev": "74dfb62871be152ad3673b143b0cc56105a4f3c5",
|
|
292
|
-
"type": "github"
|
|
293
|
-
},
|
|
294
|
-
"original": {
|
|
295
|
-
"owner": "pyproject-nix",
|
|
296
|
-
"repo": "uv2nix",
|
|
297
|
-
"type": "github"
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
},
|
|
301
|
-
"root": "root",
|
|
302
|
-
"version": 7
|
|
303
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
description = "Fluid Attacks Core filesystem package.";
|
|
3
|
-
|
|
4
|
-
inputs = {
|
|
5
|
-
python_builder = {
|
|
6
|
-
url = "git+ssh://git@gitlab.com/fluidattacks/universe?shallow=1&rev=09fd25a13309eb5e3b5b2a061bb340df3ae5d281&dir=common/utils/python-builder";
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
outputs =
|
|
11
|
-
{ self, ... }@inputs:
|
|
12
|
-
let
|
|
13
|
-
build_args =
|
|
14
|
-
{
|
|
15
|
-
system,
|
|
16
|
-
python_version,
|
|
17
|
-
nixpkgs,
|
|
18
|
-
builders,
|
|
19
|
-
scripts,
|
|
20
|
-
}:
|
|
21
|
-
import ./build {
|
|
22
|
-
src = import ./build/filter.nix nixpkgs.nix-filter self;
|
|
23
|
-
workspace_root = ./.;
|
|
24
|
-
};
|
|
25
|
-
in
|
|
26
|
-
{
|
|
27
|
-
packages = inputs.python_builder.outputs.build build_args;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/import-linter.cfg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/tests/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/tests/test_defaults.py
RENAMED
|
File without changes
|
{fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/tests/test_extract_db.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/tests/test_parts.py
RENAMED
|
File without changes
|
{fluidattacks_core_filesystem-13.0.0 → fluidattacks_core_filesystem-15.0.0}/tests/test_projects.py
RENAMED
|
File without changes
|