Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/4.0.x' into 4.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
kalefranz committed Nov 15, 2016
2 parents 594cf3b + 7e904f4 commit e1c548e
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ install:
- conda install psutil ruamel_yaml
- conda install flake8 pytest pytest-cov mock
- conda install pip
- pip install auxlib pytest-timeout radon responses
- pip install auxlib pytest-timeout radon responses pyyaml
- python setup.py install

script:
Expand Down
10 changes: 7 additions & 3 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
4.1.13 (unreleased):
--------------------
* use install.rm_rf for TemporaryDirectory cleanup, #3425
* fix the api->conda substitution, #3456
* fix silent directory removal, #3730
* improve handling of local dependency information, #2107
* show warning message for pre-link scripts, #3727
* error and exit for install of packages that require conda minimum version 4.3, #3726
* fix conda/install.py single-file behavior, #3854


3.19.4 (unreleased):
--------------------
* improve handling of local dependency information, #2107
* use install.rm_rf for TemporaryDirectory cleanup, #3425
* fix the api->conda substitution, #3456
* fix silent directory removal, #3730


2016-09-08 4.1.12:
Expand Down
4 changes: 3 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ install:
- setx PATH "%ANACONDA_PATH%"
- conda info
- conda config --set always_yes yes
- conda install --force --no-deps -q conda psutil ruamel_yaml requests
- conda update conda
- conda install -q psutil ruamel_yaml requests
# - conda info python
- python -c "import sys; print(sys.version)"
- python -c "import sys; print(sys.executable)"
Expand All @@ -66,6 +67,7 @@ install:
- python --version
- python -c "import struct; print(struct.calcsize('P') * 8)"
- python setup.py install --old-and-unmanageable
- python setup.py install

# Not a .NET project, we build scikit-image in the install step instead
build: false
Expand Down
1 change: 1 addition & 0 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ requirements:
- pyyaml
- ruamel_yaml
- requests
- enum34 [py<34]

test:
requires:
Expand Down
15 changes: 15 additions & 0 deletions conda/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,11 @@ def run_script(prefix, dist, action='post-link', env_prefix=None):
env['PREFIX'] = str(env_prefix or prefix)
env['PKG_NAME'], env['PKG_VERSION'], env['PKG_BUILDNUM'], _ = dist2quad(dist)
if action == 'pre-link':
sys.stderr.write("""
Package %s uses a pre-link script. Pre-link scripts are potentially dangerous discouraged.
This is because pre-link scripts have the ability to change the package contents in the
package cache, and therefore modify the underlying files for already-created conda
environments. Future versions of conda may deprecate and ignore pre-link scripts.\n""" % dist)
env['SOURCE_DIR'] = str(prefix)
try:
subprocess.check_call(args, env=env)
Expand Down Expand Up @@ -1047,10 +1052,20 @@ def link(prefix, dist, linktype=LINK_HARD, index=None):
sys.exit('Error: pre-link failed: %s' % dist)

info_dir = join(source_dir, 'info')

if not os.path.isfile(join(info_dir, "files")):
print("Installing %s requires a minimum conda version of 4.3." % dist, file=sys.stderr)
sys.exit(1)

files = list(yield_lines(join(info_dir, 'files')))
has_prefix_files = read_has_prefix(join(info_dir, 'has_prefix'))
no_link = read_no_link(info_dir)

full_dist_name = "%s.tar.bz2" % dist
if not index.get(full_dist_name, {}).get("noarch", None) in (True, False, None, "generic"):
print("Installing %s requires a minimum conda version of 4.3." % dist, file=sys.stderr)
sys.exit(1)

with Locked(prefix), Locked(pkgs_dir):
for f in files:
src = join(source_dir, f)
Expand Down
6 changes: 5 additions & 1 deletion tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ def run_conda_command(*args):
p = subprocess.Popen((sys.executable, "-m", "conda") + args, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, env=env)

stdout, stderr = [stream.strip().decode('utf-8').replace('\r\n', '\n').replace('\\\\', '\\')
stdout, stderr = [stream.strip()
.decode('utf-8')
.replace('\r\n', '\n')
.replace('\\\\', '\\')
.replace("Using Anaconda API: https://api.anaconda.org\n", "")
for stream in p.communicate()]
return stdout, strip_expected(stderr)

Expand Down

0 comments on commit e1c548e

Please sign in to comment.