-
Notifications
You must be signed in to change notification settings - Fork 151
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
Default values for reuse annotate
, enabling a pre-commit hook
#761
base: main
Are you sure you want to change the base?
Conversation
54c2a92
to
12ec884
Compare
src/reuse/_config.py
Outdated
# precedence. | ||
for o_path, options in self.override_annotate_options.items(): | ||
o_path = Path(o_path).expanduser() | ||
if path.is_relative_to(o_path): |
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.
Apparently this method doesn't exist in Python ≤3.8.
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 think it can be replaced with relative_to
, which exists in 3.8 though. From the 3.9 source:
def is_relative_to(self, *other):
"""Return True if the path is relative to another path or False.
"""
try:
self.relative_to(*other)
return True
except ValueError:
return False
In newer versions both functions are based on with_segments
which doesn't exist in 3.8 or 3.9 yet.
b985333
to
c4c4a0e
Compare
Signed-off-by: Carmen Bianca BAKKER <carmenbianca@fsfe.org>
Signed-off-by: Carmen Bianca BAKKER <carmenbianca@fsfe.org>
Signed-off-by: Carmen Bianca BAKKER <carmenbianca@fsfe.org>
c4c4a0e
to
86cdb83
Compare
Fixes #68
Fixes #534
WIP