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

Implement negative matching for files in outputs #4197

Closed
wants to merge 5 commits into from

Conversation

duncanmmacleod
Copy link
Contributor

This PR implements #4196 by adding supporting for a negative match expression for the files list in outputs.

Closes #4196.

@anaconda-issue-bot anaconda-issue-bot added the cla-signed [bot] added once the contributor has signed the CLA label Feb 19, 2021
@duncanmmacleod
Copy link
Contributor Author

@mingwandroid, I think this is ready for a review (sorry if there's a better @ ping for the conda-build team). The macOS jobs are failing, but the logs suggest it's not my fault..

@duncanmmacleod
Copy link
Contributor Author

Ping for anyone to review this.

Copy link
Member

@mbargull mbargull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to consider filenames starting with !.

Comment on lines 1622 to 1623
include = [f for f in files if not f.startswith('!')]
exclude = [f[1:] for f in files if f.startswith('!')]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to consider files which themselves start with a !. For example with gitignore you can start entries with \! for this.
Personally, I'd rather suggest to have a more explicit form to avoid these custom syntax and special cases (also wrt. YAML tags). I.e., I'd rather have files optionally be a dictionary with two keys:

  files:
    include:
      - *.txt
    exclude:
      - do-not-want.txt

.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, @mbargull!

Copy link
Member

@jezdez jezdez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I concur with @mbargull's comment, this should be done with a new exclude section instead of prepending the filename with !.

@github-actions
Copy link

Hi there, thank you for your contribution!

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this pull request to remain open please:

  1. Rebase and verify the changes still work
  2. Leave a comment with the current status

NOTE: If this pull request was closed prematurely, please leave a comment.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label Jul 30, 2023
@github-actions github-actions bot added the stale::closed [bot] closed after being marked as stale label Aug 29, 2023
@github-actions github-actions bot closed this Aug 29, 2023
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Aug 28, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed [bot] added once the contributor has signed the CLA locked [bot] locked due to inactivity stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Negative matching 'files' for outputs
5 participants