-
Notifications
You must be signed in to change notification settings - Fork 149
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
feat: no strict dep5 parsing #805
Conversation
Since version 0.1.47 of python-debian the dep5 parsing is strict. This is causing issues for certain users that have multiple Copyright statements in their Dep5 file. Disablng strictness removes the issue for those users. Closes #803 Signed-off-by: Nico Rikken <nico.rikken@fsfe.org>
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.
This is missing a test. The test can be as simple as 'does not raise an error when trying to parse a (slightly? very?) incorrect DEP5 file'.
Tests to ensure that all Copyright information from the .reuse/dep5 file is taken into account. It contains 2 testcases, for both strictly and non-strictly formatted dep5 files. The latter being present in the wild, based on comments in #803 Signed-off-by: Nico Rikken <nico.rikken@fsfe.org>
This fails in its current state as multiple copyright fields are simply ignored. |
Generating a file-report with a non-strict dep5 containing multiple Copyright entries will leave part of the Copyright information to be ignored. The updated test reflects that behavior and now no longer fails. Signed-off-by: Nico Rikken <nico.rikken@fsfe.org>
Update line wrap length and disable pylint for the dep5 file content. Signed-off-by: Nico Rikken <nico.rikken@fsfe.org>
I found this while working on something else. Tiny commit; why not.
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've adjusted the tests a little. No functional changes; just refactored to no longer call to_dict_lint.
I am no longer certain if I want to merge this. I took a look at python-debian 0.1.38 (the lowest compatible version according to pyproject.toml), and strict mode was always enabled. https://salsa.debian.org/python-debian-team/python-debian/-/blob/0.1.38/lib/debian/copyright.py#L130 I have to assume that python-debian recently included 'no duplicate fields' in their checks, which is fine, but simply disabling this now results in other breakage. Specifically, the following checks (in 0.1.38, but I'm going to assume that they exist after 0.1.38 also): _complain('Non-header paragraph has neither "Files" nor '
'"License" fields', strict)
[...]
if 'Copyright' not in data:
_complain('Files paragraph missing Copyright field', strict)
if 'License' not in data:
_complain('Files paragraph missing License field', strict)
if not self.files:
_complain('Files paragraph has empty Files field', strict) I am fairly certain that we do need/want these checks. |
@carmenbianca Good catch, then downgrading python-debian seems more appropriate. |
Since version 0.1.47 of python-debian the dep5 parsing is strict. This is causing issues for certain users that have multiple Copyright statements in their Dep5 file. Disablng strictness removes the issue for those users.
Closes #803