Develop this package#

Setup#

You need a working python environment (system, virtualenv, pyenv, etc) version 3.8 or superior.

Then install the dependencies and a development instance using:

make install

Local Environment#

Plone Server#

Start Plone, on port 8080, with the command:

make start

Keycloak#

The pas.plugins.keycloakgroups repository has a working setup for a Keycloak development server using Docker and Docker Compose. To use it, in a terminal, run the command:

make keycloak-start

There are two realms configured plone and plone-test. The later is used in automated tests, while the former should be used for your development environment.

The plone realm ships with an user that has the following credentials:

  • username: user

  • password: 12345678

To update the default realm information, please enter the running Keycloak container and run:

/opt/keycloak/bin/kc.sh export --realm plone --users realm_file --file /opt/keycloak/data/import/plone-realm.json
/opt/keycloak/bin/kc.sh export --realm plone-test --users realm_file --file /opt/keycloak/data/import/plone-test-realm.json

To stop a running Keycloak (needed when running tests), use:

make keycloak-stop

Format codebase#

make format

Run tests#

Testing of this package is done with pytest and tox.

Run all tests with:

make test

Run all tests but stop on the first error and open a pdb session:

./bin/tox -e test -- -x --pdb

Run tests named TestGroupsPlugin:

./bin/tox -e test -- -k TestGroupsPlugin

Update translations#

make i18n

Documentation#

Build this documentation

make docs-build

Live version#

To have a live version – with auto-update – of this documentation, run the command:

make docs-live

And then point your browser at http://localhost:8000