GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-37860: Add netlify deploy preview for docs by epicfaace · Pull Request #15288 · python/cpython

Conversation

@epicfaace

@epicfaace epicfaace commented Aug 14, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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: epicfaace#5
And the corresponding deploy preview: https://deploy-preview-5--priceless-newton-e3c22b.netlify.com/

https://bugs.python.org/issue37860

Fixes python/core-workflow#348

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
epicfaace added 13 commits August 14, 2019 20:38
@epicfaace
add netlify deploy preview
2c1724a
@epicfaace
fix publish path
ebf24e1
@epicfaace
install python3 venv
5312c6f
@epicfaace
add sudo
80a6bbf
@epicfaace
try without venv
7482533
@epicfaace
install right dependencies
7458e2a
@epicfaace
use python3, not python
a75c028
@epicfaace
use pip3
24f3a20
@epicfaace
python3.7
3e8f9bd
@epicfaace
use requirements.txt
73c2b39
@epicfaace
move requirements.txt to Doc
706382c
@epicfaace
use python 3.7 in runtime.txt
087a79d
@epicfaace
move runtime.txt
f5b2280
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Aug 14, 2019
@bedevere-bot bedevere-bot added the awaiting review label Aug 14, 2019
@aeros aeros mentioned this pull request Aug 18, 2019
Expand "What's New and News Entries" to include Sphinx python/devguide#525
Merged
aeros
aeros reviewed Aug 19, 2019
View reviewed changes

@aeros aeros left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@epicfaace Thanks for the PR!

This will definitely be much more convenient than having to manually use make html to preview rich formatting changes.

Edit: Also, as far as I can tell, the netlify preview seems to be working correctly in the PR within the author's forked repository: https://deploy-preview-5--priceless-newton-e3c22b.netlify.com.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
willingc
willingc approved these changes Aug 21, 2019
View reviewed changes

@willingc willingc left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @epicfaace 👍

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/requirements.txt
@@ -0,0 +1,4 @@
# Requirements for docs build on netlify
sphinx==2.0.1

@willingc willingc Aug 21, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mariatta Do you think that this should be pinned or float upward?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@epicfaace epicfaace Aug 21, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@willingc willingc Aug 21, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@epicfaace epicfaace Aug 21, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@willingc willingc Aug 21, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@epicfaace 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

epicfaace reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Aug 21, 2019
@aeros

aeros commented Aug 21, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

If it's not much of a hassle, I would appreciate it if someone could @ mention me when this PR is merged. I'll be mentioning the netlify preview in my PR for the devguide as a part of verifying rich formatting in NEWS entries.

It might be worthwhile to also mention it somewhere in https://devguide.python.org/documenting/.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@willingc

willingc commented Aug 21, 2019

Copy link
Copy Markdown
Contributor

If it's not much of a hassle, I would appreciate it if someone could @ mention me when this PR is merged. I'll be mentioning the netlify preview in my PR for the devguide as a part of verifying rich formatting in NEWS entries.

@aeros167 It's probably better for you to click Notifications on the right sidebar which will subscribe you to changes in the PR 😄

It might be worthwhile to also mention it somewhere in https://devguide.python.org/documenting/.

Yes it would 👍

aeros reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@willingc willingc mentioned this pull request Aug 21, 2019
Add information about Netlify preview for docs on GitHub PRs python/devguide#526
Closed
@aeros

aeros commented Aug 21, 2019

Copy link
Copy Markdown
Contributor

@aeros167 It's probably better for you to click Notifications on the right sidebar which will subscribe you to changes in the PR smile

Haha, good point. I recently changed my notification settings to only notify me via email for @ mentions (since I was getting a bit over-flooded w/ GitHub emails), but I could probably have it different for specific PRs. I previously had it set to "Watching" for any PR that I reviewed or commented in.

Also, I hadn't realized that the "Releases only" setting was an option, which notifies only for @ mentions and releases. That should do the trick. (:

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@epicfaace
Update requirements.txt
31fc12d
@aeros

aeros commented Aug 21, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Since this change is involving the addition of a development tool to the repository and it wouldn't affect users of Python, I'll add a skip news label.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeros aeros added skip issue docs Documentation in the Doc dir skip news and removed skip issue labels Aug 21, 2019
@bedevere-bot bedevere-bot removed the awaiting merge label Aug 21, 2019
@aeros

aeros commented Aug 21, 2019

Copy link
Copy Markdown
Contributor

Thanks again for the PR @epicfaace and thanks for merging it @willingc. I'll go update my PR for the devguide.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@epicfaace

