Skip to content

Commit b1c8f75

Browse files
committed
ENH: Track the origin of each Spec
1 parent 316a7d3 commit b1c8f75

File tree

5 files changed

+185
-16
lines changed

5 files changed

+185
-16
lines changed

tests/test_project_dependency_handling.py

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,30 +103,69 @@ def test_project_dependency_handling_in_pyproject_toml(
103103

104104
expected = {
105105
"python-graphviz": [
106-
Spec(name="python-graphviz", which="conda", identifier="17e5d607"),
106+
Spec(
107+
name="python-graphviz",
108+
which="conda",
109+
identifier="17e5d607",
110+
origin=(p,),
111+
),
107112
],
108113
"graphviz": [
109-
Spec(name="graphviz", which="pip", identifier="17e5d607"),
110-
Spec(name="graphviz", which="conda", identifier="5eb93b8c"),
114+
Spec(name="graphviz", which="pip", identifier="17e5d607", origin=(p,)),
115+
Spec(name="graphviz", which="conda", identifier="5eb93b8c", origin=(p,)),
111116
],
112117
}
113118
if project_dependency_handling == "pip-only":
114119
expected.update(
115120
{
116-
"requests": [Spec(name="requests", which="pip", identifier="08fd8713")],
117-
"pandas": [Spec(name="pandas", which="pip", identifier="9e467fa1")],
121+
"requests": [
122+
Spec(
123+
name="requests",
124+
which="pip",
125+
identifier="08fd8713",
126+
origin=(p,),
127+
),
128+
],
129+
"pandas": [
130+
Spec(
131+
name="pandas",
132+
which="pip",
133+
identifier="9e467fa1",
134+
origin=(p,),
135+
),
136+
],
118137
},
119138
)
120139
elif project_dependency_handling == "same-name":
121140
expected.update(
122141
{
123142
"requests": [
124-
Spec(name="requests", which="conda", identifier="08fd8713"),
125-
Spec(name="requests", which="pip", identifier="08fd8713"),
143+
Spec(
144+
name="requests",
145+
which="conda",
146+
identifier="08fd8713",
147+
origin=(p,),
148+
),
149+
Spec(
150+
name="requests",
151+
which="pip",
152+
identifier="08fd8713",
153+
origin=(p,),
154+
),
126155
],
127156
"pandas": [
128-
Spec(name="pandas", which="conda", identifier="9e467fa1"),
129-
Spec(name="pandas", which="pip", identifier="9e467fa1"),
157+
Spec(
158+
name="pandas",
159+
which="conda",
160+
identifier="9e467fa1",
161+
origin=(p,),
162+
),
163+
Spec(
164+
name="pandas",
165+
which="pip",
166+
identifier="9e467fa1",
167+
origin=(p,),
168+
),
130169
],
131170
},
132171
)

0 commit comments

Comments
 (0)