Skip to content
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

Merged
merged 3 commits into from
Jan 8, 2019
Merged

Conversation

Zlopez
Copy link
Contributor

@Zlopez Zlopez commented Nov 20, 2018

  • Introduce new method to Project model
  • Introduce new method to backend plugins

Signed-off-by: Michal Konečný [email protected]

@codecov-io
Copy link

codecov-io commented Nov 20, 2018

Codecov Report

Merging #663 into master will increase coverage by 0.8%.
The diff coverage is 97.42%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
anitya/lib/backends/pear.py 100% <100%> (+4.25%) ⬆️
anitya/db/models.py 100% <100%> (ø) ⬆️
anitya/lib/backends/crates.py 100% <100%> (ø) ⬆️
anitya/lib/backends/stackage.py 100% <100%> (ø) ⬆️
anitya/lib/backends/gnu.py 100% <100%> (ø) ⬆️
anitya/lib/backends/rubygems.py 93.33% <100%> (+0.74%) ⬆️
anitya/lib/backends/cran.py 100% <100%> (ø) ⬆️
anitya/lib/backends/gnome.py 97.14% <100%> (+0.26%) ⬆️
anitya/lib/backends/github.py 100% <100%> (ø) ⬆️
anitya/lib/backends/google.py 100% <100%> (ø) ⬆️
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 75f46d3...36f3343. Read the comment docs.

@Zlopez
Copy link
Contributor Author

Zlopez commented Nov 22, 2018

Fix conflict

@Zlopez
Copy link
Contributor Author

Zlopez commented Dec 30, 2018

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.

Zlopez added 2 commits January 7, 2019 09:03
* 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('/'):
Copy link

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/' % {
Copy link

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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return url
return project.version_url

Returns:
str: url used for version checking
'''
url = project.version_url
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
url = project.version_url

elif project.homepage.startswith('https://github.com'):
url = project.homepage.replace('https://github.com/', '')

if url.endswith('/'):
Copy link

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

Copy link
Member

@pypingou pypingou left a 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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants