editable install breaks custom package_dir spec
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
I have a project with this directory structure:
- project_folder_name
- lib
- __init__.py
- module.py
- ...
So in my setup.py I followed the instructions in the docs and set the package_dir:
from setuptools import setup
setup(name='project-name',
packages=['project'],
package_dir={'project' : 'lib'},
)
If I install normally python setup.py install everything is fine and I can get the module like: import project. (Possibly another issue but pip install . seems to have issues though.)
However, in development mode python setup.py develop or pip install -e . I can't import via the package name. Strangely, I can import from the folder name import lib.
Just as a reference and sanity check I also tried other organizations that work i.e. "lib/project" with package_dir={'' : 'lib'}. Would like for this directory structure though if possible.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the shown setup.py and the commands python setup.py develop and pip install -e ., then compare them with python setup.py install. Trace the editable-install handling for the custom package_dir mapping. Done means both editable-install paths allow import project rather than only import lib.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100