Skip to content

Fix bug when .config does not exist. Add test.#154

Merged
BSchilperoort merged 7 commits into
mainfrom
fix-153
Jun 30, 2023
Merged

Fix bug when .config does not exist. Add test.#154
BSchilperoort merged 7 commits into
mainfrom
fix-153

Conversation

@BSchilperoort

@BSchilperoort BSchilperoort commented Jun 29, 2023

Copy link
Copy Markdown
Member

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.

@codecov

codecov Bot commented Jun 29, 2023

Copy link
Copy Markdown

Codecov Report

Merging #154 (43692a3) into main (127494b) will not change coverage.
The diff coverage is 100.00%.

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           

@BSchilperoort
BSchilperoort requested a review from sverhoeven June 29, 2023 06:29

@sverhoeven sverhoeven left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .pre-commit-config.yaml
@@ -0,0 +1,8 @@
repos:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@BSchilperoort

Copy link
Copy Markdown
Member Author

Thank you for the review, @sverhoeven ! I have added instructions on pre-commit to the dev guide.

@BSchilperoort
BSchilperoort merged commit 750a4d6 into main Jun 30, 2023
@BSchilperoort
BSchilperoort deleted the fix-153 branch June 30, 2023 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error when adding keys

2 participants