Skip to content

Commit

Permalink
fixing deploy->deployers naming arg and folder (#13740)
Browse files Browse the repository at this point in the history
Changelog: Fix: Renaming the cache "deploy" folder to "deployers" and
allow ``-d, --deployer`` cli arg. ("deploy" folder will not break but
will warn as deprecated)
Docs: https://github.com/conan-io/docs/pull/XXXX

Close #13734
  • Loading branch information
AbrilRBS authored Apr 21, 2023
2 parents 5100559 + 21c5e98 commit 85a1b7e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
6 changes: 3 additions & 3 deletions conan/cli/commands/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def graph_info(conan_api, parser, subparser, *args):
help="Show only the specified fields")
subparser.add_argument("--package-filter", action="append",
help='Print information only for packages that match the patterns')
subparser.add_argument("--deploy", action="append",
subparser.add_argument("-d", "--deployer", action="append",
help='Deploy using the provided deployer to the output folder')
subparser.add_argument("--build-require", action='store_true', default=False,
help='Whether the provided reference is a build-require')
Expand Down Expand Up @@ -165,9 +165,9 @@ def graph_info(conan_api, parser, subparser, *args):
lockfile = conan_api.lockfile.update_lockfile(lockfile, deps_graph, args.lockfile_packages,
clean=args.lockfile_clean)
conan_api.lockfile.save_lockfile(lockfile, args.lockfile_out, os.getcwd())
if args.deploy:
if args.deployer:
base_folder = os.getcwd()
do_deploys(conan_api, deps_graph, args.deploy, base_folder)
do_deploys(conan_api, deps_graph, args.deployer, base_folder)

return {"graph": deps_graph,
"field_filter": args.filter,
Expand Down
4 changes: 2 additions & 2 deletions conan/cli/commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def install(conan_api, parser, *args):
help='Generators to use')
parser.add_argument("-of", "--output-folder",
help='The root output folder for generated and build files')
parser.add_argument("--deploy", action="append",
parser.add_argument("-d", "--deployer", action="append",
help='Deploy using the provided deployer to the output folder')
parser.add_argument("--build-require", action='store_true', default=False,
help='Whether the provided reference is a build-require')
Expand Down Expand Up @@ -86,7 +86,7 @@ def install(conan_api, parser, *args):
generators=args.generator,
output_folder=output_folder,
source_folder=source_folder,
deploy=args.deploy
deploy=args.deployer
)

out.success("Install finished successfully")
Expand Down
15 changes: 8 additions & 7 deletions conans/client/cache/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from jinja2 import FileSystemLoader, Environment

from conan import conan_version
from conan.api.output import ConanOutput
from conan.internal.cache.cache import DataCache, RecipeLayout, PackageLayout
from conans.client.cache.editable import EditablePackages
from conans.client.cache.remote_registry import RemoteRegistry
Expand All @@ -27,8 +28,6 @@
EXTENSIONS_FOLDER = "extensions"
HOOKS_EXTENSION_FOLDER = "hooks"
PLUGINS_FOLDER = "plugins"
DEPLOYERS_EXTENSION_FOLDER = "deploy"
CUSTOM_COMMANDS_FOLDER = "commands"


# TODO: Rename this to ClientHome
Expand Down Expand Up @@ -186,7 +185,7 @@ def settings_path(self):

@property
def custom_commands_path(self):
return os.path.join(self.cache_folder, EXTENSIONS_FOLDER, CUSTOM_COMMANDS_FOLDER)
return os.path.join(self.cache_folder, EXTENSIONS_FOLDER, "commands")

@property
def custom_generators_path(self):
Expand All @@ -203,14 +202,16 @@ def default_profile_path(self):

@property
def hooks_path(self):
"""
:return: Hooks folder in client cache
"""
return os.path.join(self.cache_folder, EXTENSIONS_FOLDER, HOOKS_EXTENSION_FOLDER)

@property
def deployers_path(self):
return os.path.join(self.cache_folder, EXTENSIONS_FOLDER, DEPLOYERS_EXTENSION_FOLDER)
deploy = os.path.join(self.cache_folder, EXTENSIONS_FOLDER, "deploy")
if os.path.exists(deploy):
ConanOutput().warning("Use 'deployers' cache folder for deployers instead of 'deploy'",
warn_tag="deprecated")
return deploy
return os.path.join(self.cache_folder, EXTENSIONS_FOLDER, "deployers")

@property
def settings(self):
Expand Down

0 comments on commit 85a1b7e

Please sign in to comment.