Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NO MRG] testing stuff #52

Closed
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ install:
build: off

test_script:
- conda.exe build recipe -m .ci_support\%CONFIG%.yaml --quiet
- python bld.py recipe -m .ci_support\%CONFIG%.yaml --quiet
deploy_script:
- cmd: upload_or_check_non_existence .\recipe conda-forge --channel=main -m .ci_support\%CONFIG%.yaml
37 changes: 37 additions & 0 deletions bld.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from __future__ import print_function

from io import BytesIO
import os
import subprocess
import sys

from conda_build.cli.main_build import main
import conda_build.utils

_rm_rf = conda_build.utils.rm_rf


def rm_rf(path, config=None):
_check_call = subprocess.check_call
def check_call(popen_args, *args, **kwargs):
rd_str = 'rd /s /q'
if not (isinstance(popen_args, str) and rd_str in popen_args):
return _check_call(popen_args, *args, **kwargs)
popen_args = popen_args.replace(rd_str, 'del /F /S /Q')
print('>>>>>> running monkeypatched call:', popen_args, file=sys.stderr)
out_stream = BytesIO()
kwargs['stdout'] = out_stream
ret = _check_call(popen_args, *args, **kwargs)
for line in out_stream.getvalue().splitlines():
print(line)
return ret
try:
subprocess.check_call = check_call
_rm_rf(path, config=config)
finally:
subprocess.check_call = _check_call


conda_build.utils.rm_rf = rm_rf

main()
4 changes: 2 additions & 2 deletions recipe/run_test.bat
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mkdir %CONDA_PKGS_DIRS%
if errorlevel 1 exit 1

:: Activate the built conda.
conda activate base
call conda activate base
if errorlevel 1 exit 1

:: Run conda tests.
Expand All @@ -29,7 +29,7 @@ if errorlevel 1 exit 1

:: Deactivate the built conda when done.
:: Not necessary, but a good test.
conda deactivate
call conda deactivate
if errorlevel 1 exit 1

endlocal