mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-13 23:02:34 +00:00
[update] Prepare to remove Python 3.6 support
This commit is contained in:
parent
f5e438a976
commit
24093d52a7
2 changed files with 17 additions and 9 deletions
|
@ -588,8 +588,8 @@ class YoutubeDL:
|
||||||
current_version = sys.version_info[:2]
|
current_version = sys.version_info[:2]
|
||||||
if current_version < MIN_RECOMMENDED:
|
if current_version < MIN_RECOMMENDED:
|
||||||
msg = ('Support for Python version %d.%d has been deprecated. '
|
msg = ('Support for Python version %d.%d has been deprecated. '
|
||||||
'See https://github.com/yt-dlp/yt-dlp/issues/3764 for more details. '
|
'See https://github.com/yt-dlp/yt-dlp/issues/3764 for more details.'
|
||||||
'You will recieve only one more update on this version')
|
'\n You will no longer recieve updates on this version')
|
||||||
if current_version < MIN_SUPPORTED:
|
if current_version < MIN_SUPPORTED:
|
||||||
msg = 'Python version %d.%d is no longer supported'
|
msg = 'Python version %d.%d is no longer supported'
|
||||||
self.deprecation_warning(
|
self.deprecation_warning(
|
||||||
|
|
|
@ -88,8 +88,7 @@ class Updater:
|
||||||
|
|
||||||
@functools.cached_property
|
@functools.cached_property
|
||||||
def _tag(self):
|
def _tag(self):
|
||||||
latest = self._get_version_info('latest')['tag_name']
|
if version_tuple(__version__) >= version_tuple(self.latest_version):
|
||||||
if version_tuple(__version__) >= version_tuple(latest):
|
|
||||||
return 'latest'
|
return 'latest'
|
||||||
|
|
||||||
identifier = f'{detect_variant()} {system_identifier()}'
|
identifier = f'{detect_variant()} {system_identifier()}'
|
||||||
|
@ -113,9 +112,16 @@ class Updater:
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def new_version(self):
|
def new_version(self):
|
||||||
"""Version of the latest release"""
|
"""Version of the latest release we can update to"""
|
||||||
|
if self._tag.startswith('tags/'):
|
||||||
|
return self._tag[5:]
|
||||||
return self._get_version_info(self._tag)['tag_name']
|
return self._get_version_info(self._tag)['tag_name']
|
||||||
|
|
||||||
|
@property
|
||||||
|
def latest_version(self):
|
||||||
|
"""Version of the latest release"""
|
||||||
|
return self._get_version_info('latest')['tag_name']
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def has_update(self):
|
def has_update(self):
|
||||||
"""Whether there is an update available"""
|
"""Whether there is an update available"""
|
||||||
|
@ -161,13 +167,15 @@ class Updater:
|
||||||
"""Report whether there is an update available"""
|
"""Report whether there is an update available"""
|
||||||
try:
|
try:
|
||||||
self.ydl.to_screen(
|
self.ydl.to_screen(
|
||||||
f'Latest version: {self.new_version}, Current version: {self.current_version}')
|
f'Latest version: {self.latest_version}, Current version: {self.current_version}')
|
||||||
|
if not self.has_update:
|
||||||
|
if self._tag == 'latest':
|
||||||
|
return self.ydl.to_screen(f'yt-dlp is up to date ({__version__})')
|
||||||
|
return self.ydl.report_warning(
|
||||||
|
'yt-dlp cannot be updated any further since you are on an older Python version')
|
||||||
except Exception:
|
except Exception:
|
||||||
return self._report_network_error('obtain version info', delim='; Please try again later or')
|
return self._report_network_error('obtain version info', delim='; Please try again later or')
|
||||||
|
|
||||||
if not self.has_update:
|
|
||||||
return self.ydl.to_screen(f'yt-dlp is up to date ({__version__})')
|
|
||||||
|
|
||||||
if not is_non_updateable():
|
if not is_non_updateable():
|
||||||
self.ydl.to_screen(f'Current Build Hash {_sha256_file(self.filename)}')
|
self.ydl.to_screen(f'Current Build Hash {_sha256_file(self.filename)}')
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in a new issue