Repository: python/cpython
Pull request: bpo-37860: Add netlify deploy preview for docs
Add netlify deploy preview for docs. Once you add Netlify as an app to this github repo, then with these files added in, it should build the docs properly.

Here is an example PR with netlify enabled: https://github.com/epicfaace/cpython/pull/5
And the corresponding deploy preview: https://deploy-preview-5--priceless-newton-e3c22b.netlify.com/

<!-- issue-number: [bpo-37860](https://bugs.python.org/issue37860) -->
https://bugs.python.org/issue37860
<!-- /issue-number -->

Fixes https://github.com/python/core-workflow/issues/348

Problem statement:
Preview CPython documentation build in PR via netlify
In Devguide, we have a preview of the new content by deploying the PR changes to netlify. It gives us the ability to view the changes in the browser without needing to manually build it locally on our own computer.

It would be great to do the same for CPython docs.

Hints from issue discussion:

Commit message: move runtime.txt

Patch to review:
diff --git a/Doc/requirements.txt b/Doc/requirements.txt
new file mode 100644
index 00000000000000..d29fbd61dd010a
--- /dev/null
+++ b/Doc/requirements.txt
@@ -0,0 +1,4 @@
+# Requirements for docs build on netlify
+sphinx==2.0.1
+blurb
+python-docs-theme
\ No newline at end of file
diff --git a/Doc/runtime.txt b/Doc/runtime.txt
new file mode 100644
index 00000000000000..548d71365f0ec7
--- /dev/null
+++ b/Doc/runtime.txt
@@ -0,0 +1 @@
+3.7
\ No newline at end of file
diff --git a/netlify.toml b/netlify.toml
new file mode 100644
index 00000000000000..387c8f954ada3c
--- /dev/null
+++ b/netlify.toml
@@ -0,0 +1,4 @@
+[build]
+    base = "Doc/"
+    command = "make html"
+    publish = "Doc/build/html"
\ No newline at end of file


Code review comments:
diff_hunk: @@ -0,0 +1,4 @@
+# Requirements for docs build on netlify
+sphinx==2.0.1
path: Doc/requirements.txt
text: @user2:
@user1 Do you think that this should be pinned or float upward?

@author:
I pinned it because that's how it was in .travis.yml.

https://github.com/python/cpython/blob/master/.travis.yml#L58

Actually, do you think it might be better to make .travis.yml to read from Doc/requirements.txt instead of specifying its own versions?

@user2:
Let's do this. Keep it pinned for now but add a comment: `# Pin sphinx to version specified in .travis.yml` on the line above Sphinx in requirements.txt

@author:
Done. I think it might be better to just include `python -m pip install -r Docs/requirements.txt` in `.travis.yml` though, so that we don't have to keep two files in sync, unless there's a reason not to do so?

@user2:
@author For now, the least disruptive change was to make the modification here. Ideally, there wouldn't be duplication. Would you like to open an issue suggesting the above.