-
Notifications
You must be signed in to change notification settings - Fork 354
Add plugin documentation page #1703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
JeanChristopheMorinPerso
merged 18 commits into
AcademySoftwareFoundation:main
from
BryceGattis:feature/add_plugin_docs
Apr 13, 2024
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
5d280b3
Add plugin documentation page
BryceGattis 32b773f
Update docs/source/plugins.rst
BryceGattis 0c474ed
Update docs/source/plugins.rst
BryceGattis 234389f
Add captions
BryceGattis b6c8060
Change plugin to plugin type
BryceGattis 095bdb3
Start fixing up extensions section, and add section about how to quer…
BryceGattis 95f6fce
Fix GitHub links, add new registering subcommands section.
BryceGattis 5877eb0
Change caption on file for clarity
BryceGattis ae8d55d
Add TODO for configuring plugins section
BryceGattis 52b86b9
Update docs/source/plugins.rst
BryceGattis 14739ab
Wording change
BryceGattis b7041a6
Fix header
BryceGattis de2a051
Add configuring plugins section
BryceGattis b5b61f9
Update docs/source/plugins.rst
BryceGattis 6bfabb3
Update docs/source/plugins.rst
BryceGattis 2d3b60c
Update docs/source/plugins.rst
BryceGattis 6454f22
Update docs/source/plugins.rst
BryceGattis a3d0de7
Specify where files go and add info on schema_dict
BryceGattis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
|
@@ -31,6 +31,7 @@ Welcome to rez's documentation! | |
managing_packages | ||
caching | ||
pip | ||
plugins | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
This file contains hidden or 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,66 @@ | ||
======= | ||
Plugins | ||
======= | ||
|
||
Plugins are extensions of rez that extend rez functionality. | ||
|
||
Plugins are currently bundled in the main rez repo, but will be split out | ||
to their own repos in the future. | ||
|
||
The plugins that exist are currently located at :gh-rez:`src/rezplugins`. | ||
BryceGattis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
Existing plugins | ||
BryceGattis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
================ | ||
|
||
- :gh-rez:`src/rezplugins/build_process` | ||
- :gh-rez:`src/rezplugins/build_system` | ||
- :gh-rez:`src/rezplugins/command` | ||
- :gh-rez:`src/rezplugins/build_process/package_repository` | ||
- :gh-rez:`src/rezplugins/build_process/release_hook` | ||
- :gh-rez:`src/rezplugins/build_process/release_vcs` | ||
- :gh-rez:`src/rezplugins/build_process/shell` | ||
|
||
Developing your own plugin | ||
========================== | ||
|
||
Rez plugins require a specific folder structure as follows: | ||
|
||
.. code-block:: text | ||
|
||
/plugin_name | ||
BryceGattis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
/__init__.py (adds plugin path to rez) | ||
/rezconfig.py (defines configuration settings for your plugin) | ||
/plugin_file1.py (your plugin file) | ||
/plugin_file2.py (your plugin file) | ||
etc. | ||
|
||
To make your plugin available to rez, you can install them directly under | ||
``src/rezplugins`` (that's called a namespace package) or you can add | ||
the path to :envvar:`REZ_PLUGIN_PATH`. | ||
|
||
Plugin types | ||
------------ | ||
|
||
There are two different plugin types in Rez. | ||
|
||
- Plugin | ||
- Extension | ||
|
||
Extensions differ from standard plugins in that they add a new command to rez's | ||
CLI. | ||
BryceGattis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
Required file contents | ||
---------------------- | ||
``__init__.py`` | ||
|
||
.. code-block:: python | ||
BryceGattis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
from rez.plugin_managers import extend_path | ||
__path__ = extend_path(__path__, __name__) | ||
|
||
``your_plugin_file.py`` | ||
|
||
.. code-block:: python | ||
|
||
def register_plugin(): | ||
return YourPluginClass |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.