Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
berland committed Mar 1, 2023
1 parent 90ae2f1 commit bc258e0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
17 changes: 8 additions & 9 deletions komodo/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ def _main(args):
data = Data(extra_data_dirs=args.extra_data_dirs)

if args.download or (not args.build and not args.install):
git_hashes = fetch(
args.pkgs, args.repo, outdir=args.workspace_for_downloads, pip=args.pip
)
git_hashes = fetch(args.pkgs, args.repo, outdir=args.downloads, pip=args.pip)

if args.download and not args.build:
sys.exit(0)
Expand All @@ -72,7 +70,7 @@ def _main(args):
args.repo,
data,
prefix=str(tmp_prefix),
dlprefix=args.workspace_for_downloads,
dlprefix=args.downloads,
builddir=args.tmp,
jobs=args.jobs,
cmk=args.cmake,
Expand Down Expand Up @@ -162,8 +160,9 @@ def _main(args):
"--no-index",
"--no-deps",
"--ignore-installed",
f"--cache-dir {args.workspace_for_downloads}",
f"--find-links {args.workspace_for_downloads}",
# assuming fetch.py has done "pip download" to this directory:
f"--cache-dir {args.downloads}",
f"--find-links {args.downloads}",
]
shell_input.append(current.get("makeopts"))

Expand Down Expand Up @@ -268,14 +267,14 @@ def parse_args(args: List[str]) -> argparse.Namespace:
"current working directory.",
)
optional_args.add_argument(
"--workspace_for_downloads",
"--downloads",
"--cache", # deprecated
"-c", # deprecated
type=str,
default="_work",
default="downloads",
help="A temporary destination directory used for downloads, "
"used by pip download, cp, rsync and git clone. This directory "
"should be empty if it already exists, otherwise it will be created.",
"must be empty if it already exists, otherwise it will be created.",
)
optional_args.add_argument(
"--jobs",
Expand Down
8 changes: 4 additions & 4 deletions komodo/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ def fetch(pkgs, repo, outdir, pip="pip") -> dict:
"cannot be None or the empty string."
)
if os.path.exists(outdir) and os.listdir(outdir):
print(
f"WARNING: Downloading to non-empty directory {outdir}, "
"this is not recommended."
raise RuntimeError(
f"Downloading to non-empty directory {outdir} is not supported."
)
if not os.path.exists(outdir):
os.mkdir(outdir)
Expand Down Expand Up @@ -176,7 +175,8 @@ def fetch(pkgs, repo, outdir, pip="pip") -> dict:
"-o",
type=str,
required=True,
help="The download destination for pip, cp, rsync and git; will be created.",
help="The download destination for pip, cp, rsync and git. "
"Must be non-existing or empty.",
)
parser.add_argument(
"--pip",
Expand Down

0 comments on commit bc258e0

Please sign in to comment.