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

Replace m2r with new typescript-based method #6091

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

catalinaperalta
Copy link
Member

  • Remove m2r usage in the emitter
  • Add md2rst method to convert markdown to rst format
  • Add method to walk through yamlMap record

@microsoft-github-policy-service microsoft-github-policy-service bot added the emitter:client:python Issue for the Python client emitter: @typespec/http-client-python label Feb 21, 2025
@azure-sdk
Copy link
Collaborator

azure-sdk commented Feb 21, 2025

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

@typespec/http-client-python - fix ✏️

Replace m2r with new md2rst() method

@azure-sdk
Copy link
Collaborator

azure-sdk commented Feb 21, 2025

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@catalinaperalta catalinaperalta marked this pull request as ready for review February 25, 2025 02:23
@catalinaperalta
Copy link
Member Author

@iscai-msft @msyyc @tadelesh I attempted to create the downstream PR but looks like it didnt work. Here is the pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=4586228&view=results any advice on how to fix?

@msyyc
Copy link
Contributor

msyyc commented Feb 25, 2025

@iscai-msft @msyyc @tadelesh I attempted to create the downstream PR but looks like it didnt work. Here is the pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=4586228&view=results any advice on how to fix?

You may forget to add " when trigger pipeline
image

Copy link
Member

@iscai-msft iscai-msft left a comment

Choose a reason for hiding this comment

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

amazing looks like you got the recursion working. approve, you can merge it whenevedr

@@ -66,6 +66,7 @@
},
"dependencies": {
"js-yaml": "~4.1.0",
"marked": "^15.0.6",
Copy link
Member

Choose a reason for hiding this comment

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

can you remove mistune and m2r2 from the python requirements as well? i think you can explicitly remove it from http-client-python, but add it as a requirement for autorest.python/packages/autoerst.python only

Copy link
Member Author

@catalinaperalta catalinaperalta Feb 26, 2025

Choose a reason for hiding this comment

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

I searched through the http-client-python for mistune, but probably missed it. Where is that dependency specified?

Also, I'll remove the m2r file under pygen/ but looks like there's a test that relies on it. I'll convert it to ts test. <-- DONE

Copy link
Member

Choose a reason for hiding this comment

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

oh i think we stopped pinning mistune then when we switched to 0.3.3.post2 of m2r2, so we're good on that, thanks!

# license information.
# --------------------------------------------------------------------------
"""An MD to RST plugin.
"""
Copy link
Contributor

@msyyc msyyc Feb 26, 2025

Choose a reason for hiding this comment

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

Hi @catalinaperalta Since autorest.python which is generator tool for swagger is still using m2r, it will break autorest.python if remove m2r directly. Actually pipeline already reports this error:
https://dev.azure.com/azure-sdk/internal/_build/results?buildId=4595692&view=logs&j=bdb939de-aec3-5086-18f3-4b01b4ec4195&t=e0b74152-f1d7-5f23-b222-7ca4870e75b0

image

Could you make a PR to copy m2r.py to atuorest.python repo to make sure autorest.python could work after this PR merged?

Copy link
Contributor

Choose a reason for hiding this comment

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

@iscai-msft for awareness.

Copy link
Member

Choose a reason for hiding this comment

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

yes, that would be part of this work as well, and I've already talked to @catalinaperalta about it. thanks for the catch @msyyc !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emitter:client:python Issue for the Python client emitter: @typespec/http-client-python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants