Skip to content

Commit

Permalink
AppVeyor related updates
Browse files Browse the repository at this point in the history
- Disable 2.7 tests. Too much to bite off at this point...and since 2.7 is deprecated it may not matter
- Update conda-build to version 3.17 and build local activate_deactivate_package
- Retain line endings on bat files in the activate_deactivate_package
- Simplify path adjustment logic in activate_deactivate_package batch files. (This may be unnecessary as controlling the line endings may have fixed the issue)
- Update condarc tests to write files without duplicate keys.
  • Loading branch information
mlline00 committed Apr 14, 2020
1 parent 03c59ef commit 33d5d8b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.sh text eol=lf
*.psm1 text eol=lf
dev/start text eol=lf
*activate.bat text eol=crlf
13 changes: 7 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ environment:
PYTHON_ROOT: "C:\\Miniconda36-x64"
CONDA_INSTRUMENTATION_ENABLED: "true"

- PYTHON: "C:\\Python27_32"
PYTHON_VERSION: "2.7"
PYTHON_ARCH: "32"
PYTHON_ROOT: "C:\\Miniconda"
CONDA_INSTRUMENTATION_ENABLED: "true"
# - PYTHON: "C:\\Python27_32"
# PYTHON_VERSION: "2.7"
# PYTHON_ARCH: "32"
# PYTHON_ROOT: "C:\\Miniconda"
# CONDA_INSTRUMENTATION_ENABLED: "true"

init:
- ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH% %HOME%
Expand All @@ -32,7 +32,7 @@ init:
install:
- CALL "%PYTHON_ROOT%\\Scripts\\activate.bat"
- 'conda install -y -c conda-canary -c defaults -c conda-forge python=%PYTHON_VERSION% pycosat conda requests ruamel_yaml pytest pytest-cov pytest-timeout mock responses urllib3>1.23 pexpect pywin32 anaconda-client conda-package-handling'
- "conda install -yq conda-build=3.13"
- "conda install -yq conda-build=3.17"
# conda install -y -c defaults -c conda-forge pytest pytest-cov pytest-timeout mock responses pexpect xonsh
# TODO: add xonsh for PY3 builds
- "pip install codecov==2.0.5"
Expand All @@ -42,6 +42,7 @@ build: false

test_script:
- CALL dev-init.bat
- conda-build tests\test-recipes\activate_deactivate_package
- py.test %ADD_COV% -m "not integration and not installed" -v --basetemp=C:\tmp
- py.test %ADD_COV% --cov-append -m "integration and not installed" -v --basetemp=C:\tmp
- DEL /Q /F conda.egg-info
Expand Down
2 changes: 1 addition & 1 deletion tests/test-recipes/activate_deactivate_package/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build:
noarch: True
script:
- cp -r etc ${PREFIX} #[not win]
- (robocopy etc %LIBRARY_PREFIX% /E) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0 #[win] https://superuser.com/a/346112
- (robocopy etc %PREFIX%\etc /E /v /fp) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0 #[win] https://superuser.com/a/346112

about:
summary: Test activate and deactivate scripts effecting environment variables
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
@ECHO OFF
set TEST=teststringfromactivate

set PATH_PRE_ACTIVATE_DEACTIVATE=%PATH%
set PATH=%TEST%/bin/test;%PATH%
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@
@echo off&cls
setlocal EnableDelayedExpansion

set TEST=teststringfromactivate

set $line=%PATH%
set $line=%$line: =#%
set $line=%$line:;= %

for %%a in (%$line%) do echo %%a | find /i %TEST% || set $newpath=!$newpath!;%%a
set $newpath=!$newpath:#= !
set PATH=!$newpath:~1!
@ECHO OFF
set PATH=%PATH_PRE_ACTIVATE_DEACTIVATE%
9 changes: 5 additions & 4 deletions tests/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,9 @@ def test_safety_checks(self):
assert message1 in error_message
assert message2 in error_message

with open(join(prefix, 'condarc'), 'a') as fh:
with open(join(prefix, 'condarc'), 'w') as fh:
fh.write("safety_checks: warn\n")
fh.write("extra_safety_checks: true\n")
reload_config(prefix)
assert context.safety_checks is SafetyChecks.warn

Expand Down Expand Up @@ -1338,7 +1339,7 @@ def test_conda_config_validate(self):
assert not stderr

try:
with open(join(prefix, 'condarc'), 'a') as fh:
with open(join(prefix, 'condarc'), 'w') as fh:
fh.write('default_python: anaconda\n')
fh.write('ssl_verify: /path/doesnt/exist\n')
reload_config(prefix)
Expand Down Expand Up @@ -2302,7 +2303,7 @@ def test_offline_with_empty_index_cache(self):
SubdirData._cache_.clear()

try:
with make_temp_env() as prefix:
with make_temp_env(use_restricted_unicode=on_win) as prefix:
pkgs_dir = join(prefix, 'pkgs')
with env_var('CONDA_PKGS_DIRS', pkgs_dir, stack_callback=conda_tests_ctxt_mgmt_def_pol):
with make_temp_channel(['flask-0.12.2']) as channel:
Expand Down Expand Up @@ -2757,7 +2758,7 @@ def test_conda_info_python(self):
assert "python 3.5.4" in output

def test_toolz_cytoolz_package_cache_regression(self):
with make_temp_env("python=3.5") as prefix:
with make_temp_env("python=3.5", use_restricted_unicode=on_win) as prefix:
pkgs_dir = join(prefix, 'pkgs')
with env_var('CONDA_PKGS_DIRS', pkgs_dir, stack_callback=conda_tests_ctxt_mgmt_def_pol):
assert context.pkgs_dirs == (pkgs_dir,)
Expand Down

0 comments on commit 33d5d8b

Please sign in to comment.