-
Notifications
You must be signed in to change notification settings - Fork 451
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
Adopt AppStream #6056
Adopt AppStream #6056
Conversation
Can one of the admins verify this patch? |
ok to test |
<content_attribute id="social-info">mild</content_attribute> | ||
</content_rating> | ||
<releases> | ||
<release version="7.8.0" date="2021-02-15"/> |
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.
We refrain from hard-coding versions in our files. Please have a look at this script that is executed before packaging Tribler 👍
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.
@overflw this is a way to satisfy this request for changes:
-
Remove the last three lines from this file (line 47, line 48 and line 49) and leave the last line blank.
-
Paste the following code into the
__main__
section of that script:
logger.info('Writing AppStream version.')
with open(path.join('build', 'debian', 'tribler', 'usr', 'share', 'metainfo',
'org.tribler.Tribler.metainfo.xml'), 'a') as f:
f.write(f' <release version="{version_id}" date="{build_date}"/>'
f'\n </releases>\n</component>')
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.
Hey (: thanks for the hints! I wrote a xml parsing based addendum to update_version_from_git.py
:
logger.info('Writing AppStream version info.')
releaseDate = time.strftime("%Y-%m-%d", time.localtime())
attrib = {'version': f'{version_id}', 'date':f'{releaseDate}'}
tree = xml.parse(path.join('build', 'debian', 'tribler', 'usr', 'share', 'metainfo',
'org.tribler.Tribler.metainfo.xml'))
xmlRoot = tree.getroot()
releases = xmlRoot.find('releases')
release = xml.SubElement(releases, 'release', attrib)
tree.write(path.join('build', 'debian', 'tribler', 'usr', 'share', 'metainfo',
'org.tribler.Tribler.metainfo.xml'))
Congratulations 🎉. DeepCode analyzed your code in 3.971 seconds and we found no issues. Enjoy a moment of no bugs ☀️. 👉 View analysis in DeepCode’s Dashboard | Configure the bot👉 The DeepCode service and API will be deprecated in August, 2021. Here is the information how to migrate. Thank you for using DeepCode 🙏 ❤️ !If you are using our plugins, you might be interested in their successors: Snyk's JetBrains plugin and Snyk's VS Code plugin. |
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.
Thanks for your changes! Could you look at/implement the suggestion raised by DeepCode? Also, please satisfy the flake8 check by making sure the import order is according to the standards 👍
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.
Thanks for the changes! I just installed defusedxml
on the machine that runs the flake8 checker. @xoriole do you think it is fine to add this as a build dependency or do you prefer to use the 'normal' XML parsing tools?
Tbh, defusdxml is not really necessary here, since we only parse our own metainfo.xml. But it won't hurt I guess. |
retest this please |
1 similar comment
retest this please |
Hey, sorry for dismissing the review - I haven't seen it before pushing.. what can I do to close this pull request? |
@overflw could you rebase and please squash your commit history into one commit (and remove the merge commits)? |
Kudos, SonarCloud Quality Gate passed! |
Should be done, I hope. |
Failure on Mac is due to #6042:
This is a random failure, so retesting this PR should fix it. |
retest this please |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
retest this please |
With those small changes I hope to make tribler compatible with the AppStream standard. I couldn't test the changes yet, because tribler won't build for me at the moment.