Skip to content

Move some recipe-related deprecations to policy-based#19892

Merged
czoido merged 18 commits into
conan-io:develop2from
AbrilRBS:ar/policy-deprecated-recipe
Apr 27, 2026
Merged

Move some recipe-related deprecations to policy-based#19892
czoido merged 18 commits into
conan-io:develop2from
AbrilRBS:ar/policy-deprecated-recipe

Conversation

@AbrilRBS

@AbrilRBS AbrilRBS commented Apr 21, 2026

Copy link
Copy Markdown
Member

Changelog: Feature: Introduce policies in core:policies conf to control Conan behaviour.
Changelog: Fix: Force --order-by in conan graph build-order. Old deprecated behaviour can be restored until Conan 2.32 with the deprecated_build_order_args policy
Changelog: Fix: Remove support for empty version ranges. Old deprecated behaviour can be restored until Conan 2.32 with the deprecated_empty_version_range policy
Docs: conan-io/docs#4436

@AbrilRBS AbrilRBS added this to the 2.28.0 milestone Apr 21, 2026
@AbrilRBS AbrilRBS marked this pull request as ready for review April 22, 2026 15:57
Comment thread conan/internal/model/conf.py Outdated
Comment thread conan/cli/printers/graph.py Outdated
Comment thread conan/cli/printers/graph.py
Comment thread conan/internal/model/conan_file.py Outdated
AbrilRBS and others added 2 commits April 23, 2026 07:48
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>

@franramirez688 franramirez688 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

@memsharded

Copy link
Copy Markdown
Member

conan_api.config.check_policy("xxxxxx")

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.

@franramirez688

Copy link
Copy Markdown
Contributor

conan_api.config.check_policy("xxxxxx")

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.

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.

@AbrilRBS AbrilRBS marked this pull request as draft April 23, 2026 16:12
@AbrilRBS AbrilRBS marked this pull request as ready for review April 27, 2026 09:09
@czoido czoido merged commit 7df90ba into conan-io:develop2 Apr 27, 2026
17 checks passed
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>
@AbrilRBS AbrilRBS deleted the ar/policy-deprecated-recipe branch April 27, 2026 11:53
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>
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