-
-
Notifications
You must be signed in to change notification settings - Fork 210
Implement kadet input type cache #1319
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: master
Are you sure you want to change the base?
Conversation
| "-c", | ||
| help="enable compilation caching to .kapitan_cache\ | ||
| and dependency caching to .dependency_cache, default is False", | ||
| help="enable compilation caching to $XDG_CACHE_HOME/kapitan, default is False", |
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.
Maybe it is should state:
caching preferably to $XDG_CACHE_HOME/kapitan or $HOME/kapitan, default is False"
or
caching preferably to $XDG_CACHE_HOME/kapitan (if XDG-compliant) or $HOME/kapitan, default is False"
or
caching either to $XDG_CACHE_HOME/kapitan or $HOME/kapitan, default is False"
| default=from_dot_kapitan("compile", "cache", False), | ||
| ) | ||
| compile_parser.add_argument( | ||
| "--cache-paths", |
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.
Should the removal of the --cache-paths be announced on CHANGELOG.md file under the NEXT RELEASE - Breaking section?
|
I think it would be good to have docstrings for the new functions |
rjmco
left a comment
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.
Announcement of the new feature on the NEXT RELEASE section of the CHANGELOG.md might be missing.
default.nix
Outdated
| # from https://nixos.wiki/wiki/Python#Emulating_virtualenv_with_nix-shell | ||
| let | ||
| pkgs = import <nixpkgs> {}; | ||
| in pkgs.mkShell { |
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: in pkgs.mkShell with pkgs; {
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.
thanks, fixed
| """ | ||
|
|
||
| input_params = config.input_params | ||
| target_name = self.target_name |
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 would suggest changing slightly the initial line of this function's docstring from:
Compile a kadet input file.
to
Compile a kadet input file, if resulting compilation is not already cached
| with open(cached_path_lock, "wb") as fp: | ||
| logger.debug("Writing cache file: %s", cached_path_lock) | ||
| self.dump_output(output_obj, fp) | ||
| cached_path_lock.rename(Path(str(cached_path_lock).removesuffix(".lock"))) |
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 if for some reason, someone aborts execution and this step is never executed? Should there be a recommendation to remove the .lock? Would it be to:
- Delete the whole cache?
- Delete just the
.lockfile? - Remove the
.loclsuffix?
97da85b to
8dbb04b
Compare
Fixes #1318
Proposed Changes
Docs and Tests