Skip to content

feat: easily construct function signature #381

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

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

Conversation

ISOR3X
Copy link

@ISOR3X ISOR3X commented Apr 27, 2025

Added a construct_signature function to the Function class. This closely follows the way the jinja template works for the mkdocstrings python handler

The reason behind this PR is because I want to try to integrate python api docs into a vitepress website, but I also noticed both griffe2md and mkdocstrings/python/ have similar logic for building a function signature. Perhaps this code could replace that.

REF: #376

@ISOR3X
Copy link
Author

ISOR3X commented Apr 27, 2025

Those errors do not seem to come from my code so I am not sure what to do. This is one of my first time contributing to open sources projects to I might need some guidance here.

@pawamoy
Copy link
Member

pawamoy commented Apr 30, 2025

Thanks a lot for your PR @ISOR3X!

The errors I see in the CI logs do seem to come from your changes: you removed the Union import in src/_griffe/models.py and Ruff is complaining.

You also added spacing changes that are irrelevant to the feature here (added tabulations), could you revert these? You can run make format to format the code according to the project rules.

@ISOR3X
Copy link
Author

ISOR3X commented May 1, 2025

Fixed the formatting but the CI still seems to fail...

Also make format doesn't work for me, but I did noticed my IDE (PyCharm) automatically made a venv when opening the project, do you know something about this?

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