rattler-build icon indicating copy to clipboard operation
rattler-build copied to clipboard

Allow to exclude test files from conda package

Open borchero opened this issue 1 year ago • 2 comments

Currently, whenever a recipe specifies test files, these test files end up in the final conda package. For example,

source:
  path: ../
build:
  number: 0
  noarch: python
package:
  name: test
  version: v1
requirements:
  run:
    - python >=3.9
tests:
  - script: test -f foo.txt
    files:
      source:
        - foo.txt

causes foo.txt to end up in /etc/conda/test-files/test/0 of the final package.

In some cases, it would be desirable to not include these test files into the final package. Would it be possible to introduce a flag to prevent this behavior?


@pavelzw suggested that this might even make sense to do when --no-include-recipe is specified, I personally can't comment on that in detail :smile:

borchero avatar Nov 29 '24 12:11 borchero

Yeah this is how tests currently work. We could also think about creating additional -test packages automagically with a flag.

wolfv avatar Nov 29 '24 12:11 wolfv

Side-note: I also just realized that specifying --no-test still copies these files 🫣

borchero avatar Nov 29 '24 13:11 borchero