Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
dvershinin committed Feb 24, 2022
2 parents f309a27 + 8ac77e6 commit c8bd920
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions lastversion/GitHubRepoSession.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def find_in_tags_via_graphql(self, ret, pre_ok, major):
}
}
}
fragment refInfo on Ref {
name
target {
Expand All @@ -302,7 +302,7 @@ def find_in_tags_via_graphql(self, ret, pre_ok, major):
}
}
}
fragment commitInfo on Commit {
zipballUrl
tarballUrl
Expand All @@ -312,7 +312,7 @@ def find_in_tags_via_graphql(self, ret, pre_ok, major):
date
}
}
"""
cursor = ''
log.info('Using graphql queries...')
Expand Down
2 changes: 1 addition & 1 deletion lastversion/ProjectHolder.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(self):
cache_adapter = CacheControlAdapter(cache=self.cache)
self.mount("http://", cache_adapter)
self.mount("https://", cache_adapter)

self.headers.update({'User-Agent': '{}/{}'.format(app_name, __version__)})
log.info('Created instance of {}'.format(type(self).__name__))
self.branches = None
Expand Down
14 changes: 7 additions & 7 deletions lastversion/lastversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,21 @@ def latest(repo, output_format='version', pre_ok=False, assets_filter=None,
# bail out, found nothing that looks like a release
if not release:
return None

from_type = 'Located the latest release tag {} at: {}'.format(
release['tag_name'], project.get_canonical_link()
)
if 'type' in release:
from_type = '{} via {} mechanism'.format(from_type, release['type'])
log.info(from_type)

version = release['version']
tag = release['tag_name']

# return the release if we've reached far enough:
if output_format == 'version':
return version

if output_format in ['json', 'dict']:
if output_format == 'dict':
release['version'] = version
Expand Down Expand Up @@ -195,13 +195,13 @@ def latest(repo, output_format='version', pre_ok=False, assets_filter=None,
pass
release['from'] = project.get_canonical_link()
return release

if output_format == 'assets':
return project.get_assets(release, short_urls, assets_filter)

if output_format == 'source':
return project.release_download_url(release, short_urls)

if output_format == 'tag':
return tag

Expand Down

0 comments on commit c8bd920

Please sign in to comment.