{"action":"created","comment":{"url":"https://api.github.com/repos/zeit/now-builders/pulls/comments/236919325","pull_request_review_id":179097417,"id":236919325,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjkxOTMyNQ==","diff_hunk":"@@ -0,0 +1,57 @@\n+const path = require('path');\n+const fetch = require('node-fetch');\n+const execa = require('execa');\n+const { createWriteStream } = require('fs');\n+\n+const getWritableDirectory = require('@now/build-utils/fs/get-writable-directory.js');\n+\n+const url = 'https://bootstrap.pypa.io/get-pip.py';\n+\n+// downloads `get-pip.py` and returns its absolute path\n+async function downloadGetPipScript() {\n+  console.log('downloading \"get-pip.py\"...');\n+  const res = await fetch(url);\n+\n+  if (!res.ok || res.status !== 200) {\n+    throw new Error(`Could not download \"get-pip.py\" from \"${url}\"`);\n+  }\n+\n+  const dir = await getWritableDirectory();\n+  const filePath = path.join(dir, 'get-pip.py');\n+  const writeStream = createWriteStream(filePath);\n+\n+  return new Promise((resolve, reject) => {","path":"packages/now-python-wsgi/download-and-install-pip.js","position":23,"original_position":23,"commit_id":"26b9a225d42f093d9abd9285057b091d6ac45b67","original_commit_id":"26b9a225d42f093d9abd9285057b091d6ac45b67","user":{"login":"sisp","id":2206639,"node_id":"MDQ6VXNlcjIyMDY2Mzk=","avatar_url":"https://avatars1.githubusercontent.com/u/2206639?v=4","gravatar_id":"","url":"https://api.github.com/users/sisp","html_url":"https://github.com/sisp","followers_url":"https://api.github.com/users/sisp/followers","following_url":"https://api.github.com/users/sisp/following{/other_user}","gists_url":"https://api.github.com/users/sisp/gists{/gist_id}","starred_url":"https://api.github.com/users/sisp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sisp/subscriptions","organizations_url":"https://api.github.com/users/sisp/orgs","repos_url":"https://api.github.com/users/sisp/repos","events_url":"https://api.github.com/users/sisp/events{/privacy}","received_events_url":"https://api.github.com/users/sisp/received_events","type":"User","site_admin":false},"body":"I just copied everything from `now-python`.","created_at":"2018-11-28T02:14:13Z","updated_at":"2018-11-28T02:14:14Z","html_url":"https://github.com/zeit/now-builders/pull/95#discussion_r236919325","pull_request_url":"https://api.github.com/repos/zeit/now-builders/pulls/95","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/zeit/now-builders/pulls/comments/236919325"},"html":{"href":"https://github.com/zeit/now-builders/pull/95#discussion_r236919325"},"pull_request":{"href":"https://api.github.com/repos/zeit/now-builders/pulls/95"}},"in_reply_to_id":236919172},"pull_request":{"url":"https://api.github.com/repos/zeit/now-builders/pulls/95","id":234123704,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0MTIzNzA0","html_url":"https://github.com/zeit/now-builders/pull/95","diff_url":"https://github.com/zeit/now-builders/pull/95.diff","patch_url":"https://github.com/zeit/now-builders/pull/95.patch","issue_url":"https://api.github.com/repos/zeit/now-builders/issues/95","number":95,"state":"open","locked":false,"title":"Python WSGI builder without server","user":{"login":"sisp","id":2206639,"node_id":"MDQ6VXNlcjIyMDY2Mzk=","avatar_url":"https://avatars1.githubusercontent.com/u/2206639?v=4","gravatar_id":"","url":"https://api.github.com/users/sisp","html_url":"https://github.com/sisp","followers_url":"https://api.github.com/users/sisp/followers","following_url":"https://api.github.com/users/sisp/following{/other_user}","gists_url":"https://api.github.com/users/sisp/gists{/gist_id}","starred_url":"https://api.github.com/users/sisp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sisp/subscriptions","organizations_url":"https://api.github.com/users/sisp/orgs","repos_url":"https://api.github.com/users/sisp/repos","events_url":"https://api.github.com/users/sisp/events{/privacy}","received_events_url":"https://api.github.com/users/sisp/received_events","type":"User","site_admin":false},"body":"This PR adds a builder for Python WSGI web apps. It is heavily based on [`serverless-wsgi`](https://github.com/logandk/serverless-wsgi) and [`requests-wsgi-adapter`](https://github.com/seanbrant/requests-wsgi-adapter), uses [`Werkzeug`](https://github.com/pallets/werkzeug), and works without running an additional web server.\r\n\r\nI've tested it manually with a simple Flask app that contains endpoints with `GET` and `POST` methods, nested paths, and JSON and binary response bodies.\r\n\r\nCuriously, the `event` parameter in the `now_handler` function does not appear to have the expected structure of AWS Lambda functions. For instance, `event['isBase64Encoded']` does not exist. Instead, this information is encoded in `json.loads(event['body'])['encoding']`. The returned `dict` also expects `encoding='base64'` for a binary response body instead of `isBase64Encoded=True`. I've also noticed that no AWS request headers are included. I assume Now is responsible for these differences to plain AWS Lambda functions.\r\n\r\nI'd appreciate code review and feedback to get robust official Python WSGI support into Now as soon as possible.","created_at":"2018-11-28T02:08:34Z","updated_at":"2018-11-28T02:14:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4034c18f5d74f3005b89ab6c7c410a94cc1947be","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/zeit/now-builders/pulls/95/commits","review_comments_url":"https://api.github.com/repos/zeit/now-builders/pulls/95/comments","review_comment_url":"https://api.github.com/repos/zeit/now-builders/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zeit/now-builders/issues/95/comments","statuses_url":"https://api.github.com/repos/zeit/now-builders/statuses/26b9a225d42f093d9abd9285057b091d6ac45b67","head":{"label":"sisp:python-wsgi","ref":"python-wsgi","sha":"26b9a225d42f093d9abd9285057b091d6ac45b67","user":{"login":"sisp","id":2206639,"node_id":"MDQ6VXNlcjIyMDY2Mzk=","avatar_url":"https://avatars1.githubusercontent.com/u/2206639?v=4","gravatar_id":"","url":"https://api.github.com/users/sisp","html_url":"https://github.com/sisp","followers_url":"https://api.github.com/users/sisp/followers","following_url":"https://api.github.com/users/sisp/following{/other_user}","gists_url":"https://api.github.com/users/sisp/gists{/gist_id}","starred_url":"https://api.github.com/users/sisp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sisp/subscriptions","organizations_url":"https://api.github.com/users/sisp/orgs","repos_url":"https://api.github.com/users/sisp/repos","events_url":"https://api.github.com/users/sisp/events{/privacy}","received_events_url":"https://api.github.com/users/sisp/received_events","type":"User","site_admin":false},"repo":{"id":159401856,"node_id":"MDEwOlJlcG9zaXRvcnkxNTk0MDE4NTY=","name":"now-builders","full_name":"sisp/now-builders","private":false,"owner":{"login":"sisp","id":2206639,"node_id":"MDQ6VXNlcjIyMDY2Mzk=","avatar_url":"https://avatars1.githubusercontent.com/u/2206639?v=4","gravatar_id":"","url":"https://api.github.com/users/sisp","html_url":"https://github.com/sisp","followers_url":"https://api.github.com/users/sisp/followers","following_url":"https://api.github.com/users/sisp/following{/other_user}","gists_url":"https://api.github.com/users/sisp/gists{/gist_id}","starred_url":"https://api.github.com/users/sisp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sisp/subscriptions","organizations_url":"https://api.github.com/users/sisp/orgs","repos_url":"https://api.github.com/users/sisp/repos","events_url":"https://api.github.com/users/sisp/events{/privacy}","received_events_url":"https://api.github.com/users/sisp/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sisp/now-builders","description":"Official Now Builders created by the ZEIT team","fork":true,"url":"https://api.github.com/repos/sisp/now-builders","forks_url":"https://api.github.com/repos/sisp/now-builders/forks","keys_url":"https://api.github.com/repos/sisp/now-builders/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sisp/now-builders/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sisp/now-builders/teams","hooks_url":"https://api.github.com/repos/sisp/now-builders/hooks","issue_events_url":"https://api.github.com/repos/sisp/now-builders/issues/events{/number}","events_url":"https://api.github.com/repos/sisp/now-builders/events","assignees_url":"https://api.github.com/repos/sisp/now-builders/assignees{/user}","branches_url":"https://api.github.com/repos/sisp/now-builders/branches{/branch}","tags_url":"https://api.github.com/repos/sisp/now-builders/tags","blobs_url":"https://api.github.com/repos/sisp/now-builders/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sisp/now-builders/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sisp/now-builders/git/refs{/sha}","trees_url":"https://api.github.com/repos/sisp/now-builders/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sisp/now-builders/statuses/{sha}","languages_url":"https://api.github.com/repos/sisp/now-builders/languages","stargazers_url":"https://api.github.com/repos/sisp/now-builders/stargazers","contributors_url":"https://api.github.com/repos/sisp/now-builders/contributors","subscribers_url":"https://api.github.com/repos/sisp/now-builders/subscribers","subscription_url":"https://api.github.com/repos/sisp/now-builders/subscription","commits_url":"https://api.github.com/repos/sisp/now-builders/commits{/sha}","git_commits_url":"https://api.github.com/repos/sisp/now-builders/git/commits{/sha}","comments_url":"https://api.github.com/repos/sisp/now-builders/comments{/number}","issue_comment_url":"https://api.github.com/repos/sisp/now-builders/issues/comments{/number}","contents_url":"https://api.github.com/repos/sisp/now-builders/contents/{+path}","compare_url":"https://api.github.com/repos/sisp/now-builders/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sisp/now-builders/merges","archive_url":"https://api.github.com/repos/sisp/now-builders/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sisp/now-builders/downloads","issues_url":"https://api.github.com/repos/sisp/now-builders/issues{/number}","pulls_url":"https://api.github.com/repos/sisp/now-builders/pulls{/number}","milestones_url":"https://api.github.com/repos/sisp/now-builders/milestones{/number}","notifications_url":"https://api.github.com/repos/sisp/now-builders/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sisp/now-builders/labels{/name}","releases_url":"https://api.github.com/repos/sisp/now-builders/releases{/id}","deployments_url":"https://api.github.com/repos/sisp/now-builders/deployments","created_at":"2018-11-27T21:30:27Z","updated_at":"2018-11-27T21:30:30Z","pushed_at":"2018-11-28T01:49:48Z","git_url":"git://github.com/sisp/now-builders.git","ssh_url":"git@github.com:sisp/now-builders.git","clone_url":"https://github.com/sisp/now-builders.git","svn_url":"https://github.com/sisp/now-builders","homepage":"https://zeit.co/docs","size":9052,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"zeit:master","ref":"master","sha":"1385c1ca489174604542707dd3125325b79d2ad5","user":{"login":"zeit","id":14985020,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0OTg1MDIw","avatar_url":"https://avatars0.githubusercontent.com/u/14985020?v=4","gravatar_id":"","url":"https://api.github.com/users/zeit","html_url":"https://github.com/zeit","followers_url":"https://api.github.com/users/zeit/followers","following_url":"https://api.github.com/users/zeit/following{/other_user}","gists_url":"https://api.github.com/users/zeit/gists{/gist_id}","starred_url":"https://api.github.com/users/zeit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeit/subscriptions","organizations_url":"https://api.github.com/users/zeit/orgs","repos_url":"https://api.github.com/users/zeit/repos","events_url":"https://api.github.com/users/zeit/events{/privacy}","received_events_url":"https://api.github.com/users/zeit/received_events","type":"Organization","site_admin":false},"repo":{"id":156710412,"node_id":"MDEwOlJlcG9zaXRvcnkxNTY3MTA0MTI=","name":"now-builders","full_name":"zeit/now-builders","private":false,"owner":{"login":"zeit","id":14985020,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0OTg1MDIw","avatar_url":"https://avatars0.githubusercontent.com/u/14985020?v=4","gravatar_id":"","url":"https://api.github.com/users/zeit","html_url":"https://github.com/zeit","followers_url":"https://api.github.com/users/zeit/followers","following_url":"https://api.github.com/users/zeit/following{/other_user}","gists_url":"https://api.github.com/users/zeit/gists{/gist_id}","starred_url":"https://api.github.com/users/zeit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeit/subscriptions","organizations_url":"https://api.github.com/users/zeit/orgs","repos_url":"https://api.github.com/users/zeit/repos","events_url":"https://api.github.com/users/zeit/events{/privacy}","received_events_url":"https://api.github.com/users/zeit/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/zeit/now-builders","description":"Official Now Builders created by the ZEIT team","fork":false,"url":"https://api.github.com/repos/zeit/now-builders","forks_url":"https://api.github.com/repos/zeit/now-builders/forks","keys_url":"https://api.github.com/repos/zeit/now-builders/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zeit/now-builders/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zeit/now-builders/teams","hooks_url":"https://api.github.com/repos/zeit/now-builders/hooks","issue_events_url":"https://api.github.com/repos/zeit/now-builders/issues/events{/number}","events_url":"https://api.github.com/repos/zeit/now-builders/events","assignees_url":"https://api.github.com/repos/zeit/now-builders/assignees{/user}","branches_url":"https://api.github.com/repos/zeit/now-builders/branches{/branch}","tags_url":"https://api.github.com/repos/zeit/now-builders/tags","blobs_url":"https://api.github.com/repos/zeit/now-builders/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zeit/now-builders/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zeit/now-builders/git/refs{/sha}","trees_url":"https://api.github.com/repos/zeit/now-builders/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zeit/now-builders/statuses/{sha}","languages_url":"https://api.github.com/repos/zeit/now-builders/languages","stargazers_url":"https://api.github.com/repos/zeit/now-builders/stargazers","contributors_url":"https://api.github.com/repos/zeit/now-builders/contributors","subscribers_url":"https://api.github.com/repos/zeit/now-builders/subscribers","subscription_url":"https://api.github.com/repos/zeit/now-builders/subscription","commits_url":"https://api.github.com/repos/zeit/now-builders/commits{/sha}","git_commits_url":"https://api.github.com/repos/zeit/now-builders/git/commits{/sha}","comments_url":"https://api.github.com/repos/zeit/now-builders/comments{/number}","issue_comment_url":"https://api.github.com/repos/zeit/now-builders/issues/comments{/number}","contents_url":"https://api.github.com/repos/zeit/now-builders/contents/{+path}","compare_url":"https://api.github.com/repos/zeit/now-builders/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zeit/now-builders/merges","archive_url":"https://api.github.com/repos/zeit/now-builders/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zeit/now-builders/downloads","issues_url":"https://api.github.com/repos/zeit/now-builders/issues{/number}","pulls_url":"https://api.github.com/repos/zeit/now-builders/pulls{/number}","milestones_url":"https://api.github.com/repos/zeit/now-builders/milestones{/number}","notifications_url":"https://api.github.com/repos/zeit/now-builders/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zeit/now-builders/labels{/name}","releases_url":"https://api.github.com/repos/zeit/now-builders/releases{/id}","deployments_url":"https://api.github.com/repos/zeit/now-builders/deployments","created_at":"2018-11-08T13:22:37Z","updated_at":"2018-11-28T00:10:55Z","pushed_at":"2018-11-28T02:08:35Z","git_url":"git://github.com/zeit/now-builders.git","ssh_url":"git@github.com:zeit/now-builders.git","clone_url":"https://github.com/zeit/now-builders.git","svn_url":"https://github.com/zeit/now-builders","homepage":"https://zeit.co/docs","size":9182,"stargazers_count":159,"watchers_count":159,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":26,"mirror_url":null,"archived":false,"open_issues_count":47,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":26,"open_issues":47,"watchers":159,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zeit/now-builders/pulls/95"},"html":{"href":"https://github.com/zeit/now-builders/pull/95"},"issue":{"href":"https://api.github.com/repos/zeit/now-builders/issues/95"},"comments":{"href":"https://api.github.com/repos/zeit/now-builders/issues/95/comments"},"review_comments":{"href":"https://api.github.com/repos/zeit/now-builders/pulls/95/comments"},"review_comment":{"href":"https://api.github.com/repos/zeit/now-builders/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zeit/now-builders/pulls/95/commits"},"statuses":{"href":"https://api.github.com/repos/zeit/now-builders/statuses/26b9a225d42f093d9abd9285057b091d6ac45b67"}},"author_association":"NONE"}}
{"actor":{"display_login":"sisp"}}