-
Notifications
You must be signed in to change notification settings - Fork 30
feat: update rust to pip install code block requirements #752
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
base: main
Are you sure you want to change the base?
Conversation
3a766ac
to
de9be63
Compare
src/pdl/pdl_ast.py
Outdated
@@ -462,6 +462,9 @@ class CodeBlock(LeafBlock): | |||
] | |||
"""Programming language of the code. | |||
""" | |||
requirements: Optional[str] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be only enabled for lang: python
. Should we check for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch. do you know how to express this in pydantic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this issue seems to indicate that we could do it, but only with a custom model validator pydantic/pydantic#10252
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i added a model validator. thanks for the good catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to suggest Pydantic validator as well. Also wondering if requirements
should actually be Optional[str | List[str]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very good! done
badb6ca
to
447dc05
Compare
852b315
to
c5ed197
Compare
c5ed197
to
f88e09d
Compare
Signed-off-by: Nick Mitchell <[email protected]>
f88e09d
to
c1375f6
Compare
requirements
attribute to CodeBlockTODO
The thought process here:
Logic: code-generate a new program such that each code block with a
requirements
attribute is rewritten to:/tmp/logic.py
for this discussioncode
attribute to look likeThis should allow us to use the pdl_interpreter, where it is none the wiser of our venv caching.