Skip to content

Commit

Permalink
Merge branch 'develop2' into ar/clean-config-command
Browse files Browse the repository at this point in the history
  • Loading branch information
AbrilRBS authored Jan 14, 2025
2 parents 7c6e937 + 0b8b150 commit 9b00fe1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions conan/api/subapi/remove.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Optional

from conan.api.model import Remote
from conan.internal.conan_app import ConanBasicApp
from conans.model.package_ref import PkgReference
Expand All @@ -9,7 +11,7 @@ class RemoveAPI:
def __init__(self, conan_api):
self.conan_api = conan_api

def recipe(self, ref: RecipeReference, remote: Remote=None):
def recipe(self, ref: RecipeReference, remote: Optional[Remote] = None):
assert ref.revision, "Recipe revision cannot be None to remove a recipe"
"""Removes the recipe (or recipe revision if present) and all the packages (with all prev)"""
app = ConanBasicApp(self.conan_api)
Expand All @@ -20,7 +22,7 @@ def recipe(self, ref: RecipeReference, remote: Remote=None):
recipe_layout = app.cache.recipe_layout(ref)
app.cache.remove_recipe_layout(recipe_layout)

def all_recipe_packages(self, ref: RecipeReference, remote: Remote = None):
def all_recipe_packages(self, ref: RecipeReference, remote: Optional[Remote] = None):
assert ref.revision, "Recipe revision cannot be None to remove a recipe"
"""Removes all the packages from the provided reference"""
app = ConanBasicApp(self.conan_api)
Expand All @@ -38,7 +40,7 @@ def _remove_all_local_packages(app, ref):
package_layout = app.cache.pkg_layout(pref)
app.cache.remove_package_layout(package_layout)

def package(self, pref: PkgReference, remote: Remote):
def package(self, pref: PkgReference, remote: Optional[Remote]):
assert pref.ref.revision, "Recipe revision cannot be None to remove a package"
assert pref.revision, "Package revision cannot be None to remove a package"

Expand Down

0 comments on commit 9b00fe1

Please sign in to comment.