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

allow regex pattern for conf tools.info.package_id:confs #14621

Merged

Conversation

thorsten-klein
Copy link
Contributor

@thorsten-klein thorsten-klein commented Aug 30, 2023

Changelog: Feature: Supporting regex pattern for conf tools.info.package_id:confs
Docs: conan-io/docs#3382

Ref: #14620

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

@thorsten-klein thorsten-klein changed the title support conf pattern support regex pattern for conf tools.info.package_id:confs Aug 30, 2023
@thorsten-klein thorsten-klein changed the title support regex pattern for conf tools.info.package_id:confs allow regex pattern for conf tools.info.package_id:confs Aug 30, 2023
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

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

Hi @thorsten-klein

Thanks for your contribution!
I think this is looking good, but I'd try to generalize it to cover also user.* confs, I think it is doable.
Also, it is better if you target the release/2.0 branch, as that means it will go into the next 2.0.11, not need to wait until the 2.1.

# Pruning any empty values, those should not affect package ID
if value:
result.define(conf_name, value)
matching_confs = [c for c in BUILT_IN_CONFS if re.match(conf_name, c)] or [conf_name]
Copy link
Member

Choose a reason for hiding this comment

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

A quick question: If we also want to match the user.mycomp.* confs, then we would need to iterate better the defined values in the current conf, rather than matching against the BUILT_IN_CONFS? I think this would be a more general approach.

@memsharded memsharded added this to the 2.0.11 milestone Aug 31, 2023
@thorsten-klein thorsten-klein changed the base branch from develop2 to release/2.0 September 1, 2023 06:41
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