{"action":"created","issue":{"url":"https://api.github.com/repos/pypa/pip/issues/3160","repository_url":"https://api.github.com/repos/pypa/pip","labels_url":"https://api.github.com/repos/pypa/pip/issues/3160/labels{/name}","comments_url":"https://api.github.com/repos/pypa/pip/issues/3160/comments","events_url":"https://api.github.com/repos/pypa/pip/issues/3160/events","html_url":"https://github.com/pypa/pip/issues/3160","id":109672619,"number":3160,"title":"Editable install does not work with package_dir","user":{"login":"lelit","id":412797,"avatar_url":"https://avatars1.githubusercontent.com/u/412797?v=4","gravatar_id":"","url":"https://api.github.com/users/lelit","html_url":"https://github.com/lelit","followers_url":"https://api.github.com/users/lelit/followers","following_url":"https://api.github.com/users/lelit/following{/other_user}","gists_url":"https://api.github.com/users/lelit/gists{/gist_id}","starred_url":"https://api.github.com/users/lelit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lelit/subscriptions","organizations_url":"https://api.github.com/users/lelit/orgs","repos_url":"https://api.github.com/users/lelit/repos","events_url":"https://api.github.com/users/lelit/events{/privacy}","received_events_url":"https://api.github.com/users/lelit/received_events","type":"User","site_admin":false},"labels":[{"id":636151531,"url":"https://api.github.com/repos/pypa/pip/labels/awaiting%20response","name":"awaiting response","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2015-10-04T10:06:20Z","updated_at":"2018-04-02T13:21:19Z","closed_at":null,"author_association":"NONE","body":"I'd like to reduce the depth of my packages working tree, that usually look like\n\n```\n.\n├── setup.py\n└── src\n    └── toplevel\n        ├── __init__.py\n        └── middle\n            ├── __init__.py\n            └── leaf\n                ├── __init__.py\n                ├── ...\n```\n\nwhere `toplevel` and often `toplevel.middle` are namespaces, and given that I mostly target Python 3 these days taking advantage of its [implicit namespaces](https://www.python.org/dev/peps/pep-0420/) those directories do not even contain an `__init__.py`.\n\nWhat I want is a shallow source tree, like\n\n```\n.\n├── setup.py\n└── src\n    ├── __init__.py\n    ├── ...\n```\n\nDistutls `package_dir` allows me to get there immediately, with a setup.py that looks like\n\n``` python\nfrom setuptools import setup\n\nsetup(name='toplevel.middle.leaf',\n      packages=['toplevel.middle.leaf'],\n      package_dir={'toplevel.middle.leaf': 'src'},\n      namespace_packages=['toplevel', 'toplevel.middle'],\n      )\n```\n\nUnfortunately this does not work with /editable/ installation of the package, as you can see by checking out [this simple](https://github.com/lelit/pipinstall-e_bugex) repo and running its [runme.sh](https://github.com/lelit/pipinstall-e_bugex/blob/master/runme.sh) script: it creates two venvs and installs the silly package in both, one as a plain install and one in develop mode. \n\nIt that emits:\n\n```\n$ ./runme.sh \nUnpacking /tmp/bugex\n  Running setup.py (path:/tmp/pip-mxukz95n-build/setup.py) egg_info for package from file:///tmp/bugex\n\nRequirement already satisfied (use --upgrade to upgrade): setuptools in ./plain/lib/python3.4/site-packages (from bugex.foo==1.0)\nInstalling collected packages: bugex.foo\n  Running setup.py install for bugex.foo\n\n    Installing /tmp/bugex/plain/lib/python3.4/site-packages/bugex.foo-1.0-nspkg.pth\nSuccessfully installed bugex.foo\nCleaning up...\nThat is me: bugex.foo\nObtaining file:///tmp/bugex\n  Running setup.py (path:/tmp/bugex/setup.py) egg_info for package from file:///tmp/bugex\n\nRequirement already satisfied (use --upgrade to upgrade): setuptools in ./edit/lib/python3.4/site-packages (from bugex.foo==1.0)\nInstalling collected packages: bugex.foo\n  Running setup.py develop for bugex.foo\n\n    Creating /tmp/bugex/edit/lib/python3.4/site-packages/bugex.foo.egg-link (link to .)\n    Adding bugex.foo 1.0 to easy-install.pth file\n\n    Installed /tmp/bugex\nSuccessfully installed bugex.foo\nCleaning up...\nTraceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: No module named 'bugex'\n```\n"},"comment":{"url":"https://api.github.com/repos/pypa/pip/issues/comments/377927760","html_url":"https://github.com/pypa/pip/issues/3160#issuecomment-377927760","issue_url":"https://api.github.com/repos/pypa/pip/issues/3160","id":377927760,"user":{"login":"Sup3rGeo","id":20566367,"avatar_url":"https://avatars2.githubusercontent.com/u/20566367?v=4","gravatar_id":"","url":"https://api.github.com/users/Sup3rGeo","html_url":"https://github.com/Sup3rGeo","followers_url":"https://api.github.com/users/Sup3rGeo/followers","following_url":"https://api.github.com/users/Sup3rGeo/following{/other_user}","gists_url":"https://api.github.com/users/Sup3rGeo/gists{/gist_id}","starred_url":"https://api.github.com/users/Sup3rGeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sup3rGeo/subscriptions","organizations_url":"https://api.github.com/users/Sup3rGeo/orgs","repos_url":"https://api.github.com/users/Sup3rGeo/repos","events_url":"https://api.github.com/users/Sup3rGeo/events{/privacy}","received_events_url":"https://api.github.com/users/Sup3rGeo/received_events","type":"User","site_admin":false},"created_at":"2018-04-02T13:21:19Z","updated_at":"2018-04-02T13:21:19Z","author_association":"NONE","body":"I believe the same problem is happening when trying to install [allure-python-commons](https://github.com/allure-framework/allure-python/tree/master/allure-python-commons) using pip editable.\r\n\r\nIt also uses `package_dir`."}}
{"actor":{"display_login":"Sup3rGeo"}}