Skip to content

Commit 3f7e4fb

Browse files
committed
config: default to external repos for add_repo()
1 parent f2c34d8 commit 3f7e4fb

6 files changed

Lines changed: 6 additions & 6 deletions

File tree

examples/eapi-usage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def main():
2727
try:
2828
config.load()
2929
if os.path.sep in args.repo:
30-
repo = config.add_repo(args.repo, external=True)
30+
repo = config.add_repo(args.repo)
3131
else:
3232
repo = config.repos[args.repo]
3333
except PkgcraftError as e:

examples/leaf-pkgs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def main():
2727
try:
2828
config.load()
2929
if os.path.sep in args.repo:
30-
repo = config.add_repo(args.repo, external=True)
30+
repo = config.add_repo(args.repo)
3131
else:
3232
repo = config.repos[args.repo]
3333
except PkgcraftError as e:

examples/query

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def main():
6767
try:
6868
if args.repos:
6969
for path in args.repos:
70-
config.add_repo(path, external=True)
70+
config.add_repo(path)
7171
else:
7272
config.load()
7373
except PkgcraftError as e:

examples/revdeps

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def main():
3333
try:
3434
if args.repos:
3535
for path in args.repos:
36-
config.add_repo(path, external=True)
36+
config.add_repo(path)
3737
else:
3838
config.load()
3939
except PkgcraftError as e:

src/pkgcraft/config.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ cdef class Config:
4646

4747
return Repo.from_ptr(ptr, False)
4848

49-
def add_repo(self, repo not None, id=None, priority=0, external=False):
49+
def add_repo(self, repo not None, id=None, priority=0, external=True):
5050
"""Add a repo via its file path or from a Repo object and return the Repo object."""
5151
if isinstance(repo, (str, os.PathLike)):
5252
path = str(repo)

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ def testdata_config():
3434
"""All repo test data loaded into a Config object."""
3535
config = Config()
3636
for path in sorted(glob.glob(f"{DATADIR}/repos/*")):
37-
config.add_repo(path, id=os.path.basename(path))
37+
config.add_repo(path, id=os.path.basename(path), external=False)
3838
return config

0 commit comments

Comments
 (0)