From 5f8e71e47706aef1b67a0142d4b496152e87e8e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Thu, 2 Feb 2023 08:48:41 +0100 Subject: [PATCH 01/20] Add deployer documentation and simple example For #2686 --- examples.rst | 1 + .../extensions/deployers/custom_deployers.rst | 14 ++++ .../sources/custom_deployer_sources.rst | 76 +++++++++++++++++++ reference/extensions/deployers.rst | 62 ++++++++++++++- 4 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 examples/extensions/deployers/custom_deployers.rst create mode 100644 examples/extensions/deployers/sources/custom_deployer_sources.rst diff --git a/examples.rst b/examples.rst index 8f9d7ec6d0d8..76a2124b8ac1 100644 --- a/examples.rst +++ b/examples.rst @@ -9,6 +9,7 @@ Examples examples/conanfile/conanfile examples/extensions/commands/custom_commands + examples/extensions/deployers/custom_deployers examples/tools/cmake/cmake examples/tools/files/files examples/tools/meson/meson diff --git a/examples/extensions/deployers/custom_deployers.rst b/examples/extensions/deployers/custom_deployers.rst new file mode 100644 index 000000000000..1e3a1ccb37b5 --- /dev/null +++ b/examples/extensions/deployers/custom_deployers.rst @@ -0,0 +1,14 @@ +.. _examples_extensions_deployers: + + + + +Custom deployers +================ + + +.. toctree:: + :maxdepth: 2 + + + sources/custom_deployer_sources diff --git a/examples/extensions/deployers/sources/custom_deployer_sources.rst b/examples/extensions/deployers/sources/custom_deployer_sources.rst new file mode 100644 index 000000000000..f41542bdc7f0 --- /dev/null +++ b/examples/extensions/deployers/sources/custom_deployer_sources.rst @@ -0,0 +1,76 @@ +.. examples_extensions_deployers_sources: + +Copy sources from all your dependencies +======================================= + + + +Please, first of all, clone the sources to recreate this project. You can find them in the +`examples2.0 repository `_ in GitHub: + +.. code-block:: bash + + $ git clone https://github.com/conan-io/examples2.git + $ cd examples2/examples/extensions/deployers/sources + + +In this example we are going to see how to create and use a custom deployer. +This deployer copies all the source files from your dependencies and puts them in a specific output folder.output_folder + +.. note: + + To better understand this example, it is highly recommended to have previously read the :ref:`Deployers ` reference. + + +Locate the deployer +------------------- + +In this case, the deployer is located in the same directory than our example conanfile, +but as show in :ref:`Deployers ` reference, +Conan will look for the specified deployer in a few extra places besides the current working directory, +including as an absolute path, and in ``[YOUR_CONAN_HOME]/extensions/deploy/``. + + +Run it +------ + +For our example, we have a simple recipe that only lists ``zlib`` as a requirement. +With the help of the ``tools.build:download_source=True`` conf, we can force the invocation of its ``source()`` method, +which will ensure that sources are available even if no build needs to be carried out. + +Now, you should be able to use the new deployer in both ``conan install`` and ``conan graph`` commands for any given recipe: + +.. code-block:: bash + + $ conan graph info . -c tools.build:download_source=True --deploy=sources_deploy + + + +Inspecting the command output we can see that it copied the sources of all our dependencies (direct and transitive) +to a ``dependency_sources`` folder. After this, extra preprocessing could be accomplished to more specific needs. + +Code tour +--------- + +The **source_deploy.py** file has the following code: + + +**sources_deploy.py** + +.. code-block:: python + + from conan.tools.files import copy + import os + + + def deploy(graph, output_folder): + for name, dep in graph.root.conanfile.dependencies.items(): + copy(dep, "*", dep.folders.source_folder, os.path.join(output_folder, "dependency_sources", str(dep))) + + +deploy() +++++++++ + +The ``deploy()`` method is called by Conan, and gets both a dependency graph (``conans.client.graph.graph.DepsGraph``) +and an output folder path as arguments. It iterates all the dependencies of our recipe, +and copies every source file to their respective folder under ``dependency_sources`` using :ref:`conan.tools.copy`. \ No newline at end of file diff --git a/reference/extensions/deployers.rst b/reference/extensions/deployers.rst index db0cee572b0a..eb6d5e227a49 100644 --- a/reference/extensions/deployers.rst +++ b/reference/extensions/deployers.rst @@ -1,5 +1,65 @@ .. _reference_extensions_deployers: Deployers ---------- +========= +Deployers are a mechanism to facilitate copying files form one folder, usually the Conan cache, to user folders. +While Conan provides two built-in ones (``full_deploy`` and ``direct_deploy``), users can easily manage their own +with ``conan config install``. + +Deployers run before generators, and they can change the target folders. +For example, if the ``--deploy=full_deploy`` deployer runs before ``CMakeDeps``, +the files generated by ``CMakeDeps`` will point to the local copy in the user folder done by the ``full_deploy`` deployer, +and not to the Conan cache. + +Deployers can be multi-configuration. Running ``conan install . --deploy=full_deploy`` repeatedly for different profiles +can achieve a fully self-contained project, including all the artifacts, binaries, and build files. +This project would be completely independent of Conan and no longer require it at all to build. + + +Built-in deployers +------------------ + +.. _reference_extensions_deployer_full_deploy: + +full_deploy() +^^^^^^^^^^^^^ + +Deploys to ``output_folder`` + ``host/dep/0.1/Release/x86_64`` subfolder + + +.. _reference_extensions_deployer_direct_deploy: + +direct_deploy() +^^^^^^^^^^^^^^^ + +Deploys only your direct dependencies to ``output_folder`` + + + +Custom deployers +---------------- + +Custom deployers can be managed via ``conan config install``. When looking for a specific deployer, +Conan will look in these locations for the deployer in the following order: + +#. Absolute paths +#. Relative to cwd +#. In the ``conancache/extensions/deploy`` folder +#. Built-in deployers + +For each installed file, Conan will look for a ``deploy()`` method which to call. +The function signature of your custom deployers should be as follows: + +**my_custom_deployer.py** + +.. code-block:: python + + def deploy(graph: conans.client.graph.graph.DepsGraph, output_folder: str): + +(Note that the arguments are passed as named parameters, so both the ``graph`` and ``output_folder`` names are mandatory) + +Your custom deployer can then be invoked as if it were a built-in deployer using the filename in which it's found, +in this case ``conan install . --deploy=my_custom_deployer``. + +See the :ref:`custom deployers` section for examples on how to implement your own deployers. \ No newline at end of file From 82209886ced3fc2e249cf1a05690ba4821772e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Thu, 2 Feb 2023 08:51:42 +0100 Subject: [PATCH 02/20] Fix note formatting and typo --- .../extensions/deployers/sources/custom_deployer_sources.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/extensions/deployers/sources/custom_deployer_sources.rst b/examples/extensions/deployers/sources/custom_deployer_sources.rst index f41542bdc7f0..849e6284e0a4 100644 --- a/examples/extensions/deployers/sources/custom_deployer_sources.rst +++ b/examples/extensions/deployers/sources/custom_deployer_sources.rst @@ -15,9 +15,9 @@ Please, first of all, clone the sources to recreate this project. You can find t In this example we are going to see how to create and use a custom deployer. -This deployer copies all the source files from your dependencies and puts them in a specific output folder.output_folder +This deployer copies all the source files from your dependencies and puts them in a specific output folder -.. note: +.. note:: To better understand this example, it is highly recommended to have previously read the :ref:`Deployers ` reference. From 43c14b17afb35ca2d0ad1a8d67567cc94f26ab80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Thu, 2 Feb 2023 09:36:40 +0100 Subject: [PATCH 03/20] Use root conanfile for copy --- .../extensions/deployers/sources/custom_deployer_sources.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/extensions/deployers/sources/custom_deployer_sources.rst b/examples/extensions/deployers/sources/custom_deployer_sources.rst index 849e6284e0a4..f5ac02e5a382 100644 --- a/examples/extensions/deployers/sources/custom_deployer_sources.rst +++ b/examples/extensions/deployers/sources/custom_deployer_sources.rst @@ -65,7 +65,7 @@ The **source_deploy.py** file has the following code: def deploy(graph, output_folder): for name, dep in graph.root.conanfile.dependencies.items(): - copy(dep, "*", dep.folders.source_folder, os.path.join(output_folder, "dependency_sources", str(dep))) + copy(graph.root.conanfile, "*", dep.folders.source_folder, os.path.join(output_folder, "dependency_sources", str(dep))) deploy() From d71b4bb1ed63f4f774e165e2239b6d487a045d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Mon, 6 Feb 2023 11:12:14 +0100 Subject: [PATCH 04/20] Update reference/extensions/deployers.rst Co-authored-by: James --- reference/extensions/deployers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/extensions/deployers.rst b/reference/extensions/deployers.rst index eb6d5e227a49..0d888dcf663b 100644 --- a/reference/extensions/deployers.rst +++ b/reference/extensions/deployers.rst @@ -45,7 +45,7 @@ Conan will look in these locations for the deployer in the following order: #. Absolute paths #. Relative to cwd -#. In the ``conancache/extensions/deploy`` folder +#. In the ``[CONAN_HOME]/extensions/deploy`` folder #. Built-in deployers For each installed file, Conan will look for a ``deploy()`` method which to call. From 721372a72ad083be5cbf014c738e45e48d11f26d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Mon, 6 Feb 2023 12:14:56 +0100 Subject: [PATCH 05/20] Address review comments --- .../sources/custom_deployer_sources.rst | 14 +++++---- reference/extensions/deployers.rst | 29 +++++++++++++------ 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/examples/extensions/deployers/sources/custom_deployer_sources.rst b/examples/extensions/deployers/sources/custom_deployer_sources.rst index f5ac02e5a382..d5b54ae44b42 100644 --- a/examples/extensions/deployers/sources/custom_deployer_sources.rst +++ b/examples/extensions/deployers/sources/custom_deployer_sources.rst @@ -27,8 +27,12 @@ Locate the deployer In this case, the deployer is located in the same directory than our example conanfile, but as show in :ref:`Deployers ` reference, -Conan will look for the specified deployer in a few extra places besides the current working directory, -including as an absolute path, and in ``[YOUR_CONAN_HOME]/extensions/deploy/``. +Conan will look for the specified deployer in a few extra places in order, namely: + +#. Absolute paths +#. Relative to cwd +#. In the ``[CONAN_HOME]/extensions/deploy`` folder +#. As built-in deployers Run it @@ -71,6 +75,6 @@ The **source_deploy.py** file has the following code: deploy() ++++++++ -The ``deploy()`` method is called by Conan, and gets both a dependency graph (``conans.client.graph.graph.DepsGraph``) -and an output folder path as arguments. It iterates all the dependencies of our recipe, -and copies every source file to their respective folder under ``dependency_sources`` using :ref:`conan.tools.copy`. \ No newline at end of file +The ``deploy()`` method is called by Conan, and gets both a dependency graph and an output folder path as arguments. +It iterates all the dependencies of our recipe, and copies every source file to their respective folders +under ``dependency_sources`` using :ref:`conan.tools.copy`. diff --git a/reference/extensions/deployers.rst b/reference/extensions/deployers.rst index 0d888dcf663b..889f8d68bf97 100644 --- a/reference/extensions/deployers.rst +++ b/reference/extensions/deployers.rst @@ -10,7 +10,8 @@ with ``conan config install``. Deployers run before generators, and they can change the target folders. For example, if the ``--deploy=full_deploy`` deployer runs before ``CMakeDeps``, the files generated by ``CMakeDeps`` will point to the local copy in the user folder done by the ``full_deploy`` deployer, -and not to the Conan cache. +and not to the Conan cache. Multiple deployers can be specified by supplying more than one ``--deploy=`` argument, +and they will be ran in order of appearance. Deployers can be multi-configuration. Running ``conan install . --deploy=full_deploy`` repeatedly for different profiles can achieve a fully self-contained project, including all the artifacts, binaries, and build files. @@ -25,7 +26,16 @@ Built-in deployers full_deploy() ^^^^^^^^^^^^^ -Deploys to ``output_folder`` + ``host/dep/0.1/Release/x86_64`` subfolder +Deploys each package folder of every dependency to your recipe's ``output_folder`` in a subfolder tree based on: + +#. The build context +#. The dependency name and version +#. The build type +#. The build arch + +Such that every dependency will end up in a folder such as: + +``[OUTPUT_FOLDER]/host/dep/0.1/Release/x86_64`` .. _reference_extensions_deployer_direct_deploy: @@ -33,8 +43,7 @@ Deploys to ``output_folder`` + ``host/dep/0.1/Release/x86_64`` subfolder direct_deploy() ^^^^^^^^^^^^^^^ -Deploys only your direct dependencies to ``output_folder`` - +Same as ``full_deploy()```, but only processes your recipe's *direct* dependencies. Custom deployers @@ -46,7 +55,7 @@ Conan will look in these locations for the deployer in the following order: #. Absolute paths #. Relative to cwd #. In the ``[CONAN_HOME]/extensions/deploy`` folder -#. Built-in deployers +#. As built-in deployers For each installed file, Conan will look for a ``deploy()`` method which to call. The function signature of your custom deployers should be as follows: @@ -55,11 +64,13 @@ The function signature of your custom deployers should be as follows: .. code-block:: python - def deploy(graph: conans.client.graph.graph.DepsGraph, output_folder: str): + def deploy(graph, output_folder: str): (Note that the arguments are passed as named parameters, so both the ``graph`` and ``output_folder`` names are mandatory) -Your custom deployer can then be invoked as if it were a built-in deployer using the filename in which it's found, -in this case ``conan install . --deploy=my_custom_deployer``. +You can access your conanfile object with ``graph.root.conanfile``. +See :ref:`ConanFile.dependencies` for information on how to iterate over its dependencies. +Your custom deployer can now be invoked as if it were a built-in deployer using the filename in which it's found, +in this case ``conan install . --deploy=my_custom_deployer``. Note that supplying the **.py** extension is optional. -See the :ref:`custom deployers` section for examples on how to implement your own deployers. \ No newline at end of file +See the :ref:`custom deployers` section for examples on how to implement your own deployers. From c6f43d306063cf878d834c95f8861eb2eb37f4e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Mon, 6 Feb 2023 12:40:44 +0100 Subject: [PATCH 06/20] Extra changes --- .../deployers/sources/custom_deployer_sources.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/extensions/deployers/sources/custom_deployer_sources.rst b/examples/extensions/deployers/sources/custom_deployer_sources.rst index d5b54ae44b42..794b5ad68b33 100644 --- a/examples/extensions/deployers/sources/custom_deployer_sources.rst +++ b/examples/extensions/deployers/sources/custom_deployer_sources.rst @@ -38,7 +38,7 @@ Conan will look for the specified deployer in a few extra places in order, namel Run it ------ -For our example, we have a simple recipe that only lists ``zlib`` as a requirement. +For our example, we have a simple recipe that lists both ``zlib`` and ``mcap`` as requirements. With the help of the ``tools.build:download_source=True`` conf, we can force the invocation of its ``source()`` method, which will ensure that sources are available even if no build needs to be carried out. @@ -49,9 +49,9 @@ Now, you should be able to use the new deployer in both ``conan install`` and `` $ conan graph info . -c tools.build:download_source=True --deploy=sources_deploy - -Inspecting the command output we can see that it copied the sources of all our dependencies (direct and transitive) -to a ``dependency_sources`` folder. After this, extra preprocessing could be accomplished to more specific needs. +Inspecting the command output we can see that it copied the sources of our direct dependencies ``zlib`` and ``mcap``, +**plus** the sources of our transitive dependencies, ``zstd``and ``lz4`` to a ``dependencies_sources`` folder. +After this is done, extra preprocessing could be done to accomplish more specific needs. Code tour --------- @@ -77,4 +77,4 @@ deploy() The ``deploy()`` method is called by Conan, and gets both a dependency graph and an output folder path as arguments. It iterates all the dependencies of our recipe, and copies every source file to their respective folders -under ``dependency_sources`` using :ref:`conan.tools.copy`. +under ``dependencies_sources`` using :ref:`conan.tools.copy`. From 72ed52ad7002233609e9b72d5884563c723f6a6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Mon, 6 Feb 2023 12:50:53 +0100 Subject: [PATCH 07/20] Update examples/extensions/deployers/sources/custom_deployer_sources.rst Co-authored-by: SSE4 --- .../extensions/deployers/sources/custom_deployer_sources.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/extensions/deployers/sources/custom_deployer_sources.rst b/examples/extensions/deployers/sources/custom_deployer_sources.rst index 794b5ad68b33..0c122d206a4b 100644 --- a/examples/extensions/deployers/sources/custom_deployer_sources.rst +++ b/examples/extensions/deployers/sources/custom_deployer_sources.rst @@ -25,7 +25,7 @@ This deployer copies all the source files from your dependencies and puts them i Locate the deployer ------------------- -In this case, the deployer is located in the same directory than our example conanfile, +In this case, the deployer is located in the same directory as our example conanfile, but as show in :ref:`Deployers ` reference, Conan will look for the specified deployer in a few extra places in order, namely: From 0aaecd01f03a8de0ab9304aef2e492c0ed71a43c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Mon, 6 Feb 2023 12:51:21 +0100 Subject: [PATCH 08/20] Update reference/extensions/deployers.rst Co-authored-by: SSE4 --- reference/extensions/deployers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/extensions/deployers.rst b/reference/extensions/deployers.rst index 889f8d68bf97..996d8a42ef9f 100644 --- a/reference/extensions/deployers.rst +++ b/reference/extensions/deployers.rst @@ -15,7 +15,7 @@ and they will be ran in order of appearance. Deployers can be multi-configuration. Running ``conan install . --deploy=full_deploy`` repeatedly for different profiles can achieve a fully self-contained project, including all the artifacts, binaries, and build files. -This project would be completely independent of Conan and no longer require it at all to build. +This project will be completely independent of Conan and no longer require it at all to build. Built-in deployers From 1b1363f8eefbb7b5ea5fddf56c2949734fb27384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Mon, 6 Feb 2023 12:52:27 +0100 Subject: [PATCH 09/20] Update examples/extensions/deployers/sources/custom_deployer_sources.rst Co-authored-by: SSE4 --- .../extensions/deployers/sources/custom_deployer_sources.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/extensions/deployers/sources/custom_deployer_sources.rst b/examples/extensions/deployers/sources/custom_deployer_sources.rst index 0c122d206a4b..96437adaee96 100644 --- a/examples/extensions/deployers/sources/custom_deployer_sources.rst +++ b/examples/extensions/deployers/sources/custom_deployer_sources.rst @@ -32,7 +32,7 @@ Conan will look for the specified deployer in a few extra places in order, namel #. Absolute paths #. Relative to cwd #. In the ``[CONAN_HOME]/extensions/deploy`` folder -#. As built-in deployers +#. Built-in deployers Run it From 9d501ef34d1da2d74ec743a7aea3213032cf42d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Mon, 6 Feb 2023 12:52:34 +0100 Subject: [PATCH 10/20] Update examples/extensions/deployers/sources/custom_deployer_sources.rst Co-authored-by: SSE4 --- .../extensions/deployers/sources/custom_deployer_sources.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/extensions/deployers/sources/custom_deployer_sources.rst b/examples/extensions/deployers/sources/custom_deployer_sources.rst index 96437adaee96..3f27a2f5bb04 100644 --- a/examples/extensions/deployers/sources/custom_deployer_sources.rst +++ b/examples/extensions/deployers/sources/custom_deployer_sources.rst @@ -26,7 +26,7 @@ Locate the deployer ------------------- In this case, the deployer is located in the same directory as our example conanfile, -but as show in :ref:`Deployers ` reference, +but as shown in :ref:`Deployers ` reference, Conan will look for the specified deployer in a few extra places in order, namely: #. Absolute paths From 12fac7a713b993f0bc02f96bc697cd6e1c966680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Mon, 6 Feb 2023 12:53:22 +0100 Subject: [PATCH 11/20] Update examples/extensions/deployers/sources/custom_deployer_sources.rst Co-authored-by: SSE4 --- .../extensions/deployers/sources/custom_deployer_sources.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/extensions/deployers/sources/custom_deployer_sources.rst b/examples/extensions/deployers/sources/custom_deployer_sources.rst index 3f27a2f5bb04..91346cffa387 100644 --- a/examples/extensions/deployers/sources/custom_deployer_sources.rst +++ b/examples/extensions/deployers/sources/custom_deployer_sources.rst @@ -15,7 +15,7 @@ Please, first of all, clone the sources to recreate this project. You can find t In this example we are going to see how to create and use a custom deployer. -This deployer copies all the source files from your dependencies and puts them in a specific output folder +This deployer copies all the source files from your dependencies and puts them into a specific output folder .. note:: From 80ed7f1797191b4b704b0e13c5feef0553179a23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Mon, 6 Feb 2023 14:25:07 +0100 Subject: [PATCH 12/20] Update reference/extensions/deployers.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Francisco Ramírez --- reference/extensions/deployers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/extensions/deployers.rst b/reference/extensions/deployers.rst index 996d8a42ef9f..c095b1dec4f3 100644 --- a/reference/extensions/deployers.rst +++ b/reference/extensions/deployers.rst @@ -33,7 +33,7 @@ Deploys each package folder of every dependency to your recipe's ``output_folder #. The build type #. The build arch -Such that every dependency will end up in a folder such as: +Then every dependency will end up in a folder such as: ``[OUTPUT_FOLDER]/host/dep/0.1/Release/x86_64`` From 26da31aae53a851e79d93769803110cb12a583d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Mon, 6 Feb 2023 14:25:40 +0100 Subject: [PATCH 13/20] Update reference/extensions/deployers.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Francisco Ramírez --- reference/extensions/deployers.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/reference/extensions/deployers.rst b/reference/extensions/deployers.rst index c095b1dec4f3..e7089fb75996 100644 --- a/reference/extensions/deployers.rst +++ b/reference/extensions/deployers.rst @@ -60,7 +60,6 @@ Conan will look in these locations for the deployer in the following order: For each installed file, Conan will look for a ``deploy()`` method which to call. The function signature of your custom deployers should be as follows: -**my_custom_deployer.py** .. code-block:: python From f3a31e18e6a7785a10bc07687dd80e52bcc6ad65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Mon, 6 Feb 2023 14:25:55 +0100 Subject: [PATCH 14/20] Update examples/extensions/deployers/sources/custom_deployer_sources.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Francisco Ramírez --- .../extensions/deployers/sources/custom_deployer_sources.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/extensions/deployers/sources/custom_deployer_sources.rst b/examples/extensions/deployers/sources/custom_deployer_sources.rst index 91346cffa387..3288df959a61 100644 --- a/examples/extensions/deployers/sources/custom_deployer_sources.rst +++ b/examples/extensions/deployers/sources/custom_deployer_sources.rst @@ -59,7 +59,6 @@ Code tour The **source_deploy.py** file has the following code: -**sources_deploy.py** .. code-block:: python From 21f66b4bb1915cf3f456af9728764e7e8faf1c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Mon, 6 Feb 2023 14:26:09 +0100 Subject: [PATCH 15/20] Update examples/extensions/deployers/sources/custom_deployer_sources.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Francisco Ramírez --- .../extensions/deployers/sources/custom_deployer_sources.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/extensions/deployers/sources/custom_deployer_sources.rst b/examples/extensions/deployers/sources/custom_deployer_sources.rst index 3288df959a61..93cb32ebee11 100644 --- a/examples/extensions/deployers/sources/custom_deployer_sources.rst +++ b/examples/extensions/deployers/sources/custom_deployer_sources.rst @@ -61,6 +61,7 @@ The **source_deploy.py** file has the following code: .. code-block:: python + :caption: **sources_deploy.py** from conan.tools.files import copy import os From faf136555ca70d6a6838773de132180d425f5334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Mon, 6 Feb 2023 14:26:32 +0100 Subject: [PATCH 16/20] Update reference/extensions/deployers.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Francisco Ramírez --- reference/extensions/deployers.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/extensions/deployers.rst b/reference/extensions/deployers.rst index e7089fb75996..05d46ebdfc43 100644 --- a/reference/extensions/deployers.rst +++ b/reference/extensions/deployers.rst @@ -62,6 +62,7 @@ The function signature of your custom deployers should be as follows: .. code-block:: python + :caption: **my_custom_deployer.py** def deploy(graph, output_folder: str): From 27448c79a5ede749f50be1b187c99af6734a0ad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Mon, 6 Feb 2023 14:26:58 +0100 Subject: [PATCH 17/20] Update examples/extensions/deployers/sources/custom_deployer_sources.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Francisco Ramírez --- .../extensions/deployers/sources/custom_deployer_sources.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/extensions/deployers/sources/custom_deployer_sources.rst b/examples/extensions/deployers/sources/custom_deployer_sources.rst index 93cb32ebee11..ebc5defa2b75 100644 --- a/examples/extensions/deployers/sources/custom_deployer_sources.rst +++ b/examples/extensions/deployers/sources/custom_deployer_sources.rst @@ -76,5 +76,5 @@ deploy() ++++++++ The ``deploy()`` method is called by Conan, and gets both a dependency graph and an output folder path as arguments. -It iterates all the dependencies of our recipe, and copies every source file to their respective folders +It iterates all the dependencies of our recipe and copies every source file to their respective folders under ``dependencies_sources`` using :ref:`conan.tools.copy`. From f774c5e8291a8a7ab6f0290936d2b1c27e251b37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Mon, 6 Feb 2023 14:27:15 +0100 Subject: [PATCH 18/20] Update reference/extensions/deployers.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Francisco Ramírez --- reference/extensions/deployers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/extensions/deployers.rst b/reference/extensions/deployers.rst index 05d46ebdfc43..d2e59b155e7b 100644 --- a/reference/extensions/deployers.rst +++ b/reference/extensions/deployers.rst @@ -57,7 +57,7 @@ Conan will look in these locations for the deployer in the following order: #. In the ``[CONAN_HOME]/extensions/deploy`` folder #. As built-in deployers -For each installed file, Conan will look for a ``deploy()`` method which to call. +Conan will look for a ``deploy()`` method to call for each installed file. The function signature of your custom deployers should be as follows: From 81c099312ae08991337b7f38976f5dedc63f79e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Mon, 6 Feb 2023 17:14:08 +0100 Subject: [PATCH 19/20] Remove fn parenthesis to full deployers --- reference/extensions/deployers.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/extensions/deployers.rst b/reference/extensions/deployers.rst index d2e59b155e7b..92e02cc958a1 100644 --- a/reference/extensions/deployers.rst +++ b/reference/extensions/deployers.rst @@ -23,8 +23,8 @@ Built-in deployers .. _reference_extensions_deployer_full_deploy: -full_deploy() -^^^^^^^^^^^^^ +full_deploy +^^^^^^^^^^^ Deploys each package folder of every dependency to your recipe's ``output_folder`` in a subfolder tree based on: @@ -40,10 +40,10 @@ Then every dependency will end up in a folder such as: .. _reference_extensions_deployer_direct_deploy: -direct_deploy() -^^^^^^^^^^^^^^^ +direct_deploy +^^^^^^^^^^^^^ -Same as ``full_deploy()```, but only processes your recipe's *direct* dependencies. +Same as ``full_deploy```, but only processes your recipe's *direct* dependencies. Custom deployers From 125bba4e8c9d9f8afa449a60af8a0c96f36eb80f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Ram=C3=ADrez?= Date: Mon, 6 Feb 2023 17:15:14 +0100 Subject: [PATCH 20/20] Update reference/extensions/deployers.rst --- reference/extensions/deployers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/extensions/deployers.rst b/reference/extensions/deployers.rst index 92e02cc958a1..bba1e298df83 100644 --- a/reference/extensions/deployers.rst +++ b/reference/extensions/deployers.rst @@ -43,7 +43,7 @@ Then every dependency will end up in a folder such as: direct_deploy ^^^^^^^^^^^^^ -Same as ``full_deploy```, but only processes your recipe's *direct* dependencies. +Same as ``full_deploy``, but only processes your recipe's *direct* dependencies. Custom deployers