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

add recipe extension cep #72

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

wolfv
Copy link
Contributor

@wolfv wolfv commented Apr 13, 2024

No description provided.

@wolfv
Copy link
Contributor Author

wolfv commented Apr 13, 2024

Discussion:

Technically, it would be nicer to solve this with a flexible script. Challenge: we only want to run over the new files in the prefix.

Should we leak "rust" regex features? Would be easy to use them from Python as well. We can also turn off the regex feature where capture groups can be referenced easily with $....

Example from Rust docs:

string: "Springsteen, Bruce"
regex: (?<last>[^,\s]+),\s+(?<first>\S+)
replacement: "$first $last"
result: "Bruce Springsteen"

@jaimergp
Copy link
Contributor

Python has \g<name> and \g<number> for that. So maybe there's a way to convert things more or less easily. The $ syntax is reasonable enough to me.

@jaimergp
Copy link
Contributor

Challenge: we only want to run over the new files in the prefix.

Can that be injected in the post_build namespace? A \0 separated list of paths in an env var or something? Maybe it overflows 😬. Maybe a file can be placed somewhere strategically which, upon parsing, returns the newly detected files.

cep-recipe-extensions.md Outdated Show resolved Hide resolved
replacement: "$${PREFIX}/"
```

## Globs, positive and negative
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this have to do with recipe post-processing? 🤔

Choose a reason for hiding this comment

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

Yeah. This really feels like it should just be incorporated into the build script(s).

Choose a reason for hiding this comment

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

The positive/negative globs should be part of the recipe. Using the build scripts just to shuffle files around into separate output is a lot of core for little gain, especially because it's a well-defined operation and doesn't overload the recipe syntax IMO.

C.f. also conda/conda-build#5216

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No this doesn't really have anything to do with post-processing per se. The idea is that any list of globs can also include negative globs.

List of globs appear in multiple places in the recipe.

Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
@wolfv
Copy link
Contributor Author

wolfv commented May 10, 2024

TODO:

  • I have recently been thinking about adding the compression settings to the build section so that compression can be configured easily per-output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants