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

Add Python documentation generation #1218

Merged
merged 10 commits into from
Feb 9, 2025

Conversation

parker-research
Copy link
Contributor

Here's my first go at Python documentation generation.

Things to check with it:

  1. Is it working generating the docs in the correct location to be included in the artifact? I think it might not be.
  2. Should it be merged with the docs/CMakeLists.txt file? Should it go in a different CMake file? Should it be done exclusively in a GH Action (as it is now)? I don't know which direction you want to take with it, and am too novice at CMake to decide/implement.
  3. If it is merged with CMake, using a virtual environment may be a bit tricky, but would be important.

@MikePopoloski
Copy link
Owner

Yeah, I think it should be merged into the CMakeLists so that it can reuse the mcss checkout we already have, and also make sure the outputs end up in the right place. You should be able to navigate to the output website locally and see that it's all working correctly. Also we'll need an actual link to the Python docs from the main website page somewhere.

CMake can run arbitrary commands; the syntax is ugly but otherwise it's not too bad.

@@ -27,7 +27,7 @@ void registerStatements(py::module_& m) {
return fmt::format("Statement(StatementKind.{})", toString(self.kind));
});

py::enum_<Statement::EvalResult>(stmt, "EvalResult")
py::enum_<Statement::EvalResult>(m, "EvalResult")
Copy link
Owner

Choose a reason for hiding this comment

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

Why did this change?

Copy link
Contributor Author

@parker-research parker-research Feb 4, 2025

Choose a reason for hiding this comment

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

It gave an error/caused an issue during documentation generation. I also believed that this new way is the way it should have been; maybe an example/test case would be good to reinforce what's intended with it if you disagree though!

docs/CMakeLists.txt Show resolved Hide resolved
Copy link

codecov bot commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.74%. Comparing base (1011bbc) to head (972bc9e).
Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1218   +/-   ##
=======================================
  Coverage   94.74%   94.74%           
=======================================
  Files         205      205           
  Lines       51218    51218           
=======================================
  Hits        48524    48524           
  Misses       2694     2694           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1011bbc...972bc9e. Read the comment docs.

@parker-research
Copy link
Contributor Author

Just pushed my latest here. I'm getting some sort of error, but it seems like it might be related to the existing Doxygen generation? Would appreciate it if you could take a quick look if you get a chance.

Note that the CMakeLists currently pull from my fork of your fork of m.css. If you can merge this PR, we can switch it back to your releases - MikePopoloski/m.css#1

parker-research and others added 9 commits February 7, 2025 21:56
Error:
ERROR:root:Class pyslang.BreakStatement.EvalResult
previously found in pyslang.BlockStatement.EvalResult,
only one occurrence will be chosen. Ensure each class
is exposed only in a single module for generating
correct documentation.
@parker-research
Copy link
Contributor Author

Ready for your review again! I think maybe the only last remaining part is a link from the Doxygen docs to these docs.

@MikePopoloski MikePopoloski merged commit 6223944 into MikePopoloski:master Feb 9, 2025
19 checks passed
@MikePopoloski
Copy link
Owner

I got the paths fixed up and the docs are live now; you can see them at https://sv-lang.com/pyslang/

We can add a link from the main page once there's some content on that landing page.

@parker-research parker-research deleted the python-docs branch February 11, 2025 01:59
@parker-research
Copy link
Contributor Author

Awesome, thanks for working through that final debugging!

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