-
Notifications
You must be signed in to change notification settings - Fork 22
cache pyproject file search results for future calls #808
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
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
| import tomlkit | ||
|
|
||
|
|
||
| @cache |
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.
@mohammedahmed18 could caching this be a problem wrt the vs code extension, when we are doing the codeflash init flow?
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.
in codeflash/lsp/beta.py there's _find_pyproject_toml that parses for pyproject.toml differently, should be fine
|
it's still in progress, there are some edge cases to consider at the moment |
| import tomlkit | ||
|
|
||
| PYPROJECT_TOML_CACHE = {} | ||
|
|
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.
how many pyproject.toml's are we expecting?
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.
at most 2-3 guessing
|
there are some merge conflicts @aseembits93 |
|
we're looking for different config types repeatedly as well no? for addopts, I think same sort of caching could be extended to avoid searching for the same stuff repeatedly |
|
@KRRT7 we're using global scope variables to cache the file location -> https://github.com/codeflash-ai/codeflash/pull/808/files#diff-0a10492dab4c0b830ed2a6f8fac08827d9976ff942013f6cbedb11d02e9df802L8 |
PR Type
Enhancement
Description
Add caching to config discovery functions
Cache pyproject lookup with functools.cache
Cache conftest discovery for test paths
Diagram Walkthrough
File Walkthrough
config_parser.py
Memoize config and test discovery functionscodeflash/code_utils/config_parser.py
find_pyproject_toml.find_conftest_files.