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
Repo creation #101
Repo creation #101
Conversation
…ter which will supporess UserWarning messages if a Hangar repository does not exist at that location yet
Codecov Report
@@ Coverage Diff @@
## master #101 +/- ##
==========================================
+ Coverage 91.78% 91.83% +0.05%
==========================================
Files 45 46 +1
Lines 8184 8454 +270
Branches 819 834 +15
==========================================
+ Hits 7511 7763 +252
- Misses 492 508 +16
- Partials 181 183 +2
|
ae5f73d
to
480acbe
Compare
@@ -68,6 +89,7 @@ def __init__(self, base_path: os.PathLike, labelenv: lmdb.Environment, | |||
commit_hash=self._commit_hash, | |||
branchenv=self._branchenv, | |||
refenv=self._refenv) | |||
atexit.register(self.close) |
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.
IMO we need another function that gets called on atexit
which does two things
- Printout a warning to the terminal saying what hangar did internally (closed the checkout for user) and it is not at all recommended. This is important because otherwise user would never remember to add the explicit close
self.close()
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.
@rlizzo Also, this raises warning if atexit
has an unregistered function and the repo has been deleted before the exit.
Motivation and Context
Why is this change required? What problem does it solve?:
Fixes issues with inconsistent warnings and adds more user control and more sane type annotations
If it fixes an open issue, please link to the issue here:
Description
Describe your changes in detail:
exists
parameter added toRepository()
which if set toFalse
will suppress the warning that a repo does not exist at the given path..hangar
instead of__hangar
as per [BUG REPORT] New repo creation is unfriendly #93README.txt
inside.hangar
folder to aid in repo identification--version
option to CLI.Types of changes
What types of changes does your code introduce? Put an
x
in all the boxes that apply:Is this PR ready for review, or a work in progress?
How Has This Been Tested?
Put an
x
in the boxes that apply:Checklist: