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

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

Merged
merged 3 commits into from
Sep 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion reference/conanfile/methods/package_id.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ If we are creating a package for a tool, to be used as a ``tool_require``, and i
def package_id(self):
self.info.settings_target = self.settings_target


The ``conf`` items do not affect the ``package_id`` by default. It is possible to explicitly make them part of it at the recipe level with:

.. code-block:: python
Expand All @@ -154,6 +153,17 @@ The ``conf`` items do not affect the ``package_id`` by default. It is possible t

Although this can be achieved for all recipes without the ``package_id()`` method, using the ``tools.info.package_id:confs = ["user.myconf:myitem"]`` configuration.

**Using regex patterns:**
You can use regex patterns in the `tools.info.package_id:confs`. This means that instead
of specifying each individual configuration item, you can use a regex pattern to match
multiple configurations. This is particularly useful when dealing with a large number of
configurations or when configurations follow a predictable naming pattern. For instance:

- tools.info.package_id:confs=[`user.myconf:myitem*`] matches all configurations that start in `user.myconf:myitem`.
- tools.info.package_id:confs=[`.*`] matches all configurations.
- tools.info.package_id:confs=[`tools\..*`] matches configurations starting with "tools.".
- tools.info.package_id:confs=[`.*cmake`] matches configurations ending with "cmake".
- tools.info.package_id:confs=[`(tools.deploy|core)`] matches configurations starting with "tools.deploy" or "core".

.. seealso::

Expand Down