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

Create user facing documentation structure #12953

Merged
merged 5 commits into from
Mar 8, 2023
Merged

Create user facing documentation structure #12953

merged 5 commits into from
Mar 8, 2023

Conversation

ewdurbin
Copy link
Member

@ewdurbin ewdurbin commented Feb 7, 2023

Uses mkdocs for building https://docs.pypi.org/

This will serve as the location for user-facing documentation moving forward. We should begin separating developer docs from the /docs directory, and @s-mm will be adding documentation for organization accounts here.

@ewdurbin ewdurbin requested a review from a team as a code owner February 7, 2023 15:38
@ewdurbin ewdurbin force-pushed the docs_pypi_org branch 3 times, most recently from 495ec3b to f2462c5 Compare February 7, 2023 15:55
@dstufft
Copy link
Member

dstufft commented Feb 7, 2023

Question that's maybe already been discussed, should we use packaging.python.org for PyPI's docs so that people have less places to go to look for Python packaging documentation? Or do we think that PyPI has docs that should be distinct from the overall packaging docs?

I'm OK either way, just figured I'd raise the question!

@ewdurbin
Copy link
Member Author

ewdurbin commented Feb 7, 2023

We'll have some very PyPI specific docs relating to Organizations and any other paid-features down the line. That's the main driver for this docset.

@di
Copy link
Member

di commented Feb 7, 2023

Or do we think that PyPI has docs that should be distinct from the overall packaging docs?

IMO, docs like https://packaging.python.org/en/latest/guides/analyzing-pypi-package-downloads/ are already somewhat out of place on p.p.o, but docs about PyPI-specific features would be even more out of place.

Additionally, I think there's an advantage to keeping docs alongside the code in one repo, as it makes it easier to keep them accurate and up to date.

@dstufft
Copy link
Member

dstufft commented Feb 7, 2023

👍

@ewdurbin
Copy link
Member Author

ewdurbin commented Feb 7, 2023

this is semi-blocked on readthedocs/readthedocs.org#8234.

as is there is no clean way to host multiple RTD projects out of a single repo/branch.

@humitos
Copy link

humitos commented Feb 8, 2023

I arrived at this issue while reading your comment and PR on Read the Docs.

this is semi-blocked on readthedocs/readthedocs.org#8234.

as is there is no clean way to host multiple RTD projects out of a single repo/branch.

I noted from the description that you are using MkDocs, so I'm not sure if it's currently possible to do this. However, the official Read the Docs user and developer documentation use a Sphinx extension to allow us this use case:

The Sphinx extension is https://github.com/readthedocs/sphinx-multiproject/

I don't think this will solve your problem, but maybe gives you an idea for a potential workaround and unblock you. I hope it helps 😄

Edit: this issue on Read the Docs looks related as well readthedocs/readthedocs.org#8811

@humitos
Copy link

humitos commented Feb 8, 2023

