|
@@ 644-670 (lines=27) @@
|
| 641 |
|
cmd_list.extend(['--name', name]) |
| 642 |
|
elif prefix: |
| 643 |
|
cmd_list.extend(['--prefix', prefix]) |
| 644 |
|
else: |
| 645 |
|
raise TypeError('must specify either an environment name or a ' |
| 646 |
|
'path for package removal') |
| 647 |
|
|
| 648 |
|
if all_: |
| 649 |
|
cmd_list.extend(['--all']) |
| 650 |
|
else: |
| 651 |
|
cmd_list.extend(pkgs) |
| 652 |
|
|
| 653 |
|
return self._call_and_parse(cmd_list) |
| 654 |
|
|
| 655 |
|
def remove_environment(self, name=None, path=None, **kwargs): |
| 656 |
|
""" |
| 657 |
|
Remove an environment entirely. |
| 658 |
|
|
| 659 |
|
See ``remove``. |
| 660 |
|
""" |
| 661 |
|
return self.remove(name=name, path=path, all=True, **kwargs) |
| 662 |
|
|
| 663 |
|
def clone_environment(self, clone, name=None, prefix=None, **kwargs): |
| 664 |
|
""" |
| 665 |
|
Clone the environment `clone` into `name` or `prefix`. |
| 666 |
|
""" |
| 667 |
|
cmd_list = ['create', '--json', '--quiet'] |
| 668 |
|
|
| 669 |
|
if (name and prefix) or not (name or prefix): |
| 670 |
|
raise TypeError("conda clone_environment: exactly one of `name` " |
| 671 |
|
"or `path` required") |
| 672 |
|
|
| 673 |
|
if name: |
|
@@ 447-472 (lines=26) @@
|
| 444 |
|
return self._call_and_parse(['info', package, '--json'], |
| 445 |
|
abspath=abspath) |
| 446 |
|
|
| 447 |
|
def search(self, regex=None, spec=None, **kwargs): |
| 448 |
|
""" |
| 449 |
|
Search for packages. |
| 450 |
|
""" |
| 451 |
|
cmd_list = ['search', '--json'] |
| 452 |
|
|
| 453 |
|
if regex and spec: |
| 454 |
|
raise TypeError('conda search: only one of regex or spec allowed') |
| 455 |
|
|
| 456 |
|
if regex: |
| 457 |
|
cmd_list.append(regex) |
| 458 |
|
|
| 459 |
|
if spec: |
| 460 |
|
cmd_list.extend(['--spec', spec]) |
| 461 |
|
|
| 462 |
|
if 'platform' in kwargs: |
| 463 |
|
cmd_list.extend(['--platform', kwargs.pop('platform')]) |
| 464 |
|
|
| 465 |
|
cmd_list.extend( |
| 466 |
|
self._setup_install_commands_from_kwargs( |
| 467 |
|
kwargs, |
| 468 |
|
('canonical', 'unknown', 'use_index_cache', 'outdated', |
| 469 |
|
'override_channels'))) |
| 470 |
|
|
| 471 |
|
return self._call_and_parse(cmd_list, |
| 472 |
|
abspath=kwargs.get('abspath', True)) |
| 473 |
|
|
| 474 |
|
|
| 475 |
|
def create_from_yaml(self, name, yamlfile): |