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
"How to create plugins" needs additional development context #3035
Comments
Hi @pkt-nspktr. The short answer is that you must install the plugin, and it sounds like it has not yet been installed. In a development context, it's best to install plugins in "editable" mode so you can make changes and observe the results in real time. You can refer to the plugin development documentation for more detail. There are multiple ways to install Python packages in editable mode, and the method utilized in that documentation is to run the |
@justinmayer , thank you for the response - I am certainly ignorant of this process. Under the link you provided there's only one sentence about creating a new plugin, with a link to the cookiecutter template. That documentation does not provide a description of the plugin installation process. The following section describing contributions to existing projects uses the Your description about installing in editable mode is new to me, I'll have to look into this more as well as the |
Happy to help. As noted above, the canonical approach for now is to use What other questions do you have? |
It's been a few days and I've been working through the process of installing my plugin so I can start fixing it. But first I had to get the plugin to actually install. I've kept an ongoing write up of my experience of this process which I'll publish on my blog at a future date, but I'll leave my list of recommendations for Pelican's documentation. When the Pelican developer's feel this issue is addressed, they can close it. If I encounter development issues specifically with my plugin, I'll open up a new issue. Thank you again for your assistance, @justinmayer. Recommendations for Pelican documentationAs I encounter issues that I feel should be addressed in the Pelican documentation, I'll update this section. As of the writing of this post, Pelican 4.8.0 is the most current version and I'm using Python 3.9. I hope future releases of Pelican will incorporate these changes and make this post obsolete.
|
Thanks for writing down your notes. Some comments:
I imagine that a link from the Plugins section to the Plugin Development section should suffice. I don't believe such a link currently exists.
First, the list of development dependencies is currently maintained inside Second, I don't believe any of those items are actually necessary to develop a Pelican plugin. They are useful, and that's why they are mentioned in the development docs, but it should be possible to do plugin development without any of those tools installed. Git should only be required if one wants to make commits, Invoke merely automates a bunch of commands that could otherwise be executed manually, someone (such as I) might use Fish instead of Bash, etc. While Poetry would be needed for folks who want to locally build Python packages, even Poetry is not strictly required since the CI system handles building/publishing, and installation can alternatively be performed via: In short, the development documentation describes, in detail, one possible workflow for development that can be used, but that is not the only possible workflow.
I can see how the latter would be useful, and a pull request to the cookiecutter-pelican-plugin repo to that effect would be welcome.
This is intentional —
I don't understand this. It's not clear why initializing the plugin root into a Git repository is required. Could you elaborate?
I'm not sure how the installation method (e.g., |
Thank you for the comprehensive responses -- clearly there is a wealth of Python knowledge assumed of potential developers within the documentation, which in my case is lacking. I'll look at the references you've provided to expand my own knowledge scope. I'll see if I can get my full writeup published this weekend where those interested can see the steps and errors I encountered trying to get my plugin to just install which lead to this list of recommendations. Regarding the pull request to the cookiecutter-pelican-plugin repo; I've not done one before, but I'll attempt to submit one in the next few days. Regarding After I got through installing all the dependencies, running
I did have git installed, but the plugin directory was not a git repository. Once I performed a git init; git add; git commit and re-ran
This was the background of the comment that the plugin needed to be a git repository. Again, I used the default responses to the cookiecutter template prompts, so this may have been a result of the the template providing a git repository, but I don't know for sure. I certainly don't know enough at this point which configuration options to change to avoid having to create a git repository to get Finally, the first paragraph under the How to use plugins says (my emphasis):
The documentation calls out "Pip-installed namespace plugins" specifically, which to my inexperienced eyes, appears that there is a difference between "pip-installed" (production-ready and publicly published) plugins and |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your participation and understanding. |
Issue
Environment: FreeBSD 13.1-RELEASE-p1; Python 3.9.13 (installed from FreeBSD pkg(8)); Pelican 4.8.0 (installed in virtualenv via
pip install pelican
)I'm attempting to develop a new plugin ("csv-reader") for Pelican. I've followed the documentation for how to create plugins and even taking the steps to do a fresh install of Pelican to eliminate other factors. Nevertheless, I do not understand how to develop or test the plugin based on the current documentation.
The namespace plugin structure section recommends using the cookiecutter template to set up the proper structure. Running this created the recommended plugin directory structure under ~/virtualenvs/pelican/csv-reader/.
The how to use plugins section says, "If you leave the PLUGINS setting as default (None), Pelican will automatically discover namespace plugins and register them." Running
pelican --ignore-cache --print-settings | grep -i plugin
returnsMy expectation based on the documentation would be Pelican auto-discovers the plugin created by the cookiecutter template, but when executing
pelican --debug
, the plugin messages only says, "DEBUG Finding namespace plugins"I'm clearly missing some additional steps to test a plugin under development. I don't expect the Pelican documentation to be the definitive guide to plugin development, but it would be nice to have it link to a more comprehensive description of how to configure Pelican to load the cookiecutter-created directory structure for testing and then how to package it up and make it available on the pelican-plugins repository.
If this is the wrong Issue tracker, please point me in the correct direction. I hope that I can learn what I need to do to test my plugin and improve the documentation for other who wish to do the same.
The text was updated successfully, but these errors were encountered: