Open ka-sarthak opened 6 months ago
@ka-sarthak I just saw this now. I will bring this to the next plugins taskforce meetings. It makes sense to me and your plugins already implement it this way.
@blueraft What are your thoughts on this?
Sorry forgot to reply. Our new plugin templates will be using the src
folder.
As a best practice, it's wise to have the plugin within
src
folder. Supporting this in the example plugin repo will be super nice.For the fork I did https://github.com/FAIRmat-NFDI/nomad-analysis, it wasn't very obvious how to have the plugin inside
src
folder without running into some issues.When I added plugin code into
src
and installed the package,nomad.client.parse
ran into some errors while running pytest. To resolve this, I had to export thesrc
folder path to thePYTHONPATH
. But this isn't ideal as the pytest will then use the local source code, rather than the installed package.Then, I modified the
pyproject.toml
file to have:and did the pip install again on a fresh virtual environment. But this ran into the same issue. I believe this is related with the visibility of the plugin schema.
Eventually, I could resolve it (running the pytest without having to export
PYTHONPATH
) by slightly modifying thepyproject.toml
to have:followed by pip install. https://github.com/FAIRmat-NFDI/nomad-analysis/blob/main/pyproject.toml
Maybe it's a good idea to already have this integrated in the example repo.
What do you think? @blueraft @markus1978