I have trouble doing an import of foo_a in foo_b. Lets say the toplevel-package defined in both the .toml files will be called foo.sip. That means e.g. the pyproject.toml of foo_b looks like this:
# Specify sip v6 as the build system for the package.
[build-system]
requires = ["sip >=6, <7"]
build-backend = "sipbuild.api"
# Specify the PEP 566 metadata for the project.
[tool.sip.metadata]
name = "foo-foo_b"
requires-dist = "foo-foo_a"
# Configure the building of the project bindings.
[tool.sip.bindings.foo_b]
<dependencies ...>
[tool.sip.project]
sip-module = "foo.sip"
I have a the following project structure:
dir_a
- foo_b.cpp
- foo_b.h
- pyproject.toml
- foo_b.sip <-- here I try to %import foo_a.sip
- test_b.py
dir_b
- foo_a.cpp
- foo_a.h
- pyproject.toml
- foo_a.sip
- test_a.py
If I remove the sip-module entry under [tool.sip.project]
sip-module = foo.sip
from the .toml file of foo_a, the import of foo_a
from foo import foo_a
in test_a.py works fine. But if I try to build a package project with this entry, the following error occurs:
ModuleNotFoundError: No module named 'foo.sip'
The installation on the system is done with sip-install
, first in dir_a and then in dir_b.
I tried to structure my package project like it is in this example more or less described
But what am I missing?