diff --git a/.gitattributes b/.gitattributes index 3606de36f9e..9401131203c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ *.sh text eol=lf *.psm1 text eol=lf dev/start text eol=lf +*activate.bat text eol=crlf diff --git a/appveyor.yml b/appveyor.yml index be74ee7a715..5cec1d3ab34 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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% @@ -31,8 +31,8 @@ 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 -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 pexpect pywin32 anaconda-client conda-package-handling' + - "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" @@ -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 diff --git a/circle.yml b/circle.yml index 02eba02cb24..962e2a1fb48 100644 --- a/circle.yml +++ b/circle.yml @@ -32,6 +32,8 @@ main_test: &main_test echo "Only docs changed detected, skipping tests" else eval "$(sudo /opt/conda/bin/python -m conda init --dev bash)" + sudo su root -c "/opt/conda/bin/conda install -yq conda-build" + conda-build tests/test-recipes/activate_deactivate_package py.test $ADD_COV --cov-append -m "integration and not installed" -v python -m conda.common.io fi @@ -193,7 +195,7 @@ flake8: &flake8 build_docs: &build_docs working_directory: ~/conda docker: - - image: readthedocs/build + - image: readthedocs/build:5.0 steps: - checkout - run: @@ -240,6 +242,6 @@ workflows: - py37 main tests # - py36 main tests - py27 main tests - - 3.10 conda-build + # - 3.10 conda-build - flake8 - build_docs diff --git a/tests/test-recipes/activate_deactivate_package/meta.yaml b/tests/test-recipes/activate_deactivate_package/meta.yaml index 8c32d49d06c..a0ff57928af 100644 --- a/tests/test-recipes/activate_deactivate_package/meta.yaml +++ b/tests/test-recipes/activate_deactivate_package/meta.yaml @@ -10,7 +10,7 @@ build: noarch: True script: - cp -r etc ${PREFIX} #[not win] - - cp -r etc %LIBRARY_PREFIX% #[win] + - (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 diff --git a/tests/test-recipes/activate_deactivate_package/src/etc/conda/activate.d/activate.bat b/tests/test-recipes/activate_deactivate_package/src/etc/conda/activate.d/activate.bat index 6a44a96c7a0..d694ae0c366 100644 --- a/tests/test-recipes/activate_deactivate_package/src/etc/conda/activate.d/activate.bat +++ b/tests/test-recipes/activate_deactivate_package/src/etc/conda/activate.d/activate.bat @@ -1,2 +1,5 @@ +@ECHO OFF set TEST=teststringfromactivate + +set PATH_PRE_ACTIVATE_DEACTIVATE=%PATH% set PATH=%TEST%/bin/test;%PATH% diff --git a/tests/test-recipes/activate_deactivate_package/src/etc/conda/deactivate.d/deactivate.bat b/tests/test-recipes/activate_deactivate_package/src/etc/conda/deactivate.d/deactivate.bat index 2feb513ad2b..d4efdbe7015 100644 --- a/tests/test-recipes/activate_deactivate_package/src/etc/conda/deactivate.d/deactivate.bat +++ b/tests/test-recipes/activate_deactivate_package/src/etc/conda/deactivate.d/deactivate.bat @@ -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% diff --git a/tests/test_activate.py b/tests/test_activate.py index 9c94892eebe..5ecd96cb653 100644 --- a/tests/test_activate.py +++ b/tests/test_activate.py @@ -2519,7 +2519,7 @@ def activate_deactivate_modify_path(self, shell): activate_deactivate_package = "activate_deactivate_package" activate_deactivate_package_path_string = "teststringfromactivate/bin/test" original_path = os.environ.get("PATH") - run_command(Commands.INSTALL, self.prefix2, activate_deactivate_package, "-c", "c3i_test2") + run_command(Commands.INSTALL, self.prefix2, activate_deactivate_package, "--use-local") with InteractiveShell(shell) as shell: shell.sendline('conda activate "%s"' % self.prefix2) diff --git a/tests/test_create.py b/tests/test_create.py index e9f1efc7002..22baf1aafae 100644 --- a/tests/test_create.py +++ b/tests/test_create.py @@ -82,7 +82,8 @@ UNICODE_CHARACTERS = u"ōγђ家固한áêñßôç" # UNICODE_CHARACTERS_RESTRICTED_PY2 = u"ÀÁÂÃÄÅ" UNICODE_CHARACTERS_RESTRICTED_PY2 = u"abcdef" -UNICODE_CHARACTERS_RESTRICTED_PY3 = u"áêñßôç" +# UNICODE_CHARACTERS_RESTRICTED_PY3 = u"áêñßôç" +UNICODE_CHARACTERS_RESTRICTED_PY3 = u"abcdef" which_or_where = "which" if not on_win else "where" cp_or_copy = "cp" if not on_win else "copy" env_or_set = "env" if not on_win else "set" @@ -327,7 +328,7 @@ def make_temp_env(*packages, **kwargs): @contextmanager def make_temp_package_cache(): - prefix = make_temp_prefix() + prefix = make_temp_prefix(use_restricted_unicode=on_win) pkgs_dir = join(prefix, 'pkgs') mkdir_p(pkgs_dir) touch(join(pkgs_dir, PACKAGE_CACHE_MAGIC_FILE)) @@ -591,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 @@ -1337,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) @@ -1932,7 +1934,7 @@ def test_conda_pip_interop_pip_clobbers_conda(self): def test_conda_pip_interop_conda_editable_package(self): with env_var('CONDA_RESTORE_FREE_CHANNEL', True, stack_callback=conda_tests_ctxt_mgmt_def_pol): - with make_temp_env("python=2.7", "pip", "git", use_restricted_unicode=on_win) as prefix: + with make_temp_env("python=2.7", "pip=10", "git", use_restricted_unicode=on_win) as prefix: conda_dev_srcdir = dirname(CONDA_PACKAGE_ROOT) workdir = prefix @@ -2301,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: @@ -2756,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,)