Fix bug when .config does not exist. Add test.#154
Merged
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #154 +/- ##
=======================================
Coverage 99.66% 99.66%
=======================================
Files 14 14
Lines 601 601
=======================================
Hits 599 599
Misses 2 2 |
sverhoeven
approved these changes
Jun 30, 2023
sverhoeven
left a comment
Member
There was a problem hiding this comment.
I tested code successfully with
docker run -ti --rm python:3.10 bash
ls ~/.config
ls: cannot access '/root/.config': No such file or directory
pip install 'git+https://github.com/eWaterCycle/era5cli.git@fix-153#egg=era5cli'
era5cli config --uid ....--key ....
Keys succesfully validated and stored in /root/.config/era5cli/cds_key.txt
rm -r ~/.config/era5cli/
era5cli config --uid ...--key ...
Keys succesfully validated and stored in /root/.config/era5cli/cds_key.txt
Some documentation about pre-commit would be nice.
| @@ -0,0 +1,8 @@ | |||
| repos: | |||
Member
There was a problem hiding this comment.
To use the pre-commit it has to be installed with pip install pre-commit. Can that be added to docs/general_development.md?
I was able to run pre-commit run --all-files ok.
Member
Author
|
Thank you for the review, @sverhoeven ! I have added instructions on pre-commit to the dev guide. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #153 . The tests have been modified to be able to catch this error.
Additionally, the version has been bumped to 1.4.1 in preparation for a new release.
As a bonus I have added a pre-commit config that will run
hatch run format, allowing devs to use pre-commit, while it should stay in sync with the linter configuration.