pretalx / pretalx-plugin-cookiecutter

A cookiecutter for pretalx plugins
3 stars 2 forks source link

Installing plugin did not work #2

Closed r4f closed 5 years ago

r4f commented 5 years ago

I tried to install a plugin (for testing I used the media-ccc-plugin), but afterwards in the plugin section no plugin showed up.

This is what I did:

mkdir pretalx_with_plugin
cd pretalx_with_plugin
git clone https://github.com/pretalx/pretalx.git
git clone https://github.com/pretalx/pretalx-media-ccc-de.git
pipenv --python 3.7.3
pipenv shell # the rest happens in the virtual environment #
pipenv install pip django setuptools wheel tox
cd pretalx
tox -e dev manage.py migrate
tox -e dev manage.py init
tox -e dev manage.py compilemessages
tox -e dev
# followd by CONTROL-C to stop the server
cd ../pretalx-media-ccc-de
python setup.py develop
make
cd ../pretalx
tox -e dev
rixx commented 5 years ago

Does the following line in /src/pretalx/settings.py PLUGINS = [] need to be changed maybe?

Not at all, that variable doesn't need to be modified.

Or maybe is it relevant (however I don't think so) in which location the plugin is installed?

No, plugins work via their setup.py entrypoint configuration.

Also what I noticed was that I did need to install django in my virtual environment to run the setup.py of the plugin, which is not noted anywhere.

Yes and no – the plugin needs to be installed in the same virtualenv as you install pretalx (naturally: they have to interact after all). pretalx installs Django as a dependency. Having to install django separately means that you have installed the plugin not in the same virtualenv as pretalx. I think all tox commands run in their own virtualenv by default, so that's probably the issue. The pretalx startup output will tell you which plugins have been found.

r4f commented 5 years ago

Thank you. That explanation helped a lot. Maybe it would be useful to add the command source /path/to/pretalx/.env/bin/activate #to activate the virtualenv before the plugin-installation instruction and deactivate #to get out of the virtualenv after. Or maybe there is some easier way with tox-commands for that, but I am not so much aquainted with tox, so I don't know. Anyway, thanks for the quick response, and thanks for the great project! Cheers

r4f commented 5 years ago

I now realize, that not everybody might use the tox-setup, so the source-command might not be the same for every setting. But for someone as me, who just copied the tox-commands from your developer-documentation, in the line

Activate the virtual environment you use for pretalx development.

it was not clear, which virtual environment is refers to.

rixx commented 5 years ago

I'm actually not sure how much value tox adds for the starting developer. It was advertised to me as a way to get people onboarded faster and easier, but it seems to me that running additional commands is more clumsy. I might just revert the development docs back to a regular virtualenv.