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

Negative matching 'files' for outputs #4196

Closed
duncanmmacleod opened this issue Feb 19, 2021 · 1 comment · Fixed by #5216
Closed

Negative matching 'files' for outputs #4196

duncanmmacleod opened this issue Feb 19, 2021 · 1 comment · Fixed by #5216
Assignees

Comments

@duncanmmacleod
Copy link
Contributor

Actual Behavior

There is currently no good way to exclude one or more files from being included in an output package that uses files.

Expected Behavior

Support for some sort of negative match condition that is collected and applied after the positive glob expressions are resolved. Anything analogous to the %exclude macro you can use in RPM spec files would be great.

Perhaps something as simple as a leading exclamation ! would work:

outputs:
  - name: mpyackage
    files:
      - bin/mypackage*
      - "!bin/mypackage-optional*"

  - name: mypackage-optional
    files:
      - bin/mypackage-optional

[AFAIK the exclamation is special in YAML, so it would have to be quoted always]

I'm happy to contribute to development, if other people think this is a good idea.

@mingwandroid
Copy link
Contributor

Sounds good

duncanmmacleod added a commit to duncanmmacleod/conda-build that referenced this issue Feb 19, 2021
duncanmmacleod added a commit to duncanmmacleod/conda-build that referenced this issue Oct 4, 2021
@chenghlee chenghlee self-assigned this Oct 11, 2021
@chenghlee chenghlee added this to the Release TBD milestone Oct 11, 2021
duncanmmacleod added a commit to duncanmmacleod/conda-build that referenced this issue Nov 9, 2021
@beeankha beeankha removed this from the Release TBD milestone Aug 25, 2023
jaimergp added a commit that referenced this issue Jun 7, 2024
…glob in outputs/files (#5216)

* conda_build.build: simple implementation of files exclusion

closes #4196

* tests: add test for glob exclusion in files

* add docs for negative file matches

* news: add negative file match news entry

* conda_build.build: support separate include/exclude file lists

as keys in `files`

* REF: Only consider new files to the PREFIX when file picking

* Update docs/source/resources/define-metadata.rst

* Update define-metadata.rst

* Update files-exclude.rst

* STY: Add missing __future__ import

* STY: Address RUFF lints

* STY: Remove extra whitespace in news

* BUG: Use default value to make API backwards-compatible

* Update news/files-exclude.rst

Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>

* REF: Prevent errors when outputs/files is None

* TST: Robust testing of new filematching

* TST: Use defaults packages instead of conda-forge

* DOC: Use admonition to warn users about explicit file lists

* DOC: Update explicit file lists docs

* DOC: Fix RST syntax

* DOC: Fix RST syntax

* DOC: Fix RST syntax

* DOC: Fix RST syntax

* TST: Prevent missing glob match error in test

* DOC: Fix RST syntax

Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>

* Update news to new template style

* DOC: Fixup syntax highlighting in adjacent section

* TST: Mark subpackage tests as serial tests to avoid errors on osx

* TST: Avoid package collisions in subpackage tests

Package collisions cause errors.

* TST: Avoid more package collisions in tests

* Fix tests

For some reason, target_platform is not set.

* Update docs/source/resources/define-metadata.rst

* Remove serial

Co-authored-by: Daniel Ching <carterbox@users.noreply.github.com>

* Update docs/source/resources/define-metadata.rst

Co-authored-by: Bianca Henderson <beeankha@gmail.com>

* REF: Use walrus operator to reduce conditions

Co-authored-by: Ken Odegard <kodegard@anaconda.com>

---------

Co-authored-by: Duncan Macleod <duncan.macleod@ligo.org>
Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
Co-authored-by: Isuru Fernando <isuruf@gmail.com>
Co-authored-by: Bianca Henderson <beeankha@gmail.com>
Co-authored-by: Ken Odegard <kodegard@anaconda.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
4 participants