-
Notifications
You must be signed in to change notification settings - Fork 0
String Reading and Path Typing #35
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
Conversation
8cb42a7
to
cae9620
Compare
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.
can't say I have any experience with nix but not much to complain about here.
src/python_wrapper/src/lib.rs
Outdated
let elements = Builder::new(&src).build().map_err(|_| { | ||
let display = path.display(); | ||
let desc = format!("failed to parse source file: {display}"); | ||
let desc = String::from("failed to parse source code"); |
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.
nit, can be reduced to
.map_err(|_| PyRuntimeError::new_err("failed to parse source code"))?;
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.
Fixed.
.envrc
Outdated
if command -v nix &>/dev/null; then | ||
# Load .envrc from certora dir if exists | ||
[ -f ../.envrc ] && source_env .. | ||
# Use nix if it's available | ||
use flake | ||
fi |
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.
so to be clear, what's the behavior if nix
is unavailable?
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.
So if the nix is not available direnv
will only create a virtual environment using the stdlib venv
package and activate the virtual environment.
p = map(as_list, [p_file, p_file_as_string, p_from_string]) | ||
assert all( | ||
x == y for x in p for y in p | ||
), "all three parsers should parse the same elements" |
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.
💯
cae9620
to
dfc7ee3
Compare
Hi in this PR I would like to add some functionality to the Python wrapper:
parse_string
function that can parse already loaded string as in the cloud setup we're loading this file from zip in S3 thus we already have it in memoryUnion[str | Pathlike]
typing toparse
to allow str paths for mypy type-checking + mypy CI checkI've built it on top of the other PR just so I could pass the Rust cargo test exception, we can rebase it on top of the master if we decide to change the previous PR.