{"action":"created","issue":{"url":"https://api.github.com/repos/pypa/pip/issues/4031","repository_url":"https://api.github.com/repos/pypa/pip","labels_url":"https://api.github.com/repos/pypa/pip/issues/4031/labels{/name}","comments_url":"https://api.github.com/repos/pypa/pip/issues/4031/comments","events_url":"https://api.github.com/repos/pypa/pip/issues/4031/events","html_url":"https://github.com/pypa/pip/issues/4031","id":185005782,"number":4031,"title":"Can't install with setup.py/__main__.py (a setup.py directory)","user":{"login":"abstrus","id":2456133,"avatar_url":"https://avatars.githubusercontent.com/u/2456133?v=3","gravatar_id":"","url":"https://api.github.com/users/abstrus","html_url":"https://github.com/abstrus","followers_url":"https://api.github.com/users/abstrus/followers","following_url":"https://api.github.com/users/abstrus/following{/other_user}","gists_url":"https://api.github.com/users/abstrus/gists{/gist_id}","starred_url":"https://api.github.com/users/abstrus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abstrus/subscriptions","organizations_url":"https://api.github.com/users/abstrus/orgs","repos_url":"https://api.github.com/users/abstrus/repos","events_url":"https://api.github.com/users/abstrus/events{/privacy}","received_events_url":"https://api.github.com/users/abstrus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-25T02:51:48Z","updated_at":"2016-10-25T07:54:32Z","closed_at":null,"body":"* Pip version: pip 8.1.2 from /usr/lib/python3.5/site-packages (python 3.5)\r\n* Python version: Python 3.5.2\r\n* Operating System: Arch Linux\r\n\r\n### Description:\r\n\r\nI am exploring the use of a `setup.py` **directory**.  I have not read anywhere this could be a bad (or good) idea.\r\n\r\nI was wondering why it fails ?  This may not be a critical bug, but it positively is a smell.\r\n\r\n\r\nGiven a minimal package:\r\n\r\n```\r\n.\r\n├── foobar\r\n│   └── __init__.py\r\n└── setup.py\r\n    └── __main__.py\r\n```\r\n\r\n### What I've run:\r\n\r\nFirst I've tried to install with `pip`:\r\n\r\n```\r\n$ pip install . || echo $?\r\nDirectory '.' is not installable. File 'setup.py' not found.\r\n1\r\n```\r\n\r\nThen I've tried to make an editable install with `pip`:\r\n\r\n```\r\n$ pip install --editable . || echo $?\r\nObtaining file:///home/abstrus/workspace/test_pip\r\n    Complete output from command python setup.py egg_info:\r\n    Traceback (most recent call last):\r\n      File \"<string>\", line 1, in <module>\r\n      File \"/home/abstrus/.pyenv/versions/3.5.2/lib/python3.5/tokenize.py\", line 454, in open\r\n        buffer = _builtin_open(filename, 'rb')\r\n    IsADirectoryError: [Errno 21] Is a directory: '/home/abstrus/workspace/test_pip/setup.py'\r\n    \r\n    ----------------------------------------\r\nCommand \"python setup.py egg_info\" failed with error code 1 in /home/cblegare/workspace/test_pip/\r\n1\r\n```\r\n\r\nThis last error message made me try the `python setup.py egg_info` manually, which went fine.\r\n\r\n```\r\n$ python setup.py egg_info && ls -l *.egg-info || echo $?\r\nrunning egg_info\r\nwriting dependency_links to funniest.egg-info/dependency_links.txt\r\nwriting funniest.egg-info/PKG-INFO\r\nwriting top-level names to funniest.egg-info/top_level.txt\r\nreading manifest file 'funniest.egg-info/SOURCES.txt'\r\nwriting manifest file 'funniest.egg-info/SOURCES.txt'\r\ntotal 20K\r\n-rw-r--r-- 1 abstrus   1 24 oct 22:32 dependency_links.txt\r\n-rw-r--r-- 1 abstrus   1 24 oct 22:17 not-zip-safe\r\n-rw-r--r-- 1 abstrus 250 24 oct 22:32 PKG-INFO\r\n-rw-r--r-- 1 abstrus 186 24 oct 22:32 SOURCES.txt\r\n-rw-r--r-- 1 abstrus   7 24 oct 22:32 top_level.tx\r\n```\r\n\r\nAlso, I tried standalone editable installation:\r\n\r\n```\r\n$ python setup.py develop\r\nrunning develop\r\nrunning egg_info\r\nwriting funniest.egg-info/PKG-INFO\r\nwriting entry points to funniest.egg-info/entry_points.txt\r\nwriting top-level names to funniest.egg-info/top_level.txt\r\nwriting dependency_links to funniest.egg-info/dependency_links.txt\r\nreading manifest file 'funniest.egg-info/SOURCES.txt'\r\nwriting manifest file 'funniest.egg-info/SOURCES.txt'\r\nrunning build_ext\r\nCreating /home/abstrus/.pyenv/versions/3.5.2/lib/python3.5/site-packages/funniest.egg-link (link to .)\r\nfunniest 0.1 is already the active version in easy-install.pth\r\nInstalling pip_fails_but_setuptools_works script to /home/abstrus/.pyenv/versions/3.5.2/bin\r\n\r\nInstalled /home/abstrus/workspace/test_pip\r\nProcessing dependencies for funniest==0.1\r\nFinished processing dependencies for funniest==0.1\r\n```\r\n\r\nand the console_scripts entry_points went well :\r\n\r\n```\r\n$ pip_fails_but_setuptools_works\r\nbar\r\n```"},"comment":{"url":"https://api.github.com/repos/pypa/pip/issues/comments/255963350","html_url":"https://github.com/pypa/pip/issues/4031#issuecomment-255963350","issue_url":"https://api.github.com/repos/pypa/pip/issues/4031","id":255963350,"user":{"login":"pfmoore","id":1110419,"avatar_url":"https://avatars.githubusercontent.com/u/1110419?v=3","gravatar_id":"","url":"https://api.github.com/users/pfmoore","html_url":"https://github.com/pfmoore","followers_url":"https://api.github.com/users/pfmoore/followers","following_url":"https://api.github.com/users/pfmoore/following{/other_user}","gists_url":"https://api.github.com/users/pfmoore/gists{/gist_id}","starred_url":"https://api.github.com/users/pfmoore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfmoore/subscriptions","organizations_url":"https://api.github.com/users/pfmoore/orgs","repos_url":"https://api.github.com/users/pfmoore/repos","events_url":"https://api.github.com/users/pfmoore/events{/privacy}","received_events_url":"https://api.github.com/users/pfmoore/received_events","type":"User","site_admin":false},"created_at":"2016-10-25T07:54:32Z","updated_at":"2016-10-25T07:54:32Z","body":"See https://github.com/pypa/pip/blob/master/pip/utils/setuptools_build.py#L2 (which is used via https://github.com/pypa/pip/blob/master/pip/req/req_install.py#L409) for why.\r\n\r\nThe basic reason is because ```setup.py``` is documented as being a file, of course. But the reason behind that is that ```setup.py``` is not always called by passing it as a command line argument to python. Sometimes (as here) it's passed via ```execfile```, which doesn't support executing directories.\r\n\r\nSo yes, it might work in some parts of the code, but it's not supported and will fail in other areas. As you found out."}}
{"actor":{"display_login":"pfmoore"}}