Skip to content
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

Register plugin from entry points #1872

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

Ni-g-3l
Copy link

@Ni-g-3l Ni-g-3l commented Nov 11, 2024

Hello

As suggest here I implemented the support of entrypoints in order to make the process of adding plugin to REZ easier.

Closes #1661

Feel free to add feedback !

Have a great day

@Ni-g-3l Ni-g-3l requested a review from a team as a code owner November 11, 2024 15:07
Signed-off-by: Nig3l <[email protected]>
@Ni-g-3l Ni-g-3l force-pushed the feat/register_plugin_from_entry_points branch from 8a16886 to da9e66c Compare November 11, 2024 15:08
Copy link

codecov bot commented Nov 17, 2024

Codecov Report

Attention: Patch coverage is 67.34694% with 16 lines in your changes missing coverage. Please review.

Project coverage is 59.38%. Comparing base (c039654) to head (a7fa195).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
src/rez/plugin_managers.py 67.34% 12 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1872      +/-   ##
==========================================
+ Coverage   59.27%   59.38%   +0.10%     
==========================================
  Files         126      126              
  Lines       17217    17246      +29     
  Branches     3017     3020       +3     
==========================================
+ Hits        10206    10241      +35     
+ Misses       6326     6320       -6     
  Partials      685      685              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@JeanChristopheMorinPerso JeanChristopheMorinPerso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Ni-g-3l for creating this PR. I left a couple of comments that will need to be addressed before we can consider merging it.

Also, if you have the time and want to, we should adjust our newly written plugins doc (https://rez.readthedocs.io/en/stable/plugins.html).

@Ni-g-3l
Copy link
Author

Ni-g-3l commented Jan 25, 2025

Hello ! I fixed a big part of your comments, but I still not understand how you want resolve the plugin install with pip in tests

@JeanChristopheMorinPerso
Copy link
Member

Thanks @Ni-g-3l . I left a comment to clarify what I mean about the tests.

@JeanChristopheMorinPerso JeanChristopheMorinPerso added this to the Next milestone Jan 26, 2025
@JeanChristopheMorinPerso JeanChristopheMorinPerso added the Blocked by DCO Waiting on commit signoff label Jan 26, 2025
@Ni-g-3l Ni-g-3l force-pushed the feat/register_plugin_from_entry_points branch from 21ee959 to e30e7cd Compare February 2, 2025 16:14
Signed-off-by: Jean-Christophe Morin <[email protected]>
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you prefer this format of build system, we should update plugins doc by replacing setup.py part by a pyproject.toml.

Signed-off-by: Jean-Christophe Morin <[email protected]>
…t py 3.7) and add missing dependencies (zipp, typing_extensions)

Signed-off-by: Jean-Christophe Morin <[email protected]>
Signed-off-by: Jean-Christophe Morin <[email protected]>
Signed-off-by: Jean-Christophe Morin <[email protected]>
@JeanChristopheMorinPerso JeanChristopheMorinPerso removed the Blocked by DCO Waiting on commit signoff label Feb 2, 2025
Signed-off-by: Jean-Christophe Morin <[email protected]>
Signed-off-by: Jean-Christophe Morin <[email protected]>
@JeanChristopheMorinPerso
Copy link
Member

Ok, sorry for the noise @Ni-g-3l. There are a couple of things I wanted which were easier to do myself than do the back and forth in a PR.

I also removed and re-added the vendored dependen.cies (and added the missing ones) and made sure they are compatible with python 3.7+.

I think the last thing will be to review the docs you wrote. I'll try to do that soon.

Thanks!

@Ni-g-3l
Copy link
Author

Ni-g-3l commented Feb 3, 2025

Don't worry ! Happy to help ! I take a look at your commits and understand it ! I will do it the same way next time :)

Yes ! I will update doc according to your commits

@JeanChristopheMorinPerso
Copy link
Member

@Ni-g-3l After testing this PR more, I came to the conclusion that it wasn't working as expected. I pushed new commits to correct this. There is now one entry point group per plugin type and plugin name is set to the entry point name instead of the module name.

Signed-off-by: Jean-Christophe Morin <[email protected]>
@Ni-g-3l
Copy link
Author

Ni-g-3l commented Feb 15, 2025

Wouldn't it be strange if the command name in the python file won't match with the command name displayed with rez -i ?

Moreover, won't it break the compatibility between plugins installed manually and ones installed with entry points ?

Thanks for testing the PR do not hesitate if I can help you to do something !

@JeanChristopheMorinPerso
Copy link
Member

JeanChristopheMorinPerso commented Feb 15, 2025

@Ni-g-3l The command name and the name in rez -i will be the same with my changes, unless I made a mistake...

@Ni-g-3l
Copy link
Author

Ni-g-3l commented Feb 16, 2025

Oo sorry I missed one commit ! So it looks good to me.

@JeanChristopheMorinPerso
Copy link
Member

FYI, I'm close to approving your PR and merging it.

The last remaining thing I think is the docs. You already edited them (thanks for that) but I'd like to improve them a little bit more. More particularly, I would like them to describe the 3 different methods of installing plugins (using the namespace package, REZ_PLUGINS_PATH and now the entry points. Each method should have its section describing how they work. The plugins page could be kept as a technical reference and we could move the "how to" into the user guide section.

What do you think?

@Ni-g-3l
Copy link
Author

Ni-g-3l commented Feb 16, 2025

I think it's a good Idea ! But we have to care to keep a link between the old plugin page to the new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simplify plugin development by supporting entrypoint based plugins
2 participants