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

Problems with the new Async/Await guide #1771

Merged
merged 1 commit into from
Aug 10, 2021
Merged

Conversation

awestlake87
Copy link
Contributor

Hey, looks like we've got some issues with the async/await guide after that update. I took a look at https://pyo3.rs/v0.14.2/ecosystem/async-await.html this morning to check the links. The link to the testing module appears to be busted and this PR fixes that.

Aside from that, it looks like someone's been trying to integrate it into the rustdoc tests since I see some main functions that shouldn't be visible, and the syntax highlighting is missing on some code sections. Also the README.md still points to 0.14.1 (but that might be by design). Idk if that's a WIP or not, but those changes don't seem to be on the main branch, so I wasn't sure where to find them. My README contains most of this guide, and its integrated into rustdoc as well if you want to take a look at how I did it.

My advice for integrating them into the rustdoc tests is to mark the problematic code sections with rust compile_fail even though it may seem like a bit of a cop-out.

  • rust no_run is also a good idea for tests that require external deps like uvloop, but it will still fail to compile some sections without a hidden main (or not-so-hidden in markdown code sections).
  • rust ignore will still try to build a test for it, it just won't run it by default.

@davidhewitt
Copy link
Member

Thanks for checking this! I'm a little confused, are you intending to push more to this PR or should I merge it now?

My advice for integrating them into the rustdoc tests is to mark the problematic code sections with rust compile_fail even though it may seem like a bit of a cop-out.

Agreed.

Also the README.md still points to 0.14.1 (but that might be by design)

Actually the 0.14.2 redirect CI job failed, I'm hoping to look at that later tonight...

@awestlake87
Copy link
Contributor Author

Well what's weird is I see some changes to the guide that just aren't present on the main branch. I didn't see any activity on other pyo3 branches this morning related to the guide either so I'm not sure how those other problems I mentioned happened. I'm willing to fix them, but idk where to look.

@awestlake87
Copy link
Contributor Author

awestlake87 commented Aug 9, 2021

For example on the 0.14.2 guide I see this section:

#![allow(unused)]
fn main() {
let future = rust_sleep();
}

On the main branch I see the same section like it should be:

let future = rust_sleep();

Raw source looks like this:

```rust compile_fail
let future = rust_sleep();
```

@davidhewitt
Copy link
Member

It looks like that's to do with mdbook transformations.

If I change it locally to this and build locally

```rust,compile_fail
let future = rust_sleep();

Then the transformation doesn't the unwanted extra stuff and the syntax highlighting works again.

TBH, all of these tests would be compile_fail anyway because we don't have the pyo3_asyncio deps available when the guide builds. So I'm just going to remove the doctest markers completely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants