-
Notifications
You must be signed in to change notification settings - Fork 106
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
Show version url on project page #663
Conversation
Codecov Report
@@ Coverage Diff @@
## master #663 +/- ##
=========================================
+ Coverage 95.71% 96.51% +0.8%
=========================================
Files 57 57
Lines 2891 2985 +94
Branches 395 407 +12
=========================================
+ Hits 2767 2881 +114
+ Misses 86 70 -16
+ Partials 38 34 -4
Continue to review full report at Codecov.
|
Fix conflict |
I noticed, that this is also fixing issue with exception raised in gitlab backend, which caused the whole cron job to fail. I will add a new news file for towncryer before merging. |
* Introduce new method to Project model * Introduce new method to backend plugins Signed-off-by: Michal Konečný <[email protected]>
Signed-off-by: Michal Konečný <[email protected]>
url = project.homepage.replace( | ||
'https://bitbucket.org/', '') | ||
|
||
if url.endswith('/'): |
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.
you can use url.strip("/")
here instead of the if logic
Returns: | ||
str: url used for version checking | ||
''' | ||
url = 'https://metacpan.org/release/%(name)s/' % { |
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 would be nice to have some consistency in the use of the %
format operator and format()
method. Also if anitya is Python 3 only and runs on Python 3.6 f-strings are nice.
''' | ||
url = project.version_url | ||
|
||
return url |
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.
return url | |
return project.version_url |
Returns: | ||
str: url used for version checking | ||
''' | ||
url = project.version_url |
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.
url = project.version_url |
elif project.homepage.startswith('https://github.com'): | ||
url = project.homepage.replace('https://github.com/', '') | ||
|
||
if url.endswith('/'): |
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.
maybe use url = url.strip("/")
and remove the if
statement
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.
Looks good to me :)
Signed-off-by: Michal Konečný [email protected]