-
Notifications
You must be signed in to change notification settings - Fork 992
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding migration warnings for internal model
- Loading branch information
1 parent
67ea889
commit db23cef
Showing
4 changed files
with
57 additions
and
141 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from conan.api.output import ConanOutput | ||
from conan.internal.model.package_ref import PkgReference as _PkgReference | ||
|
||
_msg = """ | ||
******************************************************************* | ||
private '{}' | ||
detected in user code (custom commands, extensions, recipes, etc). | ||
Stop using it, use only public documented APIs. | ||
******************************************************************* | ||
""" | ||
|
||
|
||
class PkgReference(_PkgReference): | ||
usage_counter = 0 | ||
|
||
def __init__(self, *args, **kwargs): | ||
if PkgReference.usage_counter == 0: | ||
ConanOutput().warning(_msg.format("from conans.model.package_ref import PkgReference")) | ||
PkgReference.usage_counter += 1 | ||
super(PkgReference, self).__init__(*args, **kwargs) | ||
|
||
@staticmethod | ||
def loads(*args, **kwargs): | ||
if PkgReference.usage_counter == 0: | ||
ConanOutput().warning(_msg.format("from conans.model.package_ref import PkgReference"), | ||
warn_tag="deprecated") | ||
PkgReference.usage_counter += 1 | ||
return _PkgReference.loads(*args, **kwargs) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from conan.api.output import ConanOutput | ||
from conan.internal.model.recipe_ref import RecipeReference as _RecipeReference | ||
|
||
_msg = """ | ||
******************************************************************* | ||
private '{}' | ||
detected in user code (custom commands, extensions, recipes, etc). | ||
Stop using it, use only public documented APIs. | ||
******************************************************************* | ||
""" | ||
|
||
|
||
class RecipeReference(_RecipeReference): | ||
usage_counter = 0 | ||
|
||
def __init__(self, *args, **kwargs): | ||
if RecipeReference.usage_counter == 0: | ||
ConanOutput().warning(_msg.format("from conans.model.recipe_ref import RecipeReference"), | ||
warn_tag="deprecated") | ||
RecipeReference.usage_counter += 1 | ||
super(RecipeReference, self).__init__(*args, **kwargs) | ||
|
||
@staticmethod | ||
def loads(*args, **kwargs): | ||
if RecipeReference.usage_counter == 0: | ||
ConanOutput().warning(_msg.format("from conans.model.recipe_ref import RecipeReference"), | ||
warn_tag="deprecated") | ||
RecipeReference.usage_counter += 1 | ||
return _RecipeReference.loads(*args, **kwargs) |