Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/4.1.x' into 4.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
kalefranz committed Sep 7, 2016
2 parents db838fd + 64261e3 commit cc9e916
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 12 deletions.
16 changes: 9 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
## 4.1.12 (unreleased)

### Bug Fixes
* fix #2837 "File exists" in symlinked path with parallel activations (#3210)


## 4.2.5 (2016-09-XX)
## 4.2.5 (2016-09-XX unreleased)

### Deprecations/Breaking Changes
* partially revert #3041 giving conda config --add previous --prepend behavior (#3364 via #3370)
Expand All @@ -21,6 +15,14 @@
* fix CONDA_CHANNELS environment variable splitting (#3390)


## 4.1.12 (unreleased)

### Bug Fixes
* fix #2837 "File exists" in symlinked path with parallel activations (#3210)
* fix prune option when installing packages (#3354)
* change check for placeholder to be more friendly to long PATH (#3349)


## 4.2.4 (2016-08-18)

### Bug Fixes
Expand Down
5 changes: 4 additions & 1 deletion conda/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,10 @@ def install_actions(prefix, index, specs, force=False, only_names=None, always_c
if context.track_features:
specs.extend(x + '@' for x in context.track_features)

pkgs = r.install(specs, linked, update_deps=update_deps)
installed = linked
if prune:
installed = []
pkgs = r.install(specs, installed, update_deps=update_deps)

for fn in pkgs:
dist = fn[:-8]
Expand Down
12 changes: 8 additions & 4 deletions shell/activate.bat
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,18 @@
@REM always store the full path to the environment, since CONDA_DEFAULT_ENV varies
@FOR /F "tokens=1 delims=;" %%i in ("%NEW_PATH%") DO @SET "CONDA_PREFIX=%%i"

@REM Do we have CONDA_PATH_PLACEHOLDER in PATH?
@SET "CHECK_PLACEHOLDER=import os; print('CONDA_PATH_PLACEHOLDER' in os.environ['PATH'])"
@FOR /F "tokens=1 delims=;" %%i in ('@call python -c "%CHECK_PLACEHOLDER%"') DO @SET "HAS_PLACEHOLDER=%%i"

@REM look if the deactivate script left a placeholder for us.
@IF "x%PATH%" == "x%PATH:CONDA_PATH_PLACEHOLDER=%" (
@REM If it did not, prepend NEW_PATH
@SET "PATH=%NEW_PATH%;%PATH%"
) ELSE (
@IF "%HAS_PLACEHOLDER%" == "True" (
@REM If it did, replace it with our NEW_PATH
@REM Delayed expansion used here to do replacement with value of NEW_PATH
@CALL SET "PATH=%%PATH:CONDA_PATH_PLACEHOLDER=!NEW_PATH!%%"
) ELSE (
@REM If it did not, prepend NEW_PATH
@SET "PATH=%NEW_PATH%;%PATH%"
)

@REM This persists env variables, which are otherwise local to this script right now.
Expand Down
27 changes: 27 additions & 0 deletions tests/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,20 @@
import json
import os
import pytest
<<<<<<< HEAD
import sys
from conda import CondaError
from conda.base.context import bits, context, reset_context
from conda.cli.main import generate_parser
=======
from requests import Session
from requests.adapters import BaseAdapter

from conda import config
from conda import plan
from conda.cli import conda_argparse
from conda.cli.common import get_index_trap
>>>>>>> origin/4.1.x
from conda.cli.main_config import configure_parser as config_configure_parser
from conda.cli.main_create import configure_parser as create_configure_parser
from conda.cli.main_install import configure_parser as install_configure_parser
Expand Down Expand Up @@ -405,6 +415,23 @@ def test_python2_pandas(self):
assert exists(join(prefix, PYTHON_BINARY))
assert_package_is_installed(prefix, 'numpy')

@pytest.mark.timeout(300)
def test_install_prune(self):
with make_temp_env("python=2 decorator") as prefix:
assert_package_is_installed(prefix, 'decorator')

# prune is a feature used by conda-env
# conda itself does not provide a public API for it
index = get_index_trap(prefix=prefix)
actions = plan.install_actions(prefix,
index,
specs=['flask'],
prune=True)
plan.execute_actions(actions, index, verbose=True)

assert_package_is_installed(prefix, 'flask')
assert not package_is_installed(prefix, 'decorator')

@pytest.mark.skipif(on_win, reason="mkl package not available on Windows")
@pytest.mark.timeout(300)
def test_install_features(self):
Expand Down

0 comments on commit cc9e916

Please sign in to comment.