epicfaace commented Aug 21, 2019

Copy link
Copy Markdown
Contributor Author

An admin now needs to actually add Netlify as an app to this repository so that it can start running and building the docs.

aeros reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeros

aeros commented Aug 21, 2019

Copy link
Copy Markdown
Contributor

An admin now needs to actually add Netlify as an app to this repository so that it can start running and building the docs.

I'm not certain if there's a specific person that manages the repository's apps, so I'll notify all of the admins for CPython.

/cc @python/cpython-repository-admins

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brettcannon

brettcannon commented Aug 21, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

@epicfaace have a link to the GitHub App for Netlify?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

merwok
merwok reviewed Aug 22, 2019
View reviewed changes
Comment thread Doc/runtime.txt
@@ -0,0 +1 @@
3.7 No newline at end of file

@merwok merwok Aug 22, 2019

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be specified in netlify.toml too instead of a special-purpose file?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@epicfaace epicfaace Aug 22, 2019

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. https://www.netlify.com/docs/build-settings

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@epicfaace

epicfaace commented Aug 22, 2019

Copy link
Copy Markdown
Contributor Author

@epicfaace have a link to the GitHub App for Netlify?

@brettcannon I think the easiest way to integrate it is to sign in to netlify.com with whichever account Python is using. You can use the same Netlify account that's being used with https://github.com/python/devguide. Then, you can add this repo as a "site" on netlify, and then it should ask for permission with the appropriate scopes. See https://www.netlify.com/docs/github-permissions/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brettcannon

brettcannon commented Aug 22, 2019

Copy link
Copy Markdown
Member

@epicfaace not aware of any account, so I don't know what you're talking about. 😄 @ewdurbin do you know/control the netlify account for the org?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeros aeros mentioned this pull request Aug 22, 2019
simplify aeros/devguide#1
Merged
@epicfaace

epicfaace commented Aug 22, 2019

Copy link
Copy Markdown
Contributor Author

For reference, here's the original thread where it was set up for devguide: python/devguide#463

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Mariatta

Mariatta commented Aug 22, 2019

Copy link
Copy Markdown
Member

😟 the devguide netlify was actually set up under my personal netlify account.
I could not figure out how to transfer that to a different account.

If the PSF can create the netlify account and add me to it as a team member, I can help manage and create the netlify for CPython.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@epicfaace

epicfaace commented Aug 23, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

I've set up an open source site on Netlify before. You need to contact Support and then they will give your account access to create a "Team". Then, you can add people to the team and create sites on it.

Note that in order to qualify for this, you must have a badge that links to Netlify on the deployed site. (They suggest you add a "deploys by Netlify" badge, so it seems like this requirement would only apply to the version of the site that is deployed by Netlify, i.e. the deploy previews)

https://www.netlify.com/legal/open-source-policy/

Otherwise, using a personal account on Netlify doesn't give you the ability to share permissions/management with others.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
@epicfaace @lisroach
bpo-37860: Add netlify deploy preview for docs (pythonGH-15288)
c3a86ff
* add netlify deploy preview

* fix publish path

* install python3 venv

* add sudo

* try without venv

* install right dependencies

* use python3, not python

* use pip3

* python3.7

* use requirements.txt

* move requirements.txt to Doc

* use python 3.7 in runtime.txt

* move runtime.txt

* Update requirements.txt
@jaraco

jaraco commented Dec 29, 2019

Copy link
Copy Markdown
Member

I'm eager to see this feature employed. Today, I'm reviewing GH-17730, and I'd love to see the rendered output without building the toolchain or downloading the zip file and expanding it locally.

aeros, epicfaace, and willingc reacted with thumbs up emoji
All reactions
  • 👍 3 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@epicfaace

epicfaace commented Jan 2, 2020

Copy link
Copy Markdown
Contributor Author

@Mariatta how could we go forward with this? Could we just set this up as part of your personal netlify account (although it's not ideal, at least then the devguide and cpython repos will both be under your account, so that they could later be transferred together to a PSF account)?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brettcannon

brettcannon commented Jan 2, 2020

Copy link
Copy Markdown
Member

@epicfaace we would need @ewdurbin to set up a PSF-managed Netlify account.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ewdurbin

ewdurbin commented Jan 6, 2020

Copy link
Copy Markdown
Member

I've contacted Netlify to inquire about setting up a PSF team on the service. It looks like their free tier has changed and probably would not support the needs of this repo both in build minutes and collaborator count.

willingc reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@epicfaace

epicfaace commented Jan 7, 2020

Copy link
Copy Markdown
Contributor Author

@ewdurbin I assume you're talking about the "Pro" tier, correct (which is what Netlify provides to open-source teams for free) (1000 build minutes included/month and 3 collaborators included)? What values of build minutes / collaborator count do you think would be required for this repo?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
@epicfaace @DinoV
bpo-37860: Add netlify deploy preview for docs (pythonGH-15288)
d6ec373
* add netlify deploy preview

* fix publish path

* install python3 venv

* add sudo

* try without venv

* install right dependencies

* use python3, not python

* use pip3

* python3.7

* use requirements.txt

* move requirements.txt to Doc

* use python 3.7 in runtime.txt

* move runtime.txt

* Update requirements.txt
@ewdurbin ewdurbin mentioned this pull request Jan 28, 2020
bpo-37860: Update netlify.toml #18242
Closed
@ewdurbin

ewdurbin commented Jan 28, 2020

Copy link
Copy Markdown
Member

Howdy! I heard back from netlify and we have access to a Pro level account now through their Open Source Plan Policy.

To get some bearings, I temporarily enabled it for this repository and opened a test pull request at #18242, which resulted in a working preview build 🎉.

Overall it seems to work with that minor tweak, but the limitations of the Pro level plan will likely need to be addressed:

1000 build minutes per month

I'm not sure if it's a cold cache kind of situation, but from the logs of a few test deploys (example) I noticed that cloning alone is taking over a minute per build, followed by another 5-6 minutes to install dependencies and build the docs.

This means that we can currently expect to get ~170 preview builds per month before reaching our limit and beginning to incur charges of $7/500 additional build minutes.

3 concurrent builds

This is a pretty active repository, so this would likely just be a headache at times. Probably not a blocker.

3 team members

Probably not an issue, I'd just need to know who to add.

Given those, I think we'd need to investigate some way to handle the limitations above (and figure out why the change in #18242 was necessary) before turning this on.

aeros and brettcannon reacted with hooray emoji
All reactions
  • 🎉 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeros

aeros commented Jan 29, 2020

Copy link
Copy Markdown
Contributor

Thanks for reaching out to netlify on this @ewdurbin!

Assuming we can find a way around the monthly build time limits, this will be an awesome feature for documentation PRs; especially for larger ones that include a significant amount of markdown. For example, the "What's New" documentation often contains broken Sphinx roles (with correct syntax, but an incorrect link). These could be caught much easier with the netlify preview.

One possible solution would be to use the preview selectively for documentation PRs, via a manually applied label (which would be configured to trigger a webhook). For example: test-with-netlify, similar to the recently added test-with-buildbots. As long as the limit is a concern, the label would have to be manually added by either Python core developers or members of the Triage team for PRs that would substantially benefit from having the netlify preview.

In the future if we're able to increase the monthly build limit substantially (to either unlimited or high enough that we'd never reasonably reach it), we could potentially configure @bedevere-bot to automatically add the above test-with-netlify whenever a PR includes changes to any file to the Doc/ directory in the CPython repository.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@epicfaace

epicfaace commented Mar 15, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Given the limitations of using Netlify, I've added a PR with an alternative approach using GitHub Actions in the issue (https://bugs.python.org/issue37860). Any thoughts on this approach?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
@epicfaace @websurfer5
bpo-37860: Add netlify deploy preview for docs (pythonGH-15288)
ba7deac
* add netlify deploy preview

* fix publish path

* install python3 venv

* add sudo

* try without venv

* install right dependencies

* use python3, not python

* use pip3

* python3.7

* use requirements.txt

* move requirements.txt to Doc

* use python 3.7 in runtime.txt

* move runtime.txt

* Update requirements.txt
@hugovk hugovk mentioned this pull request Dec 28, 2021
bpo-46184: remove netlify.toml #30272
Merged
@hugovk hugovk mentioned this pull request Apr 16, 2022
Doc: Fix spurious comma in the author metadata field #32386
Merged
@epicfaace epicfaace mannequin mentioned this pull request Apr 16, 2022
Add deploy preview for docs #82041
Closed
@epicfaace epicfaace mentioned this pull request May 16, 2022
bpo-37860: re-add netlify.toml to set up deploy previews for docs #92852
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@merwok merwok merwok left review comments
@willingc willingc willingc approved these changes
+1 more reviewer
@aeros aeros aeros left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Preview CPython documentation build in PR via netlify

Uh oh!

There was an error while loading. Please reload this page.

10 participants

@epicfaace @aeros @willingc @brettcannon @Mariatta @jaraco @ewdurbin @merwok @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.