-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add plugin system and local wheels support (#91)
Signed-off-by: Jean-Christophe Morin <[email protected]>
- Loading branch information
1 parent
3e9ed1a
commit ce91594
Showing
44 changed files
with
2,669 additions
and
291 deletions.
There are no files selected for viewing
This file contains 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,9 @@ | ||
[run] | ||
branch = True | ||
source_pkgs=rez_pip | ||
|
||
[report] | ||
exclude_also = | ||
def __dir__ | ||
if TYPE_CHECKING: | ||
if typing.TYPE_CHECKING: |
This file contains 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,5 @@ | ||
# Set the default behavior, in case people don't have core.autocrlf set. | ||
* text=auto | ||
|
||
# Denote all files that are truly binary and should not be modified. | ||
*.patch binary |
This file contains 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 |
---|---|---|
|
@@ -57,3 +57,4 @@ tests/data/rez_repo/ | |
tests/data/_tmp_download/ | ||
docs/bin/ | ||
.idea/ | ||
/patches |
This file contains 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,27 @@ | ||
=== | ||
API | ||
=== | ||
|
||
.. warning:: The API is only meant to be used by plugins authors. | ||
|
||
.. autoclass:: rez_pip.pip.T | ||
|
||
.. autoclass:: rez_pip.pip.DownloadInfo | ||
:members: | ||
|
||
.. autoclass:: rez_pip.pip.Metadata | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: rez_pip.pip.PackageInfo | ||
:members: | ||
|
||
.. autoclass:: rez_pip.pip.PackageGroup | ||
:members: | ||
:show-inheritance: | ||
|
||
.. autoclass:: rez_pip.pip.DownloadedArtifact | ||
:members: | ||
|
||
.. autoclass:: rez_pip.plugins.CleanupAction | ||
:members: |
This file contains 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
This file contains 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
This file contains 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
This file contains 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,71 @@ | ||
======= | ||
Plugins | ||
======= | ||
|
||
.. versionadded:: 0.4.0 | ||
|
||
.. warning:: | ||
Plugins are new and have not been tested througfully. There might be bugs, missing | ||
features and rough edges. | ||
|
||
We encourage you to try them out and report any issues you might find. | ||
|
||
If you create your own plugins, expect them to break when you update | ||
rez-pip's minor version. The plugin system is still in its early stages | ||
and we will probably release breaking changes in the future. | ||
|
||
rez-pip can be extended using plugins. Plugins can be used to do various things, such as | ||
modifying packages (both metadata and files), etc. | ||
|
||
This page documents the hooks available to plugins and how to implement plugins. | ||
|
||
List installed plugins | ||
====================== | ||
|
||
To list all installed plugins, use the :option:`rez-pip --list-plugins` command line argument. | ||
|
||
Register a plugin | ||
================= | ||
|
||
rez-pip's plugin system is based on the `pluggy <https://pluggy.readthedocs.io/en/latest/>`_ framework, | ||
and as such, plugins must be registered using `entry points <https://packaging.python.org/en/latest/specifications/entry-points/>`_. | ||
|
||
The entry point group is named ``rez-pip``. | ||
|
||
In a ``pyproject.toml`` file, it can be set like this: | ||
|
||
.. code-block:: toml | ||
:caption: pyproject.toml | ||
[project.entry-points."rez-pip"] | ||
my_plugin = "my_plugin_module" | ||
Functions | ||
========= | ||
|
||
.. Not Using autodoc here because the decorator has a complex | ||
signature to help type hinters. That signature is not needed | ||
for the end user. | ||
.. py:decorator:: rez_pip.plugins.hookimpl | ||
Decorator used to register a plugin hook. | ||
|
||
Hooks | ||
===== | ||
|
||
The list of available hooks is provided below. They are listed in the order they | ||
are called by rez-pip. | ||
|
||
.. rez-pip-autopluginhooks:: rez_pip.plugins.PluginSpec | ||
|
||
|
||
Built-in plugins | ||
================ | ||
|
||
rez-pip comes with some built-in plugins that are enabled by default. They exists mostly | ||
to fix packages that are known to be "broken" if we don't fix them using plugins. | ||
|
||
This lists the plugin names and the hooks they implement. | ||
|
||
.. rez-pip-autoplugins:: |
Oops, something went wrong.