Another potential immediate solution for this could be using build.commands (https://docs.readthedocs.io/en/latest/build-customization.html) and decide what commands execute depending on the project's slug (READTHEDOCS_PROJECT environment variable)

# .readthedocs.yaml
version: 2
build:
  os: ubuntu-22.04
  tools:
    python: "3"
  commands:
    - |
        if [ "$READTHEDOCS_PROJECT" = "developer" ] ;
        then
          cd docs/developer;
          mkdocs build;
          mv _build/html ../_readthedocs/html;
        fi
  - |
      if [ "$READTHEDOCS_PROJECT" = "user" ] ;
        then
          cd docs/user;
          mkdocs build;
          mv _build/html ../_readthedocs/html;
        fi

I grabbed this idea from readthedocs/readthedocs.org#8811 (comment). Let me know that could work for now.

@ewdurbin ewdurbin force-pushed the docs_pypi_org branch 2 times, most recently from 8f55bb5 to f1eed7d Compare February 8, 2023 18:40
@humitos
Copy link

humitos commented Feb 8, 2023

He, I just saw that you are fighting with the shell in YAML. I've been there as well, and it was frustrating 😞 . Maybe you can follow this example from our docs that it's working already. It's hard to tell you what are the syntax issues you are having in yours, tho; https://github.com/readthedocs/readthedocs.org/blob/main/.readthedocs.yml#L26

@ewdurbin
Copy link
Member Author

ewdurbin commented Feb 8, 2023

yeah, struggling indeed! getting confused since running these in a true /bin/sh on ubuntu-22.04 works 😅

@ewdurbin
Copy link
Member Author

ewdurbin commented Feb 8, 2023

@humitos given that 50f591b failed and 8e06fdc worked... it seems there is something different in the handling of shell commands in build.jobs versus build.commands

@humitos
Copy link

humitos commented Feb 8, 2023

🤯 -- I have no idea what could be happening. It looks weird to me at simple sight. In theory, there shouldn't be any differences.

I'm closing my day now because I'm super tired, but I'll jump into this tomorrow's morning with fresh eyes. Hopefully, I can give you a better answer.

@ewdurbin
Copy link
Member Author

ewdurbin commented Feb 8, 2023

8a79c92 indicates that its a difference in the environments that the commands are run.

post_checkout is the only job run in the vcs_environment, all subsequent jobs are run in the build_enviornment just like build.command.

@ewdurbin
Copy link
Member Author

ewdurbin commented Mar 7, 2023

I'm going to remove the deployment portion of this and merge so @s-mm can begin opening PRs against the user-docs directory for organization documentation.

When read the docs supports our use case, we will revisit deployment.

@humitos
Copy link

humitos commented Mar 7, 2023

@ewdurbin today I opened a PR that I think it will solve the issue you are having with the script syntax error: readthedocs/readthedocs.org#10119. It's under review now, but it has high changes to get deployed next Tuesday 🙏🏼

@ewdurbin
Copy link
Member Author

ewdurbin commented Mar 7, 2023

thanks @humitos, is there any way we'll know when it deploys other than tryin' it out?

@humitos
Copy link

humitos commented Mar 7, 2023

@ewdurbin it's already merged -- It's going to be deployed next Tuesday at 5PM CET

@ewdurbin
Copy link
Member Author

ewdurbin commented Mar 7, 2023

@ewdurbin it's already merged -- It's going to be deployed next Tuesday at 5PM CET

Nice! I'll get a follow-up PR for this one ready after it is merged. :) Thank you!

@di
Copy link
Member

di commented Mar 8, 2023

@ewdurbin Are you OK with this change to the directory structure here? I think this will make it a little more clean/organized, especially when we add another docsite: docs_pypi_org...docs_pypi_org-patch

@ewdurbin
Copy link
Member Author

ewdurbin commented Mar 8, 2023

absolutely, send it!

@di
Copy link
Member

di commented Mar 8, 2023

@ewdurbin This should be good to merge.

@ewdurbin
Copy link
Member Author

ewdurbin commented Mar 8, 2023

Thank you for the tidying!

@ewdurbin ewdurbin merged commit 1db4b00 into main Mar 8, 2023
@ewdurbin ewdurbin deleted the docs_pypi_org branch March 8, 2023 19:31
miketheman added a commit to miketheman/warehouse that referenced this pull request Mar 9, 2023
With the changes in pypi#12953, the existing path is no longer valid, and
new doc builds surface linter errors.

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
humitos added a commit to readthedocs/readthedocs.org that referenced this pull request May 22, 2023
This is another attempt to fix this issue. It follows the suggestion posted by
@bensze01 in #10103. It
looks simple and I think it makes sense to give it a try since it doesn't seem
to be harmful.

I tested it locally with the branch
https://github.com/readthedocs/test-builds/tree/build-commands-multiline and it
worked fine. Note that without this PR the branch linked fails.

Related #10133
Related #10119
Related #10206

External PRs that should be solved by this one:
* pypi/warehouse#12953
* pypi/warehouse#12953

Closes #10103
Closes #10208
humitos added a commit to readthedocs/readthedocs.org that referenced this pull request May 23, 2023
* Build: allow multi-line commands on `build.commands`

This is another attempt to fix this issue. It follows the suggestion posted by
@bensze01 in #10103. It
looks simple and I think it makes sense to give it a try since it doesn't seem
to be harmful.

I tested it locally with the branch
https://github.com/readthedocs/test-builds/tree/build-commands-multiline and it
worked fine. Note that without this PR the branch linked fails.

Related #10133
Related #10119
Related #10206

External PRs that should be solved by this one:
* pypi/warehouse#12953
* pypi/warehouse#12953

Closes #10103
Closes #10208

* Build: use `;` to separate PREFIX from COMMAND
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants