Hi @nigel , I can confirm the “boilerplate plugin” tutorial works if I use your branch. I’ll be experimenting more as I don’t know whether this approach will work for me, or whether a full fork of baserow will be needed for my project.
A couple of observations: after doing docker-compose up -d, a single docker container came up and it started working immediately, and I was able to connect to the frontend on localhost:80. the boilerplate tutorial seems to suggest a lot more steps are necessary, and i’ll end up with multiple docker containers.
Here’s where I’m stuck. I’m trying to add a new field type, following this tutorial: Field type // Baserow
$ baserow makemigrations my_baserow_plugin
$ baserow migrate
I’m assuming this needs to be run inside the docker container. so I attach to my container:
docker exec -it my-baserow-plugin bash
but then i’m confused about how I get the “baserow” executable setup:
root@bbc7042a69fb:/# which baserow
root@bbc7042a69fb:/#
root@bbc7042a69fb:/# cd baserow
root@bbc7042a69fb:/baserow# ls -la
total 76
drwxr-xr-x 1 baserow_docker_user baserow_docker_group 4096 Jun 9 01:28 .
drwxr-xr-x 1 root root 4096 Jun 9 01:30 ..
drwxr-xr-x 1 baserow_docker_user baserow_docker_group 4096 Jun 8 13:01 backend
drwxr-xr-x 2 baserow_docker_user baserow_docker_group 4096 Jun 8 17:01 caddy
drwxr-xr-x 2 root root 4096 Jun 9 01:29 container_markers
drwxr-xr-x 9 root root 4096 Jun 9 01:30 data
drwxr-xr-x 12 baserow_docker_user baserow_docker_group 4096 Jun 8 13:01 docs
drwxr-xr-x 1 baserow_docker_user baserow_docker_group 4096 Jun 9 01:28 plugins
drwxr-xr-x 1 baserow_docker_user baserow_docker_group 4096 Jun 8 13:01 premium
drwxr-xr-x 2 baserow_docker_user baserow_docker_group 4096 Jun 8 13:00 requirements
drwxr-xr-x 1 baserow_docker_user baserow_docker_group 4096 Jun 8 17:29 supervisor
drwxr-xr-x 1 baserow_docker_user baserow_docker_group 4096 Jun 8 13:00 venv
drwxr-xr-x 1 baserow_docker_user baserow_docker_group 4096 Jun 8 17:20 web-frontend
root@bbc7042a69fb:/baserow# backend/baserow
Traceback (most recent call last):
File "backend/baserow", line 2, in <module>
from baserow.manage import main
ImportError: No module named baserow.manage
edit 3: OK so I figured out I have to do the following after attaching to the docker container:
source /baserow/venv/bin/activate
pip install -r /baserow/backend/requirements/base.txt
pip install -e /baserow/backend
but then I get this issue again:
(venv) root@bbc7042a69fb:/baserow# baserow
Traceback (most recent call last):
File "/baserow/venv/bin/baserow", line 4, in <module>
__import__('pkg_resources').require('baserow==1.10.0')
File "/baserow/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3266, in <module>
@_call_aside
File "/baserow/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3241, in _call_aside
f(*args, **kwargs)
File "/baserow/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3279, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/baserow/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 573, in _build_master
ws.require(__requires__)
File "/baserow/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 891, in require
needed = self.resolve(parse_requirements(requirements))
File "/baserow/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 777, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'zope-interface==5.4.0' distribution was not found and is required by baserow
(venv) root@bbc7042a69fb:/baserow# pip list | grep zope
zope.interface 5.4.0
the zope-interface module seems to be installed:
(venv) root@bbc7042a69fb:/baserow# python --version
Python 3.7.3
(venv) root@bbc7042a69fb:/baserow# python
Python 3.7.3 (default, Jan 22 2021, 20:04:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import zope.interface
>>>
edit 4: OK so i’m able to get a bit further by doing the following hack:
in /baserow/venv/lib/python3.7/site-packages/pkg_resources/__init__.py
line 773
if req.key == 'zope-interface':
req.key = 'zope.interface'