Skip to content

Dev#2

Merged
Distortedlogic merged 35 commits into
mainfrom
dev
Aug 16, 2025
Merged

Dev#2
Distortedlogic merged 35 commits into
mainfrom
dev

Conversation

@sir-stevie
Copy link
Copy Markdown
Contributor

No description provided.

@github-advanced-security
Copy link
Copy Markdown

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Comment thread core/pluginz/ezpz.toml
@@ -1,3 +1,4 @@
[ezpz_pluginz]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lets give user option to use either dedicated ezpz.toml or add [tool.ezpz] to their pyproject.toml

Comment thread core/pluginz/ezpz_pluginz/__cli__.py Outdated
)
from ezpz_pluginz.toml_schema import load_config

app = typer.Typer(name="ezplugins", pretty_exceptions_show_locals=False, pretty_exceptions_short=True)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lets name the cli ezpz less chars to type and easier to remember. also notice that there is a theme of using z instead of s ie ezpz_pluginz vs ezpz_plugins

Comment thread core/pluginz/ezpz_pluginz/__cli__.py Outdated
@app.command(name="help")
def show_help(command: str = typer.Argument(None, help="Show help for a specific command")) -> None:
if command:
command_help = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lets put the cmd help obj in a json file, or just separate py file.

Comment thread core/pluginz/ezpz_pluginz/__cli__.py Outdated
logger.info("AVAILABLE COMMANDS:")
logger.info("")

commands = [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i thought typer add builtin "help" functionality via docs strings?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it does have builtin help functionality, I'll adapt to that style



@app.command(name="update")
def update_plugin(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i think push might be more clear than update .. seems this is for pushing a plugin to the registry?

logger.info(f" {plugin.description}")

logger.info("")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i feel like we should put all the registry related stuff in a subcmd .. ie ezpz registry ...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will do

import logging
from typing import ClassVar, Optional
from pathlib import Path

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should be using structlog?

self.macro_data.append(metadata)
except (KeyError, ValueError) as e:
logging.getLogger(__name__).warning(f"Failed to create plugin metadata: {e}")
super().visit_Call(node)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

using super() does not seem correct. the visitor pattern typical handles the recurrsion in the base class from

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll look deeper into this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I removed the super() call and explicitly controlled recursion by returning False when processing ezpz_plugin_collect calls, ensuring child nodes are not traversed redundantly.

Comment thread core/pluginz/pyproject.toml Outdated
[tool.rye]
dev-dependencies = ["painlezz-macroz"]
dev-dependencies = [
"painlezz-macroz",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

macroz is only a dev dep? also lets remove painlezz from the name and just call it macroz

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The noop.py macros (class_macro, func_macro) are used at runtime by plugin developers when they write @ezpz_plugin_collect decorators

The macro system is integral to how ezpz_pluginz works - it's used by end users writing plugins, not just during development

metadata collection happens during build/analysis time, the decorators themselves are runtime components

there might be a split where:

The macro decorators (noop.py) are runtime dependencies
The metadata collection visitors (macro_metadata_collector.py) are dev/build-time dependencies

It's somehow both runtime and build, I can adapt a hybrid config if possible (will look it up)

from typing import Any


def register_plugin() -> dict[str, Any]:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should use something with narrower typing than dict[str, Any] for users to register a plugin. most likly a pydantic model so that we can also run validations at the same time via the model

@Distortedlogic Distortedlogic merged commit b9893e6 into main Aug 16, 2025
13 of 16 checks passed
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