-
Notifications
You must be signed in to change notification settings - Fork 10
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
draft: sketched out SO interface CI workflow. #798
base: main
Are you sure you want to change the base?
Conversation
I just sketched out how this could work, but this could be a project for Andy. |
} | ||
freeze = {} | ||
|
||
with open('tests/ci/frozen_functions.py', 'r') as fh: #opens file "fname", in read mode 'r', to be used in code as "fh" |
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.
what is going to be stored in this file? Is it a pseudo-python representation of the objects/methods structure that define the interface?
return True | ||
|
||
if __name__ == "__main__": #if this is the main thing being run | ||
for fname, spec in interface.items(): #loop over file names "fname" as keys and "spec" as values in dictionary called "interface" |
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.
currently interface
is not defined
for meth in spec[key]: #iterating over methods specified in spec[key] | ||
assert meth in tree[key] | ||
assert _compare_args(spec[key][meth], tree[key][meth]) | ||
notfound = [] |
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.
these two lines don't need to be in the context manager
notfound = [] | ||
found = {} | ||
dump = ast.dump(tree) | ||
for node in ast.walk(tree): |
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.
the first layer in the tree is usually going to be made up of ClassDef
objects (though not always), which in turn contain FunctionDef
's. The original sketch had a check for this.
Description
Draft of github CI workflow to enforce compliance with the SO interface document here.
This is just a sketch and the code needs to be fleshed out, tested and documented.