Skip to content

Commit 9c96e1a

Browse files
committed
Add comments on bug
1 parent 2f578eb commit 9c96e1a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

robotpy_build/pkgcfg_provider.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,23 @@ class PkgCfgProvider:
118118
def __init__(self):
119119
self.pkgs = {}
120120

121-
def detect_pkgs(self):
121+
def detect_pkgs(self) -> None:
122+
"""
123+
Detect and load packages under the robotpybuild entry point group.
124+
Only loads packages that are dependencies.
125+
"""
122126
deps_names = set().union(*[pkg.depends for pkg in self.pkgs.values()])
123127
entry_points = list(iter_entry_points(group="robotpybuild", name=None))
124128

129+
# Only load the dependencies of the package we're building.
130+
# If we load the [package being built], then the current build will fail.
131+
# If we load a package that depends on the [package being built],
132+
# then the [package being built] will be loaded and the current build will fail.
125133
run_loop = True
126134
while run_loop:
127135
run_loop = False
128136
for ep in entry_points:
129-
if ep.name in self.pkgs:
137+
if ep.name in self.pkgs: # Prevents loading the package being built
130138
continue
131139
if ep.name not in deps_names and ep.name != "robotpy-build":
132140
continue

0 commit comments

Comments
 (0)