You cannot do that with pip install -e because option -e "installs" packages in development/editable mode. It doesn't actually install anything but creates a link that allows Python to import modules directly from the development directory. Unfortunately in your case that impossible — directories project-core and project-api contain forbidden character in their name (-) — these directories cannot be made importable in-place.
But pip install . could be made to install top-level packages api and core from these directories. First you have to add __init__.py:
touch project-api/source/__init__.py
touch project-core/source/__init__.py
And the following setup.py do the rest:
#!/usr/bin/env python
from setuptools import setup
setup(
name='example',
version='0.0.1',
description='Example',
packages=['api', 'core'],
package_dir={
'api': 'project-api/source',
'core': 'project-core/source',
}
)
Run pip install . and you're done. Execute import api, core in Python.
PS. If you can create symlinks at the root:
ln -s project-api/source api
ln -s project-core/source core
you can use pip install -e .