From 4f4d45c96bef7b47b9e8dc2f7ffd3f228eea3242 Mon Sep 17 00:00:00 2001 From: Michael Sarahan Date: Tue, 17 Jul 2018 16:14:03 -0500 Subject: [PATCH] try pytest-mp instead of xdist on win --- appveyor.yml | 7 ++++--- conda_build/metadata.py | 7 +++---- setup.cfg | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 91030b6f13..97eda8d561 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -43,7 +43,8 @@ install: - python -c "import sys; print(sys.executable)" - python -c "import sys; print(sys.prefix)" - conda update -q --all - - conda install -q pip pytest pytest-cov jinja2 patch flake8 mock requests contextlib2 chardet glob2 perl pyflakes pycrypto posix m2-git anaconda-client numpy conda-verify beautifulsoup4 pytest-xdist pytest-mock filelock pkginfo psutil + - conda install -q pip pytest pytest-cov jinja2 patch flake8 mock requests contextlib2 chardet glob2 perl pyflakes pycrypto posix m2-git anaconda-client numpy conda-verify beautifulsoup4 pytest-mock filelock pkginfo psutil + - pip install pytest-mp - if "%PYTHON_VERSION%" == "2.7" conda install -q scandir # this is to ensure dependencies - python --version @@ -83,10 +84,10 @@ test_script: # no libpng here because we already have the right version from the 3.5 install - conda create -n blarg -yq --download-only python=3.6 - conda create -n blarg -yq --download-only cmake - - py.test --color=yes -v --cov conda_build --cov-report xml tests --basetemp C:\cbtmp -n 0 -m "serial" + - py.test --color=yes -v --cov conda_build --cov-report xml tests --basetemp C:\cbtmp -m "serial" # remove all folders to avoid permission errors. Leave root files (may have coverage info there) - for /d %%F in (c:\cbtmp\*) do rd /s /q "%%F" - - py.test --color=yes -v --cov conda_build --cov-report xml --cov-append tests --basetemp C:\cbtmp -n 2 -m "not serial" + - py.test --color=yes -v --cov conda_build --cov-report xml --cov-append tests --basetemp C:\cbtmp --mp -m "not serial" # For debugging, this is helpful - zip up the test environment and make it available for later download. # However, it eats up a fair amount of time. Better to disable until you need it. diff --git a/conda_build/metadata.py b/conda_build/metadata.py index f337398a1f..a6b45a6d2e 100644 --- a/conda_build/metadata.py +++ b/conda_build/metadata.py @@ -208,9 +208,8 @@ def select_lines(data, namespace, variants_in_place): def yamlize(data): try: - loader_instance = copy.deepcopy(loader) - with stringify_numbers(loader_instance): - loaded_data = yaml.load(data, Loader=loader_instance) + with stringify_numbers(): + loaded_data = yaml.load(data, Loader=loader) return loaded_data except yaml.error.YAMLError as e: if '{{' in data: @@ -797,7 +796,7 @@ def trim_build_only_deps(metadata, requirements_used): @contextlib.contextmanager -def stringify_numbers(loader): +def stringify_numbers(): # ensure that numbers are not interpreted as ints or floats. That trips up versions # with trailing zeros. implicit_resolver_backup = loader.yaml_implicit_resolvers.copy() diff --git a/setup.cfg b/setup.cfg index 2c2669aeae..0af36ab1bb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,6 +17,7 @@ env = PYTHONHASHSEED=0 markers = serial: execute test serially (to avoid race conditions) + mp_group_info: for pytest-mp [versioneer] VCS = git