Skip to content

Only check version URL after determining if it was already installed #673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions cmdstanpy/install_cmdstan.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,16 +568,8 @@ def run_install(args: Union[InteractiveSettings, InstallationSettings]) -> None:
"""
Run a (potentially interactive) installation
"""
if is_version_available(args.version):
print('Installing CmdStan version: {}'.format(args.version))
else:
raise ValueError(
f'Version {args.version} cannot be downloaded. '
'Connection to GitHub failed. '
'Check firewall settings or ensure this version exists.'
)
validate_dir(args.dir)
print('Install directory: {}'.format(args.dir))
print('CmdStan install directory: {}'.format(args.dir))

# these accesses just 'warm up' the interactive install
_ = args.progress
Expand All @@ -598,6 +590,14 @@ def run_install(args: Union[InteractiveSettings, InstallationSettings]) -> None:
)
)
if not already_installed or args.overwrite:
if is_version_available(args.version):
print('Installing CmdStan version: {}'.format(args.version))
else:
raise ValueError(
f'Version {args.version} cannot be downloaded. '
'Connection to GitHub failed. '
'Check firewall settings or ensure this version exists.'
)
retrieve_version(args.version, args.progress)
install_version(
cmdstan_version=cmdstan_version,
Expand Down