vcsgraph 0.3.2__tar.gz → 0.3.3__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.
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/Cargo.lock +17 -18
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/Cargo.toml +2 -2
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/PKG-INFO +17 -17
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/README.md +14 -14
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/crates/graph/src/graph.rs +1 -1
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/crates/graph/src/tsort.rs +6 -11
- vcsgraph-0.3.3/pyproject.toml +120 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/vcsgraph/__init__.py +1 -1
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/vcsgraph.egg-info/PKG-INFO +17 -17
- vcsgraph-0.3.3/vcsgraph.egg-info/requires.txt +4 -0
- vcsgraph-0.3.2/pyproject.toml +0 -108
- vcsgraph-0.3.2/vcsgraph.egg-info/requires.txt +0 -4
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/COPYING.txt +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/MANIFEST.in +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/crates/graph/Cargo.toml +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/crates/graph/src/bfs.rs +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/crates/graph/src/known_graph.rs +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/crates/graph/src/lib.rs +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/crates/graph/src/parents_provider.rs +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/crates/graph/src/test.rs +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/crates/graph-py/Cargo.toml +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/crates/graph-py/src/lib.rs +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/setup.cfg +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/setup.py +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/vcsgraph/errors.py +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/vcsgraph/graph.py +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/vcsgraph/known_graph.py +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/vcsgraph/py.typed +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/vcsgraph/tests/__init__.py +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/vcsgraph/tests/test_graph.py +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/vcsgraph/tests/test_known_graph.py +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/vcsgraph/tests/test_tsort.py +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/vcsgraph/tsort.py +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/vcsgraph.egg-info/SOURCES.txt +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/vcsgraph.egg-info/dependency_links.txt +0 -0
- {vcsgraph-0.3.2 → vcsgraph-0.3.3}/vcsgraph.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ version = 4
|
|
|
4
4
|
|
|
5
5
|
[[package]]
|
|
6
6
|
name = "graph-py"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.3"
|
|
8
8
|
dependencies = [
|
|
9
9
|
"pyo3",
|
|
10
10
|
"rustc-hash",
|
|
@@ -19,9 +19,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
|
19
19
|
|
|
20
20
|
[[package]]
|
|
21
21
|
name = "lazy_static"
|
|
22
|
-
version = "1.5.
|
|
22
|
+
version = "1.5.1"
|
|
23
23
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
24
|
-
checksum = "
|
|
24
|
+
checksum = "20870f649af7073d53e38067b2a84312175d56ea15217e1b15bc83506ec50afb"
|
|
25
25
|
|
|
26
26
|
[[package]]
|
|
27
27
|
name = "libc"
|
|
@@ -58,9 +58,9 @@ dependencies = [
|
|
|
58
58
|
|
|
59
59
|
[[package]]
|
|
60
60
|
name = "pyo3"
|
|
61
|
-
version = "0.
|
|
61
|
+
version = "0.30.1"
|
|
62
62
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
63
|
-
checksum = "
|
|
63
|
+
checksum = "229ca13b8a15bb0d1487b81ab975bfcd97513416499a8312011b6036e42e0de4"
|
|
64
64
|
dependencies = [
|
|
65
65
|
"libc",
|
|
66
66
|
"once_cell",
|
|
@@ -72,18 +72,18 @@ dependencies = [
|
|
|
72
72
|
|
|
73
73
|
[[package]]
|
|
74
74
|
name = "pyo3-build-config"
|
|
75
|
-
version = "0.
|
|
75
|
+
version = "0.30.1"
|
|
76
76
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
77
|
-
checksum = "
|
|
77
|
+
checksum = "70130e2b6dd1ee589a8788026a429561ca5c40fa7a2fa7914c2282eddae24700"
|
|
78
78
|
dependencies = [
|
|
79
79
|
"target-lexicon",
|
|
80
80
|
]
|
|
81
81
|
|
|
82
82
|
[[package]]
|
|
83
83
|
name = "pyo3-ffi"
|
|
84
|
-
version = "0.
|
|
84
|
+
version = "0.30.1"
|
|
85
85
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
86
|
-
checksum = "
|
|
86
|
+
checksum = "5e7ff73c555c286d212d4ce7e5fbda845a973c4f61bd5f160f5f2c3c2a04d1c4"
|
|
87
87
|
dependencies = [
|
|
88
88
|
"libc",
|
|
89
89
|
"pyo3-build-config",
|
|
@@ -91,9 +91,9 @@ dependencies = [
|
|
|
91
91
|
|
|
92
92
|
[[package]]
|
|
93
93
|
name = "pyo3-macros"
|
|
94
|
-
version = "0.
|
|
94
|
+
version = "0.30.1"
|
|
95
95
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
96
|
-
checksum = "
|
|
96
|
+
checksum = "c46d2e5862c7bb8207e3b639f713dda3c499933444784154c11d013c5a691b60"
|
|
97
97
|
dependencies = [
|
|
98
98
|
"proc-macro2",
|
|
99
99
|
"pyo3-macros-backend",
|
|
@@ -103,13 +103,12 @@ dependencies = [
|
|
|
103
103
|
|
|
104
104
|
[[package]]
|
|
105
105
|
name = "pyo3-macros-backend"
|
|
106
|
-
version = "0.
|
|
106
|
+
version = "0.30.1"
|
|
107
107
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
108
|
-
checksum = "
|
|
108
|
+
checksum = "38b89f066f2ae72a2aef52d1537ca2fcd104440ebfadee06e97aa90738a25b9b"
|
|
109
109
|
dependencies = [
|
|
110
110
|
"heck",
|
|
111
111
|
"proc-macro2",
|
|
112
|
-
"pyo3-build-config",
|
|
113
112
|
"quote",
|
|
114
113
|
"syn",
|
|
115
114
|
]
|
|
@@ -125,15 +124,15 @@ dependencies = [
|
|
|
125
124
|
|
|
126
125
|
[[package]]
|
|
127
126
|
name = "rustc-hash"
|
|
128
|
-
version = "2.1.
|
|
127
|
+
version = "2.1.3"
|
|
129
128
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
130
|
-
checksum = "
|
|
129
|
+
checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"
|
|
131
130
|
|
|
132
131
|
[[package]]
|
|
133
132
|
name = "syn"
|
|
134
|
-
version = "
|
|
133
|
+
version = "3.0.9"
|
|
135
134
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
136
|
-
checksum = "
|
|
135
|
+
checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
|
|
137
136
|
dependencies = [
|
|
138
137
|
"proc-macro2",
|
|
139
138
|
"quote",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vcsgraph
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: Graph algorithms for version control systems
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
7
7
|
License-File: COPYING.txt
|
|
8
8
|
Provides-Extra: dev
|
|
9
|
-
Requires-Dist: mypy==2.
|
|
10
|
-
Requires-Dist: ruff==0.
|
|
9
|
+
Requires-Dist: mypy==2.4.0; extra == "dev"
|
|
10
|
+
Requires-Dist: ruff==0.17.1; extra == "dev"
|
|
11
11
|
Dynamic: license-file
|
|
12
12
|
|
|
13
13
|
# vcsgraph
|
|
@@ -66,10 +66,10 @@ from vcsgraph import topo_sort
|
|
|
66
66
|
|
|
67
67
|
# Define a graph as a list of (node, parents) tuples
|
|
68
68
|
graph = [
|
|
69
|
-
(b
|
|
70
|
-
(b
|
|
71
|
-
(b
|
|
72
|
-
(b
|
|
69
|
+
(b"rev1", []),
|
|
70
|
+
(b"rev2", [b"rev1"]),
|
|
71
|
+
(b"rev3", [b"rev1"]),
|
|
72
|
+
(b"rev4", [b"rev2", b"rev3"]),
|
|
73
73
|
]
|
|
74
74
|
|
|
75
75
|
# Sort nodes topologically (parents before children)
|
|
@@ -83,17 +83,17 @@ from vcsgraph import Graph, DictParentsProvider
|
|
|
83
83
|
|
|
84
84
|
# Create a parents provider from a dictionary
|
|
85
85
|
ancestry = {
|
|
86
|
-
b
|
|
87
|
-
b
|
|
88
|
-
b
|
|
89
|
-
b
|
|
90
|
-
b
|
|
86
|
+
b"rev1": (b"null:",),
|
|
87
|
+
b"rev2a": (b"rev1",),
|
|
88
|
+
b"rev2b": (b"rev1",),
|
|
89
|
+
b"rev3": (b"rev2a",),
|
|
90
|
+
b"rev4": (b"rev3", b"rev2b"),
|
|
91
91
|
}
|
|
92
92
|
parents_provider = DictParentsProvider(ancestry)
|
|
93
93
|
|
|
94
94
|
# Create a graph and find merge bases
|
|
95
95
|
graph = Graph(parents_provider)
|
|
96
|
-
merge_base = graph.find_merge_base(b
|
|
96
|
+
merge_base = graph.find_merge_base(b"rev2a", b"rev2b")
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
### Working with Known Graphs
|
|
@@ -103,14 +103,14 @@ from vcsgraph import KnownGraph
|
|
|
103
103
|
|
|
104
104
|
# Create a known graph from parent relationships
|
|
105
105
|
parent_map = {
|
|
106
|
-
b
|
|
107
|
-
b
|
|
108
|
-
b
|
|
106
|
+
b"rev1": (b"null:",),
|
|
107
|
+
b"rev2": (b"rev1",),
|
|
108
|
+
b"rev3": (b"rev2",),
|
|
109
109
|
}
|
|
110
110
|
kg = KnownGraph(parent_map)
|
|
111
111
|
|
|
112
112
|
# Get heads (revisions with no children)
|
|
113
|
-
heads = kg.heads([b
|
|
113
|
+
heads = kg.heads([b"rev1", b"rev2", b"rev3"])
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
## Performance
|
|
@@ -54,10 +54,10 @@ from vcsgraph import topo_sort
|
|
|
54
54
|
|
|
55
55
|
# Define a graph as a list of (node, parents) tuples
|
|
56
56
|
graph = [
|
|
57
|
-
(b
|
|
58
|
-
(b
|
|
59
|
-
(b
|
|
60
|
-
(b
|
|
57
|
+
(b"rev1", []),
|
|
58
|
+
(b"rev2", [b"rev1"]),
|
|
59
|
+
(b"rev3", [b"rev1"]),
|
|
60
|
+
(b"rev4", [b"rev2", b"rev3"]),
|
|
61
61
|
]
|
|
62
62
|
|
|
63
63
|
# Sort nodes topologically (parents before children)
|
|
@@ -71,17 +71,17 @@ from vcsgraph import Graph, DictParentsProvider
|
|
|
71
71
|
|
|
72
72
|
# Create a parents provider from a dictionary
|
|
73
73
|
ancestry = {
|
|
74
|
-
b
|
|
75
|
-
b
|
|
76
|
-
b
|
|
77
|
-
b
|
|
78
|
-
b
|
|
74
|
+
b"rev1": (b"null:",),
|
|
75
|
+
b"rev2a": (b"rev1",),
|
|
76
|
+
b"rev2b": (b"rev1",),
|
|
77
|
+
b"rev3": (b"rev2a",),
|
|
78
|
+
b"rev4": (b"rev3", b"rev2b"),
|
|
79
79
|
}
|
|
80
80
|
parents_provider = DictParentsProvider(ancestry)
|
|
81
81
|
|
|
82
82
|
# Create a graph and find merge bases
|
|
83
83
|
graph = Graph(parents_provider)
|
|
84
|
-
merge_base = graph.find_merge_base(b
|
|
84
|
+
merge_base = graph.find_merge_base(b"rev2a", b"rev2b")
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
### Working with Known Graphs
|
|
@@ -91,14 +91,14 @@ from vcsgraph import KnownGraph
|
|
|
91
91
|
|
|
92
92
|
# Create a known graph from parent relationships
|
|
93
93
|
parent_map = {
|
|
94
|
-
b
|
|
95
|
-
b
|
|
96
|
-
b
|
|
94
|
+
b"rev1": (b"null:",),
|
|
95
|
+
b"rev2": (b"rev1",),
|
|
96
|
+
b"rev3": (b"rev2",),
|
|
97
97
|
}
|
|
98
98
|
kg = KnownGraph(parent_map)
|
|
99
99
|
|
|
100
100
|
# Get heads (revisions with no children)
|
|
101
|
-
heads = kg.heads([b
|
|
101
|
+
heads = kg.heads([b"rev1", b"rev2", b"rev3"])
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
## Performance
|
|
@@ -1051,7 +1051,7 @@ where
|
|
|
1051
1051
|
.collect();
|
|
1052
1052
|
let mut active: FxHashSet<K> = candidate_heads.iter().cloned().collect();
|
|
1053
1053
|
// Skip the first yield (the candidate itself).
|
|
1054
|
-
for
|
|
1054
|
+
for searcher in searchers.values_mut() {
|
|
1055
1055
|
searcher.next_set(&self.provider);
|
|
1056
1056
|
}
|
|
1057
1057
|
// Common walker: tracks nodes known to be common across all
|
|
@@ -105,17 +105,12 @@ impl<K: Eq + Hash + std::fmt::Debug + Clone> Iterator for TopoSorter<K> {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
self.pending_parents_stack.push(parents);
|
|
115
|
-
} else {
|
|
116
|
-
// if the source graph is empty, we are done.
|
|
117
|
-
return None;
|
|
118
|
-
}
|
|
108
|
+
let node_name = self.graph.keys().next()?.clone();
|
|
109
|
+
let parents = self.graph.remove(&node_name).unwrap();
|
|
110
|
+
// now pick a random node in the source graph, and transfer it to the
|
|
111
|
+
// top of the depth first search stack of pending nodes.
|
|
112
|
+
self.pending_node_stack.push(node_name);
|
|
113
|
+
self.pending_parents_stack.push(parents);
|
|
119
114
|
}
|
|
120
115
|
}
|
|
121
116
|
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools", "wheel", "setuptools-rust"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "vcsgraph"
|
|
7
|
+
description = "Graph algorithms for version control systems"
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
requires-python = ">=3.10"
|
|
10
|
+
license-files = ["COPYING.txt"]
|
|
11
|
+
dynamic = ["version"]
|
|
12
|
+
|
|
13
|
+
[project.optional-dependencies]
|
|
14
|
+
dev = ["mypy==2.4.0", "ruff==0.17.1"]
|
|
15
|
+
|
|
16
|
+
[tool.setuptools]
|
|
17
|
+
packages = ["vcsgraph"]
|
|
18
|
+
|
|
19
|
+
[[tool.setuptools-rust.ext-modules]]
|
|
20
|
+
target = "vcsgraph._graph_rs"
|
|
21
|
+
path = "crates/graph-py/Cargo.toml"
|
|
22
|
+
binding = "PyO3"
|
|
23
|
+
|
|
24
|
+
[tool.setuptools.dynamic]
|
|
25
|
+
version = { attr = "vcsgraph.__version__" }
|
|
26
|
+
|
|
27
|
+
[tool.mypy]
|
|
28
|
+
ignore_missing_imports = true
|
|
29
|
+
|
|
30
|
+
[tool.ruff]
|
|
31
|
+
extend-exclude = ["lib", "bin"]
|
|
32
|
+
|
|
33
|
+
[tool.ruff.lint]
|
|
34
|
+
select = [
|
|
35
|
+
"ANN", # annotations
|
|
36
|
+
"D", # pydocstyle
|
|
37
|
+
"E", # pycodestyle
|
|
38
|
+
"F", # pyflakes
|
|
39
|
+
"N", # naming
|
|
40
|
+
"B", # bugbear
|
|
41
|
+
"I", # isort
|
|
42
|
+
"S", # bandit
|
|
43
|
+
"TCH", # typecheck
|
|
44
|
+
"INT", # gettext
|
|
45
|
+
"SIM", # simplify
|
|
46
|
+
"C4", # comprehensions
|
|
47
|
+
"UP", # pyupgrade
|
|
48
|
+
"RUF", # ruf-specific
|
|
49
|
+
]
|
|
50
|
+
ignore = [
|
|
51
|
+
"ANN001",
|
|
52
|
+
"ANN002",
|
|
53
|
+
"ANN003", # missing-type-arg
|
|
54
|
+
"ANN201",
|
|
55
|
+
"ANN202",
|
|
56
|
+
"ANN204",
|
|
57
|
+
"ANN205",
|
|
58
|
+
"ANN206",
|
|
59
|
+
"D205", # 1 blank line required between summary line and description
|
|
60
|
+
"D417", # Missing argument descriptions in the docstring
|
|
61
|
+
"F821", # undefined-name
|
|
62
|
+
"E501", # line too long
|
|
63
|
+
"D402", # Missing blank line after last section
|
|
64
|
+
"E402", # module level import not at top of file
|
|
65
|
+
"E741", # ambiguous variable name
|
|
66
|
+
"F405", # name may be undefined, or defined from star imports
|
|
67
|
+
"N801", # Naming convention violation: invalid constant name
|
|
68
|
+
"N802", # Naming convention violation: invalid variable name
|
|
69
|
+
"N804", # Naming convention violation: invalid lowercase variable name
|
|
70
|
+
"N806", # Naming convention violation: invalid lowercase function name
|
|
71
|
+
"N818", # Naming convention violation: invalid argument name
|
|
72
|
+
"N999", # Naming convention violation: invalid module name
|
|
73
|
+
|
|
74
|
+
"S602", # subprocess with shell=True
|
|
75
|
+
"S603", # check for execution of untrusted input
|
|
76
|
+
"S105", # "hardcoded password"; false positives on "pwd"
|
|
77
|
+
"S106", # "hardcoded password"; false positives on "pwd"
|
|
78
|
+
"S110", # "consider logging exception"
|
|
79
|
+
|
|
80
|
+
"S317", # use defusedxml
|
|
81
|
+
|
|
82
|
+
# This triggers for docstrings that uses __doc__
|
|
83
|
+
"D104", # Missing docstring in public package
|
|
84
|
+
|
|
85
|
+
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
|
|
86
|
+
"RUF005", # Consider iterable concatenation instead of list concatenation
|
|
87
|
+
"RUF015", # Prefer next() of single slice access
|
|
88
|
+
|
|
89
|
+
"SIM102", # Use a single `if` statement instead of nested `if` statements
|
|
90
|
+
"SIM105", # Use `contextlib.suppress
|
|
91
|
+
"SIM108", # Use ternary operator
|
|
92
|
+
"SIM114", # Combine `if` branches using logical `or` operator
|
|
93
|
+
"SIM115", # Use context handler for opening files
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
[tool.ruff.lint.extend-per-file-ignores]
|
|
97
|
+
# Ignore docstring requirements for test files
|
|
98
|
+
"vcsgraph/tests/*.py" = [
|
|
99
|
+
"D100",
|
|
100
|
+
"D101",
|
|
101
|
+
"D102",
|
|
102
|
+
"D103",
|
|
103
|
+
"D104",
|
|
104
|
+
"D105",
|
|
105
|
+
"D106",
|
|
106
|
+
"D107",
|
|
107
|
+
]
|
|
108
|
+
|
|
109
|
+
[tool.ruff.lint.pydocstyle]
|
|
110
|
+
convention = "google"
|
|
111
|
+
|
|
112
|
+
[tool.cibuildwheel.linux]
|
|
113
|
+
skip = "*-musllinux_*"
|
|
114
|
+
archs = ["auto", "aarch64"]
|
|
115
|
+
|
|
116
|
+
[tool.cibuildwheel.macos]
|
|
117
|
+
archs = ["x86_64", "arm64", "universal2"]
|
|
118
|
+
|
|
119
|
+
[tool.cibuildwheel.windows]
|
|
120
|
+
skip = "*-win32"
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vcsgraph
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: Graph algorithms for version control systems
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
7
7
|
License-File: COPYING.txt
|
|
8
8
|
Provides-Extra: dev
|
|
9
|
-
Requires-Dist: mypy==2.
|
|
10
|
-
Requires-Dist: ruff==0.
|
|
9
|
+
Requires-Dist: mypy==2.4.0; extra == "dev"
|
|
10
|
+
Requires-Dist: ruff==0.17.1; extra == "dev"
|
|
11
11
|
Dynamic: license-file
|
|
12
12
|
|
|
13
13
|
# vcsgraph
|
|
@@ -66,10 +66,10 @@ from vcsgraph import topo_sort
|
|
|
66
66
|
|
|
67
67
|
# Define a graph as a list of (node, parents) tuples
|
|
68
68
|
graph = [
|
|
69
|
-
(b
|
|
70
|
-
(b
|
|
71
|
-
(b
|
|
72
|
-
(b
|
|
69
|
+
(b"rev1", []),
|
|
70
|
+
(b"rev2", [b"rev1"]),
|
|
71
|
+
(b"rev3", [b"rev1"]),
|
|
72
|
+
(b"rev4", [b"rev2", b"rev3"]),
|
|
73
73
|
]
|
|
74
74
|
|
|
75
75
|
# Sort nodes topologically (parents before children)
|
|
@@ -83,17 +83,17 @@ from vcsgraph import Graph, DictParentsProvider
|
|
|
83
83
|
|
|
84
84
|
# Create a parents provider from a dictionary
|
|
85
85
|
ancestry = {
|
|
86
|
-
b
|
|
87
|
-
b
|
|
88
|
-
b
|
|
89
|
-
b
|
|
90
|
-
b
|
|
86
|
+
b"rev1": (b"null:",),
|
|
87
|
+
b"rev2a": (b"rev1",),
|
|
88
|
+
b"rev2b": (b"rev1",),
|
|
89
|
+
b"rev3": (b"rev2a",),
|
|
90
|
+
b"rev4": (b"rev3", b"rev2b"),
|
|
91
91
|
}
|
|
92
92
|
parents_provider = DictParentsProvider(ancestry)
|
|
93
93
|
|
|
94
94
|
# Create a graph and find merge bases
|
|
95
95
|
graph = Graph(parents_provider)
|
|
96
|
-
merge_base = graph.find_merge_base(b
|
|
96
|
+
merge_base = graph.find_merge_base(b"rev2a", b"rev2b")
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
### Working with Known Graphs
|
|
@@ -103,14 +103,14 @@ from vcsgraph import KnownGraph
|
|
|
103
103
|
|
|
104
104
|
# Create a known graph from parent relationships
|
|
105
105
|
parent_map = {
|
|
106
|
-
b
|
|
107
|
-
b
|
|
108
|
-
b
|
|
106
|
+
b"rev1": (b"null:",),
|
|
107
|
+
b"rev2": (b"rev1",),
|
|
108
|
+
b"rev3": (b"rev2",),
|
|
109
109
|
}
|
|
110
110
|
kg = KnownGraph(parent_map)
|
|
111
111
|
|
|
112
112
|
# Get heads (revisions with no children)
|
|
113
|
-
heads = kg.heads([b
|
|
113
|
+
heads = kg.heads([b"rev1", b"rev2", b"rev3"])
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
## Performance
|
vcsgraph-0.3.2/pyproject.toml
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["setuptools", "wheel", "setuptools-rust"]
|
|
3
|
-
build-backend = "setuptools.build_meta"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "vcsgraph"
|
|
7
|
-
description = "Graph algorithms for version control systems"
|
|
8
|
-
readme = "README.md"
|
|
9
|
-
requires-python = ">=3.10"
|
|
10
|
-
license-files = ["COPYING.txt"]
|
|
11
|
-
dynamic = ["version"]
|
|
12
|
-
|
|
13
|
-
[project.optional-dependencies]
|
|
14
|
-
dev = [
|
|
15
|
-
"mypy==2.1.0",
|
|
16
|
-
"ruff==0.15.18"
|
|
17
|
-
]
|
|
18
|
-
|
|
19
|
-
[tool.setuptools]
|
|
20
|
-
packages = ["vcsgraph"]
|
|
21
|
-
|
|
22
|
-
[[tool.setuptools-rust.ext-modules]]
|
|
23
|
-
target = "vcsgraph._graph_rs"
|
|
24
|
-
path = "crates/graph-py/Cargo.toml"
|
|
25
|
-
binding = "PyO3"
|
|
26
|
-
|
|
27
|
-
[tool.setuptools.dynamic]
|
|
28
|
-
version = {attr = "vcsgraph.__version__"}
|
|
29
|
-
|
|
30
|
-
[tool.mypy]
|
|
31
|
-
ignore_missing_imports = true
|
|
32
|
-
|
|
33
|
-
[tool.ruff]
|
|
34
|
-
extend-exclude = ["lib", "bin"]
|
|
35
|
-
|
|
36
|
-
[tool.ruff.lint]
|
|
37
|
-
select = [
|
|
38
|
-
"ANN", # annotations
|
|
39
|
-
"D", # pydocstyle
|
|
40
|
-
"E", # pycodestyle
|
|
41
|
-
"F", # pyflakes
|
|
42
|
-
"N", # naming
|
|
43
|
-
"B", # bugbear
|
|
44
|
-
"I", # isort
|
|
45
|
-
"S", # bandit
|
|
46
|
-
"TCH", # typecheck
|
|
47
|
-
"INT", # gettext
|
|
48
|
-
"SIM", # simplify
|
|
49
|
-
"C4", # comprehensions
|
|
50
|
-
"UP", # pyupgrade
|
|
51
|
-
"RUF", # ruf-specific
|
|
52
|
-
]
|
|
53
|
-
ignore = [
|
|
54
|
-
"ANN001",
|
|
55
|
-
"ANN002",
|
|
56
|
-
"ANN003", # missing-type-arg
|
|
57
|
-
"ANN201",
|
|
58
|
-
"ANN202",
|
|
59
|
-
"ANN204",
|
|
60
|
-
"ANN205",
|
|
61
|
-
"ANN206",
|
|
62
|
-
"D205", # 1 blank line required between summary line and description
|
|
63
|
-
"D417", # Missing argument descriptions in the docstring
|
|
64
|
-
"F821", # undefined-name
|
|
65
|
-
"E501", # line too long
|
|
66
|
-
"D402", # Missing blank line after last section
|
|
67
|
-
"E402", # module level import not at top of file
|
|
68
|
-
"E741", # ambiguous variable name
|
|
69
|
-
"F405", # name may be undefined, or defined from star imports
|
|
70
|
-
"N801", # Naming convention violation: invalid constant name
|
|
71
|
-
"N802", # Naming convention violation: invalid variable name
|
|
72
|
-
"N804", # Naming convention violation: invalid lowercase variable name
|
|
73
|
-
"N806", # Naming convention violation: invalid lowercase function name
|
|
74
|
-
"N818", # Naming convention violation: invalid argument name
|
|
75
|
-
"N999", # Naming convention violation: invalid module name
|
|
76
|
-
|
|
77
|
-
"S602", # subprocess with shell=True
|
|
78
|
-
"S603", # check for execution of untrusted input
|
|
79
|
-
"S105", # "hardcoded password"; false positives on "pwd"
|
|
80
|
-
"S106", # "hardcoded password"; false positives on "pwd"
|
|
81
|
-
"S110", # "consider logging exception"
|
|
82
|
-
|
|
83
|
-
"S317", # use defusedxml
|
|
84
|
-
|
|
85
|
-
# This triggers for docstrings that uses __doc__
|
|
86
|
-
"D104", # Missing docstring in public package
|
|
87
|
-
|
|
88
|
-
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
|
|
89
|
-
"RUF005", # Consider iterable concatenation instead of list concatenation
|
|
90
|
-
"RUF015", # Prefer next() of single slice access
|
|
91
|
-
|
|
92
|
-
"SIM102", # Use a single `if` statement instead of nested `if` statements
|
|
93
|
-
"SIM105", # Use `contextlib.suppress
|
|
94
|
-
"SIM108", # Use ternary operator
|
|
95
|
-
"SIM114", # Combine `if` branches using logical `or` operator
|
|
96
|
-
"SIM115", # Use context handler for opening files
|
|
97
|
-
]
|
|
98
|
-
|
|
99
|
-
[tool.ruff.lint.extend-per-file-ignores]
|
|
100
|
-
# Ignore docstring requirements for test files
|
|
101
|
-
"vcsgraph/tests/*.py" = ["D100", "D101", "D102", "D103", "D104", "D105", "D106", "D107"]
|
|
102
|
-
|
|
103
|
-
[tool.ruff.lint.pydocstyle]
|
|
104
|
-
convention = "google"
|
|
105
|
-
|
|
106
|
-
[tool.cibuildwheel.linux]
|
|
107
|
-
skip = "*-musllinux_*"
|
|
108
|
-
archs = ["auto", "aarch64"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|