Skip to content

Conversation

rod7760
Copy link
Contributor

@rod7760 rod7760 commented Sep 23, 2025

Changes

  • Add pyinfra-metadata-schema-1.0.0.json.
  • Add pyinfra-metadata.toml with current plugins.
  • Add Jinja2 templating to sphinx build.
  • Extended build-public-docs.sh to build local docs.
  • Added generated index for facts and operations.

Bench Test

scripts/build-public-docs.sh 

Screenshot of Change

image
  • Pull request is based on the default branch (3.x at this time)
  • Pull request includes tests for any new/updated operations/facts
  • Pull request includes documentation for any new/updated operations/facts
  • Tests pass (see scripts/dev-test.sh)
  • Type checking & code style passes (see scripts/dev-lint.sh)

@rod7760 rod7760 force-pushed the group-operations-and-facts branch from 6578bd7 to baa30b1 Compare September 23, 2025 02:28
* Add pyinfra-metadata-schema-1.0.0.json.
* Add pyinfra-metadata.toml with current plugins.
* Add Jinja2 templating to sphinx build.
* Extended build-public-docs.sh to build local docs.
* Added generated index for facts and operations.
@rod7760 rod7760 force-pushed the group-operations-and-facts branch from baa30b1 to b4e02c5 Compare September 23, 2025 02:30
@DonDebonair
Copy link
Contributor

DonDebonair commented Sep 24, 2025

Love this! I would move the template folder inside the docs folder if possible, because it's only relevant for docs right? And for metadata.py I wonder if the other way around makes sense: move it outside of the docs folder, because in the future, metadata could be relevant for other things than generating docs.

Maybe we want to create a plugin registry with API (think Ansible Galaxy)

@rod7760
Copy link
Contributor Author

rod7760 commented Sep 24, 2025

Those both sound reasonable. That template folder is actually from an old implementation. I forgot to delete it. Whoops

Copy link
Member

@Fizzadar Fizzadar left a comment

Choose a reason for hiding this comment

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

This is awesome stuff @rod7760! Couple of bits to cleanup Daan already pointed out and good to go I think.

Community context: this is the precursor work that will enable us to generate other pyinfra projects docs inline on docs.pyinfra.com avoiding a disjointed mess of documentation websites.

@@ -0,0 +1,550 @@
"$schema" = "./pyinfra-metadata-schema-1.0.0.json"
Copy link
Member

Choose a reason for hiding this comment

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

Might be nice to have a script to regenerate this file in-repo since there's so many entries (probably only relevant to pyinfra core itself).

Copy link
Member

Choose a reason for hiding this comment

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

Eh, might need to put the tags into machine readable format in the docstrings to do that though 🤔

@rod7760
Copy link
Contributor Author

rod7760 commented Oct 2, 2025

Resolved the open comments. I moved docs.metadata to pyinfra.api.metadata.

Additionally, I now only render the operations.rst and facts.rst as jinja2 templates.
( src/pyinfra/operations/files.py contains jinja2 templates as examples. They caused undefined variable errors.)

We could also explicitly exclude files, but the jinja2 templating felt niche enough to include files explicitly.

Remove old template dir

Drop system-ops and system-facts

Add pydantic to docs/metadata.py

Move docs/metadata to pyinfra.api.metadata need to
fix docs generation error for missing jinja2 vars

Fix linting and only render subset of docs as jinja2

Update python3 -m http.server command in build-public-docs.sh
@rod7760 rod7760 force-pushed the group-operations-and-facts branch from 65e6ae8 to fc7edac Compare October 2, 2025 02:30
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.

3 participants