Skip to content

conda-build behaves unpredictably with slashes and backslashes if you use pytest command with the --ignore flag and run SP_DIR/tests (only on Winodws) #5759

@skupr-anaconda

Description

@skupr-anaconda

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

conda-build behaves unpredictably in the test environment. Look at slashes:

    - pytest -v ${SP_DIR}/json_merge_patch/tests.py  # [unix]
    - pytest -v %SP_DIR%/json_merge_patch/tests.py  # [win]

They work. See an example AnacondaRecipes/json-merge-patch-feedstock#1

I tried the same for python-gssapi with --ignore=%SP_DIR%/path/to_test but slashes and backslashes fail on Windows if you try to ignore tests. Only two feedstocks in aggregate repo run pytest with %SP_DIR% on Windows:

rg "pytest.*%SP_DIR%"
pyarrow-18.1.x-feedstock/recipe/meta.yaml
116:    - python -m pytest -v -k "not ({{ tests_to_skip }})" %SP_DIR%/pyarrow  # [win and py<313]

pyarrow-feedstock/recipe/meta.yaml
116:    - python -m pytest -v -k "not ({{ tests_to_skip }})" %SP_DIR%/pyarrow  # [win and py<313]

but no one has the ignore flag.

As a result, I skipped python-gssapi's tests on Windows AnacondaRecipes/python-gssapi-feedstock#3

Conda Info

Conda Config

Conda list

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    os::windowsrelevant to Windowstype::bugdescribes erroneous operation, use severity::* to classify the type

    Type

    No type

    Projects

    Status

    TODO 📬

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions