Skip to content
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

Conda project #363

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
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
Prev Previous commit
Next Next commit
avoid writing anaconda-project.yml for list commands
* also list pip packages with list-packages command
  • Loading branch information
AlbertDeFusco committed Feb 14, 2022
commit bdeece1d585ed3ba2f98c1174839cad5ca38e478
8 changes: 3 additions & 5 deletions anaconda_project/internal/cli/activate.py
Original file line number Diff line number Diff line change
@@ -27,11 +27,9 @@ def activate(dirname, ui_mode, conda_environment, command_name):
Returns:
None on failure or a list of lines to print.
"""
project = load_project(dirname)
result = prepare_with_ui_mode_printing_errors(project,
ui_mode=ui_mode,
env_spec_name=conda_environment,
command_name=command_name)
project = load_project(dirname, save=False)
result = prepare_with_ui_mode_printing_errors(
project, ui_mode=ui_mode, env_spec_name=conda_environment, command_name=command_name)
if result.failed:
return None

2 changes: 1 addition & 1 deletion anaconda_project/internal/cli/clean.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ def clean_command(project_dir):
Returns:
exit code
"""
project = load_project(project_dir)
project = load_project(project_dir, save=False)
# we don't want to print errors during this prepare, clean
# can proceed even though the prepare fails.
with project.null_frontend():
4 changes: 2 additions & 2 deletions anaconda_project/internal/cli/command_commands.py
Original file line number Diff line number Diff line change
@@ -93,7 +93,7 @@ def list_commands(project_dir):
Returns:
int exit code
"""
project = load_project(project_dir)
project = load_project(project_dir, save=False)
if console_utils.print_project_problems(project):
return 1

@@ -111,7 +111,7 @@ def list_default_command(project_dir):
Returns:
int exit code
"""
project = load_project(project_dir)
project = load_project(project_dir, save=False)
if console_utils.print_project_problems(project):
return 1

2 changes: 1 addition & 1 deletion anaconda_project/internal/cli/download_commands.py
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ def remove_download(project_dir, env_spec_name, filename_variable):

def list_downloads(project_dir, env_spec_name):
"""List the downloads present in project."""
project = load_project(project_dir)
project = load_project(project_dir, save=False)
if console_utils.print_project_problems(project):
return 1

10 changes: 5 additions & 5 deletions anaconda_project/internal/cli/environment_commands.py
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ def remove_env_spec(project_dir, name):

def export_env_spec(project_dir, name, filename):
"""Save an environment.yml file."""
project = load_project(project_dir)
project = load_project(project_dir, save=False)
status = project_ops.export_env_spec(project, name=name, filename=filename)
return _handle_status(status)

@@ -101,7 +101,7 @@ def remove_platforms(project, environment, platforms):

def list_env_specs(project_dir):
"""List environments in the project."""
project = load_project(project_dir)
project = load_project(project_dir, save=False)
if console_utils.print_project_problems(project):
return 1
print("Environments for project: {}\n".format(project_dir))
@@ -111,7 +111,7 @@ def list_env_specs(project_dir):

def list_packages(project_dir, environment):
"""List the packages for an environment in the project."""
project = load_project(project_dir)
project = load_project(project_dir, save=False)
if console_utils.print_project_problems(project):
return 1
if environment is None:
@@ -132,7 +132,7 @@ def list_packages(project_dir, environment):

def list_platforms(project_dir, environment):
"""List the platforms for an environment in the project."""
project = load_project(project_dir)
project = load_project(project_dir, save=False)
if console_utils.print_project_problems(project):
return 1
if environment is None:
@@ -166,7 +166,7 @@ def update(project_dir, env_spec_name):

def unlock(project_dir, env_spec_name):
"""Unlock dependency versions."""
project = load_project(project_dir)
project = load_project(project_dir, save=False)
if console_utils.print_project_problems(project):
return 1
status = project_ops.unlock(project, env_spec_name=env_spec_name)
2 changes: 1 addition & 1 deletion anaconda_project/internal/cli/service_commands.py
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ def remove_service(project_dir, env_spec_name, variable_name):

def list_services(project_dir, env_spec_name):
"""List the services listed on the project."""
project = load_project(project_dir)
project = load_project(project_dir, save=False)
if console_utils.print_project_problems(project):
return 1

2 changes: 1 addition & 1 deletion anaconda_project/internal/cli/variable_commands.py
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ def remove_variables(project_dir, env_spec_name, vars_to_remove):

def list_variables(project_dir, env_spec_name):
"""List variables present in project."""
project = load_project(project_dir)
project = load_project(project_dir, save=False)
if console_utils.print_project_problems(project):
return 1
print("Variables for project: {}\n".format(project_dir))