-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add lakectl config support #45
Conversation
Assumes the default location (~/.lakectl.yaml), and loads the config file if it exists and YAML is installed. If YAML is not installed (this is not a hard requirement), it is possible to install it via `python -m pip install lakefs-spec[yaml]`.
For reading in `lakectl` configuration files. Also ignores missing imports from `pyyaml` under mypy.
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #45 +/- ##
==========================================
- Coverage 71.37% 68.79% -2.58%
==========================================
Files 3 3
Lines 262 282 +20
Branches 45 47 +2
==========================================
+ Hits 187 194 +7
- Misses 59 71 +12
- Partials 16 17 +1
☔ View full report in Codecov by Sentry. |
Saves a `Path.expanduser` in the `LakectlConfig.read()`.
Since we now have three rivaling modes of initialization for the file system, it is time to test the priority order is correct. This brought up a quirk related to instance caching: Since both the `lakectl` config file and environment variables are read implicitly, they do not require arguments, and thus the first method used between config file and envvar initialization will cause cache hits, and suffocate the other method unless the cache is cleared.
4835119
to
88ead49
Compare
Explains the caveat of implicit initializations from envvars and lakectl config files together with the instance cache. Also changes the install instructions to bare `pip install` commands.
If the file exists, we enter the `LakectlConfig.read()` method. There, we conditionally abort if `pyyaml` is not installed. If `pyyaml` is not installed, emit a warning that it cannot be found, and a solution (i.e. a pip install).
Assumes the default location (
~/.lakectl.yaml
), and loads the config file if it exists and YAML is installed.If YAML is not installed (this is not a hard requirement), it is possible to install it via
python -m pip install lakefs-spec[yaml]
. This extra is added specifically forlakectl
configuration file support.Also ignores missing imports from
pyyaml
under mypy.Closes #43.