mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 21:33:13 -07:00
Updates vendored subliminal to 2.1.0
Updates rarfile to 3.1 Updates stevedore to 3.5.0 Updates appdirs to 1.4.4 Updates click to 8.1.3 Updates decorator to 5.1.1 Updates dogpile.cache to 1.1.8 Updates pbr to 5.11.0 Updates pysrt to 1.1.2 Updates pytz to 2022.6 Adds importlib-metadata version 3.1.1 Adds typing-extensions version 4.1.1 Adds zipp version 3.11.0
This commit is contained in:
parent
d8da02cb69
commit
f05b09f349
694 changed files with 16621 additions and 11056 deletions
|
@ -62,8 +62,10 @@ except ImportError:
|
|||
import logging # noqa
|
||||
|
||||
from collections import defaultdict
|
||||
import io
|
||||
import os
|
||||
import re
|
||||
import shlex
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
|
@ -86,50 +88,52 @@ import pbr.hooks
|
|||
# predicates in ()
|
||||
_VERSION_SPEC_RE = re.compile(r'\s*(.*?)\s*\((.*)\)\s*$')
|
||||
|
||||
|
||||
# Mappings from setup() keyword arguments to setup.cfg options;
|
||||
# The values are (section, option) tuples, or simply (section,) tuples if
|
||||
# the option has the same name as the setup() argument
|
||||
D1_D2_SETUP_ARGS = {
|
||||
"name": ("metadata",),
|
||||
"version": ("metadata",),
|
||||
"author": ("metadata",),
|
||||
"author_email": ("metadata",),
|
||||
"maintainer": ("metadata",),
|
||||
"maintainer_email": ("metadata",),
|
||||
"url": ("metadata", "home_page"),
|
||||
"project_urls": ("metadata",),
|
||||
"description": ("metadata", "summary"),
|
||||
"keywords": ("metadata",),
|
||||
"long_description": ("metadata", "description"),
|
||||
"long_description_content_type": ("metadata", "description_content_type"),
|
||||
"download_url": ("metadata",),
|
||||
"classifiers": ("metadata", "classifier"),
|
||||
"platforms": ("metadata", "platform"), # **
|
||||
"license": ("metadata",),
|
||||
# Mappings from setup.cfg options, in (section, option) form, to setup()
|
||||
# keyword arguments
|
||||
CFG_TO_PY_SETUP_ARGS = (
|
||||
(('metadata', 'name'), 'name'),
|
||||
(('metadata', 'version'), 'version'),
|
||||
(('metadata', 'author'), 'author'),
|
||||
(('metadata', 'author_email'), 'author_email'),
|
||||
(('metadata', 'maintainer'), 'maintainer'),
|
||||
(('metadata', 'maintainer_email'), 'maintainer_email'),
|
||||
(('metadata', 'home_page'), 'url'),
|
||||
(('metadata', 'project_urls'), 'project_urls'),
|
||||
(('metadata', 'summary'), 'description'),
|
||||
(('metadata', 'keywords'), 'keywords'),
|
||||
(('metadata', 'description'), 'long_description'),
|
||||
(
|
||||
('metadata', 'description_content_type'),
|
||||
'long_description_content_type',
|
||||
),
|
||||
(('metadata', 'download_url'), 'download_url'),
|
||||
(('metadata', 'classifier'), 'classifiers'),
|
||||
(('metadata', 'platform'), 'platforms'), # **
|
||||
(('metadata', 'license'), 'license'),
|
||||
# Use setuptools install_requires, not
|
||||
# broken distutils requires
|
||||
"install_requires": ("metadata", "requires_dist"),
|
||||
"setup_requires": ("metadata", "setup_requires_dist"),
|
||||
"python_requires": ("metadata",),
|
||||
"provides": ("metadata", "provides_dist"), # **
|
||||
"obsoletes": ("metadata", "obsoletes_dist"), # **
|
||||
"package_dir": ("files", 'packages_root'),
|
||||
"packages": ("files",),
|
||||
"package_data": ("files",),
|
||||
"namespace_packages": ("files",),
|
||||
"data_files": ("files",),
|
||||
"scripts": ("files",),
|
||||
"py_modules": ("files", "modules"), # **
|
||||
"cmdclass": ("global", "commands"),
|
||||
(('metadata', 'requires_dist'), 'install_requires'),
|
||||
(('metadata', 'setup_requires_dist'), 'setup_requires'),
|
||||
(('metadata', 'python_requires'), 'python_requires'),
|
||||
(('metadata', 'requires_python'), 'python_requires'),
|
||||
(('metadata', 'provides_dist'), 'provides'), # **
|
||||
(('metadata', 'provides_extras'), 'provides_extras'),
|
||||
(('metadata', 'obsoletes_dist'), 'obsoletes'), # **
|
||||
(('files', 'packages_root'), 'package_dir'),
|
||||
(('files', 'packages'), 'packages'),
|
||||
(('files', 'package_data'), 'package_data'),
|
||||
(('files', 'namespace_packages'), 'namespace_packages'),
|
||||
(('files', 'data_files'), 'data_files'),
|
||||
(('files', 'scripts'), 'scripts'),
|
||||
(('files', 'modules'), 'py_modules'), # **
|
||||
(('global', 'commands'), 'cmdclass'),
|
||||
# Not supported in distutils2, but provided for
|
||||
# backwards compatibility with setuptools
|
||||
"use_2to3": ("backwards_compat", "use_2to3"),
|
||||
"zip_safe": ("backwards_compat", "zip_safe"),
|
||||
"tests_require": ("backwards_compat", "tests_require"),
|
||||
"dependency_links": ("backwards_compat",),
|
||||
"include_package_data": ("backwards_compat",),
|
||||
}
|
||||
(('backwards_compat', 'zip_safe'), 'zip_safe'),
|
||||
(('backwards_compat', 'tests_require'), 'tests_require'),
|
||||
(('backwards_compat', 'dependency_links'), 'dependency_links'),
|
||||
(('backwards_compat', 'include_package_data'), 'include_package_data'),
|
||||
)
|
||||
|
||||
# setup() arguments that can have multiple values in setup.cfg
|
||||
MULTI_FIELDS = ("classifiers",
|
||||
|
@ -146,16 +150,27 @@ MULTI_FIELDS = ("classifiers",
|
|||
"dependency_links",
|
||||
"setup_requires",
|
||||
"tests_require",
|
||||
"cmdclass")
|
||||
"keywords",
|
||||
"cmdclass",
|
||||
"provides_extras")
|
||||
|
||||
# setup() arguments that can have mapping values in setup.cfg
|
||||
MAP_FIELDS = ("project_urls",)
|
||||
|
||||
# setup() arguments that contain boolean values
|
||||
BOOL_FIELDS = ("use_2to3", "zip_safe", "include_package_data")
|
||||
BOOL_FIELDS = ("zip_safe", "include_package_data")
|
||||
|
||||
CSV_FIELDS = ()
|
||||
|
||||
|
||||
CSV_FIELDS = ("keywords",)
|
||||
def shlex_split(path):
|
||||
if os.name == 'nt':
|
||||
# shlex cannot handle paths that contain backslashes, treating those
|
||||
# as escape characters.
|
||||
path = path.replace("\\", "/")
|
||||
return [x.replace("/", "\\") for x in shlex.split(path)]
|
||||
|
||||
return shlex.split(path)
|
||||
|
||||
|
||||
def resolve_name(name):
|
||||
|
@ -205,10 +220,11 @@ def cfg_to_args(path='setup.cfg', script_args=()):
|
|||
"""
|
||||
|
||||
# The method source code really starts here.
|
||||
if sys.version_info >= (3, 2):
|
||||
parser = configparser.ConfigParser()
|
||||
if sys.version_info >= (3, 0):
|
||||
parser = configparser.ConfigParser()
|
||||
else:
|
||||
parser = configparser.SafeConfigParser()
|
||||
parser = configparser.SafeConfigParser()
|
||||
|
||||
if not os.path.exists(path):
|
||||
raise errors.DistutilsFileError("file '%s' does not exist" %
|
||||
os.path.abspath(path))
|
||||
|
@ -297,34 +313,25 @@ def setup_cfg_to_setup_kwargs(config, script_args=()):
|
|||
# parse env_markers.
|
||||
all_requirements = {}
|
||||
|
||||
for arg in D1_D2_SETUP_ARGS:
|
||||
if len(D1_D2_SETUP_ARGS[arg]) == 2:
|
||||
# The distutils field name is different than distutils2's.
|
||||
section, option = D1_D2_SETUP_ARGS[arg]
|
||||
|
||||
elif len(D1_D2_SETUP_ARGS[arg]) == 1:
|
||||
# The distutils field name is the same thant distutils2's.
|
||||
section = D1_D2_SETUP_ARGS[arg][0]
|
||||
option = arg
|
||||
for alias, arg in CFG_TO_PY_SETUP_ARGS:
|
||||
section, option = alias
|
||||
|
||||
in_cfg_value = has_get_option(config, section, option)
|
||||
if not in_cfg_value and arg == "long_description":
|
||||
in_cfg_value = has_get_option(config, section, "description_file")
|
||||
if in_cfg_value:
|
||||
in_cfg_value = split_multiline(in_cfg_value)
|
||||
value = ''
|
||||
for filename in in_cfg_value:
|
||||
description_file = io.open(filename, encoding='utf-8')
|
||||
try:
|
||||
value += description_file.read().strip() + '\n\n'
|
||||
finally:
|
||||
description_file.close()
|
||||
in_cfg_value = value
|
||||
|
||||
if not in_cfg_value:
|
||||
# There is no such option in the setup.cfg
|
||||
if arg == "long_description":
|
||||
in_cfg_value = has_get_option(config, section,
|
||||
"description_file")
|
||||
if in_cfg_value:
|
||||
in_cfg_value = split_multiline(in_cfg_value)
|
||||
value = ''
|
||||
for filename in in_cfg_value:
|
||||
description_file = open(filename)
|
||||
try:
|
||||
value += description_file.read().strip() + '\n\n'
|
||||
finally:
|
||||
description_file.close()
|
||||
in_cfg_value = value
|
||||
else:
|
||||
continue
|
||||
continue
|
||||
|
||||
if arg in CSV_FIELDS:
|
||||
in_cfg_value = split_csv(in_cfg_value)
|
||||
|
@ -333,7 +340,7 @@ def setup_cfg_to_setup_kwargs(config, script_args=()):
|
|||
elif arg in MAP_FIELDS:
|
||||
in_cfg_map = {}
|
||||
for i in split_multiline(in_cfg_value):
|
||||
k, v = i.split('=')
|
||||
k, v = i.split('=', 1)
|
||||
in_cfg_map[k.strip()] = v.strip()
|
||||
in_cfg_value = in_cfg_map
|
||||
elif arg in BOOL_FIELDS:
|
||||
|
@ -370,26 +377,27 @@ def setup_cfg_to_setup_kwargs(config, script_args=()):
|
|||
for line in in_cfg_value:
|
||||
if '=' in line:
|
||||
key, value = line.split('=', 1)
|
||||
key, value = (key.strip(), value.strip())
|
||||
key_unquoted = shlex_split(key.strip())[0]
|
||||
key, value = (key_unquoted, value.strip())
|
||||
if key in data_files:
|
||||
# Multiple duplicates of the same package name;
|
||||
# this is for backwards compatibility of the old
|
||||
# format prior to d2to1 0.2.6.
|
||||
prev = data_files[key]
|
||||
prev.extend(value.split())
|
||||
prev.extend(shlex_split(value))
|
||||
else:
|
||||
prev = data_files[key.strip()] = value.split()
|
||||
prev = data_files[key.strip()] = shlex_split(value)
|
||||
elif firstline:
|
||||
raise errors.DistutilsOptionError(
|
||||
'malformed package_data first line %r (misses '
|
||||
'"=")' % line)
|
||||
else:
|
||||
prev.extend(line.strip().split())
|
||||
prev.extend(shlex_split(line.strip()))
|
||||
firstline = False
|
||||
if arg == 'data_files':
|
||||
# the data_files value is a pointlessly different structure
|
||||
# from the package_data value
|
||||
data_files = data_files.items()
|
||||
data_files = sorted(data_files.items())
|
||||
in_cfg_value = data_files
|
||||
elif arg == 'cmdclass':
|
||||
cmdclass = {}
|
||||
|
@ -532,7 +540,7 @@ def get_extension_modules(config):
|
|||
else:
|
||||
# Backwards compatibility for old syntax; don't use this though
|
||||
labels = section.split('=', 1)
|
||||
labels = [l.strip() for l in labels]
|
||||
labels = [label.strip() for label in labels]
|
||||
if (len(labels) == 2) and (labels[0] == 'extension'):
|
||||
ext_args = {}
|
||||
for field in EXTENSION_FIELDS:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue