Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: Fix up auto build procedure to upload Cheat Sheet to web site #40949

Closed
Dr-Irv opened this issue Apr 14, 2021 · 13 comments · Fixed by #44018
Closed

DOC: Fix up auto build procedure to upload Cheat Sheet to web site #40949

Dr-Irv opened this issue Apr 14, 2021 · 13 comments · Fixed by #44018
Assignees
Labels
Build Library building on various platforms Docs good first issue Web pandas website
Milestone

Comments

@Dr-Irv
Copy link
Contributor

Dr-Irv commented Apr 14, 2021

Need to fix the procedures so that the PDFs (English, Japanese) for the cheat sheet here: https://github.com/pandas-dev/pandas/tree/master/doc/cheatsheet

get uploaded to here:
https://pandas.pydata.org/Pandas_Cheat_Sheet.pdf

(and when the Japanese one is there, can update the docs to link to it as well)

Note: If we decide to move the location on the web site, then we should do a redirect, because there are links out there to the cheat sheet in the current location.

Followup to discussion here: #40168 (comment)

@Dr-Irv Dr-Irv added Docs Needs Triage Issue that has not been reviewed by a pandas team member Build Library building on various platforms Web pandas website labels Apr 14, 2021
@lithomas1 lithomas1 removed the Needs Triage Issue that has not been reviewed by a pandas team member label Apr 15, 2021
@jorisvandenbossche
Copy link
Member

For the website and docs, we rsync to the server for every commit on master. For example for the website:

- name: Upload web
run: rsync -az --delete --exclude='pandas-docs' --exclude='docs' --exclude='Pandas_Cheat_Sheet*' web/build/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas
if: github.event_name == 'push'

I assume the reason the --exclude='Pandas_Cheat_Sheet*' is there, is because the cheatsheet is not actually included in the built web sources, so when rsyncing that, the cheatsheet would otherwise be removed.

But adding an additional rsync call to synchronize the cheatsheets should be possible?

(cc @TomAugspurger @datapythonista)

@datapythonista
Copy link
Member

Instead of another rsync, I think we can simply cp the cheat sheets from the repo to right location in the built web / docs after the web / docs are built. Does it make sense?

@jorisvandenbossche
Copy link
Member

Yes, that's indeed even easier.

@Hallicopter
Copy link

Hallicopter commented Apr 22, 2021

I can give this a shot, seems like a good starter issue for a new contributor like me :)
From what I understand of the issue, I would have to make a change in the CI file pointed out here, so that as a part of the build pipeline the cheatsheet files are also cp'd in, correct?

I will have to figure out the Github workflows part, but I think I can try for a PR by the weekend. Is there anything else I should know? (Especially as a new contributor to this project?)

@Hallicopter
Copy link

take

@Hallicopter
Copy link

I think we can simply cp the cheat sheets from the repo to right location in the built web / docs after the web / docs are built. Does it make sense?

I went through the contribution guidelines and got a good sense of the overall build workflow. I am still a little confused as to where should I cp the cheatsheets to? Ie., where is the right location in the built web/docs that these cheatsheets can be copied to so that it shows up https://pandas.pydata.org/Pandas_Cheat_Sheet.pdf

Sorry if I am asking obvious questions, but I am unfamiliar with the website build workflows for Pandas overall, so asking what comes to my mind.

Would adding the following solve the problem (again, unsure of the destination for the cp)

- name: Move cheatsheets into site directory
  run: cp doc/cheatsheets/Pandas_Cheat_Sheet* web/build/docs

(this would be added right above name: Save website as an artifact)

Correct me if I have misunderstood anywhere.

@jorisvandenbossche
Copy link
Member

I am still a little confused as to where should I cp the cheatsheets to? Ie., where is the right location in the built web/docs that these cheatsheets can be copied to so that it shows up https://pandas.pydata.org/Pandas_Cheat_Sheet.pdf

Since the cheatsheet uses a "top-level" URL (it lives directly under pandas.pydata.org), I think it should be copied to web/build/, as that is the main directory that is synced with the server for the main website.

Would adding the following solve the problem

Yes, that seems correct to me (with web/build as target then)

@Hallicopter Thanks for working on it!

@datapythonista
Copy link
Member

Not sure, but just came to my mind that maybe we have a nginx rule for the cheatsheets. I remember we had something being served from a different place, and would make sense that are the cheatsheets, otherwise they could be overwritten when updating the web/docs.

I'm in a bus the whole day, so can't check until tomorrow. But if that's the case we'll have to synchronize merging the PR with updating nginx.

@Hallicopter
Copy link

Yep, no problem! If I were to locally test my changes, is there any suggestion you have? I can just build the website locally using the commands I am assuming.
Also, if there are some other nuances regarding the nginx configs, do let me know!

@datapythonista
Copy link
Member

I was just checking, there is nothing in the nginx config. It's just the exclude in the rsync that is being used to avoid them being overwritten.

I'm +1 on moving the cheatsheets to their own directory (e.g. cheatsheets/).

In any case, your command seems right (I'd just add Copy instead of Move in the title since that's what you're doing). And then you'll have to remove the exclude of the cheatsheets in the sync.

@Hallicopter
Copy link

Hallicopter commented Apr 27, 2021

That's great! I shall put in a PR in a few days for review.

Also, for my understanding here

--exclude='pandas-docs' --exclude='docs' --exclude='Pandas_Cheat_Sheet*'

Why are pandas-docs and docs excluded?

@Dr-Irv
Copy link
Contributor Author

Dr-Irv commented Jun 23, 2021

@Hallicopter any update on doing a PR for this?

@trallard
Copy link
Contributor

take

@jreback jreback added this to the 1.4 milestone Oct 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms Docs good first issue Web pandas website
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants