Move some recipe-related deprecations to policy-based#19892
Merged
Conversation
memsharded
approved these changes
Apr 22, 2026
czoido
reviewed
Apr 23, 2026
czoido
reviewed
Apr 23, 2026
czoido
reviewed
Apr 23, 2026
czoido
reviewed
Apr 23, 2026
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
franramirez688
left a comment
Contributor
There was a problem hiding this comment.
I think that, given the pattern, we could make something like:
conf.py
BUILT_IN_POLICIES = {
"policy": (msg, error_msg)
}
def check_policy(self, policy):
# ...xxxx.py
conan_api.config.check_policy("xxxxxx")Wdyt?
Member
I am not sure we want a public API for this. What is the user programmatic use case? The users already have control over that with their inputs in global.conf and recipes. |
Contributor
I was not thinking of public API usage. I put that as public without realizing this is exposed to the public. I simply meant that having an internal function/mechanism to check that would be helpful for us. |
franramirez688
approved these changes
Apr 27, 2026
czoido
approved these changes
Apr 27, 2026
memsharded
pushed a commit
to memsharded/conan
that referenced
this pull request
Apr 27, 2026
* Put Conanfile path accessors under conf * Fix tests to use conf * Fix test syntaxt * tests for path methods * Failing test for deprecation * Failing test for deprecation * Core conf * wip * Naming * Use global conf * Typo * Update conan/internal/model/conf.py Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * Update conan/cli/printers/graph.py Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * Cleanup conanfile diff * Tests for ensuring we remove support for this in 2.32 --------- Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
czoido
added a commit
that referenced
this pull request
Apr 28, 2026
…required_conan_version`` (#19907) * decouple new core:policy_conan_version * review, using OR * Extra test case, test cleanup * reduce diff * Fix `transitive_libs=True` when using CMakeConfigDeps for shared libraries (#19815) * Failing test * Porposed fix * Shared * Cleanup API, cleanup example * Better api * Update test_cmakeconfigdeps_new.py * Better use libs * trying if 'req.libs' is enough * Test! * review * new test, more real with transitive_headers=True and static function * Static variant just in case --------- Co-authored-by: Francisco Ramírez <franchuti688@gmail.com> Co-authored-by: memsharded <james@conan.io> * Move some recipe-related deprecations to policy-based (#19892) * Put Conanfile path accessors under conf * Fix tests to use conf * Fix test syntaxt * tests for path methods * Failing test for deprecation * Failing test for deprecation * Core conf * wip * Naming * Use global conf * Typo * Update conan/internal/model/conf.py Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * Update conan/cli/printers/graph.py Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * Cleanup conanfile diff * Tests for ensuring we remove support for this in 2.32 --------- Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * new policies * review * fix tests * fix conf help --------- Co-authored-by: Abril Rincón Blanco <5364255+AbrilRBS@users.noreply.github.com> Co-authored-by: Francisco Ramírez <franchuti688@gmail.com> Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
czoido
added a commit
to czoido/conan
that referenced
this pull request
Apr 28, 2026
* Put Conanfile path accessors under conf * Fix tests to use conf * Fix test syntaxt * tests for path methods * Failing test for deprecation * Failing test for deprecation * Core conf * wip * Naming * Use global conf * Typo * Update conan/internal/model/conf.py Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * Update conan/cli/printers/graph.py Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * Cleanup conanfile diff * Tests for ensuring we remove support for this in 2.32 --------- Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
czoido
added a commit
to czoido/conan
that referenced
this pull request
Apr 28, 2026
…required_conan_version`` (conan-io#19907) * decouple new core:policy_conan_version * review, using OR * Extra test case, test cleanup * reduce diff * Fix `transitive_libs=True` when using CMakeConfigDeps for shared libraries (conan-io#19815) * Failing test * Porposed fix * Shared * Cleanup API, cleanup example * Better api * Update test_cmakeconfigdeps_new.py * Better use libs * trying if 'req.libs' is enough * Test! * review * new test, more real with transitive_headers=True and static function * Static variant just in case --------- Co-authored-by: Francisco Ramírez <franchuti688@gmail.com> Co-authored-by: memsharded <james@conan.io> * Move some recipe-related deprecations to policy-based (conan-io#19892) * Put Conanfile path accessors under conf * Fix tests to use conf * Fix test syntaxt * tests for path methods * Failing test for deprecation * Failing test for deprecation * Core conf * wip * Naming * Use global conf * Typo * Update conan/internal/model/conf.py Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * Update conan/cli/printers/graph.py Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * Cleanup conanfile diff * Tests for ensuring we remove support for this in 2.32 --------- Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * new policies * review * fix tests * fix conf help --------- Co-authored-by: Abril Rincón Blanco <5364255+AbrilRBS@users.noreply.github.com> Co-authored-by: Francisco Ramírez <franchuti688@gmail.com> Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog: Feature: Introduce policies in
core:policiesconf to control Conan behaviour.Changelog: Fix: Force
--order-byinconan graph build-order. Old deprecated behaviour can be restored until Conan 2.32 with thedeprecated_build_order_argspolicyChangelog: Fix: Remove support for empty version ranges. Old deprecated behaviour can be restored until Conan 2.32 with the
deprecated_empty_version_rangepolicyDocs: conan-io/docs#4436