Skip to content

Commit e30e7cd

Browse files
committed
Update plugin install doc
Signed-off-by: Nig3l <[email protected]>
1 parent e6a3256 commit e30e7cd

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

docs/source/plugins.rst

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ Rez plugins require a specific folder structure as follows:
7676
/plugin_file2.py (your plugin file)
7777
etc.
7878
79-
To make your plugin available to rez, you can install them directly under
80-
``src/rezplugins`` (that's called a namespace package) or you can add
81-
the path to :envvar:`REZ_PLUGIN_PATH`.
82-
8379
Registering subcommands
8480
-----------------------
8581

@@ -137,4 +133,38 @@ so that the plugin manager will find them.
137133
from rez.plugin_managers import extend_path
138134
__path__ = extend_path(__path__, __name__)
139135
136+
Install plugins
137+
---------------
138+
139+
1. Copy directly to rez install folder
140+
141+
To make your plugin available to rez, you can install it directly under
142+
``src/rezplugins`` (that's called a namespace package).
143+
144+
2. Add the source path to :envvar:`REZ_PLUGIN_PATH`
140145

146+
Add the source path to the REZ_PLUGIN_PATH environment variable in order to make your plugin available to rez.
147+
148+
3. Create a setup.py
149+
150+
To make your plugin available to rez, you can also create a ``setup.py`` file
151+
that will allow you to install your plugin with `pip install` command.
152+
153+
.. code-block:: python
154+
:caption: setup.py
155+
156+
from setuptools import setup, find_packages
157+
158+
setup(
159+
name="foo",
160+
version="0.1.0",
161+
package_dir={
162+
"foo": "foo"
163+
},
164+
packages=find_packages(where="."),
165+
entry_points={
166+
'rez.plugins': [
167+
'foo_cmd = foo',
168+
]
169+
}
170+
)

0 commit comments

Comments
 (0)