Skip to content

SENAITE Extension Integration Help Request #2770

@badshuang

Description

@badshuang

Problem Description

We are developing a SENAITE extension named SENAITE .helloworld, but we are encountering issues with the extension not loading correctly in a Docker environment.

Environment Information

  • SENAITE Version: 2.6.0
  • Deployment Method: Docker (senaite/senaite:v2.6.0)
  • Operating System: Windows
  • Extension Name: SENAITE .helloworld

Project Structure

d:\Projects\SENAITE \
├── docker-compose.yml
├── setup.py
└── src/
    └── SENAITE /
        ├── __init__.py
        └── helloworld/
            ├── __init__.py
            ├── configure.zcml
            ├── profiles/
            │   └── default/
            │       ├── metadata.xml
            │       └── registry.xml
            └── SENAITE .helloworld.egg-info/

Configuration Files

docker-compose.yml

services:
  instance1:
    environment:
      - PLONE_DEVELOP=src/SENAITE /helloworld
      - PLONE_PROFILES=senaite.lims:default senaite.storage:default SENAITE .helloworld:default

custom.cfg (inside container)

[buildout]
extends = buildout.cfg
develop += src/SENAITE /helloworld
eggs += senaite.storage

[plonesite]
profiles += senaite.lims:default
        senaite.storage:default
        SENAITE .helloworld:default

Attempted Solutions

  1. Container Rebuild: Used docker-compose build --no-cache
  2. Manual Buildout: Executed /usr/local/bin/buildout -c custom.cfg inside container
  3. File Structure Verification: Confirmed all necessary __init__.py files exist
  4. Configuration Check: Verified configure.zcml and profile configurations are correct
  5. Cleanup Duplicate Files: Removed conflicting setup.py files

Current Status

  • ✅ SENAITE system running normally (http://localhost:8081/senaite)
  • ✅ senaite.storage extension successfully loaded
  • ❌ SENAITE .helloworld extension not visible in management interface
  • ✅ buildout process completed without errors
  • ✅ Container logs show Develop: '/home/senaite/senaitelims/src/SENAITE /helloworld'

Specific Issues

  1. Python Import Failure: ImportError: No module named SENAITE .helloworld
  2. Extension Not Visible: Extension not shown in SENAITE management interface installed products
  3. Profile Not Loaded: Extension's GenericSetup profile seems not to be recognized

Questions Needing Help

  1. Package Structure: Is our package structure correct? Do we need special namespace configuration?
  2. Docker Integration: Do development mode extensions require special configuration in Docker environment?
  3. Debugging Methods: What methods are available to debug the extension loading process and view detailed error information?
  4. Best Practices: What are the recommended project structure and configuration approaches for custom extension development?

Related File Contents

setup.py

from setuptools import setup, find_packages

setup(
    name="SENAITE .helloworld",
    version="1.0.0",
    packages=find_packages("src", exclude=["ez_setup"]),
    package_dir={"": "src"},
    namespace_packages=["SENAITE "],
    install_requires=[
        "senaite.lims>=2.6.0",
    ],
    entry_points="""
      [z3c.autoinclude.plugin]
      target = plone
      """,
)

src/SENAITE /helloworld/init.py

from bika.lims.api import get_request
from zope.i18nmessageid import MessageFactory

_ = MessageFactory('SENAITE .helloworld')

def initialize(context):
    """Initializer called when used as a Zope 2 product."""
    pass

Contact Information

If you need more information or have any suggestions, please contact us. We greatly appreciate the community's help!


Note: We have successfully integrated the senaite.storage extension, so the basic environment should be correct. The issue likely lies in the specific configuration of our custom extension.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions