{"action":"created","comment":{"url":"https://api.github.com/repos/pypa/interoperability-peps/pulls/comments/36153402","id":36153402,"diff_hunk":"@@ -0,0 +1,359 @@\n+PEP: 497\n+Title: External and environment-specific dependencies\n+Version: $Revision$\n+Last-Modified: $Date$\n+Author: Tennessee Leeuwenburg <tleeuwenburg@gmail.com>,\n+\n+Status: Draft\n+Type: Standards Track\n+Python-Version 3.6\n+Content-Type: text/x-rst\n+Created: 03-Aug-2015\n+Post-History: 03-Aug-2015\n+\n+\n+Abstract\n+========\n+\n+The canonical method for installing Python packages is to use pip, whether that\n+is referencing PyPI or a local repository. A limitation of the current install\n+ecosystem is the relationship with non-Python dependencies. This\n+can result in compilation failures or execution failures. Package maintainers\n+may wish to specify the requirements to avoid this issue, and users may\n+appreciate earlier and more informative messages about their system.\n+\n+The responsibility of pip is to stop early and provide useful information about\n+missing (and not automatically installable) dependencies. Ideally it would provide\n+a useful user message about how to obtain the required dependencies. The\n+responsibility for actual installation lies with the user at this time.\n+\n+This PEP proposes a mechanism for extending the requirements section of setup.py\n+which will allow authors to express non-Python requirements cleanly. In the\n+implementation section, a discussion of how this may be used to solved problems\n+is given.\n+\n+Here is an example of the proposed syntax, where both operating system and build\n+target specifiers are included. This is \"Concept 1\" of the alternatives discussed\n+later in the document.\n+\n+::\n+\n+    setup(\n+        name='uses_scipy_with_atlas_extension'\n+        install_requires=['yaml', 'scipy[atlas]', 'lib!libblas1.so'],\n+        setup_requires=[\n+            'pyfortran',\n+            'bin!fortran:dist_name==\"ubuntu\"',\n+            'include!kernel.h',\n+            'include!liblas.h',\n+          ],\n+    )\n+\n+\n+If the user does not have the required dependencies, the user will be presented\n+with a useful install message and a process that exits early, as opposed to\n+relying on the compiler to fail and provide an error message that may not be\n+readily understood by most users.\n+\n+The mechanism of referencing failed dependencies such as 'kernel.h' to useful\n+user messages regarding the actual operating system packages that are relevant\n+is discussed in the implementation section, along with the rationale for\n+handling that referencing outside of setup.py.\n+\n+Rationale\n+=========\n+\n+Differences between environments have implications for the building, testing,\n+installing and execution of software. There are two sides to this coin. First,\n+in some environments, additional Python packages are needed. Secondly, in some\n+environments, additional non-Python packages need to be present, such as header\n+files, libraries, scripts or other binaries. The syntax proposed here allows\n+the description of both sorts of requirements in a single syntax.\n+\n+Setuptools and pip should be modified to support the use case of installing\n+the appropriate python packages as required depending on the specification.\n+\n+They should also support aborting an install with a useful error message if\n+required dependecies are not installed in the environment. The responsibility\n+for actually installing those required packages lies with the user.\n+\n+This would allow automatic installation of environment-specific Python\n+dependencies and pave the way to improving how users go about installing\n+non-Python prerequisites.\n+\n+Ideally, and error message will display the package manager command required\n+to add the missing environment dependencies.\n+\n+It is expected that this feature would be commonly used, particularly in\n+scientific applications which frequently have complex interactions with\n+externally provided libraries. An example would be needing versions of\n+numpy and scipy, both of which must have been compiled to be aware of the ATLAS\n+compiled set of linear algebra libraries for performance reasons. This sounds\n+esoteric but is, in fact, a routinely encountered situation which drives\n+people towards using the alternative packaging for scientific python\n+environments.\n+\n+Syntax\n+======\n+\n+The valid context specifiers are taken from the environment markers library.\n+This command says that when the operating system matches 'ubuntu', then add\n+the yaml==0.3 requirement to the list.\n+\n+Meta: I am not a syntax wizard and will need help from others to properly specify\n+the syntax as a formal grammar if that is required.\n+\n+Essentially, the \"!\" separator is used to flag key-value pairs which will allow\n+two things: the specification of dependency type and the environment context\n+where the rule should apply.\n+\n+For example, consider the line\n+\n+    setup_requires=['bin!fortran:dist_name==\"ubuntu\"']\n+\n+The 'bin' specifies one of \"bin\", \"lib\" or \"header\", representing the only","path":"pep-0497-externals.txt","position":114,"original_position":114,"commit_id":"3c06cd8f8785aa4bc39eadbe1431f90a6c1bd95a","original_commit_id":"3c06cd8f8785aa4bc39eadbe1431f90a6c1bd95a","user":{"login":"ncoghlan","id":1026649,"avatar_url":"https://avatars.githubusercontent.com/u/1026649?v=3","gravatar_id":"","url":"https://api.github.com/users/ncoghlan","html_url":"https://github.com/ncoghlan","followers_url":"https://api.github.com/users/ncoghlan/followers","following_url":"https://api.github.com/users/ncoghlan/following{/other_user}","gists_url":"https://api.github.com/users/ncoghlan/gists{/gist_id}","starred_url":"https://api.github.com/users/ncoghlan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncoghlan/subscriptions","organizations_url":"https://api.github.com/users/ncoghlan/orgs","repos_url":"https://api.github.com/users/ncoghlan/repos","events_url":"https://api.github.com/users/ncoghlan/events{/privacy}","received_events_url":"https://api.github.com/users/ncoghlan/received_events","type":"User","site_admin":false},"body":"s/allows/allowed/\r\n\r\ns/the the/the/","created_at":"2015-08-04T02:48:18Z","updated_at":"2015-08-04T02:48:18Z","html_url":"https://github.com/pypa/interoperability-peps/pull/30#discussion_r36153402","pull_request_url":"https://api.github.com/repos/pypa/interoperability-peps/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/pypa/interoperability-peps/pulls/comments/36153402"},"html":{"href":"https://github.com/pypa/interoperability-peps/pull/30#discussion_r36153402"},"pull_request":{"href":"https://api.github.com/repos/pypa/interoperability-peps/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/pypa/interoperability-peps/pulls/30","id":41436187,"html_url":"https://github.com/pypa/interoperability-peps/pull/30","diff_url":"https://github.com/pypa/interoperability-peps/pull/30.diff","patch_url":"https://github.com/pypa/interoperability-peps/pull/30.patch","issue_url":"https://api.github.com/repos/pypa/interoperability-peps/issues/30","number":30,"state":"open","locked":false,"title":"Adding the draft status PEP for external dependency expression","user":{"login":"tleeuwenburg","id":60954,"avatar_url":"https://avatars.githubusercontent.com/u/60954?v=3","gravatar_id":"","url":"https://api.github.com/users/tleeuwenburg","html_url":"https://github.com/tleeuwenburg","followers_url":"https://api.github.com/users/tleeuwenburg/followers","following_url":"https://api.github.com/users/tleeuwenburg/following{/other_user}","gists_url":"https://api.github.com/users/tleeuwenburg/gists{/gist_id}","starred_url":"https://api.github.com/users/tleeuwenburg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tleeuwenburg/subscriptions","organizations_url":"https://api.github.com/users/tleeuwenburg/orgs","repos_url":"https://api.github.com/users/tleeuwenburg/repos","events_url":"https://api.github.com/users/tleeuwenburg/events{/privacy}","received_events_url":"https://api.github.com/users/tleeuwenburg/received_events","type":"User","site_admin":false},"body":"Hoping this will initiating a useful discussion around expressing external depencies within setup.py.","created_at":"2015-08-03T05:36:08Z","updated_at":"2015-08-04T02:48:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ec7eebe2bb9becf8677032eba033f31c525daeb1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pypa/interoperability-peps/pulls/30/commits","review_comments_url":"https://api.github.com/repos/pypa/interoperability-peps/pulls/30/comments","review_comment_url":"https://api.github.com/repos/pypa/interoperability-peps/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pypa/interoperability-peps/issues/30/comments","statuses_url":"https://api.github.com/repos/pypa/interoperability-peps/statuses/3c06cd8f8785aa4bc39eadbe1431f90a6c1bd95a","head":{"label":"tleeuwenburg:master","ref":"master","sha":"3c06cd8f8785aa4bc39eadbe1431f90a6c1bd95a","user":{"login":"tleeuwenburg","id":60954,"avatar_url":"https://avatars.githubusercontent.com/u/60954?v=3","gravatar_id":"","url":"https://api.github.com/users/tleeuwenburg","html_url":"https://github.com/tleeuwenburg","followers_url":"https://api.github.com/users/tleeuwenburg/followers","following_url":"https://api.github.com/users/tleeuwenburg/following{/other_user}","gists_url":"https://api.github.com/users/tleeuwenburg/gists{/gist_id}","starred_url":"https://api.github.com/users/tleeuwenburg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tleeuwenburg/subscriptions","organizations_url":"https://api.github.com/users/tleeuwenburg/orgs","repos_url":"https://api.github.com/users/tleeuwenburg/repos","events_url":"https://api.github.com/users/tleeuwenburg/events{/privacy}","received_events_url":"https://api.github.com/users/tleeuwenburg/received_events","type":"User","site_admin":false},"repo":{"id":40106727,"name":"interoperability-peps","full_name":"tleeuwenburg/interoperability-peps","owner":{"login":"tleeuwenburg","id":60954,"avatar_url":"https://avatars.githubusercontent.com/u/60954?v=3","gravatar_id":"","url":"https://api.github.com/users/tleeuwenburg","html_url":"https://github.com/tleeuwenburg","followers_url":"https://api.github.com/users/tleeuwenburg/followers","following_url":"https://api.github.com/users/tleeuwenburg/following{/other_user}","gists_url":"https://api.github.com/users/tleeuwenburg/gists{/gist_id}","starred_url":"https://api.github.com/users/tleeuwenburg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tleeuwenburg/subscriptions","organizations_url":"https://api.github.com/users/tleeuwenburg/orgs","repos_url":"https://api.github.com/users/tleeuwenburg/repos","events_url":"https://api.github.com/users/tleeuwenburg/events{/privacy}","received_events_url":"https://api.github.com/users/tleeuwenburg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tleeuwenburg/interoperability-peps","description":"Development repo for evolution of PyPA interoperability standards (released versions are published as PEPs on python.org)","fork":true,"url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps","forks_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/forks","keys_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/teams","hooks_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/hooks","issue_events_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/issues/events{/number}","events_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/events","assignees_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/assignees{/user}","branches_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/branches{/branch}","tags_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/tags","blobs_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/git/refs{/sha}","trees_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/statuses/{sha}","languages_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/languages","stargazers_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/stargazers","contributors_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/contributors","subscribers_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/subscribers","subscription_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/subscription","commits_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/commits{/sha}","git_commits_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/git/commits{/sha}","comments_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/comments{/number}","issue_comment_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/issues/comments{/number}","contents_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/contents/{+path}","compare_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/merges","archive_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/downloads","issues_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/issues{/number}","pulls_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/pulls{/number}","milestones_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/milestones{/number}","notifications_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/labels{/name}","releases_url":"https://api.github.com/repos/tleeuwenburg/interoperability-peps/releases{/id}","created_at":"2015-08-03T05:33:20Z","updated_at":"2015-08-03T05:33:20Z","pushed_at":"2015-08-04T00:44:07Z","git_url":"git://github.com/tleeuwenburg/interoperability-peps.git","ssh_url":"git@github.com:tleeuwenburg/interoperability-peps.git","clone_url":"https://github.com/tleeuwenburg/interoperability-peps.git","svn_url":"https://github.com/tleeuwenburg/interoperability-peps","homepage":null,"size":24568,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pypa:master","ref":"master","sha":"3dd97834faa8c4f61b916e1cd76f623b702c8ad3","user":{"login":"pypa","id":647025,"avatar_url":"https://avatars.githubusercontent.com/u/647025?v=3","gravatar_id":"","url":"https://api.github.com/users/pypa","html_url":"https://github.com/pypa","followers_url":"https://api.github.com/users/pypa/followers","following_url":"https://api.github.com/users/pypa/following{/other_user}","gists_url":"https://api.github.com/users/pypa/gists{/gist_id}","starred_url":"https://api.github.com/users/pypa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pypa/subscriptions","organizations_url":"https://api.github.com/users/pypa/orgs","repos_url":"https://api.github.com/users/pypa/repos","events_url":"https://api.github.com/users/pypa/events{/privacy}","received_events_url":"https://api.github.com/users/pypa/received_events","type":"Organization","site_admin":false},"repo":{"id":28580365,"name":"interoperability-peps","full_name":"pypa/interoperability-peps","owner":{"login":"pypa","id":647025,"avatar_url":"https://avatars.githubusercontent.com/u/647025?v=3","gravatar_id":"","url":"https://api.github.com/users/pypa","html_url":"https://github.com/pypa","followers_url":"https://api.github.com/users/pypa/followers","following_url":"https://api.github.com/users/pypa/following{/other_user}","gists_url":"https://api.github.com/users/pypa/gists{/gist_id}","starred_url":"https://api.github.com/users/pypa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pypa/subscriptions","organizations_url":"https://api.github.com/users/pypa/orgs","repos_url":"https://api.github.com/users/pypa/repos","events_url":"https://api.github.com/users/pypa/events{/privacy}","received_events_url":"https://api.github.com/users/pypa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pypa/interoperability-peps","description":"Development repo for evolution of PyPA interoperability standards (released versions are published as PEPs on python.org)","fork":false,"url":"https://api.github.com/repos/pypa/interoperability-peps","forks_url":"https://api.github.com/repos/pypa/interoperability-peps/forks","keys_url":"https://api.github.com/repos/pypa/interoperability-peps/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pypa/interoperability-peps/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pypa/interoperability-peps/teams","hooks_url":"https://api.github.com/repos/pypa/interoperability-peps/hooks","issue_events_url":"https://api.github.com/repos/pypa/interoperability-peps/issues/events{/number}","events_url":"https://api.github.com/repos/pypa/interoperability-peps/events","assignees_url":"https://api.github.com/repos/pypa/interoperability-peps/assignees{/user}","branches_url":"https://api.github.com/repos/pypa/interoperability-peps/branches{/branch}","tags_url":"https://api.github.com/repos/pypa/interoperability-peps/tags","blobs_url":"https://api.github.com/repos/pypa/interoperability-peps/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pypa/interoperability-peps/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pypa/interoperability-peps/git/refs{/sha}","trees_url":"https://api.github.com/repos/pypa/interoperability-peps/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pypa/interoperability-peps/statuses/{sha}","languages_url":"https://api.github.com/repos/pypa/interoperability-peps/languages","stargazers_url":"https://api.github.com/repos/pypa/interoperability-peps/stargazers","contributors_url":"https://api.github.com/repos/pypa/interoperability-peps/contributors","subscribers_url":"https://api.github.com/repos/pypa/interoperability-peps/subscribers","subscription_url":"https://api.github.com/repos/pypa/interoperability-peps/subscription","commits_url":"https://api.github.com/repos/pypa/interoperability-peps/commits{/sha}","git_commits_url":"https://api.github.com/repos/pypa/interoperability-peps/git/commits{/sha}","comments_url":"https://api.github.com/repos/pypa/interoperability-peps/comments{/number}","issue_comment_url":"https://api.github.com/repos/pypa/interoperability-peps/issues/comments{/number}","contents_url":"https://api.github.com/repos/pypa/interoperability-peps/contents/{+path}","compare_url":"https://api.github.com/repos/pypa/interoperability-peps/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pypa/interoperability-peps/merges","archive_url":"https://api.github.com/repos/pypa/interoperability-peps/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pypa/interoperability-peps/downloads","issues_url":"https://api.github.com/repos/pypa/interoperability-peps/issues{/number}","pulls_url":"https://api.github.com/repos/pypa/interoperability-peps/pulls{/number}","milestones_url":"https://api.github.com/repos/pypa/interoperability-peps/milestones{/number}","notifications_url":"https://api.github.com/repos/pypa/interoperability-peps/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pypa/interoperability-peps/labels{/name}","releases_url":"https://api.github.com/repos/pypa/interoperability-peps/releases{/id}","created_at":"2014-12-29T04:35:09Z","updated_at":"2015-08-03T05:47:46Z","pushed_at":"2015-08-04T00:44:07Z","git_url":"git://github.com/pypa/interoperability-peps.git","ssh_url":"git@github.com:pypa/interoperability-peps.git","clone_url":"https://github.com/pypa/interoperability-peps.git","svn_url":"https://github.com/pypa/interoperability-peps","homepage":null,"size":24836,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":9,"forks":5,"open_issues":9,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pypa/interoperability-peps/pulls/30"},"html":{"href":"https://github.com/pypa/interoperability-peps/pull/30"},"issue":{"href":"https://api.github.com/repos/pypa/interoperability-peps/issues/30"},"comments":{"href":"https://api.github.com/repos/pypa/interoperability-peps/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/pypa/interoperability-peps/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/pypa/interoperability-peps/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pypa/interoperability-peps/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/pypa/interoperability-peps/statuses/3c06cd8f8785aa4bc39eadbe1431f90a6c1bd95a"}}}}