Skip to content

Conversation

@BEZOUI
Copy link
Owner

@BEZOUI BEZOUI commented Nov 3, 2025

Summary

  • add an auto-generator that assembles every project module and resource into a single self-contained script
  • include lightweight pydantic and yaml compatibility layers plus cache fallbacks so the monolith runs without external dependencies
  • ship the generated 6k+ line rms_monolith_full.py that materialises the full framework, resources, and bootstrap logic from one file

Testing

  • python -m pytest -vv -rs

https://chatgpt.com/codex/tasks/task_e_6905635dcc148324aab009e512efab09

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +35 to +85
class BaseModel:
"""Minimal BaseModel emulating core pydantic behaviour."""

def __init_subclass__(cls) -> None:
cls.__validators__ = []
for attr in dir(cls):
value = getattr(cls, attr)
if callable(value) and hasattr(value, "__validator_config__"):
cls.__validators__.append((value.__validator_config__, value))

def __init__(self, **data: Any) -> None:
annotations = getattr(self, "__annotations__", {})
for name in annotations:
field_info = getattr(self.__class__, name, None)
if isinstance(field_info, _FieldInfo):
default_value = field_info.get_default()
else:
default_value = field_info
value = data[name] if name in data else default_value
setattr(self, name, value)
extra_keys = set(data.keys()) - set(annotations.keys())
if extra_keys:
raise ValidationError(f"Unexpected fields: {sorted(extra_keys)}")
self._run_validators()

def _run_validators(self) -> None:
for field_name, func in getattr(self.__class__, "__validators__", []):
current_value = getattr(self, field_name)
new_value = func(self.__class__, current_value)
setattr(self, field_name, new_value)

@classmethod
def parse_obj(cls, obj: Dict[str, Any]) -> "BaseModel":
if isinstance(obj, cls):
return obj
if not isinstance(obj, dict):
raise ValidationError("Object must be a dict")
return cls(**obj)

def dict(self) -> Dict[str, Any]:
annotations = getattr(self, "__annotations__", {})
return {name: getattr(self, name) for name in annotations}

def json(self) -> str:
import json

return json.dumps(self.dict())

def copy(self) -> "BaseModel":
return self.__class__(**self.dict())

Choose a reason for hiding this comment

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

P1 Badge Support update kwarg in BaseModel.copy stub

The lightweight BaseModel.copy implementation only accepts self and always returns self.__class__(**self.dict()). In the configuration loader this stub is invoked as config.copy(update=overrides), mirroring the real pydantic API. Because the stub ignores the update keyword argument, any attempt to load a configuration with overrides raises TypeError: copy() got an unexpected keyword argument 'update', breaking configuration customisation whenever the project runs without the real pydantic dependency. Please implement the update parameter (and optionally deep) in the stub so it remains API-compatible with pydantic 1.x.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants