Skip to content

Conversation

@audriB
Copy link

@audriB audriB commented Feb 8, 2026

Summary

  • pip install (non-editable) omits the did.implementations subpackage because pyproject.toml hardcodes packages = ["did"]
  • This causes ModuleNotFoundError: No module named 'did.implementations' when importing did.implementations.sqlitedb
  • The bug is masked in CI because pip install -e . (editable mode) exposes the full source tree via a .pth file

Root cause

PR #12 refactored from setup.py (which used find_packages() — auto-discovers all subpackages) to pyproject.toml with a hardcoded package list that only includes ["did"], missing did.implementations.

Fix

Replace the hardcoded list with setuptools auto-discovery:

# Before (broken):
[tool.setuptools]
packages = ["did"]

# After (fixed):
[tool.setuptools.packages.find]
where = ["src"]

This matches the original setup.py behavior and will automatically include any future subpackages.

Verification

Tested with a clean non-editable install:

$ pip install .  # (not -e)
$ python -c "from did.implementations.sqlitedb import SQLiteDB; print('OK')"
OK

Before the fix, this produces ModuleNotFoundError.

Note

The MATLAB version (DID-matlab) doesn't have this issue because genpath() recursively adds all subdirectories. This fix brings the Python packaging in line with that behavior.

🤖 Generated with Claude Code

The `packages = ["did"]` declaration only includes the top-level
package, causing `pip install` (non-editable) to omit the
`did.implementations` subpackage entirely.  This results in:

    ModuleNotFoundError: No module named 'did.implementations'

when importing `did.implementations.sqlitedb`.

The bug was masked in CI because `pip install -e .` (editable mode)
exposes the full source tree via a .pth file, bypassing setuptools
package discovery.

Fix: Replace hardcoded package list with `find` auto-discovery,
matching the behavior of the original `setup.py` which used
`find_packages()`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants