diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d9233d4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +env/ +.vscode/ +testData.txt \ No newline at end of file diff --git a/PyGeoIP.py b/PyGeoIP.py index 00fc13d..172478d 100644 --- a/PyGeoIP.py +++ b/PyGeoIP.py @@ -1,4 +1,7 @@ #!/usr/bin/python3 +# Benjamyn Love +# 2018/2019 +# bip (Bulk IP lookup) import dns.resolver import ipwhois @@ -9,6 +12,13 @@ import warnings ipList = [] +def loadBlacklist(): + with open('blacklist.txt') as handle: + blacklist = handle.readlines() + for i in range(len(blacklist)): + blacklist[i] = blacklist[i].strip() + return blacklist + def lookupIP(inData): try: with warnings.catch_warnings(): @@ -26,30 +36,45 @@ def lookupIP(inData): def parseIPS(): + global countIncluded with open("ips.txt", 'r') as f: - testdata = f.read() + ipData = f.read() - data = testdata.split('\n') + data = ipData.split('\n') for ip in data: ip = ip.strip() ipAddr = ip.split() if len(ipAddr) == 2: + countIncluded = True ipList.append(ipAddr) else: - pass + if len(ipAddr) == 0: + pass + else: + countIncluded = False + ipList.append(ipAddr) + +blacklist = loadBlacklist() parseIPS() for ips in ipList: # ccode = ipCheck(lookupIP(ips[1])) - ret = lookupIP(ips[1]) + if countIncluded == True: + ret = lookupIP(ips[1]) + reverseName = reversename.from_address(ips[1]) + else: + ret = lookupIP(ips[0]) + reverseName = reversename.from_address(ips[0]) + if ret == None: continue + cc = ret["asn_country_code"] desc = ret["asn_description"] - if cc == "AU" or cc == "NZ" or cc == "US": + if cc in blacklist: continue - reverseName = reversename.from_address(ips[1]) + try: ptr = str(dns.resolver.query(reverseName, "PTR")[0]) except dns.resolver.NoAnswer as E: @@ -58,12 +83,9 @@ for ips in ipList: ptr = reverseName except dns.resolver.NXDOMAIN as E: ptr = reverseName - print("IP: {}\t\tCountry: {}\tDesc: {}\tPTR: {}\tCount: {}".format(ips[1], cc, desc, ptr, ips[0])) + if countIncluded == True: + print("IP: {}\t\tCountry: {}\tDesc: {}\tPTR: {}\tCount: {}".format(ips[1], cc, desc, ptr, ips[0])) + else: + print("IP: {}\t\tCountry: {}\tDesc: {}\tPTR: {}".format(ips[0], cc, desc, ptr)) - - -# print(ipList[0]) -# lookupIP("123.23.23.12") - -##{'asn_registry': 'apnic', 'asn': '4134', 'asn_cidr': '220.174.0.0/16', 'asn_country_code': 'CN', 'asn_date': '2002-10-30', 'asn_description': 'CHINANET-BACKBONE No.31,Jin-rong Street, CN'} diff --git a/bip.sh b/bip.sh new file mode 100644 index 0000000..faa15b2 --- /dev/null +++ b/bip.sh @@ -0,0 +1,13 @@ +#!/bin/bash +FILENAME=$PWD/ips.txt +INSTDIR=$PWD +source ./env/bin/activate +if [ -z "${EDITOR}" ] + then + nano $FILENAME +else + $EDITOR $FILENAME +fi +clear +python $INSTDIR/PyGeoIP.py #set to python3 that is in use on the system, usually python3 will suffice +rm -f $FILENAME diff --git a/env/lib/python3.7/site-packages/wheel/cli/install.py b/blacklist.txt similarity index 100% rename from env/lib/python3.7/site-packages/wheel/cli/install.py rename to blacklist.txt diff --git a/env/bin/__pycache__/ipwhois_cli.cpython-37.pyc b/env/bin/__pycache__/ipwhois_cli.cpython-37.pyc index 5edd15f..791b2c6 100644 Binary files a/env/bin/__pycache__/ipwhois_cli.cpython-37.pyc and b/env/bin/__pycache__/ipwhois_cli.cpython-37.pyc differ diff --git a/env/bin/__pycache__/ipwhois_utils_cli.cpython-37.pyc b/env/bin/__pycache__/ipwhois_utils_cli.cpython-37.pyc index ee802cd..c64fd7b 100644 Binary files a/env/bin/__pycache__/ipwhois_utils_cli.cpython-37.pyc and b/env/bin/__pycache__/ipwhois_utils_cli.cpython-37.pyc differ diff --git a/env/bin/activate.csh b/env/bin/activate.csh index 07afb72..fd87dd3 100644 --- a/env/bin/activate.csh +++ b/env/bin/activate.csh @@ -2,30 +2,37 @@ # You cannot run it directly. # Created by Davide Di Blasi . -alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate && unalias pydoc' +set newline='\ +' + +alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH:q" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT:q" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate && unalias pydoc' # Unset irrelevant variables. deactivate nondestructive setenv VIRTUAL_ENV "/home/ben/Documents/Projects/Python/PyGeoIP/env" -set _OLD_VIRTUAL_PATH="$PATH" -setenv PATH "$VIRTUAL_ENV/bin:$PATH" +set _OLD_VIRTUAL_PATH="$PATH:q" +setenv PATH "$VIRTUAL_ENV:q/bin:$PATH:q" if ("" != "") then set env_name = "" else - set env_name = `basename "$VIRTUAL_ENV"` + set env_name = "$VIRTUAL_ENV:t:q" endif # Could be in a non-interactive environment, # in which case, $prompt is undefined and we wouldn't # care about the prompt anyway. if ( $?prompt ) then - set _OLD_VIRTUAL_PROMPT="$prompt" - set prompt = "[$env_name] $prompt" + set _OLD_VIRTUAL_PROMPT="$prompt:q" +if ( "$prompt:q" =~ *"$newline:q"* ) then + : +else + set prompt = "[$env_name:q] $prompt:q" +endif endif unset env_name @@ -33,4 +40,3 @@ unset env_name alias pydoc python -m pydoc rehash - diff --git a/env/bin/activate.fish b/env/bin/activate.fish index b75c9ee..1a9b2b7 100644 --- a/env/bin/activate.fish +++ b/env/bin/activate.fish @@ -1,4 +1,4 @@ -# This file must be used using `. bin/activate.fish` *within a running fish ( http://fishshell.com ) session*. +# This file must be used using `source bin/activate.fish` *within a running fish ( http://fishshell.com ) session*. # Do not run it directly. function deactivate -d 'Exit virtualenv mode and return to the normal environment.' diff --git a/env/bin/activate_this.py b/env/bin/activate_this.py index f18193b..444d3fd 100644 --- a/env/bin/activate_this.py +++ b/env/bin/activate_this.py @@ -9,19 +9,21 @@ try: __file__ except NameError: raise AssertionError( - "You must run this like execfile('path/to/activate_this.py', dict(__file__='path/to/activate_this.py'))") -import sys + "You must run this like execfile('path/to/activate_this.py', dict(__file__='path/to/activate_this.py'))" + ) import os - -old_os_path = os.environ.get('PATH', '') -os.environ['PATH'] = os.path.dirname(os.path.abspath(__file__)) + os.pathsep + old_os_path -base = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -if sys.platform == 'win32': - site_packages = os.path.join(base, 'Lib', 'site-packages') -else: - site_packages = os.path.join(base, 'lib', 'python%s' % sys.version[:3], 'site-packages') -prev_sys_path = list(sys.path) import site +import sys + +old_os_path = os.environ.get("PATH", "") +os.environ["PATH"] = os.path.dirname(os.path.abspath(__file__)) + os.pathsep + old_os_path +base = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +if sys.platform == "win32": + site_packages = os.path.join(base, "Lib", "site-packages") +else: + site_packages = os.path.join(base, "lib", "python%s" % sys.version[:3], "site-packages") +prev_sys_path = list(sys.path) + site.addsitedir(site_packages) sys.real_prefix = sys.prefix sys.prefix = base diff --git a/env/bin/ipwhois_cli.py b/env/bin/ipwhois_cli.py index cca0a09..7acd95e 100644 --- a/env/bin/ipwhois_cli.py +++ b/env/bin/ipwhois_cli.py @@ -1,4 +1,4 @@ -# Copyright (c) 2013-2017 Philip Hane +# Copyright (c) 2013-2019 Philip Hane # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -482,10 +482,8 @@ class IPWhoisCLI: if json_data is None: json_data = {} - # Python 2.6 doesn't support set literal expressions, use explicit - # set() instead. - keys = set(['asn', 'asn_cidr', 'asn_country_code', 'asn_date', - 'asn_registry', 'asn_description']).intersection(json_data) + keys = {'asn', 'asn_cidr', 'asn_country_code', 'asn_date', + 'asn_registry', 'asn_description'}.intersection(json_data) output = '' diff --git a/env/bin/ipwhois_utils_cli.py b/env/bin/ipwhois_utils_cli.py index 3f77adb..c8dec77 100644 --- a/env/bin/ipwhois_utils_cli.py +++ b/env/bin/ipwhois_utils_cli.py @@ -1,4 +1,4 @@ -# Copyright (c) 2013-2017 Philip Hane +# Copyright (c) 2013-2019 Philip Hane # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/env/bin/python b/env/bin/python index fc81572..14b75f3 100755 Binary files a/env/bin/python and b/env/bin/python differ diff --git a/env/lib/python3.7/__pycache__/__future__.cpython-37.pyc b/env/lib/python3.7/__pycache__/__future__.cpython-37.pyc index 55606de..c898182 100644 Binary files a/env/lib/python3.7/__pycache__/__future__.cpython-37.pyc and b/env/lib/python3.7/__pycache__/__future__.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/_bootlocale.cpython-37.pyc b/env/lib/python3.7/__pycache__/_bootlocale.cpython-37.pyc index 60ea544..7ca3366 100644 Binary files a/env/lib/python3.7/__pycache__/_bootlocale.cpython-37.pyc and b/env/lib/python3.7/__pycache__/_bootlocale.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/_collections_abc.cpython-37.pyc b/env/lib/python3.7/__pycache__/_collections_abc.cpython-37.pyc index c9c2b25..19a2f91 100644 Binary files a/env/lib/python3.7/__pycache__/_collections_abc.cpython-37.pyc and b/env/lib/python3.7/__pycache__/_collections_abc.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/_weakrefset.cpython-37.pyc b/env/lib/python3.7/__pycache__/_weakrefset.cpython-37.pyc index b80c388..57741ac 100644 Binary files a/env/lib/python3.7/__pycache__/_weakrefset.cpython-37.pyc and b/env/lib/python3.7/__pycache__/_weakrefset.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/abc.cpython-37.pyc b/env/lib/python3.7/__pycache__/abc.cpython-37.pyc index 5deeff9..d4ceb71 100644 Binary files a/env/lib/python3.7/__pycache__/abc.cpython-37.pyc and b/env/lib/python3.7/__pycache__/abc.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/base64.cpython-37.pyc b/env/lib/python3.7/__pycache__/base64.cpython-37.pyc index 4b5fef6..ef27448 100644 Binary files a/env/lib/python3.7/__pycache__/base64.cpython-37.pyc and b/env/lib/python3.7/__pycache__/base64.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/bisect.cpython-37.pyc b/env/lib/python3.7/__pycache__/bisect.cpython-37.pyc index a689b49..029400a 100644 Binary files a/env/lib/python3.7/__pycache__/bisect.cpython-37.pyc and b/env/lib/python3.7/__pycache__/bisect.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/codecs.cpython-37.pyc b/env/lib/python3.7/__pycache__/codecs.cpython-37.pyc index da85fa3..fa3906e 100644 Binary files a/env/lib/python3.7/__pycache__/codecs.cpython-37.pyc and b/env/lib/python3.7/__pycache__/codecs.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/copy.cpython-37.pyc b/env/lib/python3.7/__pycache__/copy.cpython-37.pyc index 5aa9c97..ba9e861 100644 Binary files a/env/lib/python3.7/__pycache__/copy.cpython-37.pyc and b/env/lib/python3.7/__pycache__/copy.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/copyreg.cpython-37.pyc b/env/lib/python3.7/__pycache__/copyreg.cpython-37.pyc index a9b6efb..23a7997 100644 Binary files a/env/lib/python3.7/__pycache__/copyreg.cpython-37.pyc and b/env/lib/python3.7/__pycache__/copyreg.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/enum.cpython-37.pyc b/env/lib/python3.7/__pycache__/enum.cpython-37.pyc index 744b2c6..7153ddb 100644 Binary files a/env/lib/python3.7/__pycache__/enum.cpython-37.pyc and b/env/lib/python3.7/__pycache__/enum.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/fnmatch.cpython-37.pyc b/env/lib/python3.7/__pycache__/fnmatch.cpython-37.pyc index 1bc01ad..f7a003e 100644 Binary files a/env/lib/python3.7/__pycache__/fnmatch.cpython-37.pyc and b/env/lib/python3.7/__pycache__/fnmatch.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/functools.cpython-37.pyc b/env/lib/python3.7/__pycache__/functools.cpython-37.pyc index 37f9aee..1c2d608 100644 Binary files a/env/lib/python3.7/__pycache__/functools.cpython-37.pyc and b/env/lib/python3.7/__pycache__/functools.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/genericpath.cpython-37.pyc b/env/lib/python3.7/__pycache__/genericpath.cpython-37.pyc index a7d5639..47913b6 100644 Binary files a/env/lib/python3.7/__pycache__/genericpath.cpython-37.pyc and b/env/lib/python3.7/__pycache__/genericpath.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/hashlib.cpython-37.pyc b/env/lib/python3.7/__pycache__/hashlib.cpython-37.pyc index ba280a9..d4bd514 100644 Binary files a/env/lib/python3.7/__pycache__/hashlib.cpython-37.pyc and b/env/lib/python3.7/__pycache__/hashlib.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/heapq.cpython-37.pyc b/env/lib/python3.7/__pycache__/heapq.cpython-37.pyc index d1936c0..16946ad 100644 Binary files a/env/lib/python3.7/__pycache__/heapq.cpython-37.pyc and b/env/lib/python3.7/__pycache__/heapq.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/hmac.cpython-37.pyc b/env/lib/python3.7/__pycache__/hmac.cpython-37.pyc index 62a9bce..ef2a3d4 100644 Binary files a/env/lib/python3.7/__pycache__/hmac.cpython-37.pyc and b/env/lib/python3.7/__pycache__/hmac.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/imp.cpython-37.pyc b/env/lib/python3.7/__pycache__/imp.cpython-37.pyc index 44da215..b13be66 100644 Binary files a/env/lib/python3.7/__pycache__/imp.cpython-37.pyc and b/env/lib/python3.7/__pycache__/imp.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/io.cpython-37.pyc b/env/lib/python3.7/__pycache__/io.cpython-37.pyc index e8ade33..13b74e8 100644 Binary files a/env/lib/python3.7/__pycache__/io.cpython-37.pyc and b/env/lib/python3.7/__pycache__/io.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/keyword.cpython-37.pyc b/env/lib/python3.7/__pycache__/keyword.cpython-37.pyc index d127392..73eac2c 100644 Binary files a/env/lib/python3.7/__pycache__/keyword.cpython-37.pyc and b/env/lib/python3.7/__pycache__/keyword.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/linecache.cpython-37.pyc b/env/lib/python3.7/__pycache__/linecache.cpython-37.pyc index 9d5aa6e..7a7c3d9 100644 Binary files a/env/lib/python3.7/__pycache__/linecache.cpython-37.pyc and b/env/lib/python3.7/__pycache__/linecache.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/locale.cpython-37.pyc b/env/lib/python3.7/__pycache__/locale.cpython-37.pyc index 79b2465..ddddeaf 100644 Binary files a/env/lib/python3.7/__pycache__/locale.cpython-37.pyc and b/env/lib/python3.7/__pycache__/locale.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/operator.cpython-37.pyc b/env/lib/python3.7/__pycache__/operator.cpython-37.pyc index 51c5131..5293c45 100644 Binary files a/env/lib/python3.7/__pycache__/operator.cpython-37.pyc and b/env/lib/python3.7/__pycache__/operator.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/os.cpython-37.pyc b/env/lib/python3.7/__pycache__/os.cpython-37.pyc index a93e255..3bfb993 100644 Binary files a/env/lib/python3.7/__pycache__/os.cpython-37.pyc and b/env/lib/python3.7/__pycache__/os.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/posixpath.cpython-37.pyc b/env/lib/python3.7/__pycache__/posixpath.cpython-37.pyc index 35a575c..3ecb8cc 100644 Binary files a/env/lib/python3.7/__pycache__/posixpath.cpython-37.pyc and b/env/lib/python3.7/__pycache__/posixpath.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/random.cpython-37.pyc b/env/lib/python3.7/__pycache__/random.cpython-37.pyc index 722bac1..8d40dd8 100644 Binary files a/env/lib/python3.7/__pycache__/random.cpython-37.pyc and b/env/lib/python3.7/__pycache__/random.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/re.cpython-37.pyc b/env/lib/python3.7/__pycache__/re.cpython-37.pyc index d1ba2ac..5b1c79e 100644 Binary files a/env/lib/python3.7/__pycache__/re.cpython-37.pyc and b/env/lib/python3.7/__pycache__/re.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/reprlib.cpython-37.pyc b/env/lib/python3.7/__pycache__/reprlib.cpython-37.pyc index aa2689b..fefc997 100644 Binary files a/env/lib/python3.7/__pycache__/reprlib.cpython-37.pyc and b/env/lib/python3.7/__pycache__/reprlib.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/shutil.cpython-37.pyc b/env/lib/python3.7/__pycache__/shutil.cpython-37.pyc index f602a89..47dd91e 100644 Binary files a/env/lib/python3.7/__pycache__/shutil.cpython-37.pyc and b/env/lib/python3.7/__pycache__/shutil.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/site.cpython-37.pyc b/env/lib/python3.7/__pycache__/site.cpython-37.pyc index a0b7d92..f394b66 100644 Binary files a/env/lib/python3.7/__pycache__/site.cpython-37.pyc and b/env/lib/python3.7/__pycache__/site.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/sre_compile.cpython-37.pyc b/env/lib/python3.7/__pycache__/sre_compile.cpython-37.pyc index 85bffac..ed3082a 100644 Binary files a/env/lib/python3.7/__pycache__/sre_compile.cpython-37.pyc and b/env/lib/python3.7/__pycache__/sre_compile.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/sre_constants.cpython-37.pyc b/env/lib/python3.7/__pycache__/sre_constants.cpython-37.pyc index d8d8db3..ecd0a45 100644 Binary files a/env/lib/python3.7/__pycache__/sre_constants.cpython-37.pyc and b/env/lib/python3.7/__pycache__/sre_constants.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/sre_parse.cpython-37.pyc b/env/lib/python3.7/__pycache__/sre_parse.cpython-37.pyc index 628b391..2898023 100644 Binary files a/env/lib/python3.7/__pycache__/sre_parse.cpython-37.pyc and b/env/lib/python3.7/__pycache__/sre_parse.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/stat.cpython-37.pyc b/env/lib/python3.7/__pycache__/stat.cpython-37.pyc index c8f66c2..30c5b56 100644 Binary files a/env/lib/python3.7/__pycache__/stat.cpython-37.pyc and b/env/lib/python3.7/__pycache__/stat.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/struct.cpython-37.pyc b/env/lib/python3.7/__pycache__/struct.cpython-37.pyc index 8048182..dc56b90 100644 Binary files a/env/lib/python3.7/__pycache__/struct.cpython-37.pyc and b/env/lib/python3.7/__pycache__/struct.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/tarfile.cpython-37.pyc b/env/lib/python3.7/__pycache__/tarfile.cpython-37.pyc index 7285919..bb97e45 100644 Binary files a/env/lib/python3.7/__pycache__/tarfile.cpython-37.pyc and b/env/lib/python3.7/__pycache__/tarfile.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/tempfile.cpython-37.pyc b/env/lib/python3.7/__pycache__/tempfile.cpython-37.pyc index f9d0e29..73c9e13 100644 Binary files a/env/lib/python3.7/__pycache__/tempfile.cpython-37.pyc and b/env/lib/python3.7/__pycache__/tempfile.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/token.cpython-37.pyc b/env/lib/python3.7/__pycache__/token.cpython-37.pyc index 5b29a88..b43545c 100644 Binary files a/env/lib/python3.7/__pycache__/token.cpython-37.pyc and b/env/lib/python3.7/__pycache__/token.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/tokenize.cpython-37.pyc b/env/lib/python3.7/__pycache__/tokenize.cpython-37.pyc index 9212d2b..560174d 100644 Binary files a/env/lib/python3.7/__pycache__/tokenize.cpython-37.pyc and b/env/lib/python3.7/__pycache__/tokenize.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/types.cpython-37.pyc b/env/lib/python3.7/__pycache__/types.cpython-37.pyc index 5ff45f9..7bf9991 100644 Binary files a/env/lib/python3.7/__pycache__/types.cpython-37.pyc and b/env/lib/python3.7/__pycache__/types.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/warnings.cpython-37.pyc b/env/lib/python3.7/__pycache__/warnings.cpython-37.pyc index 71cabf0..d454b26 100644 Binary files a/env/lib/python3.7/__pycache__/warnings.cpython-37.pyc and b/env/lib/python3.7/__pycache__/warnings.cpython-37.pyc differ diff --git a/env/lib/python3.7/__pycache__/weakref.cpython-37.pyc b/env/lib/python3.7/__pycache__/weakref.cpython-37.pyc index fc5bfbd..859fed2 100644 Binary files a/env/lib/python3.7/__pycache__/weakref.cpython-37.pyc and b/env/lib/python3.7/__pycache__/weakref.cpython-37.pyc differ diff --git a/env/lib/python3.7/distutils/__init__.py b/env/lib/python3.7/distutils/__init__.py index 29fc1da..59f55f1 100644 --- a/env/lib/python3.7/distutils/__init__.py +++ b/env/lib/python3.7/distutils/__init__.py @@ -1,20 +1,21 @@ +import imp import os import sys -import warnings -import imp -import opcode # opcode is not a virtualenv module, so we can use it to find the stdlib - # Important! To work on pypy, this must be a module that resides in the - # lib-python/modified-x.y.z directory +import warnings + +# opcode is not a virtualenv module, so we can use it to find the stdlib +# Important! To work on pypy, this must be a module that resides in the +# lib-python/modified-x.y.z directory +import opcode dirname = os.path.dirname -distutils_path = os.path.join(os.path.dirname(opcode.__file__), 'distutils') +distutils_path = os.path.join(os.path.dirname(opcode.__file__), "distutils") if os.path.normpath(distutils_path) == os.path.dirname(os.path.normpath(__file__)): - warnings.warn( - "The virtualenv distutils package at %s appears to be in the same location as the system distutils?") + warnings.warn("The virtualenv distutils package at %s appears to be in the same location as the system distutils?") else: - __path__.insert(0, distutils_path) - real_distutils = imp.load_module("_virtualenv_distutils", None, distutils_path, ('', '', imp.PKG_DIRECTORY)) + __path__.insert(0, distutils_path) # noqa: F821 + real_distutils = imp.load_module("_virtualenv_distutils", None, distutils_path, ("", "", imp.PKG_DIRECTORY)) # Copy the relevant attributes try: __revision__ = real_distutils.__revision__ @@ -22,80 +23,94 @@ else: pass __version__ = real_distutils.__version__ -from distutils import dist, sysconfig +from distutils import dist, sysconfig # isort:skip try: basestring except NameError: basestring = str -## patch build_ext (distutils doesn't know how to get the libs directory -## path on windows - it hardcodes the paths around the patched sys.prefix) +# patch build_ext (distutils doesn't know how to get the libs directory +# path on windows - it hardcodes the paths around the patched sys.prefix) -if sys.platform == 'win32': +if sys.platform == "win32": from distutils.command.build_ext import build_ext as old_build_ext + class build_ext(old_build_ext): - def finalize_options (self): + def finalize_options(self): if self.library_dirs is None: self.library_dirs = [] elif isinstance(self.library_dirs, basestring): self.library_dirs = self.library_dirs.split(os.pathsep) - + self.library_dirs.insert(0, os.path.join(sys.real_prefix, "Libs")) old_build_ext.finalize_options(self) - - from distutils.command import build_ext as build_ext_module + + from distutils.command import build_ext as build_ext_module + build_ext_module.build_ext = build_ext -## distutils.dist patches: +# distutils.dist patches: old_find_config_files = dist.Distribution.find_config_files + + def find_config_files(self): found = old_find_config_files(self) - system_distutils = os.path.join(distutils_path, 'distutils.cfg') - #if os.path.exists(system_distutils): - # found.insert(0, system_distutils) - # What to call the per-user config file - if os.name == 'posix': + if os.name == "posix": user_filename = ".pydistutils.cfg" else: user_filename = "pydistutils.cfg" user_filename = os.path.join(sys.prefix, user_filename) if os.path.isfile(user_filename): for item in list(found): - if item.endswith('pydistutils.cfg'): + if item.endswith("pydistutils.cfg"): found.remove(item) found.append(user_filename) return found + + dist.Distribution.find_config_files = find_config_files -## distutils.sysconfig patches: +# distutils.sysconfig patches: old_get_python_inc = sysconfig.get_python_inc + + def sysconfig_get_python_inc(plat_specific=0, prefix=None): if prefix is None: prefix = sys.real_prefix return old_get_python_inc(plat_specific, prefix) + + sysconfig_get_python_inc.__doc__ = old_get_python_inc.__doc__ sysconfig.get_python_inc = sysconfig_get_python_inc old_get_python_lib = sysconfig.get_python_lib + + def sysconfig_get_python_lib(plat_specific=0, standard_lib=0, prefix=None): if standard_lib and prefix is None: prefix = sys.real_prefix return old_get_python_lib(plat_specific, standard_lib, prefix) + + sysconfig_get_python_lib.__doc__ = old_get_python_lib.__doc__ sysconfig.get_python_lib = sysconfig_get_python_lib old_get_config_vars = sysconfig.get_config_vars + + def sysconfig_get_config_vars(*args): real_vars = old_get_config_vars(*args) - if sys.platform == 'win32': + if sys.platform == "win32": lib_dir = os.path.join(sys.real_prefix, "libs") - if isinstance(real_vars, dict) and 'LIBDIR' not in real_vars: - real_vars['LIBDIR'] = lib_dir # asked for all - elif isinstance(real_vars, list) and 'LIBDIR' in args: - real_vars = real_vars + [lib_dir] # asked for list + if isinstance(real_vars, dict) and "LIBDIR" not in real_vars: + real_vars["LIBDIR"] = lib_dir # asked for all + elif isinstance(real_vars, list) and "LIBDIR" in args: + real_vars = real_vars + [lib_dir] # asked for list return real_vars + + sysconfig_get_config_vars.__doc__ = old_get_config_vars.__doc__ sysconfig.get_config_vars = sysconfig_get_config_vars diff --git a/env/lib/python3.7/distutils/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/distutils/__pycache__/__init__.cpython-37.pyc index 4adc225..46b436f 100644 Binary files a/env/lib/python3.7/distutils/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/distutils/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/__pycache__/easy_install.cpython-37.pyc b/env/lib/python3.7/site-packages/__pycache__/easy_install.cpython-37.pyc index 841c119..ecbd99a 100644 Binary files a/env/lib/python3.7/site-packages/__pycache__/easy_install.cpython-37.pyc and b/env/lib/python3.7/site-packages/__pycache__/easy_install.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/__init__.cpython-37.pyc index 68dc673..9b3cfa2 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/_compat.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/_compat.cpython-37.pyc index 357d42c..b81d270 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/_compat.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/_compat.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/dnssec.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/dnssec.cpython-37.pyc index bd9381e..e9f02fc 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/dnssec.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/dnssec.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/e164.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/e164.cpython-37.pyc index 71042fd..ebfcbe4 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/e164.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/e164.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/edns.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/edns.cpython-37.pyc index bb4b311..9f1edd2 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/edns.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/edns.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/entropy.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/entropy.cpython-37.pyc index 38f589d..e5900f8 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/entropy.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/entropy.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/exception.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/exception.cpython-37.pyc index 2e0e72a..f8ddaa4 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/exception.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/exception.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/flags.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/flags.cpython-37.pyc index 3bda983..4909684 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/flags.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/flags.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/grange.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/grange.cpython-37.pyc index d7c300c..6b19126 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/grange.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/grange.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/hash.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/hash.cpython-37.pyc index b4a99c5..03574f8 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/hash.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/hash.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/inet.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/inet.cpython-37.pyc index d0361cb..33039de 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/inet.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/inet.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/ipv4.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/ipv4.cpython-37.pyc index 046c0cd..5f8fe82 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/ipv4.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/ipv4.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/ipv6.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/ipv6.cpython-37.pyc index db46879..44495dd 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/ipv6.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/ipv6.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/message.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/message.cpython-37.pyc index 9c2b42c..e9d61e6 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/message.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/message.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/name.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/name.cpython-37.pyc index 5c28800..30fb654 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/name.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/name.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/namedict.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/namedict.cpython-37.pyc index 478cfb6..7bc7211 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/namedict.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/namedict.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/node.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/node.cpython-37.pyc index a511fb7..0312a82 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/node.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/node.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/opcode.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/opcode.cpython-37.pyc index cff7ac9..59ea260 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/opcode.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/opcode.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/query.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/query.cpython-37.pyc index 5c42e27..806ecda 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/query.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/query.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/rcode.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/rcode.cpython-37.pyc index 5d02380..1003066 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/rcode.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/rcode.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/rdata.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/rdata.cpython-37.pyc index c7980f9..1bbf9a0 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/rdata.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/rdata.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/rdataclass.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/rdataclass.cpython-37.pyc index 9b99d2e..918ebcd 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/rdataclass.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/rdataclass.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/rdataset.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/rdataset.cpython-37.pyc index 3af0b22..31db4a4 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/rdataset.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/rdataset.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/rdatatype.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/rdatatype.cpython-37.pyc index eb7a47f..52ffb26 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/rdatatype.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/rdatatype.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/renderer.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/renderer.cpython-37.pyc index a403c0e..6fb3e29 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/renderer.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/renderer.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/resolver.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/resolver.cpython-37.pyc index d85d97f..808e52a 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/resolver.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/resolver.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/reversename.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/reversename.cpython-37.pyc index defb47f..c0ea6c5 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/reversename.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/reversename.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/rrset.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/rrset.cpython-37.pyc index 751f04e..4c5e119 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/rrset.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/rrset.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/set.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/set.cpython-37.pyc index 8c87dad..0a21f73 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/set.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/set.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/tokenizer.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/tokenizer.cpython-37.pyc index 62ccb20..3e852fa 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/tokenizer.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/tokenizer.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/tsig.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/tsig.cpython-37.pyc index 37573f6..babbfb8 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/tsig.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/tsig.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/tsigkeyring.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/tsigkeyring.cpython-37.pyc index a4a55b0..15fa1cc 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/tsigkeyring.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/tsigkeyring.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/ttl.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/ttl.cpython-37.pyc index cbc5e3e..9b92f09 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/ttl.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/ttl.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/update.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/update.cpython-37.pyc index 35b2031..17552f4 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/update.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/update.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/version.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/version.cpython-37.pyc index af7f2fe..de90773 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/version.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/version.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/wiredata.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/wiredata.cpython-37.pyc index a9ee8c4..444a7b7 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/wiredata.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/wiredata.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/__pycache__/zone.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/__pycache__/zone.cpython-37.pyc index 78b1308..c89a057 100644 Binary files a/env/lib/python3.7/site-packages/dns/__pycache__/zone.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/__pycache__/zone.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/AFSDB.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/AFSDB.cpython-37.pyc index 55d7004..18b504b 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/AFSDB.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/AFSDB.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/AVC.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/AVC.cpython-37.pyc index 9a9fe9a..772e419 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/AVC.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/AVC.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CAA.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CAA.cpython-37.pyc index 7a5bc05..bc51239 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CAA.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CAA.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CDNSKEY.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CDNSKEY.cpython-37.pyc index ffc4e74..3c2c0b3 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CDNSKEY.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CDNSKEY.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CDS.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CDS.cpython-37.pyc index 0287e82..a9d0eb6 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CDS.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CDS.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CERT.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CERT.cpython-37.pyc index c96d9e0..df2aa21 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CERT.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CERT.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CNAME.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CNAME.cpython-37.pyc index 6167b1b..dca3fe7 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CNAME.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CNAME.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CSYNC.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CSYNC.cpython-37.pyc index fe59cd9..e5a782b 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CSYNC.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/CSYNC.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/DLV.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/DLV.cpython-37.pyc index 241cfd8..6df17d5 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/DLV.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/DLV.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/DNAME.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/DNAME.cpython-37.pyc index 8e8c1b1..9c823ec 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/DNAME.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/DNAME.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/DNSKEY.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/DNSKEY.cpython-37.pyc index b12dad1..c942863 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/DNSKEY.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/DNSKEY.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/DS.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/DS.cpython-37.pyc index 7982cb2..4ed5683 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/DS.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/DS.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/EUI48.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/EUI48.cpython-37.pyc index 1ed3a2d..4bb546f 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/EUI48.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/EUI48.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/EUI64.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/EUI64.cpython-37.pyc index ef8e0a9..6f7473c 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/EUI64.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/EUI64.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/GPOS.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/GPOS.cpython-37.pyc index 3e07451..61f2c75 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/GPOS.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/GPOS.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/HINFO.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/HINFO.cpython-37.pyc index 68b5f75..9b1279f 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/HINFO.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/HINFO.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/HIP.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/HIP.cpython-37.pyc index 9398b3c..c142084 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/HIP.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/HIP.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/ISDN.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/ISDN.cpython-37.pyc index 36848aa..41b05f2 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/ISDN.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/ISDN.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/LOC.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/LOC.cpython-37.pyc index 7b07e57..809d704 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/LOC.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/LOC.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/MX.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/MX.cpython-37.pyc index 42e0e8d..57e8bb3 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/MX.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/MX.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/NS.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/NS.cpython-37.pyc index 06c52c7..9b0eb28 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/NS.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/NS.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/NSEC.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/NSEC.cpython-37.pyc index 091f3e1..b50ecf1 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/NSEC.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/NSEC.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/NSEC3.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/NSEC3.cpython-37.pyc index 35fcdac..88911c4 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/NSEC3.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/NSEC3.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/NSEC3PARAM.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/NSEC3PARAM.cpython-37.pyc index 153a631..24eacc5 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/NSEC3PARAM.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/NSEC3PARAM.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/OPENPGPKEY.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/OPENPGPKEY.cpython-37.pyc index dd1196d..c60a083 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/OPENPGPKEY.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/OPENPGPKEY.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/PTR.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/PTR.cpython-37.pyc index d26ab83..3b7bc97 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/PTR.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/PTR.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/RP.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/RP.cpython-37.pyc index d49f954..f72e488 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/RP.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/RP.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/RRSIG.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/RRSIG.cpython-37.pyc index a59dfd3..8dc0fcd 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/RRSIG.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/RRSIG.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/RT.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/RT.cpython-37.pyc index 2400538..0665216 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/RT.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/RT.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/SOA.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/SOA.cpython-37.pyc index f375081..d4bf855 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/SOA.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/SOA.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/SPF.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/SPF.cpython-37.pyc index 60fee90..e066dd3 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/SPF.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/SPF.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/SSHFP.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/SSHFP.cpython-37.pyc index 89122e8..de6b20e 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/SSHFP.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/SSHFP.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/TLSA.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/TLSA.cpython-37.pyc index 13a53f7..7c55d97 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/TLSA.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/TLSA.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/TXT.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/TXT.cpython-37.pyc index b57601b..a7bd628 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/TXT.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/TXT.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/URI.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/URI.cpython-37.pyc index f501e6d..8b8fff3 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/URI.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/URI.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/X25.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/X25.cpython-37.pyc index 12c75fa..e30b920 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/X25.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/X25.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/__init__.cpython-37.pyc index e7d3606..7d79224 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/ANY/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/CH/__pycache__/A.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/CH/__pycache__/A.cpython-37.pyc index 62fd244..507dc7e 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/CH/__pycache__/A.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/CH/__pycache__/A.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/CH/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/CH/__pycache__/__init__.cpython-37.pyc index 88deb72..b4317b9 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/CH/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/CH/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/A.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/A.cpython-37.pyc index b743fb2..376844f 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/A.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/A.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/AAAA.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/AAAA.cpython-37.pyc index 8d7f824..93ad30e 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/AAAA.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/AAAA.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/APL.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/APL.cpython-37.pyc index 4d27e60..7cf41bb 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/APL.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/APL.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/DHCID.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/DHCID.cpython-37.pyc index c2dbb3d..79198f3 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/DHCID.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/DHCID.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/IPSECKEY.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/IPSECKEY.cpython-37.pyc index 598b743..e45b77f 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/IPSECKEY.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/IPSECKEY.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/KX.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/KX.cpython-37.pyc index 24e6bd2..5ee9c00 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/KX.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/KX.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/NAPTR.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/NAPTR.cpython-37.pyc index 2476089..81af85b 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/NAPTR.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/NAPTR.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/NSAP.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/NSAP.cpython-37.pyc index b4cf169..8a8be1e 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/NSAP.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/NSAP.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/NSAP_PTR.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/NSAP_PTR.cpython-37.pyc index 4f2274f..4a78614 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/NSAP_PTR.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/NSAP_PTR.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/PX.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/PX.cpython-37.pyc index c01ad1a..262f06d 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/PX.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/PX.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/SRV.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/SRV.cpython-37.pyc index 931bf74..b02c0f9 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/SRV.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/SRV.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/WKS.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/WKS.cpython-37.pyc index 34287d1..15dc5a9 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/WKS.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/WKS.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/__init__.cpython-37.pyc index aeee4e9..4259543 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/IN/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/__init__.cpython-37.pyc index 509e5eb..ee835b0 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/dnskeybase.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/dnskeybase.cpython-37.pyc index 8f5506b..66641da 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/dnskeybase.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/dnskeybase.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/dsbase.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/dsbase.cpython-37.pyc index b2193f7..d582628 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/dsbase.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/dsbase.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/euibase.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/euibase.cpython-37.pyc index 1bf9711..6be97ea 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/euibase.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/euibase.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/mxbase.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/mxbase.cpython-37.pyc index 4d68bb1..bb63165 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/mxbase.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/mxbase.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/nsbase.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/nsbase.cpython-37.pyc index 5e55be4..faa0583 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/nsbase.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/nsbase.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/txtbase.cpython-37.pyc b/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/txtbase.cpython-37.pyc index 8e30a14..236dec7 100644 Binary files a/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/txtbase.cpython-37.pyc and b/env/lib/python3.7/site-packages/dns/rdtypes/__pycache__/txtbase.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/DESCRIPTION.rst b/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/DESCRIPTION.rst deleted file mode 100644 index dcecae5..0000000 --- a/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/DESCRIPTION.rst +++ /dev/null @@ -1,495 +0,0 @@ -======= -ipwhois -======= - -.. image:: https://travis-ci.org/secynic/ipwhois.svg?branch=master - :target: https://travis-ci.org/secynic/ipwhois -.. image:: https://coveralls.io/repos/github/secynic/ipwhois/badge.svg?branch= - master - :target: https://coveralls.io/github/secynic/ipwhois?branch=master -.. image:: https://codeclimate.com/github/secynic/ipwhois/badges/issue_count.svg - :target: https://codeclimate.com/github/secynic/ipwhois -.. image:: https://img.shields.io/badge/license-BSD%202--Clause-blue.svg - :target: https://github.com/secynic/ipwhois/tree/master/LICENSE.txt -.. image:: https://img.shields.io/badge/python-2.6%2C%202.7%2C%203.3+-blue.svg - :target: https://docs.python.org -.. image:: https://img.shields.io/badge/docs-latest-green.svg?style=flat - :target: https://ipwhois.readthedocs.io/en/latest -.. image:: https://img.shields.io/badge/docs-dev-yellow.svg?style=flat - :target: https://ipwhois.readthedocs.io/en/dev - -Summary -======= - -ipwhois is a Python package focused on retrieving and parsing whois data -for IPv4 and IPv6 addresses. - -.. note:: - - If you are experiencing latency issues, it is likely related to rate - limiting. Rate limiting is based on your source IP, which may be a problem - with multiple users behind the same proxy. Additionally, LACNIC implements - aggressive rate limiting. Experimental bulk query support is new as of - v1.0.0. - -Features -======== - -* Parses a majority of whois fields in to a standard dictionary -* IPv4 and IPv6 support -* Supports RDAP queries (recommended method, see: - https://tools.ietf.org/html/rfc7483) -* Proxy support for RDAP queries -* Supports legacy whois protocol queries -* Referral whois support for legacy whois protocol -* Recursive network parsing for IPs with parent/children networks listed -* National Internet Registry support for JPNIC and KRNIC -* Supports IP to ASN and ASN origin queries -* Python 2.6+ and 3.3+ supported -* Useful set of utilities -* Experimental bulk query support -* BSD license -* 100% core code coverage (See '# pragma: no cover' for exclusions) -* Human readable field translations -* Full CLI for IPWhois with optional ANSI colored console output. - -Links -===== - -Documentation -------------- - -GitHub latest -^^^^^^^^^^^^^ - -https://ipwhois.readthedocs.io/en/latest - -GitHub dev -^^^^^^^^^^ - -https://ipwhois.readthedocs.io/en/dev - -Examples --------- - -https://github.com/secynic/ipwhois/tree/master/ipwhois/examples - -Github ------- - -https://github.com/secynic/ipwhois - -Pypi ----- - -https://pypi.org/project/ipwhois - -Changes -------- - -https://ipwhois.readthedocs.io/en/latest/CHANGES.html - -Upgrade Notes -------------- - -https://ipwhois.readthedocs.io/en/latest/UPGRADING.html - -Dependencies -============ - -Python 2.6:: - - dnspython - ipaddr - argparse (required only for CLI) - -Python 2.7:: - - dnspython - ipaddr - -Python 3.3+:: - - dnspython - -Installing -========== - -Latest release from PyPi:: - - pip install --upgrade ipwhois - -GitHub - Stable:: - - pip install -e git+https://github.com/secynic/ipwhois@master#egg=ipwhois - -GitHub - Dev:: - - pip install -e git+https://github.com/secynic/ipwhois@dev#egg=ipwhois - -Firewall Ports -============== - -ipwhois needs some outbound firewall ports opened from your host/server. - -:ASN (DNS): 53/tcp -:ASN (Whois): 43/tcp -:ASN (HTTP): - 80/tcp - - 443/tcp (Pending) -:RDAP (HTTP): - 80/tcp - - 443/tcp (Pending) -:NIR (HTTP): - 80/tcp - - 443/tcp (KRNIC) -:Legacy Whois: 43/tcp -:Get Host: 43/tcp - -API -=== - -IPWhois (main class) --------------------- - -ipwhois.IPWhois is the base class for wrapping RDAP and Legacy Whois lookups. -Instantiate this object, then call one of the lookup functions: - -`RDAP (HTTP) - IPWhois.lookup_rdap() <#rdap-http>`_ -OR -`Legacy Whois - IPWhois.lookup_whois() <#legacy-whois>`_ - -Input -^^^^^ - -+--------------------+--------+-----------------------------------------------+ -| **Key** |**Type**| **Description** | -+--------------------+--------+-----------------------------------------------+ -| address | str | An IPv4 or IPv6 address as a string, integer, | -| | | IPv4Address, or IPv6Address. | -+--------------------+--------+-----------------------------------------------+ -| timeout | int | The default timeout for socket connections | -| | | in seconds. Defaults to 5. | -+--------------------+--------+-----------------------------------------------+ -| proxy_opener | object | The urllib.request.OpenerDirector request for | -| | | proxy support or None. | -+--------------------+--------+-----------------------------------------------+ -| allow_permutations | bool | Allow net.Net() to use additional methods if | -| | | DNS lookups to Cymru fail. *WARNING* | -| | | deprecated in favor of new argument | -| | | asn_methods. Defaults to True. | -+--------------------+--------+-----------------------------------------------+ - -RDAP (HTTP) ------------ - -IPWhois.lookup_rdap() is the recommended lookup method. RDAP provides a -far better data structure than legacy whois and REST lookups (previous -implementation). RDAP queries allow for parsing of contact information and -details for users, organizations, and groups. RDAP also provides more detailed -network information. - -RDAP documentation: - -https://ipwhois.readthedocs.io/en/latest/RDAP.html - -Legacy Whois ------------- - -Legacy Whois documentation: - -https://ipwhois.readthedocs.io/en/latest/WHOIS.html - -National Internet Registries ----------------------------- - -This library now supports NIR lookups for JPNIC and KRNIC. Previously, Whois -and RDAP data for Japan and South Korea was restricted. NIR lookups scrape -these national registries directly for the data restricted from regional -internet registries. NIR queries are enabled by default via the inc_nir -argument in the IPWhois.lookup_*() functions. - -https://ipwhois.readthedocs.io/en/latest/NIR.html - -Autonomous System Numbers -------------------------- - -This library now supports ASN origin lookups via Whois and HTTP. - -IP ASN functionality was moved to its own parser API (IPASN). - -There is no CLI for these yet. - -https://ipwhois.readthedocs.io/en/latest/ASN.html - -Utilities ---------- - -Utilities documentation: - -https://ipwhois.readthedocs.io/en/latest/UTILS.html - -Scripts -------- - -CLI documentation: - -https://ipwhois.readthedocs.io/en/latest/CLI.html - -Experimental Functions ----------------------- - -.. caution:: - - Functions in experimental.py contain new functionality that has not yet - been widely tested. Bulk lookup support contained here can result in - significant system/network resource utilization. Additionally, abuse of - this functionality may get you banned by the various services queried by - this library. Use at your own discretion. - -Experimental functions documentation: - -https://ipwhois.readthedocs.io/en/latest/EXPERIMENTAL.html - -Contributing -============ - -https://ipwhois.readthedocs.io/en/latest/CONTRIBUTING.html - -IP Reputation Support -===================== - -This feature is under consideration. Take a look at TekDefense's Automater: - -`TekDefense-Automater `_ - -Domain Support -============== - -There are no plans for domain whois support in this project. - -Look at Sven Slootweg's -`python-whois `_ for a library with -domain support. - -Special Thanks -============== - -Thank you JetBrains for the `PyCharm `_ -open source support! - -Thank you Chris Wells (`@cdubz `_) for your -extensive testing on the experimental functions! - -Last but not least, thank you to all the issue submitters and contributors. - - -Changelog -========= - -1.0.0 (2017-07-30) ------------------- - -- Deprecated asn_alts, allow_permutations in favor of new asn_methods (#158) -- Added new exception ASNOriginLookupError (#158) -- KRNIC lookups changed to HTTPS (#166) -- Added experimental functions - get_bulk_asn_whois, bulk_lookup_rdap (#134) -- Fixed bug in NIR lookups that caused addresses with multi-line contacts to - error (#172 - kwheeles) -- Added IANA Reserved CIDR 198.97.38.0/24 to ipv4_is_defined (#174) -- Fixed bug in RDAP notices/remarks parsing that would omit partial entries - missing one or more of title, description, links (#176) -- Added new return key asn_description via verbose ASN DNS lookup support and - modified ASN whois lookups. New argument get_asn_description to disable - additional DNS lookup (#176) -- Fixed some test function naming errors -- Added new generators to utils.py: ipv4_generate_random and - ipv6_generate_random (#183) -- Moved upgrade notes to new UPGRADING.rst -- Deprecated unnecessary protected class functions, changed to public in - asn.py, nir.py, and whois.py (#184) -- net.Net.get_host(), utils.ipv4_is_defined(), and utils.ipv6_is_defined now - return namedtuple instead of tuple. -- Changed docstrings to Google standard for better napoleon parsing (#185) -- Removed deprecated IPWhois.lookup() - This was moved to - IPWhois.lookup_whois() -- Fixed 'nets'->'range' bug for legacy whois CIDR net_range values (#188) -- Fixed a bug in IPASN/Net that caused the ASN result to vary if Cymru has - more than one ASN listed for an IP (#190) -- Updated ElasticSearch example for ES v5.5.1 (#138) - -0.15.1 (2017-02-16) -------------------- - -- Fixed IPv6 parsing for ASN origin lookups and added tests (#162 - ti-mo) -- Fixed recursive role parsing at depths greater than 0 (#161 - cdubz) - -0.15.0 (2017-02-02) -------------------- - -- Python 3.3+ dnspython3 requirement changed to dnspython (#155) -- Added ASN origin lookup support (#149) -- Moved ASN parsing from net.Net.get_asn_*() to new class asn.IPASN. - The original functions now return the raw query (#157) -- net.Net.lookup_asn() is deprecated in favor of asn.IPASN.lookup() (#157) -- Added new exception ASNParseError (#157) -- Fixed rate-limiting exception handling for when HTTP errors are returned - rather than JSON errors (rikonor - #144) -- Fixed rate-limit infinite recursion bug for legacy whois (rikonor - #144) -- Fixed bug in net.Net.get_http_raw() that would pass the encoded form_data on - retry rather than the original argument. -- Removed nose requirements and fixed travis.yml for updated pip -- Documentation updates -- Code style tweaks -- Updated tests and version info for Python 3.6 -- Added basic stress tests (#144) -- Minor tweaks to existing tests - -0.14.0 (2016-08-29) -------------------- - -- Changed legacy whois emails output type to list (#133) -- Fixed retry count non-decrementing infinite loop in - ipwhois.net.Net.get_whois() (issue #125 - krader1961) -- Added new function ipwhois.net.Net.get_http_raw() and tests (#67) -- Added National Internet Registry (JPNIC, KRNIC) support (#67). Enabled by - default in IPWhois.lookup_*(). Disable by passing inc_nir=False. Optionally, - lower level code can call nir.NIRWhois(). This enhancement results in extra - network queries, but more detailed information for NIRs. -- Added utils CLI (ipwhois_utils_cli.py) - #121. Installed to your environments - Scripts dir. This is a wrapper for utils.py. -- Documentation improvements (#123) -- kw arg readability (#115) -- Replaced usage of args with script_args in ipwhois_cli.py -- Minor optimization in whois.py and online/test_whois.py -- Added coveralls integration and re-enabled online tests with Travis CI -- Added Read the Docs support (#132) -- Added documentation (Sphinx) requirements.txt (#132) -- Fixed test imports -- Added --json argument (output in JSON format) to ipwhois_cli.py (#135) - -0.13.0 (2016-04-18) -------------------- - -- Added events_actor parsing for RDAP results. -- Added example for caching data via Redis (#81) -- Added normalization (human-readable field information) in hr.py (#47) -- README word wrap fix (#102) -- Fixed bug in exception handling for ASN HTTP lookups. -- Fixed bug in IPWhois.lookup_rdap() that caused ASN HTTP lookup responses to - be used in place of RDAP responses. -- Added new function Net.get_asn_http() and migrated code from - Net.lookup_asn() + new tests. -- Fixed bug in ASN HTTP fallback lookups for DNIC (#108). -- Added new parameter extra_org_map in Net.get_asn_http(), Net.lookup_asn(), - and IPWhois.lookup*() (#108). -- Fixed _RDAPCommon.summarize_notices() None check - changed len() to all(). -- Added CLI (ipwhois_cli.py) - #46. Installed to your environments Scripts dir. - This is a wrapper for ipwhois.py (IPWhois). Utils CLI will be in a future - release (#121). -- Documentation split up and added more detail (#81). - -0.12.0 (2016-03-28) -------------------- - -- Added headers parameter to ipwhois.Net.get_http_json() (issue #98). -- Fixed ASN HTTP lookup (fallback) Accept headers (issue #98). -- Fixed HTTP decoding, set to utf-8 (italomaia - issue #97) -- IPWhois.lookup() deprecated (issue #96), and will be removed in a future - release (TBD). Use IPWhois.lookup_whois() instead. -- Added rate_limit_timeout parameter (issue #99) to Net.get_http_json(), - IPWhois.lookup_rdap(), and RDAP.lookup(). New exception HTTPRateLimitError. -- Added new parameter asn_alts to Net.lookup_asn(), IPWhois.lookup_rdap() and - IPWhois.lookup(). Takes a list of lookup types to attempt if the - ASN dns lookup fails. Allow permutations must be enabled. Defaults to all - ['whois', 'http'] (issue #93). -- Fixed socket exception handling in Net.get_http_json() for Python 2.6. -- Fixed assertIsInstance for Python 2.6 tests (issue #100). Implemented - unittest._formatMessage and unittest.util.safe_repr for Python 2.6. -- Moved TestCommon to tests\\__init__.py to avoid duplicate code. -- Replaced remaining % with str.format (issue #95). - -0.11.2 (2016-02-25) -------------------- - -- Added allow_permutations parameter (bool) to net.Net() and ipwhois.IPWhois() - to allow alternate ASN lookups if DNS lookups fail. (FirefighterBlu3) -- Fixed ASN DNS resolver timeout/retry_count support. Retry count is used as a - multiplier of timeout, to determine a limetime interval. (FirefighterBlu3) -- Fixed bug where remarks would return None if missing a title. -- Added CONTRIBUTING.rst -- Added tests - -0.11.1 (2015-12-17) -------------------- - -- Re-added CIDR calculation for RDAP lookups. -- Improved tests - core code coverage now 100%. See '# pragma: no cover' for - exclusions. A few bugs were identified in the process, detailed below. -- Moved IP zero stripping from rdap._RDAPNetwork.parse() to new helper function - utils.ipv4_lstrip_zeros(). -- Moved CIDR calculation from rdap._RDAPNetwork.parse() to new helper function - utils.calculate_cidr(). -- Fixed utils.ipv4_is_defined() if statement ordering for RFC 1918 conflict. -- Fixed utils.ipv6_is_defined() if statement ordering for Unspecified and - Loopback (conflict with Reserved). -- Added is_offline parameter to whois.Whois.lookup() primarily for testing. -- Fixed bug in whois.Whois._parse_fields() that attempted to parse 'val2' of - regex, which is no longer used. Also fixed the expected Exception to be - IndexError. -- Fixed bug in ipwhois.IPWhois.lookup() where the argument order was mixed up, - causing referral lookups to be skipped when get_referral=True. -- Fixed bug in rdap._RDAPCommon.summarize_notices() output for links. -- Fixed bug in root entity iteration exception handling in rdap.RDAP.lookup(). - -0.11.0 (2015-11-02) -------------------- - -- Support for REST lookups replaced with RDAP. -- Split code for a more structured system (net, whois, rdap, exceptions). -- Tests match the data new structure. -- Split tests for online and offline testing. -- Performance enhancements for parsing. -- Added an optional bootstrap parameter for RDAP lookups, in order to replace - ASN lookups or use both. Will default to False. Afrinic is currently not - supported, so I would not use this for now. ARIN acknowledged my issue - for this, and will be adding support back in for Afrinic bootstrap. -- Added field_list parameter (inclusion list) for WHOIS lookups. -- Added logging. -- Added examples directory. - -0.10.3 (2015-08-14) -------------------- - -- Fixed LACNIC lookup_rws() queries, since they switched to RDAP. This is - temporary to get it working until the major library transition to RDAP and - new parsed formatting is complete. - -0.10.2 (2015-05-19) -------------------- - -- Fixed APNIC parsing for updated field. -- Fixed datetime parsing and validation when Zulu (Z) is appended. -- Added RIPE parsing for created and updated fields (whois and RWS). -- Removed unnecessary parentheses in IPWhois class declaration. -- Some documentation and comment tweaking to work with Sphinx. -- Minor PEP 8 tweaks. - -0.10.1 (2015-02-09) -------------------- - -- Fixed setup.py bug. - -0.10.0 (2015-02-09) -------------------- - -- Added .csv support for country code source. You can no longer download - country code information from iso.org. -- Added support for IPv4Address or IPv6Address as the address arg in IPWhois. -- Fixed file open encoding bug. Moved from open to io.open. -- Fixed parameter in IPWhois ip defined checks. -- Fixed TestIPWhois.test_ip_invalid() assertions. - diff --git a/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/INSTALLER b/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/INSTALLER deleted file mode 100644 index a1b589e..0000000 --- a/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/INSTALLER +++ /dev/null @@ -1 +0,0 @@ -pip diff --git a/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/METADATA b/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/METADATA deleted file mode 100644 index bdca066..0000000 --- a/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/METADATA +++ /dev/null @@ -1,526 +0,0 @@ -Metadata-Version: 2.0 -Name: ipwhois -Version: 1.0.0 -Summary: Retrieve and parse whois data for IPv4 and IPv6 addresses. -Home-page: https://github.com/secynic/ipwhois -Author: Philip Hane -Author-email: secynic@gmail.com -License: BSD -Download-URL: https://github.com/secynic/ipwhois/tarball/master -Keywords: Python WHOIS RWhois Referral Whois ASN IP Address IP IPv4 IPv6 IETF REST Arin Ripe Apnic Lacnic Afrinic NIC National Information Center RDAP RIR Regional Internet RegistryNIR National Internet Registry ASN origin Origin -Platform: UNKNOWN -Classifier: Development Status :: 5 - Production/Stable -Classifier: Intended Audience :: Developers -Classifier: Intended Audience :: Information Technology -Classifier: Intended Audience :: Science/Research -Classifier: License :: OSI Approved :: BSD License -Classifier: Operating System :: OS Independent -Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.6 -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.3 -Classifier: Programming Language :: Python :: 3.4 -Classifier: Programming Language :: Python :: 3.5 -Classifier: Programming Language :: Python :: 3.6 -Classifier: Topic :: Internet -Classifier: Topic :: Software Development -Requires-Dist: dnspython -Requires-Dist: ipaddr; python_version < "3.3" - -======= -ipwhois -======= - -.. image:: https://travis-ci.org/secynic/ipwhois.svg?branch=master - :target: https://travis-ci.org/secynic/ipwhois -.. image:: https://coveralls.io/repos/github/secynic/ipwhois/badge.svg?branch= - master - :target: https://coveralls.io/github/secynic/ipwhois?branch=master -.. image:: https://codeclimate.com/github/secynic/ipwhois/badges/issue_count.svg - :target: https://codeclimate.com/github/secynic/ipwhois -.. image:: https://img.shields.io/badge/license-BSD%202--Clause-blue.svg - :target: https://github.com/secynic/ipwhois/tree/master/LICENSE.txt -.. image:: https://img.shields.io/badge/python-2.6%2C%202.7%2C%203.3+-blue.svg - :target: https://docs.python.org -.. image:: https://img.shields.io/badge/docs-latest-green.svg?style=flat - :target: https://ipwhois.readthedocs.io/en/latest -.. image:: https://img.shields.io/badge/docs-dev-yellow.svg?style=flat - :target: https://ipwhois.readthedocs.io/en/dev - -Summary -======= - -ipwhois is a Python package focused on retrieving and parsing whois data -for IPv4 and IPv6 addresses. - -.. note:: - - If you are experiencing latency issues, it is likely related to rate - limiting. Rate limiting is based on your source IP, which may be a problem - with multiple users behind the same proxy. Additionally, LACNIC implements - aggressive rate limiting. Experimental bulk query support is new as of - v1.0.0. - -Features -======== - -* Parses a majority of whois fields in to a standard dictionary -* IPv4 and IPv6 support -* Supports RDAP queries (recommended method, see: - https://tools.ietf.org/html/rfc7483) -* Proxy support for RDAP queries -* Supports legacy whois protocol queries -* Referral whois support for legacy whois protocol -* Recursive network parsing for IPs with parent/children networks listed -* National Internet Registry support for JPNIC and KRNIC -* Supports IP to ASN and ASN origin queries -* Python 2.6+ and 3.3+ supported -* Useful set of utilities -* Experimental bulk query support -* BSD license -* 100% core code coverage (See '# pragma: no cover' for exclusions) -* Human readable field translations -* Full CLI for IPWhois with optional ANSI colored console output. - -Links -===== - -Documentation -------------- - -GitHub latest -^^^^^^^^^^^^^ - -https://ipwhois.readthedocs.io/en/latest - -GitHub dev -^^^^^^^^^^ - -https://ipwhois.readthedocs.io/en/dev - -Examples --------- - -https://github.com/secynic/ipwhois/tree/master/ipwhois/examples - -Github ------- - -https://github.com/secynic/ipwhois - -Pypi ----- - -https://pypi.org/project/ipwhois - -Changes -------- - -https://ipwhois.readthedocs.io/en/latest/CHANGES.html - -Upgrade Notes -------------- - -https://ipwhois.readthedocs.io/en/latest/UPGRADING.html - -Dependencies -============ - -Python 2.6:: - - dnspython - ipaddr - argparse (required only for CLI) - -Python 2.7:: - - dnspython - ipaddr - -Python 3.3+:: - - dnspython - -Installing -========== - -Latest release from PyPi:: - - pip install --upgrade ipwhois - -GitHub - Stable:: - - pip install -e git+https://github.com/secynic/ipwhois@master#egg=ipwhois - -GitHub - Dev:: - - pip install -e git+https://github.com/secynic/ipwhois@dev#egg=ipwhois - -Firewall Ports -============== - -ipwhois needs some outbound firewall ports opened from your host/server. - -:ASN (DNS): 53/tcp -:ASN (Whois): 43/tcp -:ASN (HTTP): - 80/tcp - - 443/tcp (Pending) -:RDAP (HTTP): - 80/tcp - - 443/tcp (Pending) -:NIR (HTTP): - 80/tcp - - 443/tcp (KRNIC) -:Legacy Whois: 43/tcp -:Get Host: 43/tcp - -API -=== - -IPWhois (main class) --------------------- - -ipwhois.IPWhois is the base class for wrapping RDAP and Legacy Whois lookups. -Instantiate this object, then call one of the lookup functions: - -`RDAP (HTTP) - IPWhois.lookup_rdap() <#rdap-http>`_ -OR -`Legacy Whois - IPWhois.lookup_whois() <#legacy-whois>`_ - -Input -^^^^^ - -+--------------------+--------+-----------------------------------------------+ -| **Key** |**Type**| **Description** | -+--------------------+--------+-----------------------------------------------+ -| address | str | An IPv4 or IPv6 address as a string, integer, | -| | | IPv4Address, or IPv6Address. | -+--------------------+--------+-----------------------------------------------+ -| timeout | int | The default timeout for socket connections | -| | | in seconds. Defaults to 5. | -+--------------------+--------+-----------------------------------------------+ -| proxy_opener | object | The urllib.request.OpenerDirector request for | -| | | proxy support or None. | -+--------------------+--------+-----------------------------------------------+ -| allow_permutations | bool | Allow net.Net() to use additional methods if | -| | | DNS lookups to Cymru fail. *WARNING* | -| | | deprecated in favor of new argument | -| | | asn_methods. Defaults to True. | -+--------------------+--------+-----------------------------------------------+ - -RDAP (HTTP) ------------ - -IPWhois.lookup_rdap() is the recommended lookup method. RDAP provides a -far better data structure than legacy whois and REST lookups (previous -implementation). RDAP queries allow for parsing of contact information and -details for users, organizations, and groups. RDAP also provides more detailed -network information. - -RDAP documentation: - -https://ipwhois.readthedocs.io/en/latest/RDAP.html - -Legacy Whois ------------- - -Legacy Whois documentation: - -https://ipwhois.readthedocs.io/en/latest/WHOIS.html - -National Internet Registries ----------------------------- - -This library now supports NIR lookups for JPNIC and KRNIC. Previously, Whois -and RDAP data for Japan and South Korea was restricted. NIR lookups scrape -these national registries directly for the data restricted from regional -internet registries. NIR queries are enabled by default via the inc_nir -argument in the IPWhois.lookup_*() functions. - -https://ipwhois.readthedocs.io/en/latest/NIR.html - -Autonomous System Numbers -------------------------- - -This library now supports ASN origin lookups via Whois and HTTP. - -IP ASN functionality was moved to its own parser API (IPASN). - -There is no CLI for these yet. - -https://ipwhois.readthedocs.io/en/latest/ASN.html - -Utilities ---------- - -Utilities documentation: - -https://ipwhois.readthedocs.io/en/latest/UTILS.html - -Scripts -------- - -CLI documentation: - -https://ipwhois.readthedocs.io/en/latest/CLI.html - -Experimental Functions ----------------------- - -.. caution:: - - Functions in experimental.py contain new functionality that has not yet - been widely tested. Bulk lookup support contained here can result in - significant system/network resource utilization. Additionally, abuse of - this functionality may get you banned by the various services queried by - this library. Use at your own discretion. - -Experimental functions documentation: - -https://ipwhois.readthedocs.io/en/latest/EXPERIMENTAL.html - -Contributing -============ - -https://ipwhois.readthedocs.io/en/latest/CONTRIBUTING.html - -IP Reputation Support -===================== - -This feature is under consideration. Take a look at TekDefense's Automater: - -`TekDefense-Automater `_ - -Domain Support -============== - -There are no plans for domain whois support in this project. - -Look at Sven Slootweg's -`python-whois `_ for a library with -domain support. - -Special Thanks -============== - -Thank you JetBrains for the `PyCharm `_ -open source support! - -Thank you Chris Wells (`@cdubz `_) for your -extensive testing on the experimental functions! - -Last but not least, thank you to all the issue submitters and contributors. - - -Changelog -========= - -1.0.0 (2017-07-30) ------------------- - -- Deprecated asn_alts, allow_permutations in favor of new asn_methods (#158) -- Added new exception ASNOriginLookupError (#158) -- KRNIC lookups changed to HTTPS (#166) -- Added experimental functions - get_bulk_asn_whois, bulk_lookup_rdap (#134) -- Fixed bug in NIR lookups that caused addresses with multi-line contacts to - error (#172 - kwheeles) -- Added IANA Reserved CIDR 198.97.38.0/24 to ipv4_is_defined (#174) -- Fixed bug in RDAP notices/remarks parsing that would omit partial entries - missing one or more of title, description, links (#176) -- Added new return key asn_description via verbose ASN DNS lookup support and - modified ASN whois lookups. New argument get_asn_description to disable - additional DNS lookup (#176) -- Fixed some test function naming errors -- Added new generators to utils.py: ipv4_generate_random and - ipv6_generate_random (#183) -- Moved upgrade notes to new UPGRADING.rst -- Deprecated unnecessary protected class functions, changed to public in - asn.py, nir.py, and whois.py (#184) -- net.Net.get_host(), utils.ipv4_is_defined(), and utils.ipv6_is_defined now - return namedtuple instead of tuple. -- Changed docstrings to Google standard for better napoleon parsing (#185) -- Removed deprecated IPWhois.lookup() - This was moved to - IPWhois.lookup_whois() -- Fixed 'nets'->'range' bug for legacy whois CIDR net_range values (#188) -- Fixed a bug in IPASN/Net that caused the ASN result to vary if Cymru has - more than one ASN listed for an IP (#190) -- Updated ElasticSearch example for ES v5.5.1 (#138) - -0.15.1 (2017-02-16) -------------------- - -- Fixed IPv6 parsing for ASN origin lookups and added tests (#162 - ti-mo) -- Fixed recursive role parsing at depths greater than 0 (#161 - cdubz) - -0.15.0 (2017-02-02) -------------------- - -- Python 3.3+ dnspython3 requirement changed to dnspython (#155) -- Added ASN origin lookup support (#149) -- Moved ASN parsing from net.Net.get_asn_*() to new class asn.IPASN. - The original functions now return the raw query (#157) -- net.Net.lookup_asn() is deprecated in favor of asn.IPASN.lookup() (#157) -- Added new exception ASNParseError (#157) -- Fixed rate-limiting exception handling for when HTTP errors are returned - rather than JSON errors (rikonor - #144) -- Fixed rate-limit infinite recursion bug for legacy whois (rikonor - #144) -- Fixed bug in net.Net.get_http_raw() that would pass the encoded form_data on - retry rather than the original argument. -- Removed nose requirements and fixed travis.yml for updated pip -- Documentation updates -- Code style tweaks -- Updated tests and version info for Python 3.6 -- Added basic stress tests (#144) -- Minor tweaks to existing tests - -0.14.0 (2016-08-29) -------------------- - -- Changed legacy whois emails output type to list (#133) -- Fixed retry count non-decrementing infinite loop in - ipwhois.net.Net.get_whois() (issue #125 - krader1961) -- Added new function ipwhois.net.Net.get_http_raw() and tests (#67) -- Added National Internet Registry (JPNIC, KRNIC) support (#67). Enabled by - default in IPWhois.lookup_*(). Disable by passing inc_nir=False. Optionally, - lower level code can call nir.NIRWhois(). This enhancement results in extra - network queries, but more detailed information for NIRs. -- Added utils CLI (ipwhois_utils_cli.py) - #121. Installed to your environments - Scripts dir. This is a wrapper for utils.py. -- Documentation improvements (#123) -- kw arg readability (#115) -- Replaced usage of args with script_args in ipwhois_cli.py -- Minor optimization in whois.py and online/test_whois.py -- Added coveralls integration and re-enabled online tests with Travis CI -- Added Read the Docs support (#132) -- Added documentation (Sphinx) requirements.txt (#132) -- Fixed test imports -- Added --json argument (output in JSON format) to ipwhois_cli.py (#135) - -0.13.0 (2016-04-18) -------------------- - -- Added events_actor parsing for RDAP results. -- Added example for caching data via Redis (#81) -- Added normalization (human-readable field information) in hr.py (#47) -- README word wrap fix (#102) -- Fixed bug in exception handling for ASN HTTP lookups. -- Fixed bug in IPWhois.lookup_rdap() that caused ASN HTTP lookup responses to - be used in place of RDAP responses. -- Added new function Net.get_asn_http() and migrated code from - Net.lookup_asn() + new tests. -- Fixed bug in ASN HTTP fallback lookups for DNIC (#108). -- Added new parameter extra_org_map in Net.get_asn_http(), Net.lookup_asn(), - and IPWhois.lookup*() (#108). -- Fixed _RDAPCommon.summarize_notices() None check - changed len() to all(). -- Added CLI (ipwhois_cli.py) - #46. Installed to your environments Scripts dir. - This is a wrapper for ipwhois.py (IPWhois). Utils CLI will be in a future - release (#121). -- Documentation split up and added more detail (#81). - -0.12.0 (2016-03-28) -------------------- - -- Added headers parameter to ipwhois.Net.get_http_json() (issue #98). -- Fixed ASN HTTP lookup (fallback) Accept headers (issue #98). -- Fixed HTTP decoding, set to utf-8 (italomaia - issue #97) -- IPWhois.lookup() deprecated (issue #96), and will be removed in a future - release (TBD). Use IPWhois.lookup_whois() instead. -- Added rate_limit_timeout parameter (issue #99) to Net.get_http_json(), - IPWhois.lookup_rdap(), and RDAP.lookup(). New exception HTTPRateLimitError. -- Added new parameter asn_alts to Net.lookup_asn(), IPWhois.lookup_rdap() and - IPWhois.lookup(). Takes a list of lookup types to attempt if the - ASN dns lookup fails. Allow permutations must be enabled. Defaults to all - ['whois', 'http'] (issue #93). -- Fixed socket exception handling in Net.get_http_json() for Python 2.6. -- Fixed assertIsInstance for Python 2.6 tests (issue #100). Implemented - unittest._formatMessage and unittest.util.safe_repr for Python 2.6. -- Moved TestCommon to tests\\__init__.py to avoid duplicate code. -- Replaced remaining % with str.format (issue #95). - -0.11.2 (2016-02-25) -------------------- - -- Added allow_permutations parameter (bool) to net.Net() and ipwhois.IPWhois() - to allow alternate ASN lookups if DNS lookups fail. (FirefighterBlu3) -- Fixed ASN DNS resolver timeout/retry_count support. Retry count is used as a - multiplier of timeout, to determine a limetime interval. (FirefighterBlu3) -- Fixed bug where remarks would return None if missing a title. -- Added CONTRIBUTING.rst -- Added tests - -0.11.1 (2015-12-17) -------------------- - -- Re-added CIDR calculation for RDAP lookups. -- Improved tests - core code coverage now 100%. See '# pragma: no cover' for - exclusions. A few bugs were identified in the process, detailed below. -- Moved IP zero stripping from rdap._RDAPNetwork.parse() to new helper function - utils.ipv4_lstrip_zeros(). -- Moved CIDR calculation from rdap._RDAPNetwork.parse() to new helper function - utils.calculate_cidr(). -- Fixed utils.ipv4_is_defined() if statement ordering for RFC 1918 conflict. -- Fixed utils.ipv6_is_defined() if statement ordering for Unspecified and - Loopback (conflict with Reserved). -- Added is_offline parameter to whois.Whois.lookup() primarily for testing. -- Fixed bug in whois.Whois._parse_fields() that attempted to parse 'val2' of - regex, which is no longer used. Also fixed the expected Exception to be - IndexError. -- Fixed bug in ipwhois.IPWhois.lookup() where the argument order was mixed up, - causing referral lookups to be skipped when get_referral=True. -- Fixed bug in rdap._RDAPCommon.summarize_notices() output for links. -- Fixed bug in root entity iteration exception handling in rdap.RDAP.lookup(). - -0.11.0 (2015-11-02) -------------------- - -- Support for REST lookups replaced with RDAP. -- Split code for a more structured system (net, whois, rdap, exceptions). -- Tests match the data new structure. -- Split tests for online and offline testing. -- Performance enhancements for parsing. -- Added an optional bootstrap parameter for RDAP lookups, in order to replace - ASN lookups or use both. Will default to False. Afrinic is currently not - supported, so I would not use this for now. ARIN acknowledged my issue - for this, and will be adding support back in for Afrinic bootstrap. -- Added field_list parameter (inclusion list) for WHOIS lookups. -- Added logging. -- Added examples directory. - -0.10.3 (2015-08-14) -------------------- - -- Fixed LACNIC lookup_rws() queries, since they switched to RDAP. This is - temporary to get it working until the major library transition to RDAP and - new parsed formatting is complete. - -0.10.2 (2015-05-19) -------------------- - -- Fixed APNIC parsing for updated field. -- Fixed datetime parsing and validation when Zulu (Z) is appended. -- Added RIPE parsing for created and updated fields (whois and RWS). -- Removed unnecessary parentheses in IPWhois class declaration. -- Some documentation and comment tweaking to work with Sphinx. -- Minor PEP 8 tweaks. - -0.10.1 (2015-02-09) -------------------- - -- Fixed setup.py bug. - -0.10.0 (2015-02-09) -------------------- - -- Added .csv support for country code source. You can no longer download - country code information from iso.org. -- Added support for IPv4Address or IPv6Address as the address arg in IPWhois. -- Fixed file open encoding bug. Moved from open to io.open. -- Fixed parameter in IPWhois ip defined checks. -- Fixed TestIPWhois.test_ip_invalid() assertions. - diff --git a/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/RECORD b/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/RECORD deleted file mode 100644 index 5ef41e1..0000000 --- a/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/RECORD +++ /dev/null @@ -1,35 +0,0 @@ -../../../bin/__pycache__/ipwhois_cli.cpython-37.pyc,, -../../../bin/__pycache__/ipwhois_utils_cli.cpython-37.pyc,, -../../../bin/ipwhois_cli.py,sha256=a0lwRXpqOfLGfwh-nJz4DN6whYTuTsfMFCfEBHiHE-A,55038 -../../../bin/ipwhois_utils_cli.py,sha256=jslJNW3P7UTCICoXuYuQwT-54GUYmDVXQOWLthHmORI,8656 -ipwhois-1.0.0.dist-info/DESCRIPTION.rst,sha256=7o6HwNJv0917--N8hj5BvocWFjzJxUn4KO8g8fMQIjA,17221 -ipwhois-1.0.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 -ipwhois-1.0.0.dist-info/METADATA,sha256=Pb9qUi-QPn0Gc-VxuLIjT07r9MAIXs_Z1aT0mw92G7I,18650 -ipwhois-1.0.0.dist-info/RECORD,, -ipwhois-1.0.0.dist-info/WHEEL,sha256=9Z5Xm-eel1bTS7e6ogYiKz0zmPEqDwIypurdHN1hR40,116 -ipwhois-1.0.0.dist-info/metadata.json,sha256=_KPnHen51YlAxxSUQBGdVU7qYwgIWonI0ghxm4R_GxU,1646 -ipwhois-1.0.0.dist-info/top_level.txt,sha256=Rk_3xKIClsg-roGROLi8TYR4zo_8K6grqAKvL_O9ad8,8 -ipwhois/__init__.py,sha256=jPf4qFf_oefS_IXNaBi-Sv4heAscRtzj2rspLTuMAKI,1473 -ipwhois/__pycache__/__init__.cpython-37.pyc,, -ipwhois/__pycache__/asn.cpython-37.pyc,, -ipwhois/__pycache__/exceptions.cpython-37.pyc,, -ipwhois/__pycache__/experimental.cpython-37.pyc,, -ipwhois/__pycache__/hr.cpython-37.pyc,, -ipwhois/__pycache__/ipwhois.cpython-37.pyc,, -ipwhois/__pycache__/net.cpython-37.pyc,, -ipwhois/__pycache__/nir.cpython-37.pyc,, -ipwhois/__pycache__/rdap.cpython-37.pyc,, -ipwhois/__pycache__/utils.cpython-37.pyc,, -ipwhois/__pycache__/whois.cpython-37.pyc,, -ipwhois/asn.py,sha256=-3O72RFaBEaqZEdS4raoKM9n08I2sfogP5_oVcnSLhw,32339 -ipwhois/data/iso_3166-1.csv,sha256=O_whGbkO5HNp_ziuV91LhRLG6tSr8QYppzjagx-i1kE,4264 -ipwhois/data/iso_3166-1_list_en.xml,sha256=eLlDUEmUp8rRSIfL-7lxy2PmNsMyH53ot972MtIH0Ss,48718 -ipwhois/exceptions.py,sha256=VyF7DIBWov81iapkkQMRVWuSq86u_Fvo_1SPR0wh5MA,3528 -ipwhois/experimental.py,sha256=iEvv8DeTwM8Nrk12ud1ZSUsHoz_5LZ0kMKTTdyWot0g,18218 -ipwhois/hr.py,sha256=lGV1CTcjB0SLALJQxC6cvZh1fRzIChUx3S8wDbZ5LRs,18692 -ipwhois/ipwhois.py,sha256=sAARLxVJ1eS2DdH295Y17v0tbh2XM25rofpkQbYUvy0,16403 -ipwhois/net.py,sha256=PMNDaLeEemO8SV573rg_OYqvpCK1SKkfFEHG1KqZPLM,33339 -ipwhois/nir.py,sha256=UTLmksBP0ofiwYBKdDvYVKOK10DBug4YwfIrggH23sc,23819 -ipwhois/rdap.py,sha256=MD8-6gFqiiKjpvUnsK4lOBcwRAowu7fMf_jL2nxGE3U,25179 -ipwhois/utils.py,sha256=qY9NzqSClrg9Pc12TlyR63Le6OIV_rLlGMD8hwKGkzI,19201 -ipwhois/whois.py,sha256=kQibhvHbforGDOk83GUpLHI5nz3_INXoYZHutXuJ-7k,27642 diff --git a/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/WHEEL b/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/WHEEL deleted file mode 100644 index ab4a09e..0000000 --- a/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/WHEEL +++ /dev/null @@ -1,6 +0,0 @@ -Wheel-Version: 1.0 -Generator: bdist_wheel (0.29.0) -Root-Is-Purelib: true -Tag: py2-none-any -Tag: py3-none-any - diff --git a/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/metadata.json b/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/metadata.json deleted file mode 100644 index 9f77592..0000000 --- a/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"classifiers": ["Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet", "Topic :: Software Development"], "download_url": "https://github.com/secynic/ipwhois/tarball/master", "extensions": {"python.details": {"contacts": [{"email": "secynic@gmail.com", "name": "Philip Hane", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "https://github.com/secynic/ipwhois"}}}, "extras": [], "generator": "bdist_wheel (0.29.0)", "keywords": ["Python", "WHOIS", "RWhois", "Referral", "Whois", "ASN", "IP", "Address", "IP", "IPv4", "IPv6", "IETF", "REST", "Arin", "Ripe", "Apnic", "Lacnic", "Afrinic", "NIC", "National", "Information", "Center", "RDAP", "RIR", "Regional", "Internet", "RegistryNIR", "National", "Internet", "Registry", "ASN", "origin", "Origin"], "license": "BSD", "metadata_version": "2.0", "name": "ipwhois", "run_requires": [{"requires": ["dnspython"]}, {"environment": "python_version < \"3.3\"", "requires": ["ipaddr"]}], "summary": "Retrieve and parse whois data for IPv4 and IPv6 addresses.", "version": "1.0.0"} \ No newline at end of file diff --git a/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/top_level.txt b/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/top_level.txt deleted file mode 100644 index f2590b2..0000000 --- a/env/lib/python3.7/site-packages/ipwhois-1.0.0.dist-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -ipwhois diff --git a/env/lib/python3.7/site-packages/ipwhois/__init__.py b/env/lib/python3.7/site-packages/ipwhois/__init__.py index e9103f8..bc3e6de 100644 --- a/env/lib/python3.7/site-packages/ipwhois/__init__.py +++ b/env/lib/python3.7/site-packages/ipwhois/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2013-2017 Philip Hane +# Copyright (c) 2013-2019 Philip Hane # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -26,4 +26,4 @@ from .exceptions import * from .net import Net from .ipwhois import IPWhois -__version__ = '1.0.0' +__version__ = '1.1.0' diff --git a/env/lib/python3.7/site-packages/ipwhois/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/ipwhois/__pycache__/__init__.cpython-37.pyc index a547e95..57ee300 100644 Binary files a/env/lib/python3.7/site-packages/ipwhois/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/ipwhois/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/ipwhois/__pycache__/asn.cpython-37.pyc b/env/lib/python3.7/site-packages/ipwhois/__pycache__/asn.cpython-37.pyc index 2bade14..7e189cc 100644 Binary files a/env/lib/python3.7/site-packages/ipwhois/__pycache__/asn.cpython-37.pyc and b/env/lib/python3.7/site-packages/ipwhois/__pycache__/asn.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/ipwhois/__pycache__/exceptions.cpython-37.pyc b/env/lib/python3.7/site-packages/ipwhois/__pycache__/exceptions.cpython-37.pyc index 1a16e91..d710d2b 100644 Binary files a/env/lib/python3.7/site-packages/ipwhois/__pycache__/exceptions.cpython-37.pyc and b/env/lib/python3.7/site-packages/ipwhois/__pycache__/exceptions.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/ipwhois/__pycache__/experimental.cpython-37.pyc b/env/lib/python3.7/site-packages/ipwhois/__pycache__/experimental.cpython-37.pyc index 2739044..ce2615b 100644 Binary files a/env/lib/python3.7/site-packages/ipwhois/__pycache__/experimental.cpython-37.pyc and b/env/lib/python3.7/site-packages/ipwhois/__pycache__/experimental.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/ipwhois/__pycache__/hr.cpython-37.pyc b/env/lib/python3.7/site-packages/ipwhois/__pycache__/hr.cpython-37.pyc index 43ea5af..08fab05 100644 Binary files a/env/lib/python3.7/site-packages/ipwhois/__pycache__/hr.cpython-37.pyc and b/env/lib/python3.7/site-packages/ipwhois/__pycache__/hr.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/ipwhois/__pycache__/ipwhois.cpython-37.pyc b/env/lib/python3.7/site-packages/ipwhois/__pycache__/ipwhois.cpython-37.pyc index 386d5a8..e6b67e2 100644 Binary files a/env/lib/python3.7/site-packages/ipwhois/__pycache__/ipwhois.cpython-37.pyc and b/env/lib/python3.7/site-packages/ipwhois/__pycache__/ipwhois.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/ipwhois/__pycache__/net.cpython-37.pyc b/env/lib/python3.7/site-packages/ipwhois/__pycache__/net.cpython-37.pyc index 2e34614..239396d 100644 Binary files a/env/lib/python3.7/site-packages/ipwhois/__pycache__/net.cpython-37.pyc and b/env/lib/python3.7/site-packages/ipwhois/__pycache__/net.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/ipwhois/__pycache__/nir.cpython-37.pyc b/env/lib/python3.7/site-packages/ipwhois/__pycache__/nir.cpython-37.pyc index 590dfbb..5611da8 100644 Binary files a/env/lib/python3.7/site-packages/ipwhois/__pycache__/nir.cpython-37.pyc and b/env/lib/python3.7/site-packages/ipwhois/__pycache__/nir.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/ipwhois/__pycache__/rdap.cpython-37.pyc b/env/lib/python3.7/site-packages/ipwhois/__pycache__/rdap.cpython-37.pyc index 189bc4f..4af57b4 100644 Binary files a/env/lib/python3.7/site-packages/ipwhois/__pycache__/rdap.cpython-37.pyc and b/env/lib/python3.7/site-packages/ipwhois/__pycache__/rdap.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/ipwhois/__pycache__/utils.cpython-37.pyc b/env/lib/python3.7/site-packages/ipwhois/__pycache__/utils.cpython-37.pyc index 3371b48..32c6d2e 100644 Binary files a/env/lib/python3.7/site-packages/ipwhois/__pycache__/utils.cpython-37.pyc and b/env/lib/python3.7/site-packages/ipwhois/__pycache__/utils.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/ipwhois/__pycache__/whois.cpython-37.pyc b/env/lib/python3.7/site-packages/ipwhois/__pycache__/whois.cpython-37.pyc index 0238737..fbf5732 100644 Binary files a/env/lib/python3.7/site-packages/ipwhois/__pycache__/whois.cpython-37.pyc and b/env/lib/python3.7/site-packages/ipwhois/__pycache__/whois.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/ipwhois/asn.py b/env/lib/python3.7/site-packages/ipwhois/asn.py index 1b33c1e..d73b477 100644 --- a/env/lib/python3.7/site-packages/ipwhois/asn.py +++ b/env/lib/python3.7/site-packages/ipwhois/asn.py @@ -1,4 +1,4 @@ -# Copyright (c) 2013-2017 Philip Hane +# Copyright (c) 2013-2019 Philip Hane # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -371,7 +371,7 @@ class IPASN: log.debug('No networks found') net_list = [] - for n in net_list: + for n in reversed(net_list): try: @@ -383,10 +383,15 @@ class IPASN: log.debug('Could not parse ASN registry via HTTP: ' '{0}'.format(str(e))) - raise ASNRegistryError('ASN registry lookup failed.') + continue break + if not asn_data['asn_registry']: + + log.debug('Could not parse ASN registry via HTTP') + raise ASNRegistryError('ASN registry lookup failed.') + except ASNRegistryError: raise @@ -475,9 +480,7 @@ class IPASN: else: - # Python 2.6 doesn't support set literal expressions, use explicit - # set() instead. - if set(['dns', 'whois', 'http']).isdisjoint(asn_methods): + if {'dns', 'whois', 'http'}.isdisjoint(asn_methods): raise ValueError('methods argument requires at least one of ' 'dns, whois, http.') @@ -508,7 +511,7 @@ class IPASN: asn_data_list = [] for asn_entry in response: - asn_data_list.append(self._parse_fields_dns( + asn_data_list.append(self.parse_fields_dns( str(asn_entry))) # Iterate through the parsed ASN results to find the @@ -541,7 +544,7 @@ class IPASN: try: response = self._net.get_asn_whois(retry_count) - asn_data = self._parse_fields_whois( + asn_data = self.parse_fields_whois( response) # pragma: no cover break @@ -557,7 +560,7 @@ class IPASN: response = self._net.get_asn_http( retry_count=retry_count ) - asn_data = self._parse_fields_http(response, + asn_data = self.parse_fields_http(response, extra_org_map) break @@ -839,9 +842,7 @@ class ASNOrigin: else: - # Python 2.6 doesn't support set literal expressions, use explicit - # set() instead. - if set(['whois', 'http']).isdisjoint(asn_methods): + if {'whois', 'http'}.isdisjoint(asn_methods): raise ValueError('methods argument requires at least one of ' 'whois, http.') @@ -915,7 +916,7 @@ class ASNOrigin: results['raw'] = response nets = [] - nets_response = self._get_nets_radb(response, is_http) + nets_response = self.get_nets_radb(response, is_http) nets.extend(nets_response) @@ -935,7 +936,7 @@ class ASNOrigin: section_end = nets[index + 1]['start'] - temp_net = self._parse_fields( + temp_net = self.parse_fields( response, fields['radb']['fields'], section_end, diff --git a/env/lib/python3.7/site-packages/ipwhois/exceptions.py b/env/lib/python3.7/site-packages/ipwhois/exceptions.py index 5e2f78a..7a0c77f 100644 --- a/env/lib/python3.7/site-packages/ipwhois/exceptions.py +++ b/env/lib/python3.7/site-packages/ipwhois/exceptions.py @@ -1,4 +1,4 @@ -# Copyright (c) 2013-2017 Philip Hane +# Copyright (c) 2013-2019 Philip Hane # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -23,83 +23,89 @@ # POSSIBILITY OF SUCH DAMAGE. -class NetError(Exception): +class BaseIpwhoisException(Exception): + """ + Base exception for all the ipwhois custom ones. + """ + + +class NetError(BaseIpwhoisException): """ An Exception for when a parameter provided is not an instance of ipwhois.net.Net. """ -class IPDefinedError(Exception): +class IPDefinedError(BaseIpwhoisException): """ An Exception for when the IP is defined (does not need to be resolved). """ -class ASNLookupError(Exception): +class ASNLookupError(BaseIpwhoisException): """ An Exception for when the ASN lookup failed. """ -class ASNRegistryError(Exception): +class ASNRegistryError(BaseIpwhoisException): """ An Exception for when the ASN registry does not match one of the five expected values (arin, ripencc, apnic, lacnic, afrinic). """ -class ASNParseError(Exception): +class ASNParseError(BaseIpwhoisException): """ An Exception for when the ASN parsing failed. """ -class ASNOriginLookupError(Exception): +class ASNOriginLookupError(BaseIpwhoisException): """ An Exception for when the ASN origin lookup failed. """ -class HostLookupError(Exception): +class HostLookupError(BaseIpwhoisException): """ An Exception for when the host lookup failed. """ -class BlacklistError(Exception): +class BlacklistError(BaseIpwhoisException): """ An Exception for when the server is in a blacklist. """ -class WhoisLookupError(Exception): +class WhoisLookupError(BaseIpwhoisException): """ An Exception for when the whois lookup failed. """ -class WhoisRateLimitError(Exception): +class WhoisRateLimitError(BaseIpwhoisException): """ An Exception for when Whois queries exceed the NIC's request limit and have exhausted all retries. """ -class HTTPLookupError(Exception): +class HTTPLookupError(BaseIpwhoisException): """ An Exception for when the RDAP lookup failed. """ -class HTTPRateLimitError(Exception): +class HTTPRateLimitError(BaseIpwhoisException): """ An Exception for when HTTP queries exceed the NIC's request limit and have exhausted all retries. """ -class InvalidEntityContactObject(Exception): +class InvalidEntityContactObject(BaseIpwhoisException): """ An Exception for when JSON output is not an RDAP entity contact information object: @@ -107,14 +113,14 @@ class InvalidEntityContactObject(Exception): """ -class InvalidNetworkObject(Exception): +class InvalidNetworkObject(BaseIpwhoisException): """ An Exception for when JSON output is not an RDAP network object: https://tools.ietf.org/html/rfc7483#section-5.4 """ -class InvalidEntityObject(Exception): +class InvalidEntityObject(BaseIpwhoisException): """ An Exception for when JSON output is not an RDAP entity object: https://tools.ietf.org/html/rfc7483#section-5.1 diff --git a/env/lib/python3.7/site-packages/ipwhois/experimental.py b/env/lib/python3.7/site-packages/ipwhois/experimental.py index 23261a3..c9fc4ac 100644 --- a/env/lib/python3.7/site-packages/ipwhois/experimental.py +++ b/env/lib/python3.7/site-packages/ipwhois/experimental.py @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Philip Hane +# Copyright (c) 2017-2019 Philip Hane # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/env/lib/python3.7/site-packages/ipwhois/hr.py b/env/lib/python3.7/site-packages/ipwhois/hr.py index 43ba82f..6220d71 100644 --- a/env/lib/python3.7/site-packages/ipwhois/hr.py +++ b/env/lib/python3.7/site-packages/ipwhois/hr.py @@ -1,4 +1,4 @@ -# Copyright (c) 2013-2017 Philip Hane +# Copyright (c) 2013-2019 Philip Hane # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/env/lib/python3.7/site-packages/ipwhois/ipwhois.py b/env/lib/python3.7/site-packages/ipwhois/ipwhois.py index 0839143..778a582 100644 --- a/env/lib/python3.7/site-packages/ipwhois/ipwhois.py +++ b/env/lib/python3.7/site-packages/ipwhois/ipwhois.py @@ -1,4 +1,4 @@ -# Copyright (c) 2013-2017 Philip Hane +# Copyright (c) 2013-2019 Philip Hane # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -48,7 +48,7 @@ class IPWhois: """ def __init__(self, address, timeout=5, proxy_opener=None, - allow_permutations=True): + allow_permutations=False): self.net = Net( address=address, timeout=timeout, proxy_opener=proxy_opener, diff --git a/env/lib/python3.7/site-packages/ipwhois/net.py b/env/lib/python3.7/site-packages/ipwhois/net.py index 01cbe3d..b2b1095 100644 --- a/env/lib/python3.7/site-packages/ipwhois/net.py +++ b/env/lib/python3.7/site-packages/ipwhois/net.py @@ -1,4 +1,4 @@ -# Copyright (c) 2013-2017 Philip Hane +# Copyright (c) 2013-2019 Philip Hane # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -113,7 +113,7 @@ class Net: """ def __init__(self, address, timeout=5, proxy_opener=None, - allow_permutations=True): + allow_permutations=False): # IPv4Address or IPv6Address if isinstance(address, IPv4Address) or isinstance( @@ -223,7 +223,7 @@ class Net: """ Temporary wrapper for IP ASN lookups (moved to asn.IPASN.lookup()). This will be removed in a future - release (1.0.0). + release (1.1.0). """ from warnings import warn diff --git a/env/lib/python3.7/site-packages/ipwhois/nir.py b/env/lib/python3.7/site-packages/ipwhois/nir.py index e04fcde..fc7a49a 100644 --- a/env/lib/python3.7/site-packages/ipwhois/nir.py +++ b/env/lib/python3.7/site-packages/ipwhois/nir.py @@ -1,4 +1,4 @@ -# Copyright (c) 2013-2017 Philip Hane +# Copyright (c) 2013-2019 Philip Hane # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -483,7 +483,7 @@ class NIRWhois: request_type=NIR_WHOIS[nir]['request_type'] ) - return self._parse_fields( + return self.parse_fields( response=contact_response, fields_dict=NIR_WHOIS[nir]['contact_fields'], dt_format=dt_format, @@ -582,11 +582,11 @@ class NIRWhois: nets_response = None if nir == 'jpnic': - nets_response = self._get_nets_jpnic(response) + nets_response = self.get_nets_jpnic(response) elif nir == 'krnic': - nets_response = self._get_nets_krnic(response) + nets_response = self.get_nets_krnic(response) nets.extend(nets_response) @@ -609,7 +609,7 @@ class NIRWhois: dt_format = None - temp_net = self._parse_fields( + temp_net = self.parse_fields( response=response, fields_dict=NIR_WHOIS[nir]['fields'], net_start=section_end, @@ -659,7 +659,7 @@ class NIRWhois: tmp_response = None tmp_handle = contact - temp_net['contacts'][key] = self._get_contact( + temp_net['contacts'][key] = self.get_contact( response=tmp_response, handle=tmp_handle, nir=nir, diff --git a/env/lib/python3.7/site-packages/ipwhois/rdap.py b/env/lib/python3.7/site-packages/ipwhois/rdap.py index 4b16dca..4a44b3a 100644 --- a/env/lib/python3.7/site-packages/ipwhois/rdap.py +++ b/env/lib/python3.7/site-packages/ipwhois/rdap.py @@ -1,4 +1,4 @@ -# Copyright (c) 2013-2017 Philip Hane +# Copyright (c) 2013-2019 Philip Hane # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/env/lib/python3.7/site-packages/ipwhois/utils.py b/env/lib/python3.7/site-packages/ipwhois/utils.py index 98da43d..8fd94d9 100644 --- a/env/lib/python3.7/site-packages/ipwhois/utils.py +++ b/env/lib/python3.7/site-packages/ipwhois/utils.py @@ -1,4 +1,4 @@ -# Copyright (c) 2013-2017 Philip Hane +# Copyright (c) 2013-2019 Philip Hane # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/env/lib/python3.7/site-packages/ipwhois/whois.py b/env/lib/python3.7/site-packages/ipwhois/whois.py index 3cd830d..f3f6333 100644 --- a/env/lib/python3.7/site-packages/ipwhois/whois.py +++ b/env/lib/python3.7/site-packages/ipwhois/whois.py @@ -1,4 +1,4 @@ -# Copyright (c) 2013-2017 Philip Hane +# Copyright (c) 2013-2019 Philip Hane # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -740,7 +740,7 @@ class Whois: results['raw_referral'] = response_ref - temp_rnet = self._parse_fields( + temp_rnet = self.parse_fields( response_ref, RWHOIS['fields'], field_list=field_list @@ -758,15 +758,15 @@ class Whois: if asn_data['asn_registry'] == 'arin': - nets_response = self._get_nets_arin(response) + nets_response = self.get_nets_arin(response) elif asn_data['asn_registry'] == 'lacnic': - nets_response = self._get_nets_lacnic(response) + nets_response = self.get_nets_lacnic(response) else: - nets_response = self._get_nets_other(response) + nets_response = self.get_nets_other(response) nets.extend(nets_response) @@ -788,7 +788,7 @@ class Whois: dt_format = None - temp_net = self._parse_fields( + temp_net = self.parse_fields( response, RIR_WHOIS[asn_data['asn_registry']]['fields'], section_end, diff --git a/env/lib/python3.7/site-packages/pip-18.1.dist-info/INSTALLER b/env/lib/python3.7/site-packages/pip-18.1.dist-info/INSTALLER deleted file mode 100644 index a1b589e..0000000 --- a/env/lib/python3.7/site-packages/pip-18.1.dist-info/INSTALLER +++ /dev/null @@ -1 +0,0 @@ -pip diff --git a/env/lib/python3.7/site-packages/pip-18.1.dist-info/LICENSE.txt b/env/lib/python3.7/site-packages/pip-18.1.dist-info/LICENSE.txt deleted file mode 100644 index d3379fa..0000000 --- a/env/lib/python3.7/site-packages/pip-18.1.dist-info/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2008-2018 The pip developers (see AUTHORS.txt file) - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/env/lib/python3.7/site-packages/pip-18.1.dist-info/METADATA b/env/lib/python3.7/site-packages/pip-18.1.dist-info/METADATA deleted file mode 100644 index 2e314aa..0000000 --- a/env/lib/python3.7/site-packages/pip-18.1.dist-info/METADATA +++ /dev/null @@ -1,70 +0,0 @@ -Metadata-Version: 2.1 -Name: pip -Version: 18.1 -Summary: The PyPA recommended tool for installing Python packages. -Home-page: https://pip.pypa.io/ -Author: The pip developers -Author-email: pypa-dev@groups.google.com -License: MIT -Keywords: distutils easy_install egg setuptools wheel virtualenv -Platform: UNKNOWN -Classifier: Development Status :: 5 - Production/Stable -Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: MIT License -Classifier: Topic :: Software Development :: Build Tools -Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.4 -Classifier: Programming Language :: Python :: 3.5 -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 -Classifier: Programming Language :: Python :: Implementation :: CPython -Classifier: Programming Language :: Python :: Implementation :: PyPy -Requires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.* - -pip -=== - -The `PyPA recommended`_ tool for installing Python packages. - -.. image:: https://img.shields.io/pypi/v/pip.svg - :target: https://pypi.org/project/pip/ - -.. image:: https://img.shields.io/travis/pypa/pip/master.svg?label=travis-ci - :target: https://travis-ci.org/pypa/pip - -.. image:: https://img.shields.io/appveyor/ci/pypa/pip.svg?label=appveyor-ci - :target: https://ci.appveyor.com/project/pypa/pip/history - -.. image:: https://readthedocs.org/projects/pip/badge/?version=latest - :target: https://pip.pypa.io/en/latest - -* `Installation`_ -* `Documentation`_ -* `Changelog`_ -* `GitHub Page`_ -* `Issue Tracking`_ -* `User mailing list`_ -* `Dev mailing list`_ -* User IRC: #pypa on Freenode. -* Dev IRC: #pypa-dev on Freenode. - -Code of Conduct ---------------- - -Everyone interacting in the pip project's codebases, issue trackers, chat -rooms and mailing lists is expected to follow the `PyPA Code of Conduct`_. - -.. _PyPA recommended: https://packaging.python.org/en/latest/current/ -.. _Installation: https://pip.pypa.io/en/stable/installing.html -.. _Documentation: https://pip.pypa.io/en/stable/ -.. _Changelog: https://pip.pypa.io/en/stable/news.html -.. _GitHub Page: https://github.com/pypa/pip -.. _Issue Tracking: https://github.com/pypa/pip/issues -.. _User mailing list: https://groups.google.com/forum/#!forum/python-virtualenv -.. _Dev mailing list: https://groups.google.com/forum/#!forum/pypa-dev -.. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/ - - diff --git a/env/lib/python3.7/site-packages/pip-18.1.dist-info/RECORD b/env/lib/python3.7/site-packages/pip-18.1.dist-info/RECORD deleted file mode 100644 index 739feb3..0000000 --- a/env/lib/python3.7/site-packages/pip-18.1.dist-info/RECORD +++ /dev/null @@ -1,614 +0,0 @@ -pip/__init__.py,sha256=nO-iphoXiDoci_ZAMl-PG2zdd4Y7m88jBDILTYzwGy4,21 -pip/__main__.py,sha256=L3IHqBeasELUHvwy5CT_izVEMhM12tve289qut49DvU,623 -pip/_internal/__init__.py,sha256=b0jSFCCViGhB1RWni35_NMkH3Y-mbZrV648DGMagDjs,2869 -pip/_internal/build_env.py,sha256=zKhqmDMnrX5OTSNQ4xBw-mN5mTGVu6wjiNFW-ajWYEI,4797 -pip/_internal/cache.py,sha256=96_aKtDbwgLEVNgNabOT8GrFCYZEACedoiucqU5ccg8,6829 -pip/_internal/configuration.py,sha256=KMgG3ufFrUKX_QESi2cMVvFi47tl845Bg1ZkNthlWik,13243 -pip/_internal/download.py,sha256=c5Hkimq39eJdZ6DN0_0etjK43-0a5CK_W_3sVLqH87g,33300 -pip/_internal/exceptions.py,sha256=EIGotnq6qM2nbGtnlgZ8Xp5VfP2W4-9UOCzQGMwy5MY,8899 -pip/_internal/index.py,sha256=6CAtZ8QTLcpw0fJqQ9OPu-Os1ettLZtVY1pPSKia8r8,34789 -pip/_internal/locations.py,sha256=ujNrLnA04Y_EmSriO0nS6qkkw_BkPfobB_hdwIDPvpM,6307 -pip/_internal/pep425tags.py,sha256=TQhxOPss4RjxgyVgxpSRe31HaTcWmn-LVjWBbkvkjzk,10845 -pip/_internal/pyproject.py,sha256=fpO52MCa3w5xSlXIBXw39BDTGzP8G4570EW34hVvIKQ,5481 -pip/_internal/resolve.py,sha256=tdepxCewsXXNFKSIYGSxiLvzi1xCv7UVFT9jRCDO90A,13578 -pip/_internal/wheel.py,sha256=fg9E936DaI1LyrBPHqtzHG_WEVyuUwipHISkD6N3jNw,32007 -pip/_internal/cli/__init__.py,sha256=FkHBgpxxb-_gd6r1FjnNhfMOzAUYyXoXKJ6abijfcFU,132 -pip/_internal/cli/autocompletion.py,sha256=ptvsMdGjq42pzoY4skABVF43u2xAtLJlXAulPi-A10Y,6083 -pip/_internal/cli/base_command.py,sha256=ke6af4iWzrZoc3HtiPKnCZJvD6GlX8dRwBwpFCg1axc,9963 -pip/_internal/cli/cmdoptions.py,sha256=WoPPY1uHsDjA_NvZek8Mko38rxraD3pX8eZUkNKvk10,19468 -pip/_internal/cli/main_parser.py,sha256=Ga_kT7if-Gg0rmmRqlGEHW6JWVm9zwzO7igJm6RE9EI,2763 -pip/_internal/cli/parser.py,sha256=VZKUKJPbU6I2cHPLDOikin-aCx7OvLcZ3fzYp3xytd8,9378 -pip/_internal/cli/status_codes.py,sha256=F6uDG6Gj7RNKQJUDnd87QKqI16Us-t-B0wPF_4QMpWc,156 -pip/_internal/commands/__init__.py,sha256=CQAzhVx9ViPtqLNUvAeqnKj5iWfFEcqMx5RlZWjJ30c,2251 -pip/_internal/commands/check.py,sha256=CyeYH2kfDKSGSURoBfWtx-sTcZZQP-bK170NmKYlmsg,1398 -pip/_internal/commands/completion.py,sha256=hqvCvoxsIHjysiD7olHKTqK2lzE1_lS6LWn69kN5qyI,2929 -pip/_internal/commands/configuration.py,sha256=265HWuUxPggCNcIeWHA3p-LDDiRVnexwFgwmHGgWOHY,7125 -pip/_internal/commands/download.py,sha256=D_iGMp3xX2iD7KZYZAjXlYT3rf3xjwxyYe05KE-DVzE,6514 -pip/_internal/commands/freeze.py,sha256=VvS3G0wrm_9BH3B7Ex5msLL_1UQTtCq5G8dDI63Iemo,3259 -pip/_internal/commands/hash.py,sha256=K1JycsD-rpjqrRcL_ijacY9UKmI82pQcLYq4kCM4Pv0,1681 -pip/_internal/commands/help.py,sha256=MwBhPJpW1Dt3GfJV3V8V6kgAy_pXT0jGrZJB1wCTW-E,1090 -pip/_internal/commands/install.py,sha256=tKyzfo5bhDGLVTTQCQJ9PFnDjimQvEWnwIAI2XHpaac,21039 -pip/_internal/commands/list.py,sha256=n740MsR0cG34EuvGWMzdVl0uIA3UIYx1_95FUsTktN0,10272 -pip/_internal/commands/search.py,sha256=sLZ9icKMEEGekHvzRRZMiTd1zCFIZeDptyyU1mQCYzk,4728 -pip/_internal/commands/show.py,sha256=9EVh86vY0NZdlhT-wsuV-zq_MAV6qqV4S1Akn3wkUuw,6289 -pip/_internal/commands/uninstall.py,sha256=h0gfPF5jylDESx_IHgF6bZME7QAEOHzQHdn65GP-jrE,2963 -pip/_internal/commands/wheel.py,sha256=ZuVf_DMpKCUzBVstolvQPAeajQRC51Oky5_hDHzhhFs,7020 -pip/_internal/models/__init__.py,sha256=3DHUd_qxpPozfzouoqa9g9ts1Czr5qaHfFxbnxriepM,63 -pip/_internal/models/candidate.py,sha256=zq2Vb5l5JflrVX7smHTJHQciZWHyoJZuYTLeQa1G16c,741 -pip/_internal/models/format_control.py,sha256=aDbH4D2XuyaGjtRjTLQhNzClAcLZdJCKSHO8xbZSmFA,2202 -pip/_internal/models/index.py,sha256=YI1WlhWfS9mVPY0bIboA5la2pjJ2J0qgPJIbvdEjZBk,996 -pip/_internal/models/link.py,sha256=E61PvS2Wrmb9-zT-eAc_8_xI3C-89wJlpL8SL-mlQmg,3998 -pip/_internal/operations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 -pip/_internal/operations/check.py,sha256=ahcOg5p68nNow6_wy5prYYK0KZq22lm0CsJn8AyDMCI,4937 -pip/_internal/operations/freeze.py,sha256=lskaBcqf3bPZupG032fuLf76QYv5wpAQ6jsiXac56Bg,10450 -pip/_internal/operations/prepare.py,sha256=atoLFj3OD5KfXsa5dYBMC_mI06l068F5yZhF4jle1JA,14280 -pip/_internal/req/__init__.py,sha256=JnNZWvKUQuqAwHh64LCD3zprzWIVQEXChTo2UGHzVqo,2093 -pip/_internal/req/constructors.py,sha256=97WQp9Svh-Jw3oLZL9_57gJ3zihm5LnWlSRjOwOorDU,9573 -pip/_internal/req/req_file.py,sha256=ORA0GKUjGd6vy7pmBwXR55FFj4h_OxYykFQ6gHuWvt0,11940 -pip/_internal/req/req_install.py,sha256=ry1RtNNCefDHAnf3EeGMpea-9pC6Yk1uHzP0Q5p2Un0,34046 -pip/_internal/req/req_set.py,sha256=nE6oagXJSiQREuuebX3oJO5OHSOVUIlvLLilodetBzc,7264 -pip/_internal/req/req_tracker.py,sha256=zH28YHV5TXAVh1ZOEZi6Z1Edkiu26dN2tXfR6VbQ3B4,2370 -pip/_internal/req/req_uninstall.py,sha256=ORSPah64KOVrKo-InMM3zgS5HQqbl5TLHFnE_Lxstq8,16737 -pip/_internal/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 -pip/_internal/utils/appdirs.py,sha256=SPfibHtvOKzD_sHrpEZ60HfLae3GharU4Tg7SB3c-XM,9120 -pip/_internal/utils/compat.py,sha256=LSAvzXcsGY2O2drKIPszR5Ja2G0kup__51l3bx1jR_Q,8015 -pip/_internal/utils/deprecation.py,sha256=yQTe6dyWlBfxSBrOv_MdRXF1RPLER_EWOp-pa2zLoZc,3021 -pip/_internal/utils/encoding.py,sha256=D8tmfStCah6xh9OLhH9mWLr77q4akhg580YHJMKpq3Y,1025 -pip/_internal/utils/filesystem.py,sha256=ZOIHbacJ-SJtuZru4GoA5DuSIYyeaE4G5kfZPf5cn1A,915 -pip/_internal/utils/glibc.py,sha256=prOrsBjmgkDE-hY4Pl120yF5MIlkkmGrFLs8XfIyT-w,3004 -pip/_internal/utils/hashes.py,sha256=rJk-gj6F-sHggXAG97dhynqUHFFgApyZLWgaG2xCHME,2900 -pip/_internal/utils/logging.py,sha256=BQeUDEER3zlK0O4yv6DBfz6TK3f9XoLXyDlnB0mZVf0,6295 -pip/_internal/utils/misc.py,sha256=YscDfBiFx1spYOtSgdI_5hnc5BZUysWAyz1aVL5y-48,29904 -pip/_internal/utils/models.py,sha256=DQYZSRhjvSdDTAaJLLCpDtxAn1S_-v_8nlNjv4T2jwY,1042 -pip/_internal/utils/outdated.py,sha256=BXtCMKR6gjTrvMfP3MWzZ1Y4ZU4qqoCfbRNqQCusVt8,5642 -pip/_internal/utils/packaging.py,sha256=Ru8ls_S8PPKR8RKEn7jMetENY_A9jPet1HlhTZwpFxU,2443 -pip/_internal/utils/setuptools_build.py,sha256=0blfscmNJW_iZ5DcswJeDB_PbtTEjfK9RL1R1WEDW2E,278 -pip/_internal/utils/temp_dir.py,sha256=n2FkVlwRX_hS61fYt3nSAh2e2V6CcZn_dfbPId1pAQE,2615 -pip/_internal/utils/typing.py,sha256=ztYtZAcqjCYDwP-WlF6EiAAskAsZBMMXtuqvfgZIlgQ,1139 -pip/_internal/utils/ui.py,sha256=FW8wdtc7DvNwJClGr_TvGZlqcoO482GYe0UY9nKmpso,13657 -pip/_internal/vcs/__init__.py,sha256=2Ct9ogOwzS6ZKKaEXKN2XDiBOiFHMcejnN1KM21mLrQ,16319 -pip/_internal/vcs/bazaar.py,sha256=rjskVmSSn68O7lC5JrGmDTWXneXFMMJJvj_bbdSM8QA,3669 -pip/_internal/vcs/git.py,sha256=n1cFBqTnLIcxAOClZMgOBqELjEjygDBPZ9z-Q7g0qVQ,12580 -pip/_internal/vcs/mercurial.py,sha256=jVTa0XQpFR6EiBcaqW4E4JjTce_t1tFnKRaIhaIPlS8,3471 -pip/_internal/vcs/subversion.py,sha256=vDLTfcjj0kgqcEsbPBfveC4CRxyhWiOjke-qN0Zr8CE,7676 -pip/_vendor/__init__.py,sha256=XnhkujjE1qUGRlYGYbIRrEGYYYBcNLBraE27HH48wYw,4756 -pip/_vendor/appdirs.py,sha256=BENKsvcA08IpccD9345-rMrg3aXWFA1q6BFEglnHg6I,24547 -pip/_vendor/distro.py,sha256=dOMrjIXv-3GmEbtP-NJc057Sv19P7ZAdke-v0TBeNio,42455 -pip/_vendor/ipaddress.py,sha256=2OgbkeAD2rLkcXqbcvof3J5R7lRwjNLoBySyTkBtKnc,79852 -pip/_vendor/pyparsing.py,sha256=My2ZwDJCEaZkZgZyG9gL--48RLGmf9vnVCTW93rhdYI,226342 -pip/_vendor/retrying.py,sha256=k3fflf5_Mm0XcIJYhB7Tj34bqCCPhUDkYbx1NvW2FPE,9972 -pip/_vendor/six.py,sha256=A08MPb-Gi9FfInI3IW7HimXFmEH2T2IPzHgDvdhZPRA,30888 -pip/_vendor/cachecontrol/__init__.py,sha256=6cRPchVqkAkeUtYTSW8qCetjSqJo-GxP-n4VMVDbvmc,302 -pip/_vendor/cachecontrol/_cmd.py,sha256=URGE0KrA87QekCG3SGPatlSPT571dZTDjNa-ZXX3pDc,1295 -pip/_vendor/cachecontrol/adapter.py,sha256=eBGAtVNRZgtl_Kj5JV54miqL9YND-D0JZPahwY8kFtY,4863 -pip/_vendor/cachecontrol/cache.py,sha256=1fc4wJP8HYt1ycnJXeEw5pCpeBL2Cqxx6g9Fb0AYDWQ,805 -pip/_vendor/cachecontrol/compat.py,sha256=kHNvMRdt6s_Xwqq_9qJmr9ou3wYMOMUMxPPcwNxT8Mc,695 -pip/_vendor/cachecontrol/controller.py,sha256=U7g-YwizQ2O5NRgK_MZreF1ntM4E49C3PuF3od-Vwz4,13698 -pip/_vendor/cachecontrol/filewrapper.py,sha256=vACKO8Llzu_ZWyjV1Fxn1MA4TGU60N5N3GSrAFdAY2Q,2533 -pip/_vendor/cachecontrol/heuristics.py,sha256=BFGHJ3yQcxvZizfo90LLZ04T_Z5XSCXvFotrp7Us0sc,4070 -pip/_vendor/cachecontrol/serialize.py,sha256=GebE34fgToyWwAsRPguh8hEPN6CqoG-5hRMXRsjVABQ,6954 -pip/_vendor/cachecontrol/wrapper.py,sha256=sfr9YHWx-5TwNz1H5rT6QOo8ggII6v3vbEDjQFwR6wc,671 -pip/_vendor/cachecontrol/caches/__init__.py,sha256=-gHNKYvaeD0kOk5M74eOrsSgIKUtC6i6GfbmugGweEo,86 -pip/_vendor/cachecontrol/caches/file_cache.py,sha256=8vrSzzGcdfEfICago1uSFbkumNJMGLbCdEkXsmUIExw,4177 -pip/_vendor/cachecontrol/caches/redis_cache.py,sha256=HxelMpNCo-dYr2fiJDwM3hhhRmxUYtB5tXm1GpAAT4Y,856 -pip/_vendor/certifi/__init__.py,sha256=5lCYV1iWxoirX1OAaSHkBYUuZGdcwEjEBS6DS_trL0s,63 -pip/_vendor/certifi/__main__.py,sha256=NaCn6WtWME-zzVWQ2j4zFyl8cY4knDa9CwtHNIeFPhM,53 -pip/_vendor/certifi/cacert.pem,sha256=XA-4HVBsOrBD5lfg-b3PiUzAvwUd2qlIzwXypIMIRGM,263074 -pip/_vendor/certifi/core.py,sha256=xPQDdG_siy5A7BfqGWa7RJhcA61xXEqPiSrw9GNyhHE,836 -pip/_vendor/chardet/__init__.py,sha256=YsP5wQlsHJ2auF1RZJfypiSrCA7_bQiRm3ES_NI76-Y,1559 -pip/_vendor/chardet/big5freq.py,sha256=D_zK5GyzoVsRes0HkLJziltFQX0bKCLOrFe9_xDvO_8,31254 -pip/_vendor/chardet/big5prober.py,sha256=kBxHbdetBpPe7xrlb-e990iot64g_eGSLd32lB7_h3M,1757 -pip/_vendor/chardet/chardistribution.py,sha256=3woWS62KrGooKyqz4zQSnjFbJpa6V7g02daAibTwcl8,9411 -pip/_vendor/chardet/charsetgroupprober.py,sha256=6bDu8YIiRuScX4ca9Igb0U69TA2PGXXDej6Cc4_9kO4,3787 -pip/_vendor/chardet/charsetprober.py,sha256=KSmwJErjypyj0bRZmC5F5eM7c8YQgLYIjZXintZNstg,5110 -pip/_vendor/chardet/codingstatemachine.py,sha256=VYp_6cyyki5sHgXDSZnXW4q1oelHc3cu9AyQTX7uug8,3590 -pip/_vendor/chardet/compat.py,sha256=PKTzHkSbtbHDqS9PyujMbX74q1a8mMpeQTDVsQhZMRw,1134 -pip/_vendor/chardet/cp949prober.py,sha256=TZ434QX8zzBsnUvL_8wm4AQVTZ2ZkqEEQL_lNw9f9ow,1855 -pip/_vendor/chardet/enums.py,sha256=Aimwdb9as1dJKZaFNUH2OhWIVBVd6ZkJJ_WK5sNY8cU,1661 -pip/_vendor/chardet/escprober.py,sha256=kkyqVg1Yw3DIOAMJ2bdlyQgUFQhuHAW8dUGskToNWSc,3950 -pip/_vendor/chardet/escsm.py,sha256=RuXlgNvTIDarndvllNCk5WZBIpdCxQ0kcd9EAuxUh84,10510 -pip/_vendor/chardet/eucjpprober.py,sha256=iD8Jdp0ISRjgjiVN7f0e8xGeQJ5GM2oeZ1dA8nbSeUw,3749 -pip/_vendor/chardet/euckrfreq.py,sha256=-7GdmvgWez4-eO4SuXpa7tBiDi5vRXQ8WvdFAzVaSfo,13546 -pip/_vendor/chardet/euckrprober.py,sha256=MqFMTQXxW4HbzIpZ9lKDHB3GN8SP4yiHenTmf8g_PxY,1748 -pip/_vendor/chardet/euctwfreq.py,sha256=No1WyduFOgB5VITUA7PLyC5oJRNzRyMbBxaKI1l16MA,31621 -pip/_vendor/chardet/euctwprober.py,sha256=13p6EP4yRaxqnP4iHtxHOJ6R2zxHq1_m8hTRjzVZ95c,1747 -pip/_vendor/chardet/gb2312freq.py,sha256=JX8lsweKLmnCwmk8UHEQsLgkr_rP_kEbvivC4qPOrlc,20715 -pip/_vendor/chardet/gb2312prober.py,sha256=gGvIWi9WhDjE-xQXHvNIyrnLvEbMAYgyUSZ65HUfylw,1754 -pip/_vendor/chardet/hebrewprober.py,sha256=c3SZ-K7hvyzGY6JRAZxJgwJ_sUS9k0WYkvMY00YBYFo,13838 -pip/_vendor/chardet/jisfreq.py,sha256=vpmJv2Bu0J8gnMVRPHMFefTRvo_ha1mryLig8CBwgOg,25777 -pip/_vendor/chardet/jpcntx.py,sha256=PYlNqRUQT8LM3cT5FmHGP0iiscFlTWED92MALvBungo,19643 -pip/_vendor/chardet/langbulgarianmodel.py,sha256=1HqQS9Pbtnj1xQgxitJMvw8X6kKr5OockNCZWfEQrPE,12839 -pip/_vendor/chardet/langcyrillicmodel.py,sha256=LODajvsetH87yYDDQKA2CULXUH87tI223dhfjh9Zx9c,17948 -pip/_vendor/chardet/langgreekmodel.py,sha256=8YAW7bU8YwSJap0kIJSbPMw1BEqzGjWzqcqf0WgUKAA,12688 -pip/_vendor/chardet/langhebrewmodel.py,sha256=JSnqmE5E62tDLTPTvLpQsg5gOMO4PbdWRvV7Avkc0HA,11345 -pip/_vendor/chardet/langhungarianmodel.py,sha256=RhapYSG5l0ZaO-VV4Fan5sW0WRGQqhwBM61yx3yxyOA,12592 -pip/_vendor/chardet/langthaimodel.py,sha256=8l0173Gu_W6G8mxmQOTEF4ls2YdE7FxWf3QkSxEGXJQ,11290 -pip/_vendor/chardet/langturkishmodel.py,sha256=W22eRNJsqI6uWAfwXSKVWWnCerYqrI8dZQTm_M0lRFk,11102 -pip/_vendor/chardet/latin1prober.py,sha256=S2IoORhFk39FEFOlSFWtgVybRiP6h7BlLldHVclNkU8,5370 -pip/_vendor/chardet/mbcharsetprober.py,sha256=AR95eFH9vuqSfvLQZN-L5ijea25NOBCoXqw8s5O9xLQ,3413 -pip/_vendor/chardet/mbcsgroupprober.py,sha256=h6TRnnYq2OxG1WdD5JOyxcdVpn7dG0q-vB8nWr5mbh4,2012 -pip/_vendor/chardet/mbcssm.py,sha256=SY32wVIF3HzcjY3BaEspy9metbNSKxIIB0RKPn7tjpI,25481 -pip/_vendor/chardet/sbcharsetprober.py,sha256=LDSpCldDCFlYwUkGkwD2oFxLlPWIWXT09akH_2PiY74,5657 -pip/_vendor/chardet/sbcsgroupprober.py,sha256=1IprcCB_k1qfmnxGC6MBbxELlKqD3scW6S8YIwdeyXA,3546 -pip/_vendor/chardet/sjisprober.py,sha256=IIt-lZj0WJqK4rmUZzKZP4GJlE8KUEtFYVuY96ek5MQ,3774 -pip/_vendor/chardet/universaldetector.py,sha256=qL0174lSZE442eB21nnktT9_VcAye07laFWUeUrjttY,12485 -pip/_vendor/chardet/utf8prober.py,sha256=IdD8v3zWOsB8OLiyPi-y_fqwipRFxV9Nc1eKBLSuIEw,2766 -pip/_vendor/chardet/version.py,sha256=sp3B08mrDXB-pf3K9fqJ_zeDHOCLC8RrngQyDFap_7g,242 -pip/_vendor/chardet/cli/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1 -pip/_vendor/chardet/cli/chardetect.py,sha256=DI8dlV3FBD0c0XA_y3sQ78z754DUv1J8n34RtDjOXNw,2774 -pip/_vendor/colorama/__init__.py,sha256=V3-Hv_vOa-2lE5Q_0mGkdhZo-9e4XrGTW_44cU81qQY,240 -pip/_vendor/colorama/ansi.py,sha256=Fi0un-QLqRm-v7o_nKiOqyC8PapBJK7DLV_q9LKtTO0,2524 -pip/_vendor/colorama/ansitowin32.py,sha256=QrieYX2tsaWIO19P6biMa1zUCt-_abudoEp2_IdqZZU,9668 -pip/_vendor/colorama/initialise.py,sha256=cHqVJtb82OG7HUCxvQ2joG7N_CoxbIKbI_fgryZkj20,1917 -pip/_vendor/colorama/win32.py,sha256=5Hc7L1LabubrYDhdWAfRyzlt14ErP3YKDvf_zYaarLk,5426 -pip/_vendor/colorama/winterm.py,sha256=V7U7ojwG1q4n6PKripjEvW_htYQi5ueXSM3LUUoqqDY,6290 -pip/_vendor/distlib/__init__.py,sha256=GxRrh1augb66Eo9NB9jrdwQS02KcBypj9o_-C3oyKZI,581 -pip/_vendor/distlib/compat.py,sha256=xdNZmqFN5HwF30HjRn5M415pcC2kgXRBXn767xS8v-M,41404 -pip/_vendor/distlib/database.py,sha256=LqTcNkDyV4bWcc_qDxiYJHnXaNxFs1O1bFSAg_reaI0,50868 -pip/_vendor/distlib/index.py,sha256=Dd1kIV06XIdynNpKxHMMRRIKsXuoUsG7QIzntfVtZCI,21073 -pip/_vendor/distlib/locators.py,sha256=e4UaQSzNg5iG3PfQRH6lnVMfLOwhm2sVmGGRdjdB3ik,51657 -pip/_vendor/distlib/manifest.py,sha256=nQEhYmgoreaBZzyFzwYsXxJARu3fo4EkunU163U16iE,14811 -pip/_vendor/distlib/markers.py,sha256=6Ac3cCfFBERexiESWIOXmg-apIP8l2esafNSX3KMy-8,4387 -pip/_vendor/distlib/metadata.py,sha256=Ns92dqeMxopDPQsiEWnhMtd4RagJaA58lz8O_vjCxyk,39986 -pip/_vendor/distlib/resources.py,sha256=2FGv0ZHF14KXjLIlL0R991lyQQGcewOS4mJ-5n-JVnc,10766 -pip/_vendor/distlib/scripts.py,sha256=WEqXkpRvqR6oe-QlMRYg8gEJxXRWJeWn1GPc0ihZ4N0,16585 -pip/_vendor/distlib/t32.exe,sha256=ftub1bsSPUCOnBn-eCtcarKTk0N0CBEP53BumkIxWJE,92672 -pip/_vendor/distlib/t64.exe,sha256=iChOG627LWTHY8-jzSwlo9SYU5a-0JHwQu4AqDz8I68,102400 -pip/_vendor/distlib/util.py,sha256=FnzjaibVcIg1xOtET6QPNeqTnn3LcWLCjNOficMyGKA,59494 -pip/_vendor/distlib/version.py,sha256=_n7F6juvQGAcn769E_SHa7fOcf5ERlEVymJ_EjPRwGw,23391 -pip/_vendor/distlib/w32.exe,sha256=NPYPpt7PIjVqABEu1CzabbDyHHkJpuw-_qZq_48H0j0,89088 -pip/_vendor/distlib/w64.exe,sha256=Yb-qr1OQEzL8KRGTk-XHUZDwMSljfQeZnVoTk-K4e7E,99328 -pip/_vendor/distlib/wheel.py,sha256=W9aKwi4CQL_bQFYb8IcwH-c6WK-yku5P8SY3RGPv-Mk,39506 -pip/_vendor/distlib/_backport/__init__.py,sha256=bqS_dTOH6uW9iGgd0uzfpPjo6vZ4xpPZ7kyfZJ2vNaw,274 -pip/_vendor/distlib/_backport/misc.py,sha256=KWecINdbFNOxSOP1fGF680CJnaC6S4fBRgEtaYTw0ig,971 -pip/_vendor/distlib/_backport/shutil.py,sha256=VW1t3uYqUjWZH7jV-6QiimLhnldoV5uIpH4EuiT1jfw,25647 -pip/_vendor/distlib/_backport/sysconfig.cfg,sha256=swZKxq9RY5e9r3PXCrlvQPMsvOdiWZBTHLEbqS8LJLU,2617 -pip/_vendor/distlib/_backport/sysconfig.py,sha256=JdJ9ztRy4Hc-b5-VS74x3nUtdEIVr_OBvMsIb8O2sjc,26964 -pip/_vendor/distlib/_backport/tarfile.py,sha256=Ihp7rXRcjbIKw8COm9wSePV9ARGXbSF9gGXAMn2Q-KU,92628 -pip/_vendor/html5lib/__init__.py,sha256=Ztrn7UvF-wIFAgRBBa0ML-Gu5AffH3BPX_INJx4SaBI,1162 -pip/_vendor/html5lib/_ihatexml.py,sha256=3LBtJMlzgwM8vpQiU1TvGmEEmNH72sV0yD8yS53y07A,16705 -pip/_vendor/html5lib/_inputstream.py,sha256=bPUWcAfJScK4xkjQQaG_HsI2BvEVbFvI0AsodDYPQj0,32552 -pip/_vendor/html5lib/_tokenizer.py,sha256=YAaOEBD6qc5ISq9Xt9Nif1OFgcybTTfMdwqBkZhpAq4,76580 -pip/_vendor/html5lib/_utils.py,sha256=ismpASeqa2jqEPQjHUj8vReAf7yIoKnvLN5fuOw6nv0,4015 -pip/_vendor/html5lib/constants.py,sha256=4lmZWLtEPRLnl8NzftOoYTJdo6jpeMtP6dqQC0g_bWQ,83518 -pip/_vendor/html5lib/html5parser.py,sha256=g5g2ezkusHxhi7b23vK_-d6K6BfIJRbqIQmvQ9z4EgI,118963 -pip/_vendor/html5lib/serializer.py,sha256=yfcfBHse2wDs6ojxn-kieJjLT5s1ipilQJ0gL3-rJis,15758 -pip/_vendor/html5lib/_trie/__init__.py,sha256=8VR1bcgD2OpeS2XExpu5yBhP_Q1K-lwKbBKICBPf1kU,289 -pip/_vendor/html5lib/_trie/_base.py,sha256=uJHVhzif9S0MJXgy9F98iEev5evi_rgUk5BmEbUSp8c,930 -pip/_vendor/html5lib/_trie/datrie.py,sha256=EQpqSfkZRuTbE-DuhW7xMdVDxdZNZ0CfmnYfHA_3zxM,1178 -pip/_vendor/html5lib/_trie/py.py,sha256=wXmQLrZRf4MyWNyg0m3h81m9InhLR7GJ002mIIZh-8o,1775 -pip/_vendor/html5lib/filters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 -pip/_vendor/html5lib/filters/alphabeticalattributes.py,sha256=lViZc2JMCclXi_5gduvmdzrRxtO5Xo9ONnbHBVCsykU,919 -pip/_vendor/html5lib/filters/base.py,sha256=z-IU9ZAYjpsVsqmVt7kuWC63jR11hDMr6CVrvuao8W0,286 -pip/_vendor/html5lib/filters/inject_meta_charset.py,sha256=egDXUEHXmAG9504xz0K6ALDgYkvUrC2q15YUVeNlVQg,2945 -pip/_vendor/html5lib/filters/lint.py,sha256=jk6q56xY0ojiYfvpdP-OZSm9eTqcAdRqhCoPItemPYA,3643 -pip/_vendor/html5lib/filters/optionaltags.py,sha256=8lWT75J0aBOHmPgfmqTHSfPpPMp01T84NKu0CRedxcE,10588 -pip/_vendor/html5lib/filters/sanitizer.py,sha256=4ON02KNjuqda1lCw5_JCUZxb0BzWR5M7ON84dtJ7dm0,26248 -pip/_vendor/html5lib/filters/whitespace.py,sha256=8eWqZxd4UC4zlFGW6iyY6f-2uuT8pOCSALc3IZt7_t4,1214 -pip/_vendor/html5lib/treeadapters/__init__.py,sha256=A0rY5gXIe4bJOiSGRO_j_tFhngRBO8QZPzPtPw5dFzo,679 -pip/_vendor/html5lib/treeadapters/genshi.py,sha256=CH27pAsDKmu4ZGkAUrwty7u0KauGLCZRLPMzaO3M5vo,1715 -pip/_vendor/html5lib/treeadapters/sax.py,sha256=BKS8woQTnKiqeffHsxChUqL4q2ZR_wb5fc9MJ3zQC8s,1776 -pip/_vendor/html5lib/treebuilders/__init__.py,sha256=AysSJyvPfikCMMsTVvaxwkgDieELD5dfR8FJIAuq7hY,3592 -pip/_vendor/html5lib/treebuilders/base.py,sha256=wQGp5yy22TNG8tJ6aREe4UUeTR7A99dEz0BXVaedWb4,14579 -pip/_vendor/html5lib/treebuilders/dom.py,sha256=SY3MsijXyzdNPc8aK5IQsupBoM8J67y56DgNtGvsb9g,8835 -pip/_vendor/html5lib/treebuilders/etree.py,sha256=aqIBOGj_dFYqBURIcTegGNBhAIJOw5iFDHb4jrkYH-8,12764 -pip/_vendor/html5lib/treebuilders/etree_lxml.py,sha256=9V0dXxbJYYq-Skgb5-_OL2NkVYpjioEb4CHajo0e9yI,14122 -pip/_vendor/html5lib/treewalkers/__init__.py,sha256=yhXxHpjlSqfQyUag3v8-vWjMPriFBU8YRAPNpDgBTn8,5714 -pip/_vendor/html5lib/treewalkers/base.py,sha256=ouiOsuSzvI0KgzdWP8PlxIaSNs9falhbiinAEc_UIJY,7476 -pip/_vendor/html5lib/treewalkers/dom.py,sha256=EHyFR8D8lYNnyDU9lx_IKigVJRyecUGua0mOi7HBukc,1413 -pip/_vendor/html5lib/treewalkers/etree.py,sha256=sz1o6mmE93NQ53qJFDO7HKyDtuwgK-Ay3qSFZPC6u00,4550 -pip/_vendor/html5lib/treewalkers/etree_lxml.py,sha256=sY6wfRshWTllu6n48TPWpKsQRPp-0CQrT0hj_AdzHSU,6309 -pip/_vendor/html5lib/treewalkers/genshi.py,sha256=4D2PECZ5n3ZN3qu3jMl9yY7B81jnQApBQSVlfaIuYbA,2309 -pip/_vendor/idna/__init__.py,sha256=9Nt7xpyet3DmOrPUGooDdAwmHZZu1qUAy2EaJ93kGiQ,58 -pip/_vendor/idna/codec.py,sha256=lvYb7yu7PhAqFaAIAdWcwgaWI2UmgseUua-1c0AsG0A,3299 -pip/_vendor/idna/compat.py,sha256=R-h29D-6mrnJzbXxymrWUW7iZUvy-26TQwZ0ij57i4U,232 -pip/_vendor/idna/core.py,sha256=OwI5R_uuXU4PlOSoG8cjaMPA1hhdGGjjZ8I2MZhSPxo,11858 -pip/_vendor/idna/idnadata.py,sha256=zwxvoSsYqPHNa6xzXWHizXpDC28JJMGXRinhJ4Gkcz0,39285 -pip/_vendor/idna/intranges.py,sha256=TY1lpxZIQWEP6tNqjZkFA5hgoMWOj1OBmnUG8ihT87E,1749 -pip/_vendor/idna/package_data.py,sha256=Vt9rtr32BzO7O25rypo8nzAs3syTJhG1ojU3J-s2RFo,21 -pip/_vendor/idna/uts46data.py,sha256=czULzYN5Lr9K5MmOH-1g3CJY7QPjGeHjYmC3saJ_BHk,197803 -pip/_vendor/lockfile/__init__.py,sha256=Tqpz90DwKYfhPsfzVOJl84TL87pdFE5ePNHdXAxs4Tk,9371 -pip/_vendor/lockfile/linklockfile.py,sha256=C7OH3H4GdK68u4FQgp8fkP2kO4fyUTSyj3X6blgfobc,2652 -pip/_vendor/lockfile/mkdirlockfile.py,sha256=e3qgIL-etZMLsS-3ft19iW_8IQ360HNkGOqE3yBKsUw,3096 -pip/_vendor/lockfile/pidlockfile.py,sha256=ukH9uk6NFuxyVmG5QiWw4iKq3fT7MjqUguX95avYPIY,6090 -pip/_vendor/lockfile/sqlitelockfile.py,sha256=o2TMkMRY0iwn-iL1XMRRIFStMUkS4i3ajceeYNntKFg,5506 -pip/_vendor/lockfile/symlinklockfile.py,sha256=ABwXXmvTHvCl5viPblShL3PG-gGsLiT1roAMfDRwhi8,2616 -pip/_vendor/msgpack/__init__.py,sha256=y0bk2YbzK6J2e0J_dyreN6nD7yM2IezT6m_tU2h-Mdg,1677 -pip/_vendor/msgpack/_version.py,sha256=dN7wVIjbyuQIJ35B2o6gymQNDLPlj_7-uTfgCv7KErM,20 -pip/_vendor/msgpack/exceptions.py,sha256=lPkAi_u12NlFajDz4FELSHEdfU8hrR3zeTvKX8aQuz4,1056 -pip/_vendor/msgpack/fallback.py,sha256=h0ll8xnq12mI9PuQ9Qd_Ihtt08Sp8L0JqhG9KY8Vyjk,36411 -pip/_vendor/packaging/__about__.py,sha256=mH-sMIEu48PzdYakZ6Y6OBzL3TlSetzz1fQSkCXiy30,720 -pip/_vendor/packaging/__init__.py,sha256=_vNac5TrzwsrzbOFIbF-5cHqc_Y2aPT2D7zrIR06BOo,513 -pip/_vendor/packaging/_compat.py,sha256=Vi_A0rAQeHbU-a9X0tt1yQm9RqkgQbDSxzRw8WlU9kA,860 -pip/_vendor/packaging/_structures.py,sha256=DCpKtb7u94_oqgVsIJQTrTyZcb3Gz7sSGbk9vYDMME0,1418 -pip/_vendor/packaging/markers.py,sha256=ftZegBU5oEmulEKApDGEPgti2lYIchFQHAfH9tZy3_U,8221 -pip/_vendor/packaging/requirements.py,sha256=xIWdoZXVKhUHxqFP5xmnKylM7NHXQS48hUfIIX1PvY0,4439 -pip/_vendor/packaging/specifiers.py,sha256=pFp716eLYBRt0eLNsy6cnWD9dyMKq-Zag7bsLbLv4Fs,28026 -pip/_vendor/packaging/utils.py,sha256=c9obOpok2CpKDApkc2M5ma0YFnT-jtt4I6XI4F0jYiI,1580 -pip/_vendor/packaging/version.py,sha256=MKL8nbKLPLGPouIwFvwSVnYRzNpkMo5AIcsa6LGqDF8,12219 -pip/_vendor/pep517/__init__.py,sha256=GH4HshnLERtjAjkY0zHoz3f7-35UcIvr27iFWSOUazU,82 -pip/_vendor/pep517/_in_process.py,sha256=iWpagFk2GhNBbvl-Ca2RagfD0ALuits4WWSM6nQMTdg,5831 -pip/_vendor/pep517/check.py,sha256=Yp2NHW71DIOCgkFb7HKJOzKmsum_s_OokRP6HnR3bTg,5761 -pip/_vendor/pep517/colorlog.py,sha256=2AJuPI_DHM5T9IDgcTwf0E8suyHAFnfsesogr0AB7RQ,4048 -pip/_vendor/pep517/compat.py,sha256=4SFG4QN-cNj8ebSa0wV0HUtEEQWwmbok2a0uk1gYEOM,631 -pip/_vendor/pep517/envbuild.py,sha256=osRsJVd7hir1w_uFXiVeeWxfJ3iYhwxsKRgNBWpqtCI,5672 -pip/_vendor/pep517/wrappers.py,sha256=RhgWm-MLxpYPgc9cZ3-A3ToN99ZzgM8-ia4FDB58koM,5018 -pip/_vendor/pkg_resources/__init__.py,sha256=ykZI7-YBIAQ7ztWf0RskP8Oy1VQU88o-16PJbIMCtLg,103915 -pip/_vendor/pkg_resources/py31compat.py,sha256=CRk8fkiPRDLsbi5pZcKsHI__Pbmh_94L8mr9Qy9Ab2U,562 -pip/_vendor/progress/__init__.py,sha256=Hv3Y8Hr6RyM34NdZkrZQWMURjS2h5sONRHJSvZXWZgQ,3188 -pip/_vendor/progress/bar.py,sha256=hlkDAEv9pRRiWqR5XL6vIAgMG4u_dBGEW_8klQhBRq0,2942 -pip/_vendor/progress/counter.py,sha256=XtBuZY4yYmr50E2A_fAzjWhm0IkwaVwxNsNVYDE7nsw,1528 -pip/_vendor/progress/helpers.py,sha256=6FsBLh_xUlKiVua-zZIutCjxth-IO8FtyUj6I2tx9fg,2952 -pip/_vendor/progress/spinner.py,sha256=m7bASI2GUbLFG-PbAefdHtrrWWlJLFhhSBbw70gp2TY,1439 -pip/_vendor/pytoml/__init__.py,sha256=q12Xv23Tta44gtK4HGK68Gr4tKfciILidFPmPuoIqIo,92 -pip/_vendor/pytoml/core.py,sha256=9CrLLTs1PdWjEwRnYzt_i4dhHcZvGxs_GsMlYAX3iY4,509 -pip/_vendor/pytoml/parser.py,sha256=mcTzHB2GQGyK8KVwuQ0EraSz_78O36U60NqHBtgVmV0,11247 -pip/_vendor/pytoml/writer.py,sha256=-mSOVGaiGLrpj5BRR7czmquZXJGflcElHrwAd33J48A,3815 -pip/_vendor/requests/__init__.py,sha256=OrwNk1JwZGqIQ4JVGgMbfpstqey-oHS_Re_Dw6D4ciI,4209 -pip/_vendor/requests/__version__.py,sha256=rJ2xgNOLhjspGkNPfgXTBctqqvsf2uJMFTaE0rlVtbI,436 -pip/_vendor/requests/_internal_utils.py,sha256=Zx3PnEUccyfsB-ie11nZVAW8qClJy0gx1qNME7rgT18,1096 -pip/_vendor/requests/adapters.py,sha256=y5DISepvSsGlu3II_VUsdgKBej1dGY4b5beRrTE2tsI,21428 -pip/_vendor/requests/api.py,sha256=zub9ENcEUT2m9gwgBgqH5RIRDfrx2kwRpZ7L6hX3mcw,6261 -pip/_vendor/requests/auth.py,sha256=oRSQkBYcLkTEssudkzoR1UW1Glb1ts3p1RWusgHf1YU,10208 -pip/_vendor/requests/certs.py,sha256=nXRVq9DtGmv_1AYbwjTu9UrgAcdJv05ZvkNeaoLOZxY,465 -pip/_vendor/requests/compat.py,sha256=7EC6fZY4dJDxuBQnqUGwe13OTZ3VLGO3QfOApE5lE3I,1998 -pip/_vendor/requests/cookies.py,sha256=olUaLeNci_z1K-Bn5PeEKllSspmQqN9-s8Ug7CasaPE,18346 -pip/_vendor/requests/exceptions.py,sha256=-mLam3TAx80V09EaH3H-ZxR61eAVuLRZ8zgBBSLjK44,3197 -pip/_vendor/requests/help.py,sha256=T4K-Oo_FS9fxF8NHVR8hxMwFo71gIkRM7UddCc9vH7Y,3669 -pip/_vendor/requests/hooks.py,sha256=HXAHoC1FNTFRZX6-lNdvPM7Tst4kvGwYTN-AOKRxoRU,767 -pip/_vendor/requests/models.py,sha256=3fmmYdDW7U18SrVeZaseHuk8KPI-7vLp_435DY3ejes,34160 -pip/_vendor/requests/packages.py,sha256=njJmVifY4aSctuW3PP5EFRCxjEwMRDO6J_feG2dKWsI,695 -pip/_vendor/requests/sessions.py,sha256=71MK2HCadovka1vAx9dyDFWAuw69KgRPRBpd0HWSEAo,27829 -pip/_vendor/requests/status_codes.py,sha256=pgw-xlnxO5zHQWn3fKps2cxwQehKzPxEbdhIrMQe6Ec,4128 -pip/_vendor/requests/structures.py,sha256=zoP8qly2Jak5e89HwpqjN1z2diztI-_gaqts1raJJBc,2981 -pip/_vendor/requests/utils.py,sha256=3OxbbLUQFVdm84fdBD9nduXvhw6hIzj59mhvBomKuJI,30156 -pip/_vendor/urllib3/__init__.py,sha256=DZucS8tlzGYKmK5FIsyUViMghpCq_0_0Ouvm_Jp9GNc,2853 -pip/_vendor/urllib3/_collections.py,sha256=iNeAU_we9L3lMGRUKKdq24Mf7o050TXP5U4Jm9AzAY4,10841 -pip/_vendor/urllib3/connection.py,sha256=My76qeWMDkV-KP1l3iChXHOE7J-ZCaUdP3sPIiLA2uE,14485 -pip/_vendor/urllib3/connectionpool.py,sha256=w20OwKdIqk6f8FIl6QGgn6jf9gZ0-tmgH7VPxnpEgkQ,35464 -pip/_vendor/urllib3/exceptions.py,sha256=rFeIfBNKC8KJ61ux-MtJyJlEC9G9ggkmCeF751JwVR4,6604 -pip/_vendor/urllib3/fields.py,sha256=D_TE_SK15YatdbhWDMN0OE3X6UCJn1RTkANINCYOobE,5943 -pip/_vendor/urllib3/filepost.py,sha256=40CROlpRKVBpFUkD0R6wJf_PpvbcRQRFUu0OOQlFkKM,2436 -pip/_vendor/urllib3/poolmanager.py,sha256=FHBjb7odbP2LyQRzeitgpuh1AQAPyegzmrm2b3gSZlY,16821 -pip/_vendor/urllib3/request.py,sha256=fwjlq5nQfcUa7aoncR25z6-fJAX_oNTcPksKKGjBm38,5996 -pip/_vendor/urllib3/response.py,sha256=uAuOTZSuTodzvQWIDCZghDoKmZ2bKbgIRCfaVIIZfn8,24667 -pip/_vendor/urllib3/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 -pip/_vendor/urllib3/contrib/appengine.py,sha256=Q3BDy5C_TrI-3cSyo0ELNGlNiK2eSVptQAQMdz4PH9Q,11197 -pip/_vendor/urllib3/contrib/ntlmpool.py,sha256=Q9-rO5Rh2-IqyEd4ZicpTDfMnOlf0IPPCkjhChBCjV4,4478 -pip/_vendor/urllib3/contrib/pyopenssl.py,sha256=cM7fVZJRrdLZsprcdWe3meM_hvq8LR73UNDveIMa-20,15480 -pip/_vendor/urllib3/contrib/securetransport.py,sha256=BqXSlChN9_hjCWgyN6JdcgvBUdc37QCCX4u3_8zE_9o,30309 -pip/_vendor/urllib3/contrib/socks.py,sha256=Iom0snbHkCuZbZ7Sle2Kueha1W0jYAJ0SyCOtePLaio,6391 -pip/_vendor/urllib3/contrib/_securetransport/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 -pip/_vendor/urllib3/contrib/_securetransport/bindings.py,sha256=x2kLSh-ASZKsun0FxtraBuLVe3oHuth4YW6yZ5Vof-w,17560 -pip/_vendor/urllib3/contrib/_securetransport/low_level.py,sha256=Umy5u-3Z957GirdapnicXVOpHaM4xdOZABJuJxfaeJA,12162 -pip/_vendor/urllib3/packages/__init__.py,sha256=nlChrGzkjCkmhCX9HrF_qHPUgosfsPQkVIJxiiLhk9g,109 -pip/_vendor/urllib3/packages/ordered_dict.py,sha256=VQaPONfhVMsb8B63Xg7ZOydJqIE_jzeMhVN3Pec6ogw,8935 -pip/_vendor/urllib3/packages/six.py,sha256=A6hdJZVjI3t_geebZ9BzUvwRrIXo0lfwzQlM2LcKyas,30098 -pip/_vendor/urllib3/packages/backports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 -pip/_vendor/urllib3/packages/backports/makefile.py,sha256=r1IADol_pBBq2Y1ub4CPyuS2hXuShK47nfFngZRcRhI,1461 -pip/_vendor/urllib3/packages/ssl_match_hostname/__init__.py,sha256=WBVbxQBojNAxfZwNavkox3BgJiMA9BJmm-_fwd0jD_o,688 -pip/_vendor/urllib3/packages/ssl_match_hostname/_implementation.py,sha256=XCW0ydHg171GfOqNbvUAnRzQ0lc0twp5-dIlolgf4RM,5719 -pip/_vendor/urllib3/util/__init__.py,sha256=6Ran4oAVIy40Cu_oEPWnNV9bwF5rXx6G1DUZ7oehjPY,1044 -pip/_vendor/urllib3/util/connection.py,sha256=8K1VXm8BHsM3QATJJGBNRa_MStkzDy1Da2IaPAaCU8c,4279 -pip/_vendor/urllib3/util/queue.py,sha256=myTX3JDHntglKQNBf3b6dasHH-uF-W59vzGSQiFdAfI,497 -pip/_vendor/urllib3/util/request.py,sha256=H5_lrHvtwl2U2BbT1UYN9HpruNc1gsNFlz2njQmhPrQ,3705 -pip/_vendor/urllib3/util/response.py,sha256=SSNL888W-MQ8t3HAi44kNGgF682p6H__ytEXzBYxV_M,2343 -pip/_vendor/urllib3/util/retry.py,sha256=tlxiEq8OU2BSenPpPjYYO1URne8A-qTEgaykam6rZPg,15104 -pip/_vendor/urllib3/util/ssl_.py,sha256=iHJopgSv8_vXfmGg3lOsTS3ldMD9zhe130huHZxQEGU,14022 -pip/_vendor/urllib3/util/timeout.py,sha256=7lHNrgL5YH2cI1j-yZnzV_J8jBlRVdmFhQaNyM1_2b8,9757 -pip/_vendor/urllib3/util/url.py,sha256=qCY_HHUXvo05wAsEERALgExtlgxLnAHSQ7ce1b-g3SM,6487 -pip/_vendor/urllib3/util/wait.py,sha256=_4vvsT1BTTpqxQYK-2kXVfGsUsVRiuc4R4F-0Bf5BPc,5468 -pip/_vendor/webencodings/__init__.py,sha256=qOBJIuPy_4ByYH6W_bNgJF-qYQ2DoU-dKsDu5yRWCXg,10579 -pip/_vendor/webencodings/labels.py,sha256=4AO_KxTddqGtrL9ns7kAPjb0CcN6xsCIxbK37HY9r3E,8979 -pip/_vendor/webencodings/mklabels.py,sha256=GYIeywnpaLnP0GSic8LFWgd0UVvO_l1Nc6YoF-87R_4,1305 -pip/_vendor/webencodings/tests.py,sha256=OtGLyjhNY1fvkW1GvLJ_FV9ZoqC9Anyjr7q3kxTbzNs,6563 -pip/_vendor/webencodings/x_user_defined.py,sha256=yOqWSdmpytGfUgh_Z6JYgDNhoc-BAHyyeeT15Fr42tM,4307 -pip-18.1.dist-info/LICENSE.txt,sha256=ORqHhOMZ2uVDFHfUzJvFBPxdcf2eieHIDxzThV9dfPo,1090 -pip-18.1.dist-info/METADATA,sha256=D7pqBJTuqM9w_HTW91a0XGjLT9vynlBAE4pPCt_W_UE,2588 -pip-18.1.dist-info/WHEEL,sha256=8T8fxefr_r-A79qbOJ9d_AaEgkpCGmEPHc-gpCq5BRg,110 -pip-18.1.dist-info/entry_points.txt,sha256=S_zfxY25QtQDVY1BiLAmOKSkkI5llzCKPLiYOSEupsY,98 -pip-18.1.dist-info/top_level.txt,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 -pip-18.1.dist-info/RECORD,, -../../../bin/pip,sha256=GJRRYxCMPyWhKt5YOlES-ErqfPnxSoQhfiQ-bkzU_bM,258 -../../../bin/pip3,sha256=GJRRYxCMPyWhKt5YOlES-ErqfPnxSoQhfiQ-bkzU_bM,258 -../../../bin/pip3.7,sha256=GJRRYxCMPyWhKt5YOlES-ErqfPnxSoQhfiQ-bkzU_bM,258 -pip-18.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 -pip/__pycache__/__main__.cpython-37.pyc,, -pip/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/__pycache__/six.cpython-37.pyc,, -pip/_vendor/__pycache__/retrying.cpython-37.pyc,, -pip/_vendor/__pycache__/pyparsing.cpython-37.pyc,, -pip/_vendor/__pycache__/ipaddress.cpython-37.pyc,, -pip/_vendor/__pycache__/distro.cpython-37.pyc,, -pip/_vendor/__pycache__/appdirs.cpython-37.pyc,, -pip/_vendor/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/webencodings/__pycache__/x_user_defined.cpython-37.pyc,, -pip/_vendor/webencodings/__pycache__/tests.cpython-37.pyc,, -pip/_vendor/webencodings/__pycache__/mklabels.cpython-37.pyc,, -pip/_vendor/webencodings/__pycache__/labels.cpython-37.pyc,, -pip/_vendor/webencodings/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/urllib3/__pycache__/response.cpython-37.pyc,, -pip/_vendor/urllib3/__pycache__/request.cpython-37.pyc,, -pip/_vendor/urllib3/__pycache__/poolmanager.cpython-37.pyc,, -pip/_vendor/urllib3/__pycache__/filepost.cpython-37.pyc,, -pip/_vendor/urllib3/__pycache__/fields.cpython-37.pyc,, -pip/_vendor/urllib3/__pycache__/exceptions.cpython-37.pyc,, -pip/_vendor/urllib3/__pycache__/connectionpool.cpython-37.pyc,, -pip/_vendor/urllib3/__pycache__/connection.cpython-37.pyc,, -pip/_vendor/urllib3/__pycache__/_collections.cpython-37.pyc,, -pip/_vendor/urllib3/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/urllib3/util/__pycache__/wait.cpython-37.pyc,, -pip/_vendor/urllib3/util/__pycache__/url.cpython-37.pyc,, -pip/_vendor/urllib3/util/__pycache__/timeout.cpython-37.pyc,, -pip/_vendor/urllib3/util/__pycache__/ssl_.cpython-37.pyc,, -pip/_vendor/urllib3/util/__pycache__/retry.cpython-37.pyc,, -pip/_vendor/urllib3/util/__pycache__/response.cpython-37.pyc,, -pip/_vendor/urllib3/util/__pycache__/request.cpython-37.pyc,, -pip/_vendor/urllib3/util/__pycache__/queue.cpython-37.pyc,, -pip/_vendor/urllib3/util/__pycache__/connection.cpython-37.pyc,, -pip/_vendor/urllib3/util/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/urllib3/packages/__pycache__/six.cpython-37.pyc,, -pip/_vendor/urllib3/packages/__pycache__/ordered_dict.cpython-37.pyc,, -pip/_vendor/urllib3/packages/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/urllib3/packages/ssl_match_hostname/__pycache__/_implementation.cpython-37.pyc,, -pip/_vendor/urllib3/packages/ssl_match_hostname/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/urllib3/packages/backports/__pycache__/makefile.cpython-37.pyc,, -pip/_vendor/urllib3/packages/backports/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/urllib3/contrib/__pycache__/socks.cpython-37.pyc,, -pip/_vendor/urllib3/contrib/__pycache__/securetransport.cpython-37.pyc,, -pip/_vendor/urllib3/contrib/__pycache__/pyopenssl.cpython-37.pyc,, -pip/_vendor/urllib3/contrib/__pycache__/ntlmpool.cpython-37.pyc,, -pip/_vendor/urllib3/contrib/__pycache__/appengine.cpython-37.pyc,, -pip/_vendor/urllib3/contrib/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/urllib3/contrib/_securetransport/__pycache__/low_level.cpython-37.pyc,, -pip/_vendor/urllib3/contrib/_securetransport/__pycache__/bindings.cpython-37.pyc,, -pip/_vendor/urllib3/contrib/_securetransport/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/requests/__pycache__/utils.cpython-37.pyc,, -pip/_vendor/requests/__pycache__/structures.cpython-37.pyc,, -pip/_vendor/requests/__pycache__/status_codes.cpython-37.pyc,, -pip/_vendor/requests/__pycache__/sessions.cpython-37.pyc,, -pip/_vendor/requests/__pycache__/packages.cpython-37.pyc,, -pip/_vendor/requests/__pycache__/models.cpython-37.pyc,, -pip/_vendor/requests/__pycache__/hooks.cpython-37.pyc,, -pip/_vendor/requests/__pycache__/help.cpython-37.pyc,, -pip/_vendor/requests/__pycache__/exceptions.cpython-37.pyc,, -pip/_vendor/requests/__pycache__/cookies.cpython-37.pyc,, -pip/_vendor/requests/__pycache__/compat.cpython-37.pyc,, -pip/_vendor/requests/__pycache__/certs.cpython-37.pyc,, -pip/_vendor/requests/__pycache__/auth.cpython-37.pyc,, -pip/_vendor/requests/__pycache__/api.cpython-37.pyc,, -pip/_vendor/requests/__pycache__/adapters.cpython-37.pyc,, -pip/_vendor/requests/__pycache__/_internal_utils.cpython-37.pyc,, -pip/_vendor/requests/__pycache__/__version__.cpython-37.pyc,, -pip/_vendor/requests/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/pytoml/__pycache__/writer.cpython-37.pyc,, -pip/_vendor/pytoml/__pycache__/parser.cpython-37.pyc,, -pip/_vendor/pytoml/__pycache__/core.cpython-37.pyc,, -pip/_vendor/pytoml/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/progress/__pycache__/spinner.cpython-37.pyc,, -pip/_vendor/progress/__pycache__/helpers.cpython-37.pyc,, -pip/_vendor/progress/__pycache__/counter.cpython-37.pyc,, -pip/_vendor/progress/__pycache__/bar.cpython-37.pyc,, -pip/_vendor/progress/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/pkg_resources/__pycache__/py31compat.cpython-37.pyc,, -pip/_vendor/pkg_resources/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/pep517/__pycache__/wrappers.cpython-37.pyc,, -pip/_vendor/pep517/__pycache__/envbuild.cpython-37.pyc,, -pip/_vendor/pep517/__pycache__/compat.cpython-37.pyc,, -pip/_vendor/pep517/__pycache__/colorlog.cpython-37.pyc,, -pip/_vendor/pep517/__pycache__/check.cpython-37.pyc,, -pip/_vendor/pep517/__pycache__/_in_process.cpython-37.pyc,, -pip/_vendor/pep517/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/packaging/__pycache__/version.cpython-37.pyc,, -pip/_vendor/packaging/__pycache__/utils.cpython-37.pyc,, -pip/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc,, -pip/_vendor/packaging/__pycache__/requirements.cpython-37.pyc,, -pip/_vendor/packaging/__pycache__/markers.cpython-37.pyc,, -pip/_vendor/packaging/__pycache__/_structures.cpython-37.pyc,, -pip/_vendor/packaging/__pycache__/_compat.cpython-37.pyc,, -pip/_vendor/packaging/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/packaging/__pycache__/__about__.cpython-37.pyc,, -pip/_vendor/msgpack/__pycache__/fallback.cpython-37.pyc,, -pip/_vendor/msgpack/__pycache__/exceptions.cpython-37.pyc,, -pip/_vendor/msgpack/__pycache__/_version.cpython-37.pyc,, -pip/_vendor/msgpack/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/lockfile/__pycache__/symlinklockfile.cpython-37.pyc,, -pip/_vendor/lockfile/__pycache__/sqlitelockfile.cpython-37.pyc,, -pip/_vendor/lockfile/__pycache__/pidlockfile.cpython-37.pyc,, -pip/_vendor/lockfile/__pycache__/mkdirlockfile.cpython-37.pyc,, -pip/_vendor/lockfile/__pycache__/linklockfile.cpython-37.pyc,, -pip/_vendor/lockfile/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/idna/__pycache__/uts46data.cpython-37.pyc,, -pip/_vendor/idna/__pycache__/package_data.cpython-37.pyc,, -pip/_vendor/idna/__pycache__/intranges.cpython-37.pyc,, -pip/_vendor/idna/__pycache__/idnadata.cpython-37.pyc,, -pip/_vendor/idna/__pycache__/core.cpython-37.pyc,, -pip/_vendor/idna/__pycache__/compat.cpython-37.pyc,, -pip/_vendor/idna/__pycache__/codec.cpython-37.pyc,, -pip/_vendor/idna/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/html5lib/__pycache__/serializer.cpython-37.pyc,, -pip/_vendor/html5lib/__pycache__/html5parser.cpython-37.pyc,, -pip/_vendor/html5lib/__pycache__/constants.cpython-37.pyc,, -pip/_vendor/html5lib/__pycache__/_utils.cpython-37.pyc,, -pip/_vendor/html5lib/__pycache__/_tokenizer.cpython-37.pyc,, -pip/_vendor/html5lib/__pycache__/_inputstream.cpython-37.pyc,, -pip/_vendor/html5lib/__pycache__/_ihatexml.cpython-37.pyc,, -pip/_vendor/html5lib/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/html5lib/treewalkers/__pycache__/genshi.cpython-37.pyc,, -pip/_vendor/html5lib/treewalkers/__pycache__/etree_lxml.cpython-37.pyc,, -pip/_vendor/html5lib/treewalkers/__pycache__/etree.cpython-37.pyc,, -pip/_vendor/html5lib/treewalkers/__pycache__/dom.cpython-37.pyc,, -pip/_vendor/html5lib/treewalkers/__pycache__/base.cpython-37.pyc,, -pip/_vendor/html5lib/treewalkers/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/html5lib/treebuilders/__pycache__/etree_lxml.cpython-37.pyc,, -pip/_vendor/html5lib/treebuilders/__pycache__/etree.cpython-37.pyc,, -pip/_vendor/html5lib/treebuilders/__pycache__/dom.cpython-37.pyc,, -pip/_vendor/html5lib/treebuilders/__pycache__/base.cpython-37.pyc,, -pip/_vendor/html5lib/treebuilders/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/html5lib/treeadapters/__pycache__/sax.cpython-37.pyc,, -pip/_vendor/html5lib/treeadapters/__pycache__/genshi.cpython-37.pyc,, -pip/_vendor/html5lib/treeadapters/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/html5lib/filters/__pycache__/whitespace.cpython-37.pyc,, -pip/_vendor/html5lib/filters/__pycache__/sanitizer.cpython-37.pyc,, -pip/_vendor/html5lib/filters/__pycache__/optionaltags.cpython-37.pyc,, -pip/_vendor/html5lib/filters/__pycache__/lint.cpython-37.pyc,, -pip/_vendor/html5lib/filters/__pycache__/inject_meta_charset.cpython-37.pyc,, -pip/_vendor/html5lib/filters/__pycache__/base.cpython-37.pyc,, -pip/_vendor/html5lib/filters/__pycache__/alphabeticalattributes.cpython-37.pyc,, -pip/_vendor/html5lib/filters/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/html5lib/_trie/__pycache__/py.cpython-37.pyc,, -pip/_vendor/html5lib/_trie/__pycache__/datrie.cpython-37.pyc,, -pip/_vendor/html5lib/_trie/__pycache__/_base.cpython-37.pyc,, -pip/_vendor/html5lib/_trie/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/distlib/__pycache__/wheel.cpython-37.pyc,, -pip/_vendor/distlib/__pycache__/version.cpython-37.pyc,, -pip/_vendor/distlib/__pycache__/util.cpython-37.pyc,, -pip/_vendor/distlib/__pycache__/scripts.cpython-37.pyc,, -pip/_vendor/distlib/__pycache__/resources.cpython-37.pyc,, -pip/_vendor/distlib/__pycache__/metadata.cpython-37.pyc,, -pip/_vendor/distlib/__pycache__/markers.cpython-37.pyc,, -pip/_vendor/distlib/__pycache__/manifest.cpython-37.pyc,, -pip/_vendor/distlib/__pycache__/locators.cpython-37.pyc,, -pip/_vendor/distlib/__pycache__/index.cpython-37.pyc,, -pip/_vendor/distlib/__pycache__/database.cpython-37.pyc,, -pip/_vendor/distlib/__pycache__/compat.cpython-37.pyc,, -pip/_vendor/distlib/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/distlib/_backport/__pycache__/tarfile.cpython-37.pyc,, -pip/_vendor/distlib/_backport/__pycache__/sysconfig.cpython-37.pyc,, -pip/_vendor/distlib/_backport/__pycache__/shutil.cpython-37.pyc,, -pip/_vendor/distlib/_backport/__pycache__/misc.cpython-37.pyc,, -pip/_vendor/distlib/_backport/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/colorama/__pycache__/winterm.cpython-37.pyc,, -pip/_vendor/colorama/__pycache__/win32.cpython-37.pyc,, -pip/_vendor/colorama/__pycache__/initialise.cpython-37.pyc,, -pip/_vendor/colorama/__pycache__/ansitowin32.cpython-37.pyc,, -pip/_vendor/colorama/__pycache__/ansi.cpython-37.pyc,, -pip/_vendor/colorama/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/version.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/utf8prober.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/universaldetector.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/sjisprober.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/sbcsgroupprober.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/sbcharsetprober.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/mbcssm.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/mbcsgroupprober.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/mbcharsetprober.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/latin1prober.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/langturkishmodel.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/langthaimodel.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/langhungarianmodel.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/langhebrewmodel.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/langgreekmodel.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/langcyrillicmodel.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/langbulgarianmodel.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/jpcntx.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/jisfreq.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/hebrewprober.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/gb2312prober.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/gb2312freq.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/euctwprober.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/euctwfreq.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/euckrprober.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/euckrfreq.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/eucjpprober.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/escsm.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/escprober.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/enums.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/cp949prober.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/compat.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/codingstatemachine.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/charsetprober.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/charsetgroupprober.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/chardistribution.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/big5prober.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/big5freq.cpython-37.pyc,, -pip/_vendor/chardet/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/chardet/cli/__pycache__/chardetect.cpython-37.pyc,, -pip/_vendor/chardet/cli/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/certifi/__pycache__/core.cpython-37.pyc,, -pip/_vendor/certifi/__pycache__/__main__.cpython-37.pyc,, -pip/_vendor/certifi/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/cachecontrol/__pycache__/wrapper.cpython-37.pyc,, -pip/_vendor/cachecontrol/__pycache__/serialize.cpython-37.pyc,, -pip/_vendor/cachecontrol/__pycache__/heuristics.cpython-37.pyc,, -pip/_vendor/cachecontrol/__pycache__/filewrapper.cpython-37.pyc,, -pip/_vendor/cachecontrol/__pycache__/controller.cpython-37.pyc,, -pip/_vendor/cachecontrol/__pycache__/compat.cpython-37.pyc,, -pip/_vendor/cachecontrol/__pycache__/cache.cpython-37.pyc,, -pip/_vendor/cachecontrol/__pycache__/adapter.cpython-37.pyc,, -pip/_vendor/cachecontrol/__pycache__/_cmd.cpython-37.pyc,, -pip/_vendor/cachecontrol/__pycache__/__init__.cpython-37.pyc,, -pip/_vendor/cachecontrol/caches/__pycache__/redis_cache.cpython-37.pyc,, -pip/_vendor/cachecontrol/caches/__pycache__/file_cache.cpython-37.pyc,, -pip/_vendor/cachecontrol/caches/__pycache__/__init__.cpython-37.pyc,, -pip/_internal/__pycache__/wheel.cpython-37.pyc,, -pip/_internal/__pycache__/resolve.cpython-37.pyc,, -pip/_internal/__pycache__/pyproject.cpython-37.pyc,, -pip/_internal/__pycache__/pep425tags.cpython-37.pyc,, -pip/_internal/__pycache__/locations.cpython-37.pyc,, -pip/_internal/__pycache__/index.cpython-37.pyc,, -pip/_internal/__pycache__/exceptions.cpython-37.pyc,, -pip/_internal/__pycache__/download.cpython-37.pyc,, -pip/_internal/__pycache__/configuration.cpython-37.pyc,, -pip/_internal/__pycache__/cache.cpython-37.pyc,, -pip/_internal/__pycache__/build_env.cpython-37.pyc,, -pip/_internal/__pycache__/__init__.cpython-37.pyc,, -pip/_internal/vcs/__pycache__/subversion.cpython-37.pyc,, -pip/_internal/vcs/__pycache__/mercurial.cpython-37.pyc,, -pip/_internal/vcs/__pycache__/git.cpython-37.pyc,, -pip/_internal/vcs/__pycache__/bazaar.cpython-37.pyc,, -pip/_internal/vcs/__pycache__/__init__.cpython-37.pyc,, -pip/_internal/utils/__pycache__/ui.cpython-37.pyc,, -pip/_internal/utils/__pycache__/typing.cpython-37.pyc,, -pip/_internal/utils/__pycache__/temp_dir.cpython-37.pyc,, -pip/_internal/utils/__pycache__/setuptools_build.cpython-37.pyc,, -pip/_internal/utils/__pycache__/packaging.cpython-37.pyc,, -pip/_internal/utils/__pycache__/outdated.cpython-37.pyc,, -pip/_internal/utils/__pycache__/models.cpython-37.pyc,, -pip/_internal/utils/__pycache__/misc.cpython-37.pyc,, -pip/_internal/utils/__pycache__/logging.cpython-37.pyc,, -pip/_internal/utils/__pycache__/hashes.cpython-37.pyc,, -pip/_internal/utils/__pycache__/glibc.cpython-37.pyc,, -pip/_internal/utils/__pycache__/filesystem.cpython-37.pyc,, -pip/_internal/utils/__pycache__/encoding.cpython-37.pyc,, -pip/_internal/utils/__pycache__/deprecation.cpython-37.pyc,, -pip/_internal/utils/__pycache__/compat.cpython-37.pyc,, -pip/_internal/utils/__pycache__/appdirs.cpython-37.pyc,, -pip/_internal/utils/__pycache__/__init__.cpython-37.pyc,, -pip/_internal/req/__pycache__/req_uninstall.cpython-37.pyc,, -pip/_internal/req/__pycache__/req_tracker.cpython-37.pyc,, -pip/_internal/req/__pycache__/req_set.cpython-37.pyc,, -pip/_internal/req/__pycache__/req_install.cpython-37.pyc,, -pip/_internal/req/__pycache__/req_file.cpython-37.pyc,, -pip/_internal/req/__pycache__/constructors.cpython-37.pyc,, -pip/_internal/req/__pycache__/__init__.cpython-37.pyc,, -pip/_internal/operations/__pycache__/prepare.cpython-37.pyc,, -pip/_internal/operations/__pycache__/freeze.cpython-37.pyc,, -pip/_internal/operations/__pycache__/check.cpython-37.pyc,, -pip/_internal/operations/__pycache__/__init__.cpython-37.pyc,, -pip/_internal/models/__pycache__/link.cpython-37.pyc,, -pip/_internal/models/__pycache__/index.cpython-37.pyc,, -pip/_internal/models/__pycache__/format_control.cpython-37.pyc,, -pip/_internal/models/__pycache__/candidate.cpython-37.pyc,, -pip/_internal/models/__pycache__/__init__.cpython-37.pyc,, -pip/_internal/commands/__pycache__/wheel.cpython-37.pyc,, -pip/_internal/commands/__pycache__/uninstall.cpython-37.pyc,, -pip/_internal/commands/__pycache__/show.cpython-37.pyc,, -pip/_internal/commands/__pycache__/search.cpython-37.pyc,, -pip/_internal/commands/__pycache__/list.cpython-37.pyc,, -pip/_internal/commands/__pycache__/install.cpython-37.pyc,, -pip/_internal/commands/__pycache__/help.cpython-37.pyc,, -pip/_internal/commands/__pycache__/hash.cpython-37.pyc,, -pip/_internal/commands/__pycache__/freeze.cpython-37.pyc,, -pip/_internal/commands/__pycache__/download.cpython-37.pyc,, -pip/_internal/commands/__pycache__/configuration.cpython-37.pyc,, -pip/_internal/commands/__pycache__/completion.cpython-37.pyc,, -pip/_internal/commands/__pycache__/check.cpython-37.pyc,, -pip/_internal/commands/__pycache__/__init__.cpython-37.pyc,, -pip/_internal/cli/__pycache__/status_codes.cpython-37.pyc,, -pip/_internal/cli/__pycache__/parser.cpython-37.pyc,, -pip/_internal/cli/__pycache__/main_parser.cpython-37.pyc,, -pip/_internal/cli/__pycache__/cmdoptions.cpython-37.pyc,, -pip/_internal/cli/__pycache__/base_command.cpython-37.pyc,, -pip/_internal/cli/__pycache__/autocompletion.cpython-37.pyc,, -pip/_internal/cli/__pycache__/__init__.cpython-37.pyc,, diff --git a/env/lib/python3.7/site-packages/pip-18.1.dist-info/WHEEL b/env/lib/python3.7/site-packages/pip-18.1.dist-info/WHEEL deleted file mode 100644 index 1001235..0000000 --- a/env/lib/python3.7/site-packages/pip-18.1.dist-info/WHEEL +++ /dev/null @@ -1,6 +0,0 @@ -Wheel-Version: 1.0 -Generator: bdist_wheel (0.32.1) -Root-Is-Purelib: true -Tag: py2-none-any -Tag: py3-none-any - diff --git a/env/lib/python3.7/site-packages/pip-18.1.dist-info/entry_points.txt b/env/lib/python3.7/site-packages/pip-18.1.dist-info/entry_points.txt deleted file mode 100644 index f5809cb..0000000 --- a/env/lib/python3.7/site-packages/pip-18.1.dist-info/entry_points.txt +++ /dev/null @@ -1,5 +0,0 @@ -[console_scripts] -pip = pip._internal:main -pip3 = pip._internal:main -pip3.7 = pip._internal:main - diff --git a/env/lib/python3.7/site-packages/pip-18.1.dist-info/top_level.txt b/env/lib/python3.7/site-packages/pip-18.1.dist-info/top_level.txt deleted file mode 100644 index a1b589e..0000000 --- a/env/lib/python3.7/site-packages/pip-18.1.dist-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -pip diff --git a/env/lib/python3.7/site-packages/pip/__init__.py b/env/lib/python3.7/site-packages/pip/__init__.py index ae265fa..5d05da3 100644 --- a/env/lib/python3.7/site-packages/pip/__init__.py +++ b/env/lib/python3.7/site-packages/pip/__init__.py @@ -1 +1 @@ -__version__ = "18.1" +__version__ = "19.1.1" diff --git a/env/lib/python3.7/site-packages/pip/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/__pycache__/__init__.cpython-37.pyc index e5e27cd..387875b 100644 Binary files a/env/lib/python3.7/site-packages/pip/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/__pycache__/__main__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/__pycache__/__main__.cpython-37.pyc index 472803f..9af70c5 100644 Binary files a/env/lib/python3.7/site-packages/pip/__pycache__/__main__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/__pycache__/__main__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/__init__.py b/env/lib/python3.7/site-packages/pip/_internal/__init__.py index 276124d..9c1637c 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/__init__.py +++ b/env/lib/python3.7/site-packages/pip/_internal/__init__.py @@ -13,7 +13,7 @@ import sys # isn't available. requests unconditionally imports urllib3's socks contrib # module, triggering this warning. The warning breaks DEP-8 tests (because of # the stderr output) and is just plain annoying in normal usage. I don't want -# to add socks as yet another dependency for pip, nor do I want to allow-stder +# to add socks as yet another dependency for pip, nor do I want to allow-stderr # in the DEP-8 tests, so just suppress the warning. pdb tells me this has to # be done before the import of pip.vcs. from pip._vendor.urllib3.exceptions import DependencyWarning diff --git a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/__init__.cpython-37.pyc index 858e1d0..01c8bb7 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/build_env.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/build_env.cpython-37.pyc index dc30dee..8cb8c4b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/build_env.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/build_env.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/cache.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/cache.cpython-37.pyc index 4a03101..5231c3e 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/cache.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/cache.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/configuration.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/configuration.cpython-37.pyc index a781cf1..adff343 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/configuration.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/configuration.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/download.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/download.cpython-37.pyc index d3d2f9d..0519215 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/download.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/download.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/exceptions.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/exceptions.cpython-37.pyc index 05bac64..d07bfa5 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/exceptions.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/exceptions.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/index.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/index.cpython-37.pyc index d90a0f0..ff38019 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/index.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/index.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/locations.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/locations.cpython-37.pyc index 40252b9..499302a 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/locations.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/locations.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/pep425tags.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/pep425tags.cpython-37.pyc index a31a925..c15177d 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/pep425tags.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/pep425tags.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/pyproject.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/pyproject.cpython-37.pyc index 1c3149e..2fc5f6e 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/pyproject.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/pyproject.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/resolve.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/resolve.cpython-37.pyc index 655b05e..ec80c45 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/resolve.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/resolve.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/wheel.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/wheel.cpython-37.pyc index 73dee8d..95e2e30 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/__pycache__/wheel.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/__pycache__/wheel.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/build_env.py b/env/lib/python3.7/site-packages/pip/_internal/build_env.py index 673409d..89830e7 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/build_env.py +++ b/env/lib/python3.7/site-packages/pip/_internal/build_env.py @@ -4,98 +4,173 @@ import logging import os import sys +import textwrap +from collections import OrderedDict from distutils.sysconfig import get_python_lib from sysconfig import get_paths from pip._vendor.pkg_resources import Requirement, VersionConflict, WorkingSet +from pip import __file__ as pip_location from pip._internal.utils.misc import call_subprocess from pip._internal.utils.temp_dir import TempDirectory +from pip._internal.utils.typing import MYPY_CHECK_RUNNING from pip._internal.utils.ui import open_spinner +if MYPY_CHECK_RUNNING: + from typing import Tuple, Set, Iterable, Optional, List + from pip._internal.index import PackageFinder + logger = logging.getLogger(__name__) +class _Prefix: + + def __init__(self, path): + # type: (str) -> None + self.path = path + self.setup = False + self.bin_dir = get_paths( + 'nt' if os.name == 'nt' else 'posix_prefix', + vars={'base': path, 'platbase': path} + )['scripts'] + # Note: prefer distutils' sysconfig to get the + # library paths so PyPy is correctly supported. + purelib = get_python_lib(plat_specific=False, prefix=path) + platlib = get_python_lib(plat_specific=True, prefix=path) + if purelib == platlib: + self.lib_dirs = [purelib] + else: + self.lib_dirs = [purelib, platlib] + + class BuildEnvironment(object): """Creates and manages an isolated environment to install build deps """ def __init__(self): + # type: () -> None self._temp_dir = TempDirectory(kind="build-env") self._temp_dir.create() - @property - def path(self): - return self._temp_dir.path + self._prefixes = OrderedDict(( + (name, _Prefix(os.path.join(self._temp_dir.path, name))) + for name in ('normal', 'overlay') + )) + + self._bin_dirs = [] # type: List[str] + self._lib_dirs = [] # type: List[str] + for prefix in reversed(list(self._prefixes.values())): + self._bin_dirs.append(prefix.bin_dir) + self._lib_dirs.extend(prefix.lib_dirs) + + # Customize site to: + # - ensure .pth files are honored + # - prevent access to system site packages + system_sites = { + os.path.normcase(site) for site in ( + get_python_lib(plat_specific=False), + get_python_lib(plat_specific=True), + ) + } + self._site_dir = os.path.join(self._temp_dir.path, 'site') + if not os.path.exists(self._site_dir): + os.mkdir(self._site_dir) + with open(os.path.join(self._site_dir, 'sitecustomize.py'), 'w') as fp: + fp.write(textwrap.dedent( + ''' + import os, site, sys + + # First, drop system-sites related paths. + original_sys_path = sys.path[:] + known_paths = set() + for path in {system_sites!r}: + site.addsitedir(path, known_paths=known_paths) + system_paths = set( + os.path.normcase(path) + for path in sys.path[len(original_sys_path):] + ) + original_sys_path = [ + path for path in original_sys_path + if os.path.normcase(path) not in system_paths + ] + sys.path = original_sys_path + + # Second, add lib directories. + # ensuring .pth file are processed. + for path in {lib_dirs!r}: + assert not path in sys.path + site.addsitedir(path) + ''' + ).format(system_sites=system_sites, lib_dirs=self._lib_dirs)) def __enter__(self): - self.save_path = os.environ.get('PATH', None) - self.save_pythonpath = os.environ.get('PYTHONPATH', None) - self.save_nousersite = os.environ.get('PYTHONNOUSERSITE', None) + self._save_env = { + name: os.environ.get(name, None) + for name in ('PATH', 'PYTHONNOUSERSITE', 'PYTHONPATH') + } - install_scheme = 'nt' if (os.name == 'nt') else 'posix_prefix' - install_dirs = get_paths(install_scheme, vars={ - 'base': self.path, - 'platbase': self.path, + path = self._bin_dirs[:] + old_path = self._save_env['PATH'] + if old_path: + path.extend(old_path.split(os.pathsep)) + + pythonpath = [self._site_dir] + + os.environ.update({ + 'PATH': os.pathsep.join(path), + 'PYTHONNOUSERSITE': '1', + 'PYTHONPATH': os.pathsep.join(pythonpath), }) - scripts = install_dirs['scripts'] - if self.save_path: - os.environ['PATH'] = scripts + os.pathsep + self.save_path - else: - os.environ['PATH'] = scripts + os.pathsep + os.defpath - - # Note: prefer distutils' sysconfig to get the - # library paths so PyPy is correctly supported. - purelib = get_python_lib(plat_specific=0, prefix=self.path) - platlib = get_python_lib(plat_specific=1, prefix=self.path) - if purelib == platlib: - lib_dirs = purelib - else: - lib_dirs = purelib + os.pathsep + platlib - if self.save_pythonpath: - os.environ['PYTHONPATH'] = lib_dirs + os.pathsep + \ - self.save_pythonpath - else: - os.environ['PYTHONPATH'] = lib_dirs - - os.environ['PYTHONNOUSERSITE'] = '1' - - return self.path - def __exit__(self, exc_type, exc_val, exc_tb): - def restore_var(varname, old_value): + for varname, old_value in self._save_env.items(): if old_value is None: os.environ.pop(varname, None) else: os.environ[varname] = old_value - restore_var('PATH', self.save_path) - restore_var('PYTHONPATH', self.save_pythonpath) - restore_var('PYTHONNOUSERSITE', self.save_nousersite) - def cleanup(self): + # type: () -> None self._temp_dir.cleanup() - def missing_requirements(self, reqs): - """Return a list of the requirements from reqs that are not present + def check_requirements(self, reqs): + # type: (Iterable[str]) -> Tuple[Set[Tuple[str, str]], Set[str]] + """Return 2 sets: + - conflicting requirements: set of (installed, wanted) reqs tuples + - missing requirements: set of reqs """ - missing = [] - with self: - ws = WorkingSet(os.environ["PYTHONPATH"].split(os.pathsep)) + missing = set() + conflicting = set() + if reqs: + ws = WorkingSet(self._lib_dirs) for req in reqs: try: if ws.find(Requirement.parse(req)) is None: - missing.append(req) - except VersionConflict: - missing.append(req) - return missing + missing.add(req) + except VersionConflict as e: + conflicting.add((str(e.args[0].as_requirement()), + str(e.args[1]))) + return conflicting, missing - def install_requirements(self, finder, requirements, message): + def install_requirements( + self, + finder, # type: PackageFinder + requirements, # type: Iterable[str] + prefix_as_string, # type: str + message # type: Optional[str] + ): + # type: (...) -> None + prefix = self._prefixes[prefix_as_string] + assert not prefix.setup + prefix.setup = True + if not requirements: + return args = [ - sys.executable, '-m', 'pip', 'install', '--ignore-installed', - '--no-user', '--prefix', self.path, '--no-warn-script-location', - ] + sys.executable, os.path.dirname(pip_location), 'install', + '--ignore-installed', '--no-user', '--prefix', prefix.path, + '--no-warn-script-location', + ] # type: List[str] if logger.getEffectiveLevel() <= logging.DEBUG: args.append('-v') for format_control in ('no_binary', 'only_binary'): @@ -114,12 +189,10 @@ class BuildEnvironment(object): args.extend(['--trusted-host', host]) if finder.allow_all_prereleases: args.append('--pre') - if finder.process_dependency_links: - args.append('--process-dependency-links') args.append('--') args.extend(requirements) with open_spinner(message) as spinner: - call_subprocess(args, show_stdout=False, spinner=spinner) + call_subprocess(args, spinner=spinner) class NoOpBuildEnvironment(BuildEnvironment): @@ -138,5 +211,5 @@ class NoOpBuildEnvironment(BuildEnvironment): def cleanup(self): pass - def install_requirements(self, finder, requirements, message): + def install_requirements(self, finder, requirements, prefix, message): raise NotImplementedError() diff --git a/env/lib/python3.7/site-packages/pip/_internal/cache.py b/env/lib/python3.7/site-packages/pip/_internal/cache.py index 33bec97..9379343 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/cache.py +++ b/env/lib/python3.7/site-packages/pip/_internal/cache.py @@ -12,8 +12,13 @@ from pip._internal.download import path_to_url from pip._internal.models.link import Link from pip._internal.utils.compat import expanduser from pip._internal.utils.temp_dir import TempDirectory +from pip._internal.utils.typing import MYPY_CHECK_RUNNING from pip._internal.wheel import InvalidWheelFilename, Wheel +if MYPY_CHECK_RUNNING: + from typing import Optional, Set, List, Any + from pip._internal.index import FormatControl + logger = logging.getLogger(__name__) @@ -29,6 +34,7 @@ class Cache(object): """ def __init__(self, cache_dir, format_control, allowed_formats): + # type: (str, FormatControl, Set[str]) -> None super(Cache, self).__init__() self.cache_dir = expanduser(cache_dir) if cache_dir else None self.format_control = format_control @@ -38,6 +44,7 @@ class Cache(object): assert self.allowed_formats.union(_valid_formats) == _valid_formats def _get_cache_path_parts(self, link): + # type: (Link) -> List[str] """Get parts of part that must be os.path.joined with cache_dir """ @@ -63,6 +70,7 @@ class Cache(object): return parts def _get_candidates(self, link, package_name): + # type: (Link, Optional[str]) -> List[Any] can_not_cache = ( not self.cache_dir or not package_name or @@ -87,23 +95,27 @@ class Cache(object): raise def get_path_for_link(self, link): + # type: (Link) -> str """Return a directory to store cached items in for link. """ raise NotImplementedError() def get(self, link, package_name): + # type: (Link, Optional[str]) -> Link """Returns a link to a cached item if it exists, otherwise returns the passed link. """ raise NotImplementedError() def _link_for_candidate(self, link, candidate): + # type: (Link, str) -> Link root = self.get_path_for_link(link) path = os.path.join(root, candidate) return Link(path_to_url(path)) def cleanup(self): + # type: () -> None pass @@ -112,11 +124,13 @@ class SimpleWheelCache(Cache): """ def __init__(self, cache_dir, format_control): + # type: (str, FormatControl) -> None super(SimpleWheelCache, self).__init__( cache_dir, format_control, {"binary"} ) def get_path_for_link(self, link): + # type: (Link) -> str """Return a directory to store cached wheels for link Because there are M wheels for any one sdist, we provide a directory @@ -137,6 +151,7 @@ class SimpleWheelCache(Cache): return os.path.join(self.cache_dir, "wheels", *parts) def get(self, link, package_name): + # type: (Link, Optional[str]) -> Link candidates = [] for wheel_name in self._get_candidates(link, package_name): @@ -160,6 +175,7 @@ class EphemWheelCache(SimpleWheelCache): """ def __init__(self, format_control): + # type: (FormatControl) -> None self._temp_dir = TempDirectory(kind="ephem-wheel-cache") self._temp_dir.create() @@ -168,6 +184,7 @@ class EphemWheelCache(SimpleWheelCache): ) def cleanup(self): + # type: () -> None self._temp_dir.cleanup() @@ -179,6 +196,7 @@ class WheelCache(Cache): """ def __init__(self, cache_dir, format_control): + # type: (str, FormatControl) -> None super(WheelCache, self).__init__( cache_dir, format_control, {'binary'} ) @@ -186,17 +204,21 @@ class WheelCache(Cache): self._ephem_cache = EphemWheelCache(format_control) def get_path_for_link(self, link): + # type: (Link) -> str return self._wheel_cache.get_path_for_link(link) def get_ephem_path_for_link(self, link): + # type: (Link) -> str return self._ephem_cache.get_path_for_link(link) def get(self, link, package_name): + # type: (Link, Optional[str]) -> Link retval = self._wheel_cache.get(link, package_name) if retval is link: retval = self._ephem_cache.get(link, package_name) return retval def cleanup(self): + # type: () -> None self._wheel_cache.cleanup() self._ephem_cache.cleanup() diff --git a/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/__init__.cpython-37.pyc index 0596d29..f73d445 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/autocompletion.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/autocompletion.cpython-37.pyc index 0e1251c..b375d9d 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/autocompletion.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/autocompletion.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/base_command.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/base_command.cpython-37.pyc index ab16aba..86bc1a7 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/base_command.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/base_command.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/cmdoptions.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/cmdoptions.cpython-37.pyc index fce517b..3073436 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/cmdoptions.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/cmdoptions.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/main_parser.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/main_parser.cpython-37.pyc index 8400c89..655ea9f 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/main_parser.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/main_parser.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/parser.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/parser.cpython-37.pyc index e48ce84..60abd8f 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/parser.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/parser.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/status_codes.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/status_codes.cpython-37.pyc index 922cb87..58423e5 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/status_codes.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/cli/__pycache__/status_codes.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/cli/base_command.py b/env/lib/python3.7/site-packages/pip/_internal/cli/base_command.py index dac4b05..f6108c9 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/cli/base_command.py +++ b/env/lib/python3.7/site-packages/pip/_internal/cli/base_command.py @@ -1,11 +1,13 @@ """Base Command class, and related routines""" -from __future__ import absolute_import +from __future__ import absolute_import, print_function import logging import logging.config import optparse import os +import platform import sys +import traceback from pip._internal.cli import cmdoptions from pip._internal.cli.parser import ( @@ -26,13 +28,19 @@ from pip._internal.req.constructors import ( install_req_from_editable, install_req_from_line, ) from pip._internal.req.req_file import parse_requirements -from pip._internal.utils.logging import setup_logging -from pip._internal.utils.misc import get_prog, normalize_path +from pip._internal.utils.deprecation import deprecated +from pip._internal.utils.logging import BrokenStdoutLoggingError, setup_logging +from pip._internal.utils.misc import ( + get_prog, normalize_path, redact_password_from_url, +) from pip._internal.utils.outdated import pip_version_check from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: - from typing import Optional # noqa: F401 + from typing import Optional, List, Tuple, Any + from optparse import Values + from pip._internal.cache import WheelCache + from pip._internal.req.req_set import RequirementSet __all__ = ['Command'] @@ -42,10 +50,10 @@ logger = logging.getLogger(__name__) class Command(object): name = None # type: Optional[str] usage = None # type: Optional[str] - hidden = False # type: bool ignore_require_venv = False # type: bool def __init__(self, isolated=False): + # type: (bool) -> None parser_kw = { 'usage': self.usage, 'prog': '%s %s' % (get_prog(), self.name), @@ -69,7 +77,12 @@ class Command(object): ) self.parser.add_option_group(gen_opts) + def run(self, options, args): + # type: (Values, List[Any]) -> Any + raise NotImplementedError + def _build_session(self, options, retries=None, timeout=None): + # type: (Values, Optional[int], Optional[int]) -> PipSession session = PipSession( cache=( normalize_path(os.path.join(options.cache_dir, "http")) @@ -106,21 +119,43 @@ class Command(object): return session def parse_args(self, args): + # type: (List[str]) -> Tuple # factored out for testability return self.parser.parse_args(args) def main(self, args): + # type: (List[str]) -> int options, args = self.parse_args(args) # Set verbosity so that it can be used elsewhere. self.verbosity = options.verbose - options.quiet - setup_logging( + level_number = setup_logging( verbosity=self.verbosity, no_color=options.no_color, user_log_file=options.log, ) + if sys.version_info[:2] == (3, 4): + deprecated( + "Python 3.4 support has been deprecated. pip 19.1 will be the " + "last one supporting it. Please upgrade your Python as Python " + "3.4 won't be maintained after March 2019 (cf PEP 429).", + replacement=None, + gone_in='19.2', + ) + elif sys.version_info[:2] == (2, 7): + message = ( + "A future version of pip will drop support for Python 2.7." + ) + if platform.python_implementation() == "CPython": + message = ( + "Python 2.7 will reach the end of its life on January " + "1st, 2020. Please upgrade your Python as Python 2.7 " + "won't be maintained after that date. " + ) + message + deprecated(message, replacement=None, gone_in=None) + # TODO: Try to get these passing down from the command? # without resorting to os.environ to hold these. # This also affects isolated builds and it should. @@ -156,9 +191,17 @@ class Command(object): return ERROR except CommandError as exc: - logger.critical('ERROR: %s', exc) + logger.critical('%s', exc) logger.debug('Exception information:', exc_info=True) + return ERROR + except BrokenStdoutLoggingError: + # Bypass our logger and write any remaining messages to stderr + # because stdout no longer works. + print('ERROR: Pipe to stdout was broken', file=sys.stderr) + if level_number <= logging.DEBUG: + traceback.print_exc(file=sys.stderr) + return ERROR except KeyboardInterrupt: logger.critical('Operation cancelled by user') @@ -195,8 +238,15 @@ class Command(object): class RequirementCommand(Command): @staticmethod - def populate_requirement_set(requirement_set, args, options, finder, - session, name, wheel_cache): + def populate_requirement_set(requirement_set, # type: RequirementSet + args, # type: List[str] + options, # type: Values + finder, # type: PackageFinder + session, # type: PipSession + name, # type: str + wheel_cache # type: Optional[WheelCache] + ): + # type: (...) -> None """ Marshal cmd line args into a requirement set. """ @@ -214,6 +264,7 @@ class RequirementCommand(Command): for req in args: req_to_add = install_req_from_line( req, None, isolated=options.isolated_mode, + use_pep517=options.use_pep517, wheel_cache=wheel_cache ) req_to_add.is_direct = True @@ -223,6 +274,7 @@ class RequirementCommand(Command): req_to_add = install_req_from_editable( req, isolated=options.isolated_mode, + use_pep517=options.use_pep517, wheel_cache=wheel_cache ) req_to_add.is_direct = True @@ -232,7 +284,8 @@ class RequirementCommand(Command): for req_to_add in parse_requirements( filename, finder=finder, options=options, session=session, - wheel_cache=wheel_cache): + wheel_cache=wheel_cache, + use_pep517=options.use_pep517): req_to_add.is_direct = True requirement_set.add_requirement(req_to_add) # If --require-hashes was a line in a requirements file, tell @@ -251,15 +304,25 @@ class RequirementCommand(Command): 'You must give at least one requirement to %(name)s ' '(see "pip help %(name)s")' % opts) - def _build_package_finder(self, options, session, - platform=None, python_versions=None, - abi=None, implementation=None): + def _build_package_finder( + self, + options, # type: Values + session, # type: PipSession + platform=None, # type: Optional[str] + python_versions=None, # type: Optional[List[str]] + abi=None, # type: Optional[str] + implementation=None # type: Optional[str] + ): + # type: (...) -> PackageFinder """ Create a package finder appropriate to this requirement command. """ index_urls = [options.index_url] + options.extra_index_urls if options.no_index: - logger.debug('Ignoring indexes: %s', ','.join(index_urls)) + logger.debug( + 'Ignoring indexes: %s', + ','.join(redact_password_from_url(url) for url in index_urls), + ) index_urls = [] return PackageFinder( @@ -268,7 +331,6 @@ class RequirementCommand(Command): index_urls=index_urls, trusted_hosts=options.trusted_hosts, allow_all_prereleases=options.pre, - process_dependency_links=options.process_dependency_links, session=session, platform=platform, versions=python_versions, diff --git a/env/lib/python3.7/site-packages/pip/_internal/cli/cmdoptions.py b/env/lib/python3.7/site-packages/pip/_internal/cli/cmdoptions.py index 3033cd4..a09e38f 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/cli/cmdoptions.py +++ b/env/lib/python3.7/site-packages/pip/_internal/cli/cmdoptions.py @@ -9,7 +9,9 @@ pass on state. To be consistent, all options will follow this design. """ from __future__ import absolute_import +import textwrap import warnings +from distutils.util import strtobool from functools import partial from optparse import SUPPRESS_HELP, Option, OptionGroup @@ -22,10 +24,27 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING from pip._internal.utils.ui import BAR_TYPES if MYPY_CHECK_RUNNING: - from typing import Any # noqa: F401 + from typing import Any, Callable, Dict, Optional + from optparse import OptionParser, Values + from pip._internal.cli.parser import ConfigOptionParser + + +def raise_option_error(parser, option, msg): + """ + Raise an option parsing error using parser.error(). + + Args: + parser: an OptionParser instance. + option: an Option instance. + msg: the error text. + """ + msg = '{} error: {}'.format(option, msg) + msg = textwrap.fill(' '.join(msg.split())) + parser.error(msg) def make_option_group(group, parser): + # type: (Dict[str, Any], ConfigOptionParser) -> OptionGroup """ Return an OptionGroup object group -- assumed to be dict with 'name' and 'options' keys @@ -38,6 +57,7 @@ def make_option_group(group, parser): def check_install_build_global(options, check_options=None): + # type: (Values, Optional[Values]) -> None """Disable wheels if per-setup.py call options are set. :param options: The OptionParser options to update. @@ -60,6 +80,7 @@ def check_install_build_global(options, check_options=None): def check_dist_restriction(options, check_target=False): + # type: (Values, bool) -> None """Function for determining if custom platform options are allowed. :param options: The OptionParser options. @@ -80,7 +101,7 @@ def check_dist_restriction(options, check_target=False): # Installations or downloads using dist restrictions must not combine # source distributions and dist-specific wheels, as they are not - # gauranteed to be locally compatible. + # guaranteed to be locally compatible. if dist_restriction_set and sdist_dependencies_allowed: raise CommandError( "When restricting platform and interpreter constraints using " @@ -108,7 +129,7 @@ help_ = partial( dest='help', action='help', help='Show help.', -) # type: Any +) # type: Callable[..., Option] isolated_mode = partial( Option, @@ -120,7 +141,7 @@ isolated_mode = partial( "Run pip in an isolated mode, ignoring environment variables and user " "configuration." ), -) +) # type: Callable[..., Option] require_virtualenv = partial( Option, @@ -130,7 +151,7 @@ require_virtualenv = partial( action='store_true', default=False, help=SUPPRESS_HELP -) # type: Any +) # type: Callable[..., Option] verbose = partial( Option, @@ -139,7 +160,7 @@ verbose = partial( action='count', default=0, help='Give more output. Option is additive, and can be used up to 3 times.' -) +) # type: Callable[..., Option] no_color = partial( Option, @@ -148,7 +169,7 @@ no_color = partial( action='store_true', default=False, help="Suppress colored output", -) +) # type: Callable[..., Option] version = partial( Option, @@ -156,7 +177,7 @@ version = partial( dest='version', action='store_true', help='Show version and exit.', -) # type: Any +) # type: Callable[..., Option] quiet = partial( Option, @@ -169,7 +190,7 @@ quiet = partial( ' times (corresponding to WARNING, ERROR, and CRITICAL logging' ' levels).' ), -) # type: Any +) # type: Callable[..., Option] progress_bar = partial( Option, @@ -182,7 +203,7 @@ progress_bar = partial( 'Specify type of progress to be displayed [' + '|'.join(BAR_TYPES.keys()) + '] (default: %default)' ), -) # type: Any +) # type: Callable[..., Option] log = partial( Option, @@ -190,7 +211,7 @@ log = partial( dest="log", metavar="path", help="Path to a verbose appending log." -) # type: Any +) # type: Callable[..., Option] no_input = partial( Option, @@ -200,7 +221,7 @@ no_input = partial( action='store_true', default=False, help=SUPPRESS_HELP -) # type: Any +) # type: Callable[..., Option] proxy = partial( Option, @@ -209,7 +230,7 @@ proxy = partial( type='str', default='', help="Specify a proxy in the form [user:passwd@]proxy.server:port." -) # type: Any +) # type: Callable[..., Option] retries = partial( Option, @@ -219,7 +240,7 @@ retries = partial( default=5, help="Maximum number of retries each connection should attempt " "(default %default times).", -) # type: Any +) # type: Callable[..., Option] timeout = partial( Option, @@ -229,7 +250,7 @@ timeout = partial( type='float', default=15, help='Set the socket timeout (default %default seconds).', -) # type: Any +) # type: Callable[..., Option] skip_requirements_regex = partial( Option, @@ -239,10 +260,11 @@ skip_requirements_regex = partial( type='str', default='', help=SUPPRESS_HELP, -) # type: Any +) # type: Callable[..., Option] def exists_action(): + # type: () -> Option return Option( # Option when path already exist '--exists-action', @@ -253,7 +275,7 @@ def exists_action(): action='append', metavar='action', help="Default action when a path already exists: " - "(s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort).", + "(s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.", ) @@ -264,7 +286,7 @@ cert = partial( type='str', metavar='path', help="Path to alternate CA bundle.", -) # type: Any +) # type: Callable[..., Option] client_cert = partial( Option, @@ -275,7 +297,7 @@ client_cert = partial( metavar='path', help="Path to SSL client certificate, a single file containing the " "private key and the certificate in PEM format.", -) # type: Any +) # type: Callable[..., Option] index_url = partial( Option, @@ -287,7 +309,7 @@ index_url = partial( "This should point to a repository compliant with PEP 503 " "(the simple repository API) or a local directory laid out " "in the same format.", -) # type: Any +) # type: Callable[..., Option] def extra_index_url(): @@ -310,10 +332,11 @@ no_index = partial( action='store_true', default=False, help='Ignore package index (only looking at --find-links URLs instead).', -) # type: Any +) # type: Callable[..., Option] def find_links(): + # type: () -> Option return Option( '-f', '--find-links', dest='find_links', @@ -327,6 +350,7 @@ def find_links(): def trusted_host(): + # type: () -> Option return Option( "--trusted-host", dest="trusted_hosts", @@ -338,18 +362,8 @@ def trusted_host(): ) -# Remove after 1.5 -process_dependency_links = partial( - Option, - "--process-dependency-links", - dest="process_dependency_links", - action="store_true", - default=False, - help="Enable the processing of dependency links.", -) # type: Any - - def constraints(): + # type: () -> Option return Option( '-c', '--constraint', dest='constraints', @@ -362,6 +376,7 @@ def constraints(): def requirements(): + # type: () -> Option return Option( '-r', '--requirement', dest='requirements', @@ -374,6 +389,7 @@ def requirements(): def editable(): + # type: () -> Option return Option( '-e', '--editable', dest='editables', @@ -394,15 +410,17 @@ src = partial( help='Directory to check out editable projects into. ' 'The default in a virtualenv is "/src". ' 'The default for global installs is "/src".' -) # type: Any +) # type: Callable[..., Option] def _get_format_control(values, option): + # type: (Values, Option) -> Any """Get a format_control object.""" return getattr(values, option.dest) def _handle_no_binary(option, opt_str, value, parser): + # type: (Option, str, str, OptionParser) -> None existing = _get_format_control(parser.values, option) FormatControl.handle_mutual_excludes( value, existing.no_binary, existing.only_binary, @@ -410,6 +428,7 @@ def _handle_no_binary(option, opt_str, value, parser): def _handle_only_binary(option, opt_str, value, parser): + # type: (Option, str, str, OptionParser) -> None existing = _get_format_control(parser.values, option) FormatControl.handle_mutual_excludes( value, existing.only_binary, existing.no_binary, @@ -417,6 +436,7 @@ def _handle_only_binary(option, opt_str, value, parser): def no_binary(): + # type: () -> Option format_control = FormatControl(set(), set()) return Option( "--no-binary", dest="format_control", action="callback", @@ -432,6 +452,7 @@ def no_binary(): def only_binary(): + # type: () -> Option format_control = FormatControl(set(), set()) return Option( "--only-binary", dest="format_control", action="callback", @@ -454,7 +475,7 @@ platform = partial( default=None, help=("Only use wheels compatible with . " "Defaults to the platform of the running system."), -) +) # type: Callable[..., Option] python_version = partial( @@ -469,7 +490,7 @@ python_version = partial( "version (e.g. '2') can be specified to match all " "minor revs of that major version. A minor version " "(e.g. '34') can also be specified."), -) +) # type: Callable[..., Option] implementation = partial( @@ -483,7 +504,7 @@ implementation = partial( " or 'ip'. If not specified, then the current " "interpreter implementation is used. Use 'py' to force " "implementation-agnostic wheels."), -) +) # type: Callable[..., Option] abi = partial( @@ -498,10 +519,11 @@ abi = partial( "you will need to specify --implementation, " "--platform, and --python-version when using " "this option."), -) +) # type: Callable[..., Option] def prefer_binary(): + # type: () -> Option return Option( "--prefer-binary", dest="prefer_binary", @@ -518,15 +540,44 @@ cache_dir = partial( default=USER_CACHE_DIR, metavar="dir", help="Store the cache data in ." -) +) # type: Callable[..., Option] + + +def no_cache_dir_callback(option, opt, value, parser): + """ + Process a value provided for the --no-cache-dir option. + + This is an optparse.Option callback for the --no-cache-dir option. + """ + # The value argument will be None if --no-cache-dir is passed via the + # command-line, since the option doesn't accept arguments. However, + # the value can be non-None if the option is triggered e.g. by an + # environment variable, like PIP_NO_CACHE_DIR=true. + if value is not None: + # Then parse the string value to get argument error-checking. + try: + strtobool(value) + except ValueError as exc: + raise_option_error(parser, option=option, msg=str(exc)) + + # Originally, setting PIP_NO_CACHE_DIR to a value that strtobool() + # converted to 0 (like "false" or "no") caused cache_dir to be disabled + # rather than enabled (logic would say the latter). Thus, we disable + # the cache directory not just on values that parse to True, but (for + # backwards compatibility reasons) also on values that parse to False. + # In other words, always set it to False if the option is provided in + # some (valid) form. + parser.values.cache_dir = False + no_cache = partial( Option, "--no-cache-dir", dest="cache_dir", - action="store_false", + action="callback", + callback=no_cache_dir_callback, help="Disable the cache.", -) +) # type: Callable[..., Option] no_deps = partial( Option, @@ -535,7 +586,7 @@ no_deps = partial( action='store_true', default=False, help="Don't install package dependencies.", -) # type: Any +) # type: Callable[..., Option] build_dir = partial( Option, @@ -547,7 +598,7 @@ build_dir = partial( 'The location of temporary directories can be controlled by setting ' 'the TMPDIR environment variable (TEMP on Windows) appropriately. ' 'When passed, build directories are not cleaned in case of failures.' -) # type: Any +) # type: Callable[..., Option] ignore_requires_python = partial( Option, @@ -555,7 +606,7 @@ ignore_requires_python = partial( dest='ignore_requires_python', action='store_true', help='Ignore the Requires-Python information.' -) # type: Any +) # type: Callable[..., Option] no_build_isolation = partial( Option, @@ -566,6 +617,50 @@ no_build_isolation = partial( help='Disable isolation when building a modern source distribution. ' 'Build dependencies specified by PEP 518 must be already installed ' 'if this option is used.' +) # type: Callable[..., Option] + + +def no_use_pep517_callback(option, opt, value, parser): + """ + Process a value provided for the --no-use-pep517 option. + + This is an optparse.Option callback for the no_use_pep517 option. + """ + # Since --no-use-pep517 doesn't accept arguments, the value argument + # will be None if --no-use-pep517 is passed via the command-line. + # However, the value can be non-None if the option is triggered e.g. + # by an environment variable, for example "PIP_NO_USE_PEP517=true". + if value is not None: + msg = """A value was passed for --no-use-pep517, + probably using either the PIP_NO_USE_PEP517 environment variable + or the "no-use-pep517" config file option. Use an appropriate value + of the PIP_USE_PEP517 environment variable or the "use-pep517" + config file option instead. + """ + raise_option_error(parser, option=option, msg=msg) + + # Otherwise, --no-use-pep517 was passed via the command-line. + parser.values.use_pep517 = False + + +use_pep517 = partial( + Option, + '--use-pep517', + dest='use_pep517', + action='store_true', + default=None, + help='Use PEP 517 for building source distributions ' + '(use --no-use-pep517 to force legacy behaviour).' +) # type: Any + +no_use_pep517 = partial( + Option, + '--no-use-pep517', + dest='use_pep517', + action='callback', + callback=no_use_pep517_callback, + default=None, + help=SUPPRESS_HELP ) # type: Any install_options = partial( @@ -579,7 +674,7 @@ install_options = partial( "bin\"). Use multiple --install-option options to pass multiple " "options to setup.py install. If you are using an option with a " "directory path, be sure to use absolute path.", -) # type: Any +) # type: Callable[..., Option] global_options = partial( Option, @@ -589,7 +684,7 @@ global_options = partial( metavar='options', help="Extra global options to be supplied to the setup.py " "call before the install command.", -) # type: Any +) # type: Callable[..., Option] no_clean = partial( Option, @@ -597,7 +692,7 @@ no_clean = partial( action='store_true', default=False, help="Don't clean up build directories." -) # type: Any +) # type: Callable[..., Option] pre = partial( Option, @@ -606,7 +701,7 @@ pre = partial( default=False, help="Include pre-release and development versions. By default, " "pip only finds stable versions.", -) # type: Any +) # type: Callable[..., Option] disable_pip_version_check = partial( Option, @@ -616,7 +711,7 @@ disable_pip_version_check = partial( default=False, help="Don't periodically check PyPI to determine whether a new version " "of pip is available for download. Implied with --no-index.", -) # type: Any +) # type: Callable[..., Option] # Deprecated, Remove later @@ -626,10 +721,11 @@ always_unzip = partial( dest='always_unzip', action='store_true', help=SUPPRESS_HELP, -) # type: Any +) # type: Callable[..., Option] def _merge_hash(option, opt_str, value, parser): + # type: (Option, str, str, OptionParser) -> None """Given a value spelled "algo:digest", append the digest to a list pointed to in a dict by the algo name.""" if not parser.values.hashes: @@ -657,7 +753,7 @@ hash = partial( type='string', help="Verify that the package's archive matches this " 'hash before installing. Example: --hash=sha256:abcdef...', -) # type: Any +) # type: Callable[..., Option] require_hashes = partial( @@ -669,7 +765,7 @@ require_hashes = partial( help='Require a hash to check each requirement against, for ' 'repeatable installs. This option is implied when any package in a ' 'requirements file has a --hash option.', -) # type: Any +) # type: Callable[..., Option] ########## @@ -700,7 +796,7 @@ general_group = { disable_pip_version_check, no_color, ] -} +} # type: Dict[str, Any] index_group = { 'name': 'Package Index Options', @@ -709,6 +805,5 @@ index_group = { extra_index_url, no_index, find_links, - process_dependency_links, ] -} +} # type: Dict[str, Any] diff --git a/env/lib/python3.7/site-packages/pip/_internal/cli/main_parser.py b/env/lib/python3.7/site-packages/pip/_internal/cli/main_parser.py index 1774a6b..767f35d 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/cli/main_parser.py +++ b/env/lib/python3.7/site-packages/pip/_internal/cli/main_parser.py @@ -14,11 +14,17 @@ from pip._internal.commands import ( ) from pip._internal.exceptions import CommandError from pip._internal.utils.misc import get_prog +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + from typing import Tuple, List + __all__ = ["create_main_parser", "parse_command"] def create_main_parser(): + # type: () -> ConfigOptionParser """Creates and returns the main parser for pip's CLI """ @@ -44,7 +50,8 @@ def create_main_parser(): gen_opts = cmdoptions.make_option_group(cmdoptions.general_group, parser) parser.add_option_group(gen_opts) - parser.main = True # so the help formatter knows + # so the help formatter knows + parser.main = True # type: ignore # create command listing for description command_summaries = get_summaries() @@ -55,6 +62,7 @@ def create_main_parser(): def parse_command(args): + # type: (List[str]) -> Tuple[str, List[str]] parser = create_main_parser() # Note: parser calls disable_interspersed_args(), so the result of this @@ -68,7 +76,7 @@ def parse_command(args): # --version if general_options.version: - sys.stdout.write(parser.version) + sys.stdout.write(parser.version) # type: ignore sys.stdout.write(os.linesep) sys.exit() diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/__init__.py b/env/lib/python3.7/site-packages/pip/_internal/commands/__init__.py index c7d1da3..2e90db3 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/commands/__init__.py +++ b/env/lib/python3.7/site-packages/pip/_internal/commands/__init__.py @@ -20,8 +20,8 @@ from pip._internal.commands.wheel import WheelCommand from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: - from typing import List, Type # noqa: F401 - from pip._internal.cli.base_command import Command # noqa: F401 + from typing import List, Type + from pip._internal.cli.base_command import Command commands_order = [ InstallCommand, diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/__init__.cpython-37.pyc index 789db49..6b2425e 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/check.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/check.cpython-37.pyc index d6c3193..0495772 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/check.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/check.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/completion.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/completion.cpython-37.pyc index 4b8b81c..b3bf8ac 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/completion.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/completion.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/configuration.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/configuration.cpython-37.pyc index 308fe90..e23fb7a 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/configuration.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/configuration.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/download.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/download.cpython-37.pyc index 99ce5e7..b7c92f1 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/download.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/download.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/freeze.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/freeze.cpython-37.pyc index e8f86b3..a429ba1 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/freeze.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/freeze.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/hash.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/hash.cpython-37.pyc index 37e8077..da9ccad 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/hash.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/hash.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/help.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/help.cpython-37.pyc index f2790ba..9ea058a 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/help.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/help.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/install.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/install.cpython-37.pyc index 0191c19..847ddb3 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/install.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/install.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/list.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/list.cpython-37.pyc index 5b80f79..f01f7b9 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/list.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/list.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/search.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/search.cpython-37.pyc index 34f9dd3..aa68e45 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/search.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/search.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/show.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/show.cpython-37.pyc index e023535..ad170e6 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/show.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/show.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/uninstall.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/uninstall.cpython-37.pyc index 95c6e79..4b0b002 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/uninstall.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/uninstall.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/wheel.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/wheel.cpython-37.pyc index 39d5f41..4d86357 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/wheel.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/wheel.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/check.py b/env/lib/python3.7/site-packages/pip/_internal/commands/check.py index 1be3ec2..801cecc 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/commands/check.py +++ b/env/lib/python3.7/site-packages/pip/_internal/commands/check.py @@ -16,7 +16,7 @@ class CheckCommand(Command): summary = 'Verify installed packages have compatible dependencies.' def run(self, options, args): - package_set = create_package_set_from_installed() + package_set, parsing_probs = create_package_set_from_installed() missing, conflicting = check_package_set(package_set) for project_name in missing: @@ -35,7 +35,7 @@ class CheckCommand(Command): project_name, version, req, dep_name, dep_version, ) - if missing or conflicting: + if missing or conflicting or parsing_probs: return 1 else: logger.info("No broken requirements found.") diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/configuration.py b/env/lib/python3.7/site-packages/pip/_internal/commands/configuration.py index 826c08d..950e205 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/commands/configuration.py +++ b/env/lib/python3.7/site-packages/pip/_internal/commands/configuration.py @@ -6,7 +6,8 @@ from pip._internal.cli.base_command import Command from pip._internal.cli.status_codes import ERROR, SUCCESS from pip._internal.configuration import Configuration, kinds from pip._internal.exceptions import PipError -from pip._internal.locations import venv_config_file +from pip._internal.locations import running_under_virtualenv, site_config_file +from pip._internal.utils.deprecation import deprecated from pip._internal.utils.misc import get_prog logger = logging.getLogger(__name__) @@ -23,7 +24,7 @@ class ConfigurationCommand(Command): set: Set the name=value unset: Unset the value associated with name - If none of --user, --global and --venv are passed, a virtual + If none of --user, --global and --site are passed, a virtual environment configuration file is used if one is active and the file exists. Otherwise, all modifications happen on the to the user file by default. @@ -73,12 +74,23 @@ class ConfigurationCommand(Command): help='Use the user configuration file only' ) + self.cmd_opts.add_option( + '--site', + dest='site_file', + action='store_true', + default=False, + help='Use the current environment configuration file only' + ) + self.cmd_opts.add_option( '--venv', dest='venv_file', action='store_true', default=False, - help='Use the virtualenv configuration file only' + help=( + '[Deprecated] Use the current environment configuration ' + 'file in a virtual environment only' + ) ) self.parser.insert_option_group(0, self.cmd_opts) @@ -127,27 +139,41 @@ class ConfigurationCommand(Command): return SUCCESS def _determine_file(self, options, need_value): - file_options = { - kinds.USER: options.user_file, - kinds.GLOBAL: options.global_file, - kinds.VENV: options.venv_file - } + # Convert legacy venv_file option to site_file or error + if options.venv_file and not options.site_file: + if running_under_virtualenv(): + options.site_file = True + deprecated( + "The --venv option has been deprecated.", + replacement="--site", + gone_in="19.3", + ) + else: + raise PipError( + "Legacy --venv option requires a virtual environment. " + "Use --site instead." + ) - if sum(file_options.values()) == 0: + file_options = [key for key, value in ( + (kinds.USER, options.user_file), + (kinds.GLOBAL, options.global_file), + (kinds.SITE, options.site_file), + ) if value] + + if not file_options: if not need_value: return None - # Default to user, unless there's a virtualenv file. - elif os.path.exists(venv_config_file): - return kinds.VENV + # Default to user, unless there's a site file. + elif os.path.exists(site_config_file): + return kinds.SITE else: return kinds.USER - elif sum(file_options.values()) == 1: - # There's probably a better expression for this. - return [key for key in file_options if file_options[key]][0] + elif len(file_options) == 1: + return file_options[0] raise PipError( "Need exactly one file to operate upon " - "(--user, --venv, --global) to perform." + "(--user, --site, --global) to perform." ) def list_values(self, options, args): diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/download.py b/env/lib/python3.7/site-packages/pip/_internal/commands/download.py index b3f3c6e..a57e4bc 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/commands/download.py +++ b/env/lib/python3.7/site-packages/pip/_internal/commands/download.py @@ -58,6 +58,8 @@ class DownloadCommand(RequirementCommand): cmd_opts.add_option(cmdoptions.require_hashes()) cmd_opts.add_option(cmdoptions.progress_bar()) cmd_opts.add_option(cmdoptions.no_build_isolation()) + cmd_opts.add_option(cmdoptions.use_pep517()) + cmd_opts.add_option(cmdoptions.no_use_pep517()) cmd_opts.add_option( '-d', '--dest', '--destination-dir', '--destination-directory', diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/install.py b/env/lib/python3.7/site-packages/pip/_internal/commands/install.py index 6fc178f..c13da44 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/commands/install.py +++ b/env/lib/python3.7/site-packages/pip/_internal/commands/install.py @@ -30,15 +30,46 @@ from pip._internal.utils.misc import ( from pip._internal.utils.temp_dir import TempDirectory from pip._internal.wheel import WheelBuilder -try: - import wheel -except ImportError: - wheel = None - - logger = logging.getLogger(__name__) +def is_wheel_installed(): + """ + Return whether the wheel package is installed. + """ + try: + import wheel # noqa: F401 + except ImportError: + return False + + return True + + +def build_wheels(builder, pep517_requirements, legacy_requirements, session): + """ + Build wheels for requirements, depending on whether wheel is installed. + """ + # We don't build wheels for legacy requirements if wheel is not installed. + should_build_legacy = is_wheel_installed() + + # Always build PEP 517 requirements + build_failures = builder.build( + pep517_requirements, + session=session, autobuilding=True + ) + + if should_build_legacy: + # We don't care about failures building legacy + # requirements, as we'll fall through to a direct + # install for those. + builder.build( + legacy_requirements, + session=session, autobuilding=True + ) + + return build_failures + + class InstallCommand(RequirementCommand): """ Install packages from: @@ -158,6 +189,8 @@ class InstallCommand(RequirementCommand): cmd_opts.add_option(cmdoptions.ignore_requires_python()) cmd_opts.add_option(cmdoptions.no_build_isolation()) + cmd_opts.add_option(cmdoptions.use_pep517()) + cmd_opts.add_option(cmdoptions.no_use_pep517()) cmd_opts.add_option(cmdoptions.install_options()) cmd_opts.add_option(cmdoptions.global_options()) @@ -314,6 +347,7 @@ class InstallCommand(RequirementCommand): ignore_requires_python=options.ignore_requires_python, ignore_installed=options.ignore_installed, isolated=options.isolated_mode, + use_pep517=options.use_pep517 ) resolver.resolve(requirement_set) @@ -321,20 +355,34 @@ class InstallCommand(RequirementCommand): modifying_pip=requirement_set.has_requirement("pip") ) - # If caching is disabled or wheel is not installed don't - # try to build wheels. - if wheel and options.cache_dir: - # build wheels before install. - wb = WheelBuilder( - finder, preparer, wheel_cache, - build_options=[], global_options=[], - ) - # Ignore the result: a failed wheel will be - # installed from the sdist/vcs whatever. - wb.build( - requirement_set.requirements.values(), - session=session, autobuilding=True - ) + # Consider legacy and PEP517-using requirements separately + legacy_requirements = [] + pep517_requirements = [] + for req in requirement_set.requirements.values(): + if req.use_pep517: + pep517_requirements.append(req) + else: + legacy_requirements.append(req) + + wheel_builder = WheelBuilder( + finder, preparer, wheel_cache, + build_options=[], global_options=[], + ) + + build_failures = build_wheels( + builder=wheel_builder, + pep517_requirements=pep517_requirements, + legacy_requirements=legacy_requirements, + session=session, + ) + + # If we're using PEP 517, we cannot do a direct install + # so we fail here. + if build_failures: + raise InstallationError( + "Could not build wheels for {} which use" + " PEP 517 and cannot be installed directly".format( + ", ".join(r.name for r in build_failures))) to_install = resolver.get_installation_order( requirement_set @@ -472,7 +520,11 @@ class InstallCommand(RequirementCommand): ) def _warn_about_conflicts(self, to_install): - package_set, _dep_info = check_install_conflicts(to_install) + try: + package_set, _dep_info = check_install_conflicts(to_install) + except Exception: + logger.error("Error checking for conflicts.", exc_info=True) + return missing, conflicting = _dep_info # NOTE: There is some duplication here from pip check diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/list.py b/env/lib/python3.7/site-packages/pip/_internal/commands/list.py index c6eeca7..d70782d 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/commands/list.py +++ b/env/lib/python3.7/site-packages/pip/_internal/commands/list.py @@ -118,7 +118,6 @@ class ListCommand(Command): index_urls=index_urls, allow_all_prereleases=options.pre, trusted_hosts=options.trusted_hosts, - process_dependency_links=options.process_dependency_links, session=session, ) @@ -134,14 +133,18 @@ class ListCommand(Command): include_editables=options.include_editable, ) + # get_not_required must be called firstly in order to find and + # filter out all dependencies correctly. Otherwise a package + # can't be identified as requirement because some parent packages + # could be filtered out before. + if options.not_required: + packages = self.get_not_required(packages, options) + if options.outdated: packages = self.get_outdated(packages, options) elif options.uptodate: packages = self.get_uptodate(packages, options) - if options.not_required: - packages = self.get_not_required(packages, options) - self.output_package_listing(packages, options) def get_outdated(self, packages, options): @@ -168,16 +171,8 @@ class ListCommand(Command): logger.debug('Ignoring indexes: %s', ','.join(index_urls)) index_urls = [] - dependency_links = [] - for dist in packages: - if dist.has_metadata('dependency_links.txt'): - dependency_links.extend( - dist.get_metadata_lines('dependency_links.txt'), - ) - with self._build_session(options) as session: finder = self._build_package_finder(options, index_urls, session) - finder.add_dependency_links(dependency_links) for dist in packages: typ = 'unknown' @@ -187,10 +182,11 @@ class ListCommand(Command): all_candidates = [candidate for candidate in all_candidates if not candidate.version.is_prerelease] - if not all_candidates: + evaluator = finder.candidate_evaluator + best_candidate = evaluator.get_best_candidate(all_candidates) + if best_candidate is None: continue - best_candidate = max(all_candidates, - key=finder._candidate_sort_key) + remote_version = best_candidate.version if best_candidate.location.is_wheel: typ = 'wheel' diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/show.py b/env/lib/python3.7/site-packages/pip/_internal/commands/show.py index f92c9bc..a18a902 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/commands/show.py +++ b/env/lib/python3.7/site-packages/pip/_internal/commands/show.py @@ -2,7 +2,7 @@ from __future__ import absolute_import import logging import os -from email.parser import FeedParser # type: ignore +from email.parser import FeedParser from pip._vendor import pkg_resources from pip._vendor.packaging.utils import canonicalize_name diff --git a/env/lib/python3.7/site-packages/pip/_internal/commands/wheel.py b/env/lib/python3.7/site-packages/pip/_internal/commands/wheel.py index 9c1f149..cd72a3d 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/commands/wheel.py +++ b/env/lib/python3.7/site-packages/pip/_internal/commands/wheel.py @@ -67,6 +67,8 @@ class WheelCommand(RequirementCommand): help="Extra arguments to be supplied to 'setup.py bdist_wheel'.", ) cmd_opts.add_option(cmdoptions.no_build_isolation()) + cmd_opts.add_option(cmdoptions.use_pep517()) + cmd_opts.add_option(cmdoptions.no_use_pep517()) cmd_opts.add_option(cmdoptions.constraints()) cmd_opts.add_option(cmdoptions.editable()) cmd_opts.add_option(cmdoptions.requirements()) @@ -157,6 +159,7 @@ class WheelCommand(RequirementCommand): ignore_requires_python=options.ignore_requires_python, ignore_installed=True, isolated=options.isolated_mode, + use_pep517=options.use_pep517 ) resolver.resolve(requirement_set) @@ -167,10 +170,10 @@ class WheelCommand(RequirementCommand): global_options=options.global_options or [], no_clean=options.no_clean, ) - wheels_built_successfully = wb.build( + build_failures = wb.build( requirement_set.requirements.values(), session=session, ) - if not wheels_built_successfully: + if len(build_failures) != 0: raise CommandError( "Failed to build one or more wheels" ) diff --git a/env/lib/python3.7/site-packages/pip/_internal/configuration.py b/env/lib/python3.7/site-packages/pip/_internal/configuration.py index fe6df9b..b199fa7 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/configuration.py +++ b/env/lib/python3.7/site-packages/pip/_internal/configuration.py @@ -15,21 +15,19 @@ import locale import logging import os -from pip._vendor import six from pip._vendor.six.moves import configparser from pip._internal.exceptions import ( ConfigurationError, ConfigurationFileCouldNotBeLoaded, ) from pip._internal.locations import ( - legacy_config_file, new_config_file, running_under_virtualenv, - site_config_files, venv_config_file, + global_config_files, legacy_config_file, new_config_file, site_config_file, ) from pip._internal.utils.misc import ensure_dir, enum from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: - from typing import ( # noqa: F401 + from typing import ( Any, Dict, Iterable, List, NewType, Optional, Tuple ) @@ -59,7 +57,7 @@ def _disassemble_key(name): kinds = enum( USER="user", # User Specific GLOBAL="global", # System Wide - VENV="venv", # Virtual Environment Specific + SITE="site", # [Virtual] Environment Specific ENV="env", # from PIP_CONFIG_FILE ENV_VAR="env-var", # from Environment Variables ) @@ -83,7 +81,7 @@ class Configuration(object): # type: (bool, Kind) -> None super(Configuration, self).__init__() - _valid_load_only = [kinds.USER, kinds.GLOBAL, kinds.VENV, None] + _valid_load_only = [kinds.USER, kinds.GLOBAL, kinds.SITE, None] if load_only not in _valid_load_only: raise ConfigurationError( "Got invalid value for load_only - should be one of {}".format( @@ -95,7 +93,7 @@ class Configuration(object): # The order here determines the override order. self._override_order = [ - kinds.GLOBAL, kinds.USER, kinds.VENV, kinds.ENV, kinds.ENV_VAR + kinds.GLOBAL, kinds.USER, kinds.SITE, kinds.ENV, kinds.ENV_VAR ] self._ignore_env_names = ["version", "help"] @@ -188,7 +186,7 @@ class Configuration(object): # name removed from parser, section may now be empty section_iter = iter(parser.items(section)) try: - val = six.next(section_iter) + val = next(section_iter) except StopIteration: val = None @@ -205,7 +203,7 @@ class Configuration(object): def save(self): # type: () -> None - """Save the currentin-memory state. + """Save the current in-memory state. """ self._ensure_have_load_only() @@ -216,7 +214,7 @@ class Configuration(object): ensure_dir(os.path.dirname(fname)) with open(fname, "w") as f: - parser.write(f) # type: ignore + parser.write(f) # # Private routines @@ -352,7 +350,7 @@ class Configuration(object): yield kinds.ENV, [] # at the base we have any global configuration - yield kinds.GLOBAL, list(site_config_files) + yield kinds.GLOBAL, list(global_config_files) # per-user configuration next should_load_user_config = not self.isolated and not ( @@ -363,8 +361,7 @@ class Configuration(object): yield kinds.USER, [legacy_config_file, new_config_file] # finally virtualenv configuration first trumping others - if running_under_virtualenv(): - yield kinds.VENV, [venv_config_file] + yield kinds.SITE, [site_config_file] def _get_parser_to_modify(self): # type: () -> Tuple[str, RawConfigParser] diff --git a/env/lib/python3.7/site-packages/pip/_internal/download.py b/env/lib/python3.7/site-packages/pip/_internal/download.py index 96f3b65..2683cf0 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/download.py +++ b/env/lib/python3.7/site-packages/pip/_internal/download.py @@ -26,7 +26,6 @@ from pip._vendor.requests.utils import get_netrc_auth from pip._vendor.six.moves import xmlrpc_client # type: ignore from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._vendor.six.moves.urllib import request as urllib_request -from pip._vendor.six.moves.urllib.parse import unquote as urllib_unquote from pip._vendor.urllib3.util import IS_PYOPENSSL import pip @@ -36,17 +35,24 @@ from pip._internal.models.index import PyPI from pip._internal.utils.encoding import auto_decode from pip._internal.utils.filesystem import check_path_owner from pip._internal.utils.glibc import libc_ver -from pip._internal.utils.logging import indent_log from pip._internal.utils.misc import ( - ARCHIVE_EXTENSIONS, ask_path_exists, backup_dir, call_subprocess, consume, - display_path, format_size, get_installed_version, rmtree, splitext, - unpack_file, + ARCHIVE_EXTENSIONS, ask_path_exists, backup_dir, consume, display_path, + format_size, get_installed_version, rmtree, split_auth_from_netloc, + splitext, unpack_file, ) -from pip._internal.utils.setuptools_build import SETUPTOOLS_SHIM from pip._internal.utils.temp_dir import TempDirectory +from pip._internal.utils.typing import MYPY_CHECK_RUNNING from pip._internal.utils.ui import DownloadProgressProvider from pip._internal.vcs import vcs +if MYPY_CHECK_RUNNING: + from typing import ( + Optional, Tuple, Dict, IO, Text, Union + ) + from pip._internal.models.link import Link + from pip._internal.utils.hashes import Hashes + from pip._internal.vcs import AuthInfo + try: import ssl # noqa except ImportError: @@ -64,6 +70,34 @@ __all__ = ['get_file_content', logger = logging.getLogger(__name__) +# These are environment variables present when running under various +# CI systems. For each variable, some CI systems that use the variable +# are indicated. The collection was chosen so that for each of a number +# of popular systems, at least one of the environment variables is used. +# This list is used to provide some indication of and lower bound for +# CI traffic to PyPI. Thus, it is okay if the list is not comprehensive. +# For more background, see: https://github.com/pypa/pip/issues/5499 +CI_ENVIRONMENT_VARIABLES = ( + # Azure Pipelines + 'BUILD_BUILDID', + # Jenkins + 'BUILD_ID', + # AppVeyor, CircleCI, Codeship, Gitlab CI, Shippable, Travis CI + 'CI', +) + + +def looks_like_ci(): + # type: () -> bool + """ + Return whether it looks like pip is running under CI. + """ + # We don't use the method of checking for a tty (e.g. using isatty()) + # because some CI systems mimic a tty (e.g. Travis CI). Thus that + # method doesn't provide definitive information in either direction. + return any(name in os.environ for name in CI_ENVIRONMENT_VARIABLES) + + def user_agent(): """ Return a string representing the user agent. @@ -127,6 +161,16 @@ def user_agent(): if setuptools_version is not None: data["setuptools_version"] = setuptools_version + # Use None rather than False so as not to give the impression that + # pip knows it is not being run under CI. Rather, it is a null or + # inconclusive result. Also, we include some value rather than no + # value to make it easier to know that the check has been run. + data["ci"] = True if looks_like_ci() else None + + user_data = os.environ.get("PIP_USER_AGENT_USER_DATA") + if user_data is not None: + data["user_data"] = user_data + return "{data[installer][name]}/{data[installer][version]} {json}".format( data=data, json=json.dumps(data, separators=(",", ":"), sort_keys=True), @@ -136,14 +180,15 @@ def user_agent(): class MultiDomainBasicAuth(AuthBase): def __init__(self, prompting=True): + # type: (bool) -> None self.prompting = prompting - self.passwords = {} + self.passwords = {} # type: Dict[str, AuthInfo] def __call__(self, req): parsed = urllib_parse.urlparse(req.url) - # Get the netloc without any embedded credentials - netloc = parsed.netloc.rsplit("@", 1)[-1] + # Split the credentials from the netloc. + netloc, url_user_password = split_auth_from_netloc(parsed.netloc) # Set the url of the request to the url without any credentials req.url = urllib_parse.urlunparse(parsed[:1] + (netloc,) + parsed[2:]) @@ -151,9 +196,9 @@ class MultiDomainBasicAuth(AuthBase): # Use any stored credentials that we have for this netloc username, password = self.passwords.get(netloc, (None, None)) - # Extract credentials embedded in the url if we have none stored + # Use the credentials embedded in the url if we have none stored if username is None: - username, password = self.parse_credentials(parsed.netloc) + username, password = url_user_password # Get creds from netrc if we still don't have them if username is None and password is None: @@ -199,6 +244,7 @@ class MultiDomainBasicAuth(AuthBase): # Add our new username and password to the request req = HTTPBasicAuth(username or "", password or "")(resp.request) + req.register_hook("response", self.warn_on_401) # Send our new request new_resp = resp.connection.send(req, **kwargs) @@ -206,14 +252,11 @@ class MultiDomainBasicAuth(AuthBase): return new_resp - def parse_credentials(self, netloc): - if "@" in netloc: - userinfo = netloc.rsplit("@", 1)[0] - if ":" in userinfo: - user, pwd = userinfo.split(":", 1) - return (urllib_unquote(user), urllib_unquote(pwd)) - return urllib_unquote(userinfo), None - return None, None + def warn_on_401(self, resp, **kwargs): + # warn user that they provided incorrect credentials + if resp.status_code == 401: + logger.warning('401 Error, Credentials not correct for %s', + resp.request.url) class LocalFSAdapter(BaseAdapter): @@ -324,7 +367,7 @@ class InsecureHTTPAdapter(HTTPAdapter): class PipSession(requests.Session): - timeout = None + timeout = None # type: Optional[int] def __init__(self, *args, **kwargs): retries = kwargs.pop("retries", 0) @@ -397,6 +440,7 @@ class PipSession(requests.Session): def get_file_content(url, comes_from=None, session=None): + # type: (str, Optional[str], Optional[PipSession]) -> Tuple[str, Text] """Gets the content of a file; it may be a filename, file: URL, or http: URL. Returns (location, content). Content is unicode. @@ -447,6 +491,7 @@ _url_slash_drive_re = re.compile(r'/*([a-z])\|', re.I) def is_url(name): + # type: (Union[str, Text]) -> bool """Returns true if the name looks like a URL""" if ':' not in name: return False @@ -455,6 +500,7 @@ def is_url(name): def url_to_path(url): + # type: (str) -> str """ Convert a file: URL to a path. """ @@ -463,15 +509,24 @@ def url_to_path(url): _, netloc, path, _, _ = urllib_parse.urlsplit(url) - # if we have a UNC path, prepend UNC share notation - if netloc: + if not netloc or netloc == 'localhost': + # According to RFC 8089, same as empty authority. + netloc = '' + elif sys.platform == 'win32': + # If we have a UNC path, prepend UNC share notation. netloc = '\\\\' + netloc + else: + raise ValueError( + 'non-local file URIs are not supported on this platform: %r' + % url + ) path = urllib_request.url2pathname(netloc + path) return path def path_to_url(path): + # type: (Union[str, Text]) -> str """ Convert a path to a file: URL. The path will be made absolute and have quoted path parts. @@ -482,6 +537,7 @@ def path_to_url(path): def is_archive_file(name): + # type: (str) -> bool """Return True if `name` is a considered as an archive file.""" ext = splitext(name)[1].lower() if ext in ARCHIVE_EXTENSIONS: @@ -502,14 +558,17 @@ def _get_used_vcs_backend(link): def is_vcs_url(link): + # type: (Link) -> bool return bool(_get_used_vcs_backend(link)) def is_file_url(link): + # type: (Link) -> bool return link.url.lower().startswith('file:') def is_dir_url(link): + # type: (Link) -> bool """Return whether a file:// Link points to a directory. ``link`` must not have any other scheme but file://. Call is_file_url() @@ -524,7 +583,14 @@ def _progress_indicator(iterable, *args, **kwargs): return iterable -def _download_url(resp, link, content_file, hashes, progress_bar): +def _download_url( + resp, # type: Response + link, # type: Link + content_file, # type: IO + hashes, # type: Hashes + progress_bar # type: str +): + # type: (...) -> None try: total_length = int(resp.headers['content-length']) except (ValueError, KeyError, TypeError): @@ -646,8 +712,15 @@ def _copy_file(filename, location, link): logger.info('Saved %s', display_path(download_location)) -def unpack_http_url(link, location, download_dir=None, - session=None, hashes=None, progress_bar="on"): +def unpack_http_url( + link, # type: Link + location, # type: str + download_dir=None, # type: Optional[str] + session=None, # type: Optional[PipSession] + hashes=None, # type: Optional[Hashes] + progress_bar="on" # type: str +): + # type: (...) -> None if session is None: raise TypeError( "unpack_http_url() missing 1 required keyword argument: 'session'" @@ -684,7 +757,13 @@ def unpack_http_url(link, location, download_dir=None, os.unlink(from_path) -def unpack_file_url(link, location, download_dir=None, hashes=None): +def unpack_file_url( + link, # type: Link + location, # type: str + download_dir=None, # type: Optional[str] + hashes=None # type: Optional[Hashes] +): + # type: (...) -> None """Unpack link into location. If download_dir is provided and link points to a file, make a copy @@ -732,42 +811,6 @@ def unpack_file_url(link, location, download_dir=None, hashes=None): _copy_file(from_path, download_dir, link) -def _copy_dist_from_dir(link_path, location): - """Copy distribution files in `link_path` to `location`. - - Invoked when user requests to install a local directory. E.g.: - - pip install . - pip install ~/dev/git-repos/python-prompt-toolkit - - """ - - # Note: This is currently VERY SLOW if you have a lot of data in the - # directory, because it copies everything with `shutil.copytree`. - # What it should really do is build an sdist and install that. - # See https://github.com/pypa/pip/issues/2195 - - if os.path.isdir(location): - rmtree(location) - - # build an sdist - setup_py = 'setup.py' - sdist_args = [sys.executable] - sdist_args.append('-c') - sdist_args.append(SETUPTOOLS_SHIM % setup_py) - sdist_args.append('sdist') - sdist_args += ['--dist-dir', location] - logger.info('Running setup.py sdist for %s', link_path) - - with indent_log(): - call_subprocess(sdist_args, cwd=link_path, show_stdout=False) - - # unpack sdist into `location` - sdist = os.path.join(location, os.listdir(location)[0]) - logger.info('Unpacking sdist %s into %s', sdist, location) - unpack_file(sdist, location, content_type=None, link=None) - - class PipXmlrpcTransport(xmlrpc_client.Transport): """Provide a `xmlrpclib.Transport` implementation via a `PipSession` object. @@ -797,9 +840,16 @@ class PipXmlrpcTransport(xmlrpc_client.Transport): raise -def unpack_url(link, location, download_dir=None, - only_download=False, session=None, hashes=None, - progress_bar="on"): +def unpack_url( + link, # type: Optional[Link] + location, # type: Optional[str] + download_dir=None, # type: Optional[str] + only_download=False, # type: bool + session=None, # type: Optional[PipSession] + hashes=None, # type: Optional[Hashes] + progress_bar="on" # type: str +): + # type: (...) -> None """Unpack link. If link is a VCS link: if only_download, export into download_dir and ignore location @@ -839,7 +889,14 @@ def unpack_url(link, location, download_dir=None, write_delete_marker_file(location) -def _download_http_url(link, session, temp_dir, hashes, progress_bar): +def _download_http_url( + link, # type: Link + session, # type: PipSession + temp_dir, # type: str + hashes, # type: Hashes + progress_bar # type: str +): + # type: (...) -> Tuple[str, str] """Download link url into temp_dir using provided session""" target_url = link.url.split('#', 1)[0] try: @@ -899,6 +956,7 @@ def _download_http_url(link, session, temp_dir, hashes, progress_bar): def _check_download_dir(link, download_dir, hashes): + # type: (Link, str, Hashes) -> Optional[str] """ Check download_dir for previously downloaded file with correct hash If a correct file is found return its path else None """ diff --git a/env/lib/python3.7/site-packages/pip/_internal/exceptions.py b/env/lib/python3.7/site-packages/pip/_internal/exceptions.py index f1ca6f3..7b291a1 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/exceptions.py +++ b/env/lib/python3.7/site-packages/pip/_internal/exceptions.py @@ -5,6 +5,12 @@ from itertools import chain, groupby, repeat from pip._vendor.six import iteritems +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + from typing import Optional + from pip._internal.req.req_install import InstallRequirement + class PipError(Exception): """Base pip exception""" @@ -96,7 +102,7 @@ class HashError(InstallationError): typically available earlier. """ - req = None + req = None # type: Optional[InstallRequirement] head = '' def body(self): diff --git a/env/lib/python3.7/site-packages/pip/_internal/index.py b/env/lib/python3.7/site-packages/pip/_internal/index.py index 8c2f24f..ff614b3 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/index.py +++ b/env/lib/python3.7/site-packages/pip/_internal/index.py @@ -16,7 +16,7 @@ from pip._vendor.distlib.compat import unescape from pip._vendor.packaging import specifiers from pip._vendor.packaging.utils import canonicalize_name from pip._vendor.packaging.version import parse as parse_version -from pip._vendor.requests.exceptions import SSLError +from pip._vendor.requests.exceptions import HTTPError, RetryError, SSLError from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._vendor.six.moves.urllib import request as urllib_request @@ -31,16 +31,33 @@ from pip._internal.models.index import PyPI from pip._internal.models.link import Link from pip._internal.pep425tags import get_supported from pip._internal.utils.compat import ipaddress -from pip._internal.utils.deprecation import deprecated from pip._internal.utils.logging import indent_log from pip._internal.utils.misc import ( - ARCHIVE_EXTENSIONS, SUPPORTED_EXTENSIONS, normalize_path, - remove_auth_from_url, + ARCHIVE_EXTENSIONS, SUPPORTED_EXTENSIONS, WHEEL_EXTENSION, normalize_path, + redact_password_from_url, ) from pip._internal.utils.packaging import check_requires_python -from pip._internal.wheel import Wheel, wheel_ext +from pip._internal.utils.typing import MYPY_CHECK_RUNNING +from pip._internal.wheel import Wheel -__all__ = ['FormatControl', 'PackageFinder'] +if MYPY_CHECK_RUNNING: + from logging import Logger + from typing import ( + Tuple, Optional, Any, List, Union, Callable, Set, Sequence, + Iterable, MutableMapping + ) + from pip._vendor.packaging.version import _BaseVersion + from pip._vendor.requests import Response + from pip._internal.pep425tags import Pep425Tag + from pip._internal.req import InstallRequirement + from pip._internal.download import PipSession + + SecureOrigin = Tuple[str, str, Optional[str]] + BuildTag = Tuple[Any, ...] # either empty tuple or Tuple[int, str] + CandidateSortingKey = Tuple[int, _BaseVersion, BuildTag, Optional[int]] + + +__all__ = ['FormatControl', 'FoundCandidates', 'PackageFinder'] SECURE_ORIGINS = [ @@ -53,126 +70,329 @@ SECURE_ORIGINS = [ ("file", "*", None), # ssh is always secure. ("ssh", "*", "*"), -] +] # type: List[SecureOrigin] logger = logging.getLogger(__name__) -def _get_content_type(url, session): - """Get the Content-Type of the given url, using a HEAD request""" +def _match_vcs_scheme(url): + # type: (str) -> Optional[str] + """Look for VCS schemes in the URL. + + Returns the matched VCS scheme, or None if there's no match. + """ + from pip._internal.vcs import VcsSupport + for scheme in VcsSupport.schemes: + if url.lower().startswith(scheme) and url[len(scheme)] in '+:': + return scheme + return None + + +def _is_url_like_archive(url): + # type: (str) -> bool + """Return whether the URL looks like an archive. + """ + filename = Link(url).filename + for bad_ext in ARCHIVE_EXTENSIONS: + if filename.endswith(bad_ext): + return True + return False + + +class _NotHTML(Exception): + def __init__(self, content_type, request_desc): + # type: (str, str) -> None + super(_NotHTML, self).__init__(content_type, request_desc) + self.content_type = content_type + self.request_desc = request_desc + + +def _ensure_html_header(response): + # type: (Response) -> None + """Check the Content-Type header to ensure the response contains HTML. + + Raises `_NotHTML` if the content type is not text/html. + """ + content_type = response.headers.get("Content-Type", "") + if not content_type.lower().startswith("text/html"): + raise _NotHTML(content_type, response.request.method) + + +class _NotHTTP(Exception): + pass + + +def _ensure_html_response(url, session): + # type: (str, PipSession) -> None + """Send a HEAD request to the URL, and ensure the response contains HTML. + + Raises `_NotHTTP` if the URL is not available for a HEAD request, or + `_NotHTML` if the content type is not text/html. + """ scheme, netloc, path, query, fragment = urllib_parse.urlsplit(url) if scheme not in {'http', 'https'}: - # FIXME: some warning or something? - # assertion error? - return '' + raise _NotHTTP() resp = session.head(url, allow_redirects=True) resp.raise_for_status() - return resp.headers.get("Content-Type", "") + _ensure_html_header(resp) -def _handle_get_page_fail(link, reason, url, meth=None): +def _get_html_response(url, session): + # type: (str, PipSession) -> Response + """Access an HTML page with GET, and return the response. + + This consists of three parts: + + 1. If the URL looks suspiciously like an archive, send a HEAD first to + check the Content-Type is HTML, to avoid downloading a large file. + Raise `_NotHTTP` if the content type cannot be determined, or + `_NotHTML` if it is not HTML. + 2. Actually perform the request. Raise HTTP exceptions on network failures. + 3. Check the Content-Type header to make sure we got HTML, and raise + `_NotHTML` otherwise. + """ + if _is_url_like_archive(url): + _ensure_html_response(url, session=session) + + logger.debug('Getting page %s', redact_password_from_url(url)) + + resp = session.get( + url, + headers={ + "Accept": "text/html", + # We don't want to blindly returned cached data for + # /simple/, because authors generally expecting that + # twine upload && pip install will function, but if + # they've done a pip install in the last ~10 minutes + # it won't. Thus by setting this to zero we will not + # blindly use any cached data, however the benefit of + # using max-age=0 instead of no-cache, is that we will + # still support conditional requests, so we will still + # minimize traffic sent in cases where the page hasn't + # changed at all, we will just always incur the round + # trip for the conditional GET now instead of only + # once per 10 minutes. + # For more information, please see pypa/pip#5670. + "Cache-Control": "max-age=0", + }, + ) + resp.raise_for_status() + + # The check for archives above only works if the url ends with + # something that looks like an archive. However that is not a + # requirement of an url. Unless we issue a HEAD request on every + # url we cannot know ahead of time for sure if something is HTML + # or not. However we can check after we've downloaded it. + _ensure_html_header(resp) + + return resp + + +def _handle_get_page_fail( + link, # type: Link + reason, # type: Union[str, Exception] + meth=None # type: Optional[Callable[..., None]] +): + # type: (...) -> None if meth is None: meth = logger.debug meth("Could not fetch URL %s: %s - skipping", link, reason) def _get_html_page(link, session=None): + # type: (Link, Optional[PipSession]) -> Optional[HTMLPage] if session is None: raise TypeError( "_get_html_page() missing 1 required keyword argument: 'session'" ) - url = link.url - url = url.split('#', 1)[0] + url = link.url.split('#', 1)[0] # Check for VCS schemes that do not support lookup as web pages. - from pip._internal.vcs import VcsSupport - for scheme in VcsSupport.schemes: - if url.lower().startswith(scheme) and url[len(scheme)] in '+:': - logger.debug('Cannot look at %s URL %s', scheme, link) - return None + vcs_scheme = _match_vcs_scheme(url) + if vcs_scheme: + logger.debug('Cannot look at %s URL %s', vcs_scheme, link) + return None + + # Tack index.html onto file:// URLs that point to directories + scheme, _, path, _, _, _ = urllib_parse.urlparse(url) + if (scheme == 'file' and os.path.isdir(urllib_request.url2pathname(path))): + # add trailing slash if not present so urljoin doesn't trim + # final segment + if not url.endswith('/'): + url += '/' + url = urllib_parse.urljoin(url, 'index.html') + logger.debug(' file: URL is directory, getting %s', url) try: - filename = link.filename - for bad_ext in ARCHIVE_EXTENSIONS: - if filename.endswith(bad_ext): - content_type = _get_content_type(url, session=session) - if content_type.lower().startswith('text/html'): - break - else: - logger.debug( - 'Skipping page %s because of Content-Type: %s', - link, - content_type, - ) - return - - logger.debug('Getting page %s', url) - - # Tack index.html onto file:// URLs that point to directories - (scheme, netloc, path, params, query, fragment) = \ - urllib_parse.urlparse(url) - if (scheme == 'file' and - os.path.isdir(urllib_request.url2pathname(path))): - # add trailing slash if not present so urljoin doesn't trim - # final segment - if not url.endswith('/'): - url += '/' - url = urllib_parse.urljoin(url, 'index.html') - logger.debug(' file: URL is directory, getting %s', url) - - resp = session.get( - url, - headers={ - "Accept": "text/html", - # We don't want to blindly returned cached data for - # /simple/, because authors generally expecting that - # twine upload && pip install will function, but if - # they've done a pip install in the last ~10 minutes - # it won't. Thus by setting this to zero we will not - # blindly use any cached data, however the benefit of - # using max-age=0 instead of no-cache, is that we will - # still support conditional requests, so we will still - # minimize traffic sent in cases where the page hasn't - # changed at all, we will just always incur the round - # trip for the conditional GET now instead of only - # once per 10 minutes. - # For more information, please see pypa/pip#5670. - "Cache-Control": "max-age=0", - }, + resp = _get_html_response(url, session=session) + except _NotHTTP: + logger.debug( + 'Skipping page %s because it looks like an archive, and cannot ' + 'be checked by HEAD.', link, ) - resp.raise_for_status() - - # The check for archives above only works if the url ends with - # something that looks like an archive. However that is not a - # requirement of an url. Unless we issue a HEAD request on every - # url we cannot know ahead of time for sure if something is HTML - # or not. However we can check after we've downloaded it. - content_type = resp.headers.get('Content-Type', 'unknown') - if not content_type.lower().startswith("text/html"): - logger.debug( - 'Skipping page %s because of Content-Type: %s', - link, - content_type, - ) - return - - inst = HTMLPage(resp.content, resp.url, resp.headers) - except requests.HTTPError as exc: - _handle_get_page_fail(link, exc, url) + except _NotHTML as exc: + logger.debug( + 'Skipping page %s because the %s request got Content-Type: %s', + link, exc.request_desc, exc.content_type, + ) + except HTTPError as exc: + _handle_get_page_fail(link, exc) + except RetryError as exc: + _handle_get_page_fail(link, exc) except SSLError as exc: reason = "There was a problem confirming the ssl certificate: " reason += str(exc) - _handle_get_page_fail(link, reason, url, meth=logger.info) + _handle_get_page_fail(link, reason, meth=logger.info) except requests.ConnectionError as exc: - _handle_get_page_fail(link, "connection error: %s" % exc, url) + _handle_get_page_fail(link, "connection error: %s" % exc) except requests.Timeout: - _handle_get_page_fail(link, "timed out", url) + _handle_get_page_fail(link, "timed out") else: - return inst + return HTMLPage(resp.content, resp.url, resp.headers) + return None + + +class CandidateEvaluator(object): + + def __init__( + self, + valid_tags, # type: List[Pep425Tag] + prefer_binary=False # type: bool + + ): + # type: (...) -> None + self._prefer_binary = prefer_binary + self._valid_tags = valid_tags + + def is_wheel_supported(self, wheel): + # type: (Wheel) -> bool + return wheel.supported(self._valid_tags) + + def _sort_key(self, candidate): + # type: (InstallationCandidate) -> CandidateSortingKey + """ + Function used to generate link sort key for link tuples. + The greater the return value, the more preferred it is. + If not finding wheels, then sorted by version only. + If finding wheels, then the sort order is by version, then: + 1. existing installs + 2. wheels ordered via Wheel.support_index_min(self._valid_tags) + 3. source archives + If prefer_binary was set, then all wheels are sorted above sources. + Note: it was considered to embed this logic into the Link + comparison operators, but then different sdist links + with the same version, would have to be considered equal + """ + support_num = len(self._valid_tags) + build_tag = tuple() # type: BuildTag + binary_preference = 0 + if candidate.location.is_wheel: + # can raise InvalidWheelFilename + wheel = Wheel(candidate.location.filename) + if not wheel.supported(self._valid_tags): + raise UnsupportedWheel( + "%s is not a supported wheel for this platform. It " + "can't be sorted." % wheel.filename + ) + if self._prefer_binary: + binary_preference = 1 + pri = -(wheel.support_index_min(self._valid_tags)) + if wheel.build_tag is not None: + match = re.match(r'^(\d+)(.*)$', wheel.build_tag) + build_tag_groups = match.groups() + build_tag = (int(build_tag_groups[0]), build_tag_groups[1]) + else: # sdist + pri = -(support_num) + return (binary_preference, candidate.version, build_tag, pri) + + def get_best_candidate(self, candidates): + # type: (List[InstallationCandidate]) -> InstallationCandidate + """ + Return the best candidate per the instance's sort order, or None if + no candidates are given. + """ + if not candidates: + return None + + return max(candidates, key=self._sort_key) + + +class FoundCandidates(object): + """A collection of candidates, returned by `PackageFinder.find_candidates`. + + This class is only intended to be instantiated by PackageFinder through + the `from_specifier()` constructor. + + Arguments: + + * `candidates`: A sequence of all available candidates found. + * `specifier`: Specifier to filter applicable versions. + * `prereleases`: Whether prereleases should be accounted. Pass None to + infer from the specifier. + * `evaluator`: A CandidateEvaluator object to sort applicable candidates + by order of preference. + """ + + def __init__( + self, + candidates, # type: List[InstallationCandidate] + versions, # type: Set[str] + evaluator, # type: CandidateEvaluator + ): + # type: (...) -> None + self._candidates = candidates + self._evaluator = evaluator + self._versions = versions + + @classmethod + def from_specifier( + cls, + candidates, # type: List[InstallationCandidate] + specifier, # type: specifiers.BaseSpecifier + prereleases, # type: Optional[bool] + evaluator, # type: CandidateEvaluator + ): + # type: (...) -> FoundCandidates + versions = { + str(v) for v in specifier.filter( + # We turn the version object into a str here because otherwise + # when we're debundled but setuptools isn't, Python will see + # packaging.version.Version and + # pkg_resources._vendor.packaging.version.Version as different + # types. This way we'll use a str as a common data interchange + # format. If we stop using the pkg_resources provided specifier + # and start using our own, we can drop the cast to str(). + (str(c.version) for c in candidates), + prereleases=prereleases, + ) + } + return cls(candidates, versions, evaluator) + + def iter_all(self): + # type: () -> Iterable[InstallationCandidate] + """Iterate through all candidates. + """ + return iter(self._candidates) + + def iter_applicable(self): + # type: () -> Iterable[InstallationCandidate] + """Iterate through candidates matching the versions associated with + this instance. + """ + # Again, converting version to str to deal with debundling. + return (c for c in self.iter_all() if str(c.version) in self._versions) + + def get_best(self): + # type: () -> Optional[InstallationCandidate] + """Return the best candidate available, or None if no applicable + candidates are found. + """ + candidates = list(self.iter_applicable()) + return self._evaluator.get_best_candidate(candidates) class PackageFinder(object): @@ -182,11 +402,21 @@ class PackageFinder(object): packages, by reading pages and looking for appropriate links. """ - def __init__(self, find_links, index_urls, allow_all_prereleases=False, - trusted_hosts=None, process_dependency_links=False, - session=None, format_control=None, platform=None, - versions=None, abi=None, implementation=None, - prefer_binary=False): + def __init__( + self, + find_links, # type: List[str] + index_urls, # type: List[str] + allow_all_prereleases=False, # type: bool + trusted_hosts=None, # type: Optional[Iterable[str]] + session=None, # type: Optional[PipSession] + format_control=None, # type: Optional[FormatControl] + platform=None, # type: Optional[str] + versions=None, # type: Optional[List[str]] + abi=None, # type: Optional[str] + implementation=None, # type: Optional[str] + prefer_binary=False # type: bool + ): + # type: (...) -> None """Create a PackageFinder. :param format_control: A FormatControl object or None. Used to control @@ -203,6 +433,8 @@ class PackageFinder(object): to pep425tags.py in the get_supported() method. :param implementation: A string or None. This is passed directly to pep425tags.py in the get_supported() method. + :param prefer_binary: Whether to prefer an old, but valid, binary + dist over a new source dist. """ if session is None: raise TypeError( @@ -215,7 +447,7 @@ class PackageFinder(object): # it and if it exists, use the normalized version. # This is deliberately conservative - it might be fine just to # blindly normalize anything starting with a ~... - self.find_links = [] + self.find_links = [] # type: List[str] for link in find_links: if link.startswith('~'): new_link = normalize_path(link) @@ -224,10 +456,9 @@ class PackageFinder(object): self.find_links.append(link) self.index_urls = index_urls - self.dependency_links = [] # These are boring links that have already been logged somehow: - self.logged_links = set() + self.logged_links = set() # type: Set[Link] self.format_control = format_control or FormatControl(set(), set()) @@ -235,27 +466,24 @@ class PackageFinder(object): self.secure_origins = [ ("*", host, "*") for host in (trusted_hosts if trusted_hosts else []) - ] + ] # type: List[SecureOrigin] # Do we want to allow _all_ pre-releases? self.allow_all_prereleases = allow_all_prereleases - # Do we process dependency links? - self.process_dependency_links = process_dependency_links - # The Session we'll use to make requests self.session = session # The valid tags to check potential found wheel candidates against - self.valid_tags = get_supported( + valid_tags = get_supported( versions=versions, platform=platform, abi=abi, impl=implementation, ) - - # Do we prefer old, but valid, binary dist over new source dist - self.prefer_binary = prefer_binary + self.candidate_evaluator = CandidateEvaluator( + valid_tags=valid_tags, prefer_binary=prefer_binary, + ) # If we don't have TLS enabled, then WARN if anyplace we're looking # relies on TLS. @@ -271,11 +499,12 @@ class PackageFinder(object): break def get_formatted_locations(self): + # type: () -> str lines = [] if self.index_urls and self.index_urls != [PyPI.simple_url]: lines.append( "Looking in indexes: {}".format(", ".join( - remove_auth_from_url(url) for url in self.index_urls)) + redact_password_from_url(url) for url in self.index_urls)) ) if self.find_links: lines.append( @@ -283,23 +512,9 @@ class PackageFinder(object): ) return "\n".join(lines) - def add_dependency_links(self, links): - # FIXME: this shouldn't be global list this, it should only - # apply to requirements of the package that specifies the - # dependency_links value - # FIXME: also, we should track comes_from (i.e., use Link) - if self.process_dependency_links: - deprecated( - "Dependency Links processing has been deprecated and will be " - "removed in a future release.", - replacement="PEP 508 URL dependencies", - gone_in="18.2", - issue=4187, - ) - self.dependency_links.extend(links) - @staticmethod def _sort_locations(locations, expand_dir=False): + # type: (Sequence[str], bool) -> Tuple[List[str], List[str]] """ Sort locations into "files" (archives) and "urls", and return a pair of lists (files,urls) @@ -332,6 +547,11 @@ class PackageFinder(object): sort_path(os.path.join(path, item)) elif is_file_url: urls.append(url) + else: + logger.warning( + "Path '{0}' is ignored: " + "it is a directory.".format(path), + ) elif os.path.isfile(path): sort_path(path) else: @@ -350,43 +570,8 @@ class PackageFinder(object): return files, urls - def _candidate_sort_key(self, candidate): - """ - Function used to generate link sort key for link tuples. - The greater the return value, the more preferred it is. - If not finding wheels, then sorted by version only. - If finding wheels, then the sort order is by version, then: - 1. existing installs - 2. wheels ordered via Wheel.support_index_min(self.valid_tags) - 3. source archives - If prefer_binary was set, then all wheels are sorted above sources. - Note: it was considered to embed this logic into the Link - comparison operators, but then different sdist links - with the same version, would have to be considered equal - """ - support_num = len(self.valid_tags) - build_tag = tuple() - binary_preference = 0 - if candidate.location.is_wheel: - # can raise InvalidWheelFilename - wheel = Wheel(candidate.location.filename) - if not wheel.supported(self.valid_tags): - raise UnsupportedWheel( - "%s is not a supported wheel for this platform. It " - "can't be sorted." % wheel.filename - ) - if self.prefer_binary: - binary_preference = 1 - pri = -(wheel.support_index_min(self.valid_tags)) - if wheel.build_tag is not None: - match = re.match(r'^(\d+)(.*)$', wheel.build_tag) - build_tag_groups = match.groups() - build_tag = (int(build_tag_groups[0]), build_tag_groups[1]) - else: # sdist - pri = -(support_num) - return (binary_preference, candidate.version, build_tag, pri) - def _validate_secure_origin(self, logger, location): + # type: (Logger, Link) -> bool # Determine if this url used a secure transport mechanism parsed = urllib_parse.urlparse(str(location)) origin = (parsed.scheme, parsed.hostname, parsed.port) @@ -418,7 +603,9 @@ class PackageFinder(object): network = ipaddress.ip_network( secure_origin[1] if isinstance(secure_origin[1], six.text_type) - else secure_origin[1].decode("utf8") + # setting secure_origin[1] to proper Union[bytes, str] + # creates problems in other places + else secure_origin[1].decode("utf8") # type: ignore ) except ValueError: # We don't have both a valid address or a valid network, so @@ -458,6 +645,7 @@ class PackageFinder(object): return False def _get_index_urls_locations(self, project_name): + # type: (str) -> List[str] """Returns the locations found via self.index_urls Checks the url_name on the main (first in the list) index and @@ -480,9 +668,10 @@ class PackageFinder(object): return [mkurl_pypi_url(url) for url in self.index_urls] def find_all_candidates(self, project_name): + # type: (str) -> List[Optional[InstallationCandidate]] """Find all available InstallationCandidate for project_name - This checks index_urls, find_links and dependency_links. + This checks index_urls and find_links. All versions found are returned as an InstallationCandidate list. See _link_package_versions for details on which files are accepted @@ -492,21 +681,18 @@ class PackageFinder(object): fl_file_loc, fl_url_loc = self._sort_locations( self.find_links, expand_dir=True, ) - dep_file_loc, dep_url_loc = self._sort_locations(self.dependency_links) file_locations = (Link(url) for url in itertools.chain( - index_file_loc, fl_file_loc, dep_file_loc, + index_file_loc, fl_file_loc, )) # We trust every url that the user has given us whether it was given - # via --index-url or --find-links - # We explicitly do not trust links that came from dependency_links + # via --index-url or --find-links. # We want to filter out any thing which does not have a secure origin. url_locations = [ link for link in itertools.chain( (Link(url) for url in index_url_loc), (Link(url) for url in fl_url_loc), - (Link(url) for url in dep_url_loc), ) if self._validate_secure_origin(logger, link) ] @@ -534,17 +720,6 @@ class PackageFinder(object): self._package_versions(page.iter_links(), search) ) - dependency_versions = self._package_versions( - (Link(url) for url in self.dependency_links), search - ) - if dependency_versions: - logger.debug( - 'dependency_links found: %s', - ', '.join([ - version.location.url for version in dependency_versions - ]) - ) - file_versions = self._package_versions(file_locations, search) if file_versions: file_versions.sort(reverse=True) @@ -557,64 +732,60 @@ class PackageFinder(object): ) # This is an intentional priority ordering - return ( - file_versions + find_links_versions + page_versions + - dependency_versions + return file_versions + find_links_versions + page_versions + + def find_candidates( + self, + project_name, # type: str + specifier=None, # type: Optional[specifiers.BaseSpecifier] + ): + """Find matches for the given project and specifier. + + If given, `specifier` should implement `filter` to allow version + filtering (e.g. ``packaging.specifiers.SpecifierSet``). + + Returns a `FoundCandidates` instance. + """ + if specifier is None: + specifier = specifiers.SpecifierSet() + return FoundCandidates.from_specifier( + self.find_all_candidates(project_name), + specifier=specifier, + prereleases=(self.allow_all_prereleases or None), + evaluator=self.candidate_evaluator, ) def find_requirement(self, req, upgrade): + # type: (InstallRequirement, bool) -> Optional[Link] """Try to find a Link matching req Expects req, an InstallRequirement and upgrade, a boolean Returns a Link if found, Raises DistributionNotFound or BestVersionAlreadyInstalled otherwise """ - all_candidates = self.find_all_candidates(req.name) - - # Filter out anything which doesn't match our specifier - compatible_versions = set( - req.specifier.filter( - # We turn the version object into a str here because otherwise - # when we're debundled but setuptools isn't, Python will see - # packaging.version.Version and - # pkg_resources._vendor.packaging.version.Version as different - # types. This way we'll use a str as a common data interchange - # format. If we stop using the pkg_resources provided specifier - # and start using our own, we can drop the cast to str(). - [str(c.version) for c in all_candidates], - prereleases=( - self.allow_all_prereleases - if self.allow_all_prereleases else None - ), - ) - ) - applicable_candidates = [ - # Again, converting to str to deal with debundling. - c for c in all_candidates if str(c.version) in compatible_versions - ] - - if applicable_candidates: - best_candidate = max(applicable_candidates, - key=self._candidate_sort_key) - else: - best_candidate = None + candidates = self.find_candidates(req.name, req.specifier) + best_candidate = candidates.get_best() + installed_version = None # type: Optional[_BaseVersion] if req.satisfied_by is not None: installed_version = parse_version(req.satisfied_by.version) - else: - installed_version = None + + def _format_versions(cand_iter): + # This repeated parse_version and str() conversion is needed to + # handle different vendoring sources from pip and pkg_resources. + # If we stop using the pkg_resources provided specifier and start + # using our own, we can drop the cast to str(). + return ", ".join(sorted( + {str(c.version) for c in cand_iter}, + key=parse_version, + )) or "none" if installed_version is None and best_candidate is None: logger.critical( 'Could not find a version that satisfies the requirement %s ' '(from versions: %s)', req, - ', '.join( - sorted( - {str(c.version) for c in all_candidates}, - key=parse_version, - ) - ) + _format_versions(candidates.iter_all()), ) raise DistributionNotFound( @@ -649,30 +820,30 @@ class PackageFinder(object): 'Installed version (%s) is most up-to-date (past versions: ' '%s)', installed_version, - ', '.join(sorted(compatible_versions, key=parse_version)) or - "none", + _format_versions(candidates.iter_applicable()), ) raise BestVersionAlreadyInstalled logger.debug( 'Using version %s (newest of versions: %s)', best_candidate.version, - ', '.join(sorted(compatible_versions, key=parse_version)) + _format_versions(candidates.iter_applicable()), ) return best_candidate.location def _get_pages(self, locations, project_name): + # type: (Iterable[Link], str) -> Iterable[HTMLPage] """ Yields (page, page_url) from the given locations, skipping locations that have errors. """ - seen = set() + seen = set() # type: Set[Link] for location in locations: if location in seen: continue seen.add(location) - page = self._get_page(location) + page = _get_html_page(location, session=self.session) if page is None: continue @@ -681,12 +852,13 @@ class PackageFinder(object): _py_version_re = re.compile(r'-py([123]\.?[0-9]?)$') def _sort_links(self, links): + # type: (Iterable[Link]) -> List[Link] """ Returns elements of links in order, non-egg links first, egg links second, while eliminating duplicates """ eggs, no_eggs = [], [] - seen = set() + seen = set() # type: Set[Link] for link in links: if link not in seen: seen.add(link) @@ -696,7 +868,12 @@ class PackageFinder(object): no_eggs.append(link) return no_eggs + eggs - def _package_versions(self, links, search): + def _package_versions( + self, + links, # type: Iterable[Link] + search # type: Search + ): + # type: (...) -> List[Optional[InstallationCandidate]] result = [] for link in self._sort_links(links): v = self._link_package_versions(link, search) @@ -705,11 +882,13 @@ class PackageFinder(object): return result def _log_skipped_link(self, link, reason): + # type: (Link, str) -> None if link not in self.logged_links: logger.debug('Skipping link %s; %s', link, reason) self.logged_links.add(link) def _link_package_versions(self, link, search): + # type: (Link, Search) -> Optional[InstallationCandidate] """Return an InstallationCandidate or None""" version = None if link.egg_fragment: @@ -719,51 +898,51 @@ class PackageFinder(object): egg_info, ext = link.splitext() if not ext: self._log_skipped_link(link, 'not a file') - return + return None if ext not in SUPPORTED_EXTENSIONS: self._log_skipped_link( link, 'unsupported archive format: %s' % ext, ) - return - if "binary" not in search.formats and ext == wheel_ext: + return None + if "binary" not in search.formats and ext == WHEEL_EXTENSION: self._log_skipped_link( link, 'No binaries permitted for %s' % search.supplied, ) - return + return None if "macosx10" in link.path and ext == '.zip': self._log_skipped_link(link, 'macosx10 one') - return - if ext == wheel_ext: + return None + if ext == WHEEL_EXTENSION: try: wheel = Wheel(link.filename) except InvalidWheelFilename: self._log_skipped_link(link, 'invalid wheel filename') - return + return None if canonicalize_name(wheel.name) != search.canonical: self._log_skipped_link( link, 'wrong project name (not %s)' % search.supplied) - return + return None - if not wheel.supported(self.valid_tags): + if not self.candidate_evaluator.is_wheel_supported(wheel): self._log_skipped_link( link, 'it is not compatible with this Python') - return + return None version = wheel.version # This should be up by the search.ok_binary check, but see issue 2700. - if "source" not in search.formats and ext != wheel_ext: + if "source" not in search.formats and ext != WHEEL_EXTENSION: self._log_skipped_link( link, 'No sources permitted for %s' % search.supplied, ) - return + return None if not version: - version = egg_info_matches(egg_info, search.supplied, link) - if version is None: + version = _egg_info_matches(egg_info, search.canonical) + if not version: self._log_skipped_link( link, 'Missing project version for %s' % search.supplied) - return + return None match = self._py_version_re.search(version) if match: @@ -772,7 +951,7 @@ class PackageFinder(object): if py_version != sys.version[:3]: self._log_skipped_link( link, 'Python version is incorrect') - return + return None try: support_this_python = check_requires_python(link.requires_python) except specifiers.InvalidSpecifier: @@ -781,45 +960,57 @@ class PackageFinder(object): support_this_python = True if not support_this_python: - logger.debug("The package %s is incompatible with the python" - "version in use. Acceptable python versions are:%s", + logger.debug("The package %s is incompatible with the python " + "version in use. Acceptable python versions are: %s", link, link.requires_python) - return + return None logger.debug('Found link %s, version: %s', link, version) return InstallationCandidate(search.supplied, version, link) - def _get_page(self, link): - return _get_html_page(link, session=self.session) + +def _find_name_version_sep(egg_info, canonical_name): + # type: (str, str) -> int + """Find the separator's index based on the package's canonical name. + + `egg_info` must be an egg info string for the given package, and + `canonical_name` must be the package's canonical name. + + This function is needed since the canonicalized name does not necessarily + have the same length as the egg info's name part. An example:: + + >>> egg_info = 'foo__bar-1.0' + >>> canonical_name = 'foo-bar' + >>> _find_name_version_sep(egg_info, canonical_name) + 8 + """ + # Project name and version must be separated by one single dash. Find all + # occurrences of dashes; if the string in front of it matches the canonical + # name, this is the one separating the name and version parts. + for i, c in enumerate(egg_info): + if c != "-": + continue + if canonicalize_name(egg_info[:i]) == canonical_name: + return i + raise ValueError("{} does not match {}".format(egg_info, canonical_name)) -def egg_info_matches( - egg_info, search_name, link, - _egg_info_re=re.compile(r'([a-z0-9_.]+)-([a-z0-9_.!+-]+)', re.I)): +def _egg_info_matches(egg_info, canonical_name): + # type: (str, str) -> Optional[str] """Pull the version part out of a string. :param egg_info: The string to parse. E.g. foo-2.1 - :param search_name: The name of the package this belongs to. None to - infer the name. Note that this cannot unambiguously parse strings - like foo-2-2 which might be foo, 2-2 or foo-2, 2. - :param link: The link the string came from, for logging on failure. + :param canonical_name: The canonicalized name of the package this + belongs to. """ - match = _egg_info_re.search(egg_info) - if not match: - logger.debug('Could not parse version from link: %s', link) + try: + version_start = _find_name_version_sep(egg_info, canonical_name) + 1 + except ValueError: return None - if search_name is None: - full_match = match.group(0) - return full_match.split('-', 1)[-1] - name = match.group(0).lower() - # To match the "safe" name that pkg_resources creates: - name = name.replace('_', '-') - # project name and version must be separated by a dash - look_for = search_name.lower() + "-" - if name.startswith(look_for): - return match.group(0)[len(look_for):] - else: + version = egg_info[version_start:] + if not version: return None + return version def _determine_base_url(document, page_url): @@ -851,28 +1042,46 @@ def _get_encoding_from_headers(headers): return None -_CLEAN_LINK_RE = re.compile(r'[^a-z0-9$&+,/:;=?@.#%_\\|-]', re.I) - - def _clean_link(url): + # type: (str) -> str """Makes sure a link is fully encoded. That is, if a ' ' shows up in the link, it will be rewritten to %20 (while not over-quoting % or other characters).""" - return _CLEAN_LINK_RE.sub(lambda match: '%%%2x' % ord(match.group(0)), url) + # Split the URL into parts according to the general structure + # `scheme://netloc/path;parameters?query#fragment`. Note that the + # `netloc` can be empty and the URI will then refer to a local + # filesystem path. + result = urllib_parse.urlparse(url) + # In both cases below we unquote prior to quoting to make sure + # nothing is double quoted. + if result.netloc == "": + # On Windows the path part might contain a drive letter which + # should not be quoted. On Linux where drive letters do not + # exist, the colon should be quoted. We rely on urllib.request + # to do the right thing here. + path = urllib_request.pathname2url( + urllib_request.url2pathname(result.path)) + else: + # In addition to the `/` character we protect `@` so that + # revision strings in VCS URLs are properly parsed. + path = urllib_parse.quote(urllib_parse.unquote(result.path), safe="/@") + return urllib_parse.urlunparse(result._replace(path=path)) class HTMLPage(object): """Represents one page, along with its URL""" def __init__(self, content, url, headers=None): + # type: (bytes, str, MutableMapping[str, str]) -> None self.content = content self.url = url self.headers = headers def __str__(self): - return self.url + return redact_password_from_url(self.url) def iter_links(self): + # type: () -> Iterable[Link] """Yields all links in the page""" document = html5lib.parse( self.content, diff --git a/env/lib/python3.7/site-packages/pip/_internal/locations.py b/env/lib/python3.7/site-packages/pip/_internal/locations.py index 183aaa3..10860f7 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/locations.py +++ b/env/lib/python3.7/site-packages/pip/_internal/locations.py @@ -12,6 +12,11 @@ from distutils.command.install import SCHEME_KEYS # type: ignore from pip._internal.utils import appdirs from pip._internal.utils.compat import WINDOWS, expanduser +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + from typing import Any, Union, Dict, List, Optional + # Application Directories USER_CACHE_DIR = appdirs.user_cache_dir("pip") @@ -28,6 +33,7 @@ PIP_DELETE_MARKER_FILENAME = 'pip-delete-this-directory.txt' def write_delete_marker_file(directory): + # type: (str) -> None """ Write the pip delete marker file into this directory. """ @@ -37,6 +43,7 @@ def write_delete_marker_file(directory): def running_under_virtualenv(): + # type: () -> bool """ Return True if we're running inside a virtualenv, False otherwise. @@ -50,6 +57,7 @@ def running_under_virtualenv(): def virtualenv_no_global(): + # type: () -> bool """ Return True if in a venv and no system site packages. """ @@ -59,6 +67,8 @@ def virtualenv_no_global(): no_global_file = os.path.join(site_mod_dir, 'no-global-site-packages.txt') if running_under_virtualenv() and os.path.isfile(no_global_file): return True + else: + return False if running_under_virtualenv(): @@ -80,7 +90,8 @@ src_prefix = os.path.abspath(src_prefix) # FIXME doesn't account for venv linked to global site-packages -site_packages = sysconfig.get_path("purelib") +site_packages = sysconfig.get_path("purelib") # type: Optional[str] + # This is because of a bug in PyPy's sysconfig module, see # https://bitbucket.org/pypy/pypy/issues/2506/sysconfig-returns-incorrect-paths # for more information. @@ -124,17 +135,18 @@ else: if sys.platform[:6] == 'darwin' and sys.prefix[:16] == '/System/Library/': bin_py = '/usr/local/bin' -site_config_files = [ +global_config_files = [ os.path.join(path, config_basename) for path in appdirs.site_config_dirs('pip') ] -venv_config_file = os.path.join(sys.prefix, config_basename) +site_config_file = os.path.join(sys.prefix, config_basename) new_config_file = os.path.join(appdirs.user_config_dir("pip"), config_basename) def distutils_scheme(dist_name, user=False, home=None, root=None, isolated=False, prefix=None): + # type:(str, bool, str, str, bool, str) -> dict """ Return a distutils install scheme """ @@ -146,12 +158,15 @@ def distutils_scheme(dist_name, user=False, home=None, root=None, extra_dist_args = {"script_args": ["--no-user-cfg"]} else: extra_dist_args = {} - dist_args = {'name': dist_name} + dist_args = {'name': dist_name} # type: Dict[str, Union[str, List[str]]] dist_args.update(extra_dist_args) d = Distribution(dist_args) + # Ignoring, typeshed issue reported python/typeshed/issues/2567 d.parse_config_files() - i = d.get_command_obj('install', create=True) + # NOTE: Ignoring type since mypy can't find attributes on 'Command' + i = d.get_command_obj('install', create=True) # type: Any + assert i is not None # NOTE: setting user or home has the side-effect of creating the home dir # or user base for installations during finalize_options() # ideally, we'd prefer a scheme class that has no side-effects. @@ -171,7 +186,9 @@ def distutils_scheme(dist_name, user=False, home=None, root=None, # platlib). Note, i.install_lib is *always* set after # finalize_options(); we only want to override here if the user # has explicitly requested it hence going back to the config - if 'install_lib' in d.get_option_dict('install'): + + # Ignoring, typeshed issue reported python/typeshed/issues/2567 + if 'install_lib' in d.get_option_dict('install'): # type: ignore scheme.update(dict(purelib=i.install_lib, platlib=i.install_lib)) if running_under_virtualenv(): diff --git a/env/lib/python3.7/site-packages/pip/_internal/models/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/models/__pycache__/__init__.cpython-37.pyc index d4d9d47..4957e20 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/models/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/models/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/models/__pycache__/candidate.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/models/__pycache__/candidate.cpython-37.pyc index 20820e1..e439725 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/models/__pycache__/candidate.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/models/__pycache__/candidate.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/models/__pycache__/format_control.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/models/__pycache__/format_control.cpython-37.pyc index c1d76fe..2baff6a 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/models/__pycache__/format_control.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/models/__pycache__/format_control.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/models/__pycache__/index.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/models/__pycache__/index.cpython-37.pyc index b507178..3c6a7d0 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/models/__pycache__/index.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/models/__pycache__/index.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/models/__pycache__/link.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/models/__pycache__/link.cpython-37.pyc index 5d9011e..65b18cb 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/models/__pycache__/link.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/models/__pycache__/link.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/models/candidate.py b/env/lib/python3.7/site-packages/pip/_internal/models/candidate.py index c736de6..b66c365 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/models/candidate.py +++ b/env/lib/python3.7/site-packages/pip/_internal/models/candidate.py @@ -1,6 +1,12 @@ from pip._vendor.packaging.version import parse as parse_version from pip._internal.utils.models import KeyBasedCompareMixin +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + from pip._vendor.packaging.version import _BaseVersion + from pip._internal.models.link import Link + from typing import Any class InstallationCandidate(KeyBasedCompareMixin): @@ -8,8 +14,9 @@ class InstallationCandidate(KeyBasedCompareMixin): """ def __init__(self, project, version, location): + # type: (Any, str, Link) -> None self.project = project - self.version = parse_version(version) + self.version = parse_version(version) # type: _BaseVersion self.location = location super(InstallationCandidate, self).__init__( @@ -18,6 +25,7 @@ class InstallationCandidate(KeyBasedCompareMixin): ) def __repr__(self): + # type: () -> str return "".format( self.project, self.version, self.location, ) diff --git a/env/lib/python3.7/site-packages/pip/_internal/models/format_control.py b/env/lib/python3.7/site-packages/pip/_internal/models/format_control.py index 2748856..53138e4 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/models/format_control.py +++ b/env/lib/python3.7/site-packages/pip/_internal/models/format_control.py @@ -1,16 +1,24 @@ from pip._vendor.packaging.utils import canonicalize_name +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + from typing import Optional, Set, FrozenSet + class FormatControl(object): - """A helper class for controlling formats from which packages are installed. - If a field is falsy, it isn't set. If it is {':all:'}, it should match all - packages except those listed in the other field. Only one field can be set - to {':all:'} at a time. The rest of the time exact package name matches - are listed, with any given package only showing up in one field at a time. + """Helper for managing formats from which a package can be installed. """ + def __init__(self, no_binary=None, only_binary=None): - self.no_binary = set() if no_binary is None else no_binary - self.only_binary = set() if only_binary is None else only_binary + # type: (Optional[Set], Optional[Set]) -> None + if no_binary is None: + no_binary = set() + if only_binary is None: + only_binary = set() + + self.no_binary = no_binary + self.only_binary = only_binary def __eq__(self, other): return self.__dict__ == other.__dict__ @@ -27,6 +35,7 @@ class FormatControl(object): @staticmethod def handle_mutual_excludes(value, target, other): + # type: (str, Optional[Set], Optional[Set]) -> None new = value.split(',') while ':all:' in new: other.clear() @@ -45,6 +54,7 @@ class FormatControl(object): target.add(name) def get_allowed_formats(self, canonical_name): + # type: (str) -> FrozenSet result = {"binary", "source"} if canonical_name in self.only_binary: result.discard('source') @@ -57,6 +67,7 @@ class FormatControl(object): return frozenset(result) def disallow_binaries(self): + # type: () -> None self.handle_mutual_excludes( ':all:', self.no_binary, self.only_binary, ) diff --git a/env/lib/python3.7/site-packages/pip/_internal/models/index.py b/env/lib/python3.7/site-packages/pip/_internal/models/index.py index 870a315..ead1efb 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/models/index.py +++ b/env/lib/python3.7/site-packages/pip/_internal/models/index.py @@ -6,6 +6,7 @@ class PackageIndex(object): """ def __init__(self, url, file_storage_domain): + # type: (str, str) -> None super(PackageIndex, self).__init__() self.url = url self.netloc = urllib_parse.urlsplit(url).netloc @@ -18,6 +19,7 @@ class PackageIndex(object): self.file_storage_domain = file_storage_domain def _url_for_path(self, path): + # type: (str) -> str return urllib_parse.urljoin(self.url, path) diff --git a/env/lib/python3.7/site-packages/pip/_internal/models/link.py b/env/lib/python3.7/site-packages/pip/_internal/models/link.py index 5decb7c..2f42076 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/models/link.py +++ b/env/lib/python3.7/site-packages/pip/_internal/models/link.py @@ -4,9 +4,15 @@ import re from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._internal.download import path_to_url -from pip._internal.utils.misc import splitext +from pip._internal.utils.misc import ( + WHEEL_EXTENSION, redact_password_from_url, splitext, +) from pip._internal.utils.models import KeyBasedCompareMixin -from pip._internal.wheel import wheel_ext +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + from typing import Optional, Tuple, Union + from pip._internal.index import HTMLPage class Link(KeyBasedCompareMixin): @@ -14,6 +20,7 @@ class Link(KeyBasedCompareMixin): """ def __init__(self, url, comes_from=None, requires_python=None): + # type: (str, Optional[Union[str, HTMLPage]], Optional[str]) -> None """ url: url of the resource pointed to (href of the link) @@ -44,15 +51,17 @@ class Link(KeyBasedCompareMixin): else: rp = '' if self.comes_from: - return '%s (from %s)%s' % (self.url, self.comes_from, rp) + return '%s (from %s)%s' % (redact_password_from_url(self.url), + self.comes_from, rp) else: - return str(self.url) + return redact_password_from_url(str(self.url)) def __repr__(self): return '' % self @property def filename(self): + # type: () -> str _, netloc, path, _, _ = urllib_parse.urlsplit(self.url) name = posixpath.basename(path.rstrip('/')) or netloc name = urllib_parse.unquote(name) @@ -61,25 +70,31 @@ class Link(KeyBasedCompareMixin): @property def scheme(self): + # type: () -> str return urllib_parse.urlsplit(self.url)[0] @property def netloc(self): + # type: () -> str return urllib_parse.urlsplit(self.url)[1] @property def path(self): + # type: () -> str return urllib_parse.unquote(urllib_parse.urlsplit(self.url)[2]) def splitext(self): + # type: () -> Tuple[str, str] return splitext(posixpath.basename(self.path.rstrip('/'))) @property def ext(self): + # type: () -> str return self.splitext()[1] @property def url_without_fragment(self): + # type: () -> str scheme, netloc, path, query, fragment = urllib_parse.urlsplit(self.url) return urllib_parse.urlunsplit((scheme, netloc, path, query, None)) @@ -87,6 +102,7 @@ class Link(KeyBasedCompareMixin): @property def egg_fragment(self): + # type: () -> Optional[str] match = self._egg_fragment_re.search(self.url) if not match: return None @@ -96,6 +112,7 @@ class Link(KeyBasedCompareMixin): @property def subdirectory_fragment(self): + # type: () -> Optional[str] match = self._subdirectory_fragment_re.search(self.url) if not match: return None @@ -107,6 +124,7 @@ class Link(KeyBasedCompareMixin): @property def hash(self): + # type: () -> Optional[str] match = self._hash_re.search(self.url) if match: return match.group(2) @@ -114,6 +132,7 @@ class Link(KeyBasedCompareMixin): @property def hash_name(self): + # type: () -> Optional[str] match = self._hash_re.search(self.url) if match: return match.group(1) @@ -121,14 +140,17 @@ class Link(KeyBasedCompareMixin): @property def show_url(self): + # type: () -> Optional[str] return posixpath.basename(self.url.split('#', 1)[0].split('?', 1)[0]) @property def is_wheel(self): - return self.ext == wheel_ext + # type: () -> bool + return self.ext == WHEEL_EXTENSION @property def is_artifact(self): + # type: () -> bool """ Determines if this points to an actual artifact (e.g. a tarball) or if it points to an "abstract" thing like a path or a VCS location. diff --git a/env/lib/python3.7/site-packages/pip/_internal/operations/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/operations/__pycache__/__init__.cpython-37.pyc index 12f37c6..9eae194 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/operations/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/operations/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/operations/__pycache__/check.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/operations/__pycache__/check.cpython-37.pyc index e58c9b0..9f419c6 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/operations/__pycache__/check.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/operations/__pycache__/check.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/operations/__pycache__/freeze.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/operations/__pycache__/freeze.cpython-37.pyc index 7bd9da2..3d9ffee 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/operations/__pycache__/freeze.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/operations/__pycache__/freeze.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/operations/__pycache__/prepare.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/operations/__pycache__/prepare.cpython-37.pyc index 621988f..5bbd7a3 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/operations/__pycache__/prepare.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/operations/__pycache__/prepare.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/operations/check.py b/env/lib/python3.7/site-packages/pip/_internal/operations/check.py index 799257a..920df5d 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/operations/check.py +++ b/env/lib/python3.7/site-packages/pip/_internal/operations/check.py @@ -1,18 +1,22 @@ """Validation of dependencies of packages """ +import logging from collections import namedtuple from pip._vendor.packaging.utils import canonicalize_name +from pip._vendor.pkg_resources import RequirementParseError from pip._internal.operations.prepare import make_abstract_dist from pip._internal.utils.misc import get_installed_distributions from pip._internal.utils.typing import MYPY_CHECK_RUNNING +logger = logging.getLogger(__name__) + if MYPY_CHECK_RUNNING: - from pip._internal.req.req_install import InstallRequirement # noqa: F401 - from typing import ( # noqa: F401 - Any, Callable, Dict, Iterator, Optional, Set, Tuple, List + from pip._internal.req.req_install import InstallRequirement + from typing import ( + Any, Callable, Dict, Optional, Set, Tuple, List ) # Shorthands @@ -28,7 +32,7 @@ PackageDetails = namedtuple('PackageDetails', ['version', 'requires']) def create_package_set_from_installed(**kwargs): - # type: (**Any) -> PackageSet + # type: (**Any) -> Tuple[PackageSet, bool] """Converts a list of distributions into a PackageSet. """ # Default to using all packages installed on the system @@ -36,10 +40,16 @@ def create_package_set_from_installed(**kwargs): kwargs = {"local_only": False, "skip": ()} package_set = {} + problems = False for dist in get_installed_distributions(**kwargs): name = canonicalize_name(dist.project_name) - package_set[name] = PackageDetails(dist.version, dist.requires()) - return package_set + try: + package_set[name] = PackageDetails(dist.version, dist.requires()) + except RequirementParseError as e: + # Don't crash on broken metadata + logging.warning("Error parsing requirements for %s: %s", name, e) + problems = True + return package_set, problems def check_package_set(package_set, should_ignore=None): @@ -95,7 +105,7 @@ def check_install_conflicts(to_install): installing given requirements """ # Start from the current state - package_set = create_package_set_from_installed() + package_set, _ = create_package_set_from_installed() # Install packages would_be_installed = _simulate_installation_of(to_install, package_set) @@ -110,9 +120,6 @@ def check_install_conflicts(to_install): ) -# NOTE from @pradyunsg -# This required a minor update in dependency link handling logic over at -# operations.prepare.IsSDist.dist() to get it working def _simulate_installation_of(to_install, package_set): # type: (List[InstallRequirement], PackageSet) -> Set[str] """Computes the version of packages after installing to_install. @@ -123,7 +130,7 @@ def _simulate_installation_of(to_install, package_set): # Modify it as installing requirement_set would (assuming no errors) for inst_req in to_install: - dist = make_abstract_dist(inst_req).dist(finder=None) + dist = make_abstract_dist(inst_req).dist() name = canonicalize_name(dist.key) package_set[name] = PackageDetails(dist.version, dist.requires()) diff --git a/env/lib/python3.7/site-packages/pip/_internal/operations/freeze.py b/env/lib/python3.7/site-packages/pip/_internal/operations/freeze.py index beb2feb..0c4c761 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/operations/freeze.py +++ b/env/lib/python3.7/site-packages/pip/_internal/operations/freeze.py @@ -5,57 +5,61 @@ import logging import os import re -from pip._vendor import pkg_resources, six +from pip._vendor import six from pip._vendor.packaging.utils import canonicalize_name from pip._vendor.pkg_resources import RequirementParseError -from pip._internal.exceptions import InstallationError +from pip._internal.exceptions import BadCommand, InstallationError from pip._internal.req.constructors import ( install_req_from_editable, install_req_from_line, ) from pip._internal.req.req_file import COMMENT_RE -from pip._internal.utils.deprecation import deprecated from pip._internal.utils.misc import ( - dist_is_editable, get_installed_distributions, make_vcs_requirement_url, + dist_is_editable, get_installed_distributions, ) +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + from typing import ( + Iterator, Optional, List, Container, Set, Dict, Tuple, Iterable, Union + ) + from pip._internal.cache import WheelCache + from pip._vendor.pkg_resources import ( + Distribution, Requirement + ) + + RequirementInfo = Tuple[Optional[Union[str, Requirement]], bool, List[str]] + logger = logging.getLogger(__name__) def freeze( - requirement=None, - find_links=None, local_only=None, user_only=None, skip_regex=None, - isolated=False, - wheel_cache=None, - exclude_editable=False, - skip=()): + requirement=None, # type: Optional[List[str]] + find_links=None, # type: Optional[List[str]] + local_only=None, # type: Optional[bool] + user_only=None, # type: Optional[bool] + skip_regex=None, # type: Optional[str] + isolated=False, # type: bool + wheel_cache=None, # type: Optional[WheelCache] + exclude_editable=False, # type: bool + skip=() # type: Container[str] +): + # type: (...) -> Iterator[str] find_links = find_links or [] skip_match = None if skip_regex: skip_match = re.compile(skip_regex).search - dependency_links = [] - - for dist in pkg_resources.working_set: - if dist.has_metadata('dependency_links.txt'): - dependency_links.extend( - dist.get_metadata_lines('dependency_links.txt') - ) - for link in find_links: - if '#egg=' in link: - dependency_links.append(link) for link in find_links: yield '-f %s' % link - installations = {} + installations = {} # type: Dict[str, FrozenRequirement] for dist in get_installed_distributions(local_only=local_only, skip=(), user_only=user_only): try: - req = FrozenRequirement.from_dist( - dist, - dependency_links - ) + req = FrozenRequirement.from_dist(dist) except RequirementParseError: logger.warning( "Could not parse requirement: %s", @@ -71,10 +75,10 @@ def freeze( # should only be emitted once, even if the same option is in multiple # requirements files, so we need to keep track of what has been emitted # so that we don't emit it again if it's seen again - emitted_options = set() + emitted_options = set() # type: Set[str] # keep track of which files a requirement is in so that we can # give an accurate warning if a requirement appears multiple times. - req_files = collections.defaultdict(list) + req_files = collections.defaultdict(list) # type: Dict[str, List[str]] for req_file_path in requirement: with open(req_file_path) as req_file: for line in req_file: @@ -128,10 +132,10 @@ def freeze( # but has been processed already if not req_files[line_req.name]: logger.warning( - "Requirement file [%s] contains %s, but that " - "package is not installed", + "Requirement file [%s] contains %s, but " + "package %r is not installed", req_file_path, - COMMENT_RE.sub('', line).strip(), + COMMENT_RE.sub('', line).strip(), line_req.name ) else: req_files[line_req.name].append(req_file_path) @@ -157,105 +161,84 @@ def freeze( yield str(installation).rstrip() +def get_requirement_info(dist): + # type: (Distribution) -> RequirementInfo + """ + Compute and return values (req, editable, comments) for use in + FrozenRequirement.from_dist(). + """ + if not dist_is_editable(dist): + return (None, False, []) + + location = os.path.normcase(os.path.abspath(dist.location)) + + from pip._internal.vcs import vcs, RemoteNotFoundError + vc_type = vcs.get_backend_type(location) + + if not vc_type: + req = dist.as_requirement() + logger.debug( + 'No VCS found for editable requirement {!r} in: {!r}', req, + location, + ) + comments = [ + '# Editable install with no version control ({})'.format(req) + ] + return (location, True, comments) + + try: + req = vc_type.get_src_requirement(location, dist.project_name) + except RemoteNotFoundError: + req = dist.as_requirement() + comments = [ + '# Editable {} install with no remote ({})'.format( + vc_type.__name__, req, + ) + ] + return (location, True, comments) + + except BadCommand: + logger.warning( + 'cannot determine version of editable source in %s ' + '(%s command not found in path)', + location, + vc_type.name, + ) + return (None, True, []) + + except InstallationError as exc: + logger.warning( + "Error when trying to get requirement for VCS system %s, " + "falling back to uneditable format", exc + ) + else: + if req is not None: + return (req, True, []) + + logger.warning( + 'Could not determine repository location of %s', location + ) + comments = ['## !! Could not determine repository location'] + + return (None, False, comments) + + class FrozenRequirement(object): def __init__(self, name, req, editable, comments=()): + # type: (str, Union[str, Requirement], bool, Iterable[str]) -> None self.name = name self.req = req self.editable = editable self.comments = comments - _rev_re = re.compile(r'-r(\d+)$') - _date_re = re.compile(r'-(20\d\d\d\d\d\d)$') - @classmethod - def _init_args_from_dist(cls, dist, dependency_links): - """ - Compute and return arguments (req, editable, comments) to pass to - FrozenRequirement.__init__(). - - This method is for use in FrozenRequirement.from_dist(). - """ - location = os.path.normcase(os.path.abspath(dist.location)) - comments = [] - from pip._internal.vcs import vcs, get_src_requirement - if dist_is_editable(dist) and vcs.get_backend_name(location): - editable = True - try: - req = get_src_requirement(dist, location) - except InstallationError as exc: - logger.warning( - "Error when trying to get requirement for VCS system %s, " - "falling back to uneditable format", exc - ) - req = None - if req is None: - logger.warning( - 'Could not determine repository location of %s', location - ) - comments.append( - '## !! Could not determine repository location' - ) - req = dist.as_requirement() - editable = False - else: - editable = False + def from_dist(cls, dist): + # type: (Distribution) -> FrozenRequirement + req, editable, comments = get_requirement_info(dist) + if req is None: req = dist.as_requirement() - specs = req.specs - assert len(specs) == 1 and specs[0][0] in ["==", "==="], \ - 'Expected 1 spec with == or ===; specs = %r; dist = %r' % \ - (specs, dist) - version = specs[0][1] - ver_match = cls._rev_re.search(version) - date_match = cls._date_re.search(version) - if ver_match or date_match: - svn_backend = vcs.get_backend('svn') - if svn_backend: - svn_location = svn_backend().get_location( - dist, - dependency_links, - ) - if not svn_location: - logger.warning( - 'Warning: cannot find svn location for %s', req, - ) - comments.append( - '## FIXME: could not find svn URL in dependency_links ' - 'for this package:' - ) - else: - deprecated( - "SVN editable detection based on dependency links " - "will be dropped in the future.", - replacement=None, - gone_in="18.2", - issue=4187, - ) - comments.append( - '# Installing as editable to satisfy requirement %s:' % - req - ) - if ver_match: - rev = ver_match.group(1) - else: - rev = '{%s}' % date_match.group(1) - editable = True - egg_name = cls.egg_name(dist) - req = make_vcs_requirement_url(svn_location, rev, egg_name) - return (req, editable, comments) - - @classmethod - def from_dist(cls, dist, dependency_links): - args = cls._init_args_from_dist(dist, dependency_links) - return cls(dist.project_name, *args) - - @staticmethod - def egg_name(dist): - name = dist.egg_name() - match = re.search(r'-py\d\.\d$', name) - if match: - name = name[:match.start()] - return name + return cls(dist.project_name, req, editable, comments=comments) def __str__(self): req = self.req diff --git a/env/lib/python3.7/site-packages/pip/_internal/operations/prepare.py b/env/lib/python3.7/site-packages/pip/_internal/operations/prepare.py index 104bea3..077a985 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/operations/prepare.py +++ b/env/lib/python3.7/site-packages/pip/_internal/operations/prepare.py @@ -18,12 +18,20 @@ from pip._internal.utils.compat import expanduser from pip._internal.utils.hashes import MissingHashes from pip._internal.utils.logging import indent_log from pip._internal.utils.misc import display_path, normalize_path -from pip._internal.vcs import vcs +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + from typing import Any, Optional + from pip._internal.req.req_install import InstallRequirement + from pip._internal.index import PackageFinder + from pip._internal.download import PipSession + from pip._internal.req.req_tracker import RequirementTracker logger = logging.getLogger(__name__) def make_abstract_dist(req): + # type: (InstallRequirement) -> DistAbstraction """Factory to make an abstract dist object. Preconditions: Either an editable req with a source_dir, or satisfied_by or @@ -59,40 +67,70 @@ class DistAbstraction(object): """ def __init__(self, req): - self.req = req + # type: (InstallRequirement) -> None + self.req = req # type: InstallRequirement - def dist(self, finder): + def dist(self): + # type: () -> Any """Return a setuptools Dist object.""" - raise NotImplementedError(self.dist) + raise NotImplementedError def prep_for_dist(self, finder, build_isolation): + # type: (PackageFinder, bool) -> Any """Ensure that we can get a Dist for this requirement.""" - raise NotImplementedError(self.dist) + raise NotImplementedError class IsWheel(DistAbstraction): - def dist(self, finder): + def dist(self): + # type: () -> pkg_resources.Distribution return list(pkg_resources.find_distributions( self.req.source_dir))[0] def prep_for_dist(self, finder, build_isolation): + # type: (PackageFinder, bool) -> Any # FIXME:https://github.com/pypa/pip/issues/1112 pass class IsSDist(DistAbstraction): - def dist(self, finder): - dist = self.req.get_dist() - # FIXME: shouldn't be globally added. - if finder and dist.has_metadata('dependency_links.txt'): - finder.add_dependency_links( - dist.get_metadata_lines('dependency_links.txt') - ) - return dist + def dist(self): + return self.req.get_dist() + + def _raise_conflicts(self, conflicting_with, conflicting_reqs): + conflict_messages = [ + '%s is incompatible with %s' % (installed, wanted) + for installed, wanted in sorted(conflicting_reqs) + ] + raise InstallationError( + "Some build dependencies for %s conflict with %s: %s." % ( + self.req, conflicting_with, ', '.join(conflict_messages)) + ) + + def install_backend_dependencies(self, finder): + # type: (PackageFinder) -> None + """ + Install any extra build dependencies that the backend requests. + + :param finder: a PackageFinder object. + """ + req = self.req + with req.build_env: + # We need to have the env active when calling the hook. + req.spin_message = "Getting requirements to build wheel" + reqs = req.pep517_backend.get_requires_for_build_wheel() + conflicting, missing = req.build_env.check_requirements(reqs) + if conflicting: + self._raise_conflicts("the backend dependencies", conflicting) + req.build_env.install_requirements( + finder, missing, 'normal', + "Installing backend dependencies" + ) def prep_for_dist(self, finder, build_isolation): + # type: (PackageFinder, bool) -> None # Prepare for building. We need to: # 1. Load pyproject.toml (if it exists) # 2. Set up the build environment @@ -105,34 +143,43 @@ class IsSDist(DistAbstraction): # requirements. self.req.build_env = BuildEnvironment() self.req.build_env.install_requirements( - finder, self.req.pyproject_requires, + finder, self.req.pyproject_requires, 'overlay', "Installing build dependencies" ) - missing = [] - if self.req.requirements_to_check: - check = self.req.requirements_to_check - missing = self.req.build_env.missing_requirements(check) + conflicting, missing = self.req.build_env.check_requirements( + self.req.requirements_to_check + ) + if conflicting: + self._raise_conflicts("PEP 517/518 supported requirements", + conflicting) if missing: logger.warning( "Missing build requirements in pyproject.toml for %s.", self.req, ) logger.warning( - "The project does not specify a build backend, and pip " - "cannot fall back to setuptools without %s.", + "The project does not specify a build backend, and " + "pip cannot fall back to setuptools without %s.", " and ".join(map(repr, sorted(missing))) ) - self.req.run_egg_info() + # Install any extra build dependencies that the backend requests. + # This must be done in a second pass, as the pyproject.toml + # dependencies must be installed before we can call the backend. + self.install_backend_dependencies(finder=finder) + + self.req.prepare_metadata() self.req.assert_source_matches_version() class Installed(DistAbstraction): - def dist(self, finder): + def dist(self): + # type: () -> pkg_resources.Distribution return self.req.satisfied_by def prep_for_dist(self, finder, build_isolation): + # type: (PackageFinder, bool) -> Any pass @@ -140,8 +187,17 @@ class RequirementPreparer(object): """Prepares a Requirement """ - def __init__(self, build_dir, download_dir, src_dir, wheel_download_dir, - progress_bar, build_isolation, req_tracker): + def __init__( + self, + build_dir, # type: str + download_dir, # type: Optional[str] + src_dir, # type: str + wheel_download_dir, # type: Optional[str] + progress_bar, # type: str + build_isolation, # type: bool + req_tracker # type: RequirementTracker + ): + # type: (...) -> None super(RequirementPreparer, self).__init__() self.src_dir = src_dir @@ -171,6 +227,7 @@ class RequirementPreparer(object): @property def _download_should_save(self): + # type: () -> bool # TODO: Modify to reduce indentation needed if self.download_dir: self.download_dir = expanduser(self.download_dir) @@ -183,8 +240,15 @@ class RequirementPreparer(object): % display_path(self.download_dir)) return False - def prepare_linked_requirement(self, req, session, finder, - upgrade_allowed, require_hashes): + def prepare_linked_requirement( + self, + req, # type: InstallRequirement + session, # type: PipSession + finder, # type: PackageFinder + upgrade_allowed, # type: bool + require_hashes # type: bool + ): + # type: (...) -> DistAbstraction """Prepare a requirement that would be obtained from req.link """ # TODO: Breakup into smaller functions @@ -298,12 +362,18 @@ class RequirementPreparer(object): abstract_dist.prep_for_dist(finder, self.build_isolation) if self._download_should_save: # Make a .zip of the source_dir we already created. - if req.link.scheme in vcs.all_schemes: + if not req.link.is_artifact: req.archive(self.download_dir) return abstract_dist - def prepare_editable_requirement(self, req, require_hashes, use_user_site, - finder): + def prepare_editable_requirement( + self, + req, # type: InstallRequirement + require_hashes, # type: bool + use_user_site, # type: bool + finder # type: PackageFinder + ): + # type: (...) -> DistAbstraction """Prepare an editable requirement """ assert req.editable, "cannot prepare a non-editable req as editable" @@ -331,6 +401,7 @@ class RequirementPreparer(object): return abstract_dist def prepare_installed_requirement(self, req, require_hashes, skip_reason): + # type: (InstallRequirement, bool, Optional[str]) -> DistAbstraction """Prepare an already-installed requirement """ assert req.satisfied_by, "req should have been satisfied but isn't" diff --git a/env/lib/python3.7/site-packages/pip/_internal/pep425tags.py b/env/lib/python3.7/site-packages/pip/_internal/pep425tags.py index ab1a029..3b68f28 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/pep425tags.py +++ b/env/lib/python3.7/site-packages/pip/_internal/pep425tags.py @@ -12,6 +12,14 @@ from collections import OrderedDict import pip._internal.utils.glibc from pip._internal.utils.compat import get_extension_suffixes +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + from typing import ( + Tuple, Callable, List, Optional, Union, Dict + ) + + Pep425Tag = Tuple[str, str, str] logger = logging.getLogger(__name__) @@ -19,6 +27,7 @@ _osx_arch_pat = re.compile(r'(.+)_(\d+)_(\d+)_(.+)') def get_config_var(var): + # type: (str) -> Optional[str] try: return sysconfig.get_config_var(var) except IOError as e: # Issue #1074 @@ -27,6 +36,7 @@ def get_config_var(var): def get_abbr_impl(): + # type: () -> str """Return abbreviated implementation name.""" if hasattr(sys, 'pypy_version_info'): pyimpl = 'pp' @@ -40,6 +50,7 @@ def get_abbr_impl(): def get_impl_ver(): + # type: () -> str """Return implementation version.""" impl_ver = get_config_var("py_version_nodot") if not impl_ver or get_abbr_impl() == 'pp': @@ -48,17 +59,21 @@ def get_impl_ver(): def get_impl_version_info(): + # type: () -> Tuple[int, ...] """Return sys.version_info-like tuple for use in decrementing the minor version.""" if get_abbr_impl() == 'pp': # as per https://github.com/pypa/pip/issues/2882 - return (sys.version_info[0], sys.pypy_version_info.major, - sys.pypy_version_info.minor) + # attrs exist only on pypy + return (sys.version_info[0], + sys.pypy_version_info.major, # type: ignore + sys.pypy_version_info.minor) # type: ignore else: return sys.version_info[0], sys.version_info[1] def get_impl_tag(): + # type: () -> str """ Returns the Tag for this specific implementation. """ @@ -66,6 +81,7 @@ def get_impl_tag(): def get_flag(var, fallback, expected=True, warn=True): + # type: (str, Callable[..., bool], Union[bool, int], bool) -> bool """Use a fallback method for determining SOABI flags if the needed config var is unset or unavailable.""" val = get_config_var(var) @@ -78,6 +94,7 @@ def get_flag(var, fallback, expected=True, warn=True): def get_abi_tag(): + # type: () -> Optional[str] """Return the ABI tag based on SOABI (if available) or emulate SOABI (CPython 2, PyPy).""" soabi = get_config_var('SOABI') @@ -112,10 +129,12 @@ def get_abi_tag(): def _is_running_32bit(): + # type: () -> bool return sys.maxsize == 2147483647 def get_platform(): + # type: () -> str """Return our platform name 'win32', 'linux_x86_64'""" if sys.platform == 'darwin': # distutils.util.get_platform() returns the release based on the value @@ -142,6 +161,7 @@ def get_platform(): def is_manylinux1_compatible(): + # type: () -> bool # Only Linux, and only x86-64 / i686 if get_platform() not in {"linux_x86_64", "linux_i686"}: return False @@ -158,13 +178,33 @@ def is_manylinux1_compatible(): return pip._internal.utils.glibc.have_compatible_glibc(2, 5) +def is_manylinux2010_compatible(): + # type: () -> bool + # Only Linux, and only x86-64 / i686 + if get_platform() not in {"linux_x86_64", "linux_i686"}: + return False + + # Check for presence of _manylinux module + try: + import _manylinux + return bool(_manylinux.manylinux2010_compatible) + except (ImportError, AttributeError): + # Fall through to heuristic check below + pass + + # Check glibc version. CentOS 6 uses glibc 2.12. + return pip._internal.utils.glibc.have_compatible_glibc(2, 12) + + def get_darwin_arches(major, minor, machine): + # type: (int, int, str) -> List[str] """Return a list of supported arches (including group arches) for the given major, minor and machine architecture of an macOS machine. """ arches = [] def _supports_arch(major, minor, arch): + # type: (int, int, str) -> bool # Looking at the application support for macOS versions in the chart # provided by https://en.wikipedia.org/wiki/OS_X#Versions it appears # our timeline looks roughly like: @@ -205,7 +245,7 @@ def get_darwin_arches(major, minor, machine): ("intel", ("x86_64", "i386")), ("fat64", ("x86_64", "ppc64")), ("fat32", ("x86_64", "i386", "ppc")), - ]) + ]) # type: Dict[str, Tuple[str, ...]] if _supports_arch(major, minor, machine): arches.append(machine) @@ -219,8 +259,24 @@ def get_darwin_arches(major, minor, machine): return arches -def get_supported(versions=None, noarch=False, platform=None, - impl=None, abi=None): +def get_all_minor_versions_as_strings(version_info): + # type: (Tuple[int, ...]) -> List[str] + versions = [] + major = version_info[:-1] + # Support all previous minor Python versions. + for minor in range(version_info[-1], -1, -1): + versions.append(''.join(map(str, major + (minor,)))) + return versions + + +def get_supported( + versions=None, # type: Optional[List[str]] + noarch=False, # type: bool + platform=None, # type: Optional[str] + impl=None, # type: Optional[str] + abi=None # type: Optional[str] +): + # type: (...) -> List[Pep425Tag] """Return a list of supported tags for each version specified in `versions`. @@ -237,16 +293,12 @@ def get_supported(versions=None, noarch=False, platform=None, # Versions must be given with respect to the preference if versions is None: - versions = [] version_info = get_impl_version_info() - major = version_info[:-1] - # Support all previous minor Python versions. - for minor in range(version_info[-1], -1, -1): - versions.append(''.join(map(str, major + (minor,)))) + versions = get_all_minor_versions_as_strings(version_info) impl = impl or get_abbr_impl() - abis = [] + abis = [] # type: List[str] abi = abi or get_abi_tag() if abi: @@ -263,6 +315,7 @@ def get_supported(versions=None, noarch=False, platform=None, if not noarch: arch = platform or get_platform() + arch_prefix, arch_sep, arch_suffix = arch.partition('_') if arch.startswith('macosx'): # support macosx-10.6-intel on macosx-10.9-x86_64 match = _osx_arch_pat.match(arch) @@ -276,8 +329,19 @@ def get_supported(versions=None, noarch=False, platform=None, else: # arch pattern didn't match (?!) arches = [arch] - elif platform is None and is_manylinux1_compatible(): - arches = [arch.replace('linux', 'manylinux1'), arch] + elif arch_prefix == 'manylinux2010': + # manylinux1 wheels run on most manylinux2010 systems with the + # exception of wheels depending on ncurses. PEP 571 states + # manylinux1 wheels should be considered manylinux2010 wheels: + # https://www.python.org/dev/peps/pep-0571/#backwards-compatibility-with-manylinux1-wheels + arches = [arch, 'manylinux1' + arch_sep + arch_suffix] + elif platform is None: + arches = [] + if is_manylinux2010_compatible(): + arches.append('manylinux2010' + arch_sep + arch_suffix) + if is_manylinux1_compatible(): + arches.append('manylinux1' + arch_sep + arch_suffix) + arches.append(arch) else: arches = [arch] diff --git a/env/lib/python3.7/site-packages/pip/_internal/pyproject.py b/env/lib/python3.7/site-packages/pip/_internal/pyproject.py index f938a76..43efbed 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/pyproject.py +++ b/env/lib/python3.7/site-packages/pip/_internal/pyproject.py @@ -2,20 +2,43 @@ from __future__ import absolute_import import io import os +import sys from pip._vendor import pytoml, six from pip._internal.exceptions import InstallationError +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + from typing import Any, Tuple, Optional, List def _is_list_of_str(obj): + # type: (Any) -> bool return ( isinstance(obj, list) and all(isinstance(item, six.string_types) for item in obj) ) -def load_pyproject_toml(use_pep517, pyproject_toml, setup_py, req_name): +def make_pyproject_path(setup_py_dir): + # type: (str) -> str + path = os.path.join(setup_py_dir, 'pyproject.toml') + + # Python2 __file__ should not be unicode + if six.PY2 and isinstance(path, six.text_type): + path = path.encode(sys.getfilesystemencoding()) + + return path + + +def load_pyproject_toml( + use_pep517, # type: Optional[bool] + pyproject_toml, # type: str + setup_py, # type: str + req_name # type: str +): + # type: (...) -> Optional[Tuple[List[str], str, List[str]]] """Load the pyproject.toml file. Parameters: @@ -46,17 +69,20 @@ def load_pyproject_toml(use_pep517, pyproject_toml, setup_py, req_name): build_system = None # The following cases must use PEP 517 - # We check for use_pep517 equalling False because that - # means the user explicitly requested --no-use-pep517 + # We check for use_pep517 being non-None and falsey because that means + # the user explicitly requested --no-use-pep517. The value 0 as + # opposed to False can occur when the value is provided via an + # environment variable or config file option (due to the quirk of + # strtobool() returning an integer in pip's configuration code). if has_pyproject and not has_setup: - if use_pep517 is False: + if use_pep517 is not None and not use_pep517: raise InstallationError( "Disabling PEP 517 processing is invalid: " "project does not have a setup.py" ) use_pep517 = True elif build_system and "build-backend" in build_system: - if use_pep517 is False: + if use_pep517 is not None and not use_pep517: raise InstallationError( "Disabling PEP 517 processing is invalid: " "project specifies a build backend of {} " @@ -85,11 +111,13 @@ def load_pyproject_toml(use_pep517, pyproject_toml, setup_py, req_name): # section, or the user has no pyproject.toml, but has opted in # explicitly via --use-pep517. # In the absence of any explicit backend specification, we - # assume the setuptools backend, and require wheel and a version - # of setuptools that supports that backend. + # assume the setuptools backend that most closely emulates the + # traditional direct setup.py execution, and require wheel and + # a version of setuptools that supports that backend. + build_system = { - "requires": ["setuptools>=38.2.5", "wheel"], - "build-backend": "setuptools.build_meta", + "requires": ["setuptools>=40.8.0", "wheel"], + "build-backend": "setuptools.build_meta:__legacy__", } # If we're using PEP 517, we have build system information (either @@ -123,22 +151,21 @@ def load_pyproject_toml(use_pep517, pyproject_toml, setup_py, req_name): )) backend = build_system.get("build-backend") - check = [] + check = [] # type: List[str] if backend is None: # If the user didn't specify a backend, we assume they want to use # the setuptools backend. But we can't be sure they have included # a version of setuptools which supplies the backend, or wheel - # (which is neede by the backend) in their requirements. So we + # (which is needed by the backend) in their requirements. So we # make a note to check that those requirements are present once # we have set up the environment. - # TODO: Review this - it's quite a lot of work to check for a very - # specific case. The problem is, that case is potentially quite - # common - projects that adopted PEP 518 early for the ability to - # specify requirements to execute setup.py, but never considered - # needing to mention the build tools themselves. The original PEP - # 518 code had a similar check (but implemented in a different - # way). - backend = "setuptools.build_meta" - check = ["setuptools>=38.2.5", "wheel"] + # This is quite a lot of work to check for a very specific case. But + # the problem is, that case is potentially quite common - projects that + # adopted PEP 518 early for the ability to specify requirements to + # execute setup.py, but never considered needing to mention the build + # tools themselves. The original PEP 518 code had a similar check (but + # implemented in a different way). + backend = "setuptools.build_meta:__legacy__" + check = ["setuptools>=40.8.0", "wheel"] return (requires, backend, check) diff --git a/env/lib/python3.7/site-packages/pip/_internal/req/__init__.py b/env/lib/python3.7/site-packages/pip/_internal/req/__init__.py index b270498..c39f63f 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/req/__init__.py +++ b/env/lib/python3.7/site-packages/pip/_internal/req/__init__.py @@ -6,7 +6,10 @@ from .req_install import InstallRequirement from .req_set import RequirementSet from .req_file import parse_requirements from pip._internal.utils.logging import indent_log +from pip._internal.utils.typing import MYPY_CHECK_RUNNING +if MYPY_CHECK_RUNNING: + from typing import Any, List, Sequence __all__ = [ "RequirementSet", "InstallRequirement", @@ -16,8 +19,14 @@ __all__ = [ logger = logging.getLogger(__name__) -def install_given_reqs(to_install, install_options, global_options=(), - *args, **kwargs): +def install_given_reqs( + to_install, # type: List[InstallRequirement] + install_options, # type: List[str] + global_options=(), # type: Sequence[str] + *args, # type: Any + **kwargs # type: Any +): + # type: (...) -> List[InstallRequirement] """ Install everything in the given list. diff --git a/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/__init__.cpython-37.pyc index 4e3c7a3..d0f4169 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/constructors.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/constructors.cpython-37.pyc index 62aee57..2a10603 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/constructors.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/constructors.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/req_file.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/req_file.cpython-37.pyc index 07a1afd..ef7364c 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/req_file.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/req_file.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/req_install.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/req_install.cpython-37.pyc index a34182b..7e8f41c 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/req_install.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/req_install.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/req_set.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/req_set.cpython-37.pyc index e77f115..c026e86 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/req_set.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/req_set.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/req_tracker.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/req_tracker.cpython-37.pyc index 8daa87c..f78f361 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/req_tracker.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/req_tracker.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/req_uninstall.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/req_uninstall.cpython-37.pyc index 9927332..2c16493 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/req_uninstall.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/req/__pycache__/req_uninstall.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/req/constructors.py b/env/lib/python3.7/site-packages/pip/_internal/req/constructors.py index 4c4641d..0f18b6a 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/req/constructors.py +++ b/env/lib/python3.7/site-packages/pip/_internal/req/constructors.py @@ -11,7 +11,6 @@ InstallRequirement. import logging import os import re -import traceback from pip._vendor.packaging.markers import Marker from pip._vendor.packaging.requirements import InvalidRequirement, Requirement @@ -24,11 +23,20 @@ from pip._internal.download import ( from pip._internal.exceptions import InstallationError from pip._internal.models.index import PyPI, TestPyPI from pip._internal.models.link import Link +from pip._internal.pyproject import make_pyproject_path from pip._internal.req.req_install import InstallRequirement from pip._internal.utils.misc import is_installable_dir +from pip._internal.utils.typing import MYPY_CHECK_RUNNING from pip._internal.vcs import vcs from pip._internal.wheel import Wheel +if MYPY_CHECK_RUNNING: + from typing import ( + Any, Dict, Optional, Set, Tuple, Union, + ) + from pip._internal.cache import WheelCache + + __all__ = [ "install_req_from_editable", "install_req_from_line", "parse_editable" @@ -39,6 +47,7 @@ operators = Specifier._operators.keys() def _strip_extras(path): + # type: (str) -> Tuple[str, Optional[str]] m = re.match(r'^(.+)(\[[^\]]+\])$', path) extras = None if m: @@ -51,6 +60,7 @@ def _strip_extras(path): def parse_editable(editable_req): + # type: (str) -> Tuple[Optional[str], str, Optional[Set[str]]] """Parses an editable requirement into: - a requirement name - an URL @@ -68,10 +78,18 @@ def parse_editable(editable_req): if os.path.isdir(url_no_extras): if not os.path.exists(os.path.join(url_no_extras, 'setup.py')): - raise InstallationError( - "Directory %r is not installable. File 'setup.py' not found." % - url_no_extras + msg = ( + 'File "setup.py" not found. Directory cannot be installed ' + 'in editable mode: {}'.format(os.path.abspath(url_no_extras)) ) + pyproject_path = make_pyproject_path(url_no_extras) + if os.path.isfile(pyproject_path): + msg += ( + '\n(A "pyproject.toml" file was found, but editable ' + 'mode currently requires a setup.py based build.)' + ) + raise InstallationError(msg) + # Treating it as code that has already been checked out url_no_extras = path_to_url(url_no_extras) @@ -116,6 +134,7 @@ def parse_editable(editable_req): def deduce_helpful_msg(req): + # type: (str) -> str """Returns helpful msg in case requirements file does not exist, or cannot be parsed. @@ -136,7 +155,7 @@ def deduce_helpful_msg(req): " the packages specified within it." except RequirementParseError: logger.debug("Cannot parse '%s' as requirements \ - file" % (req), exc_info=1) + file" % (req), exc_info=True) else: msg += " File '%s' does not exist." % (req) return msg @@ -146,9 +165,15 @@ def deduce_helpful_msg(req): def install_req_from_editable( - editable_req, comes_from=None, isolated=False, options=None, - wheel_cache=None, constraint=False + editable_req, # type: str + comes_from=None, # type: Optional[str] + use_pep517=None, # type: Optional[bool] + isolated=False, # type: bool + options=None, # type: Optional[Dict[str, Any]] + wheel_cache=None, # type: Optional[WheelCache] + constraint=False # type: bool ): + # type: (...) -> InstallRequirement name, url, extras_override = parse_editable(editable_req) if url.startswith('file:'): source_dir = url_to_path(url) @@ -167,6 +192,7 @@ def install_req_from_editable( editable=True, link=Link(url), constraint=constraint, + use_pep517=use_pep517, isolated=isolated, options=options if options else {}, wheel_cache=wheel_cache, @@ -175,9 +201,15 @@ def install_req_from_editable( def install_req_from_line( - name, comes_from=None, isolated=False, options=None, wheel_cache=None, - constraint=False + name, # type: str + comes_from=None, # type: Optional[Union[str, InstallRequirement]] + use_pep517=None, # type: Optional[bool] + isolated=False, # type: bool + options=None, # type: Optional[Dict[str, Any]] + wheel_cache=None, # type: Optional[WheelCache] + constraint=False # type: bool ): + # type: (...) -> InstallRequirement """Creates an InstallRequirement from a name, which might be a requirement, directory containing 'setup.py', filename, or URL. """ @@ -186,24 +218,24 @@ def install_req_from_line( else: marker_sep = ';' if marker_sep in name: - name, markers = name.split(marker_sep, 1) - markers = markers.strip() - if not markers: + name, markers_as_string = name.split(marker_sep, 1) + markers_as_string = markers_as_string.strip() + if not markers_as_string: markers = None else: - markers = Marker(markers) + markers = Marker(markers_as_string) else: markers = None name = name.strip() - req = None + req_as_string = None path = os.path.normpath(os.path.abspath(name)) link = None - extras = None + extras_as_string = None if is_url(name): link = Link(name) else: - p, extras = _strip_extras(path) + p, extras_as_string = _strip_extras(path) looks_like_dir = os.path.isdir(p) and ( os.path.sep in name or (os.path.altsep is not None and os.path.altsep in name) or @@ -234,38 +266,41 @@ def install_req_from_line( # wheel file if link.is_wheel: wheel = Wheel(link.filename) # can raise InvalidWheelFilename - req = "%s==%s" % (wheel.name, wheel.version) + req_as_string = "%s==%s" % (wheel.name, wheel.version) else: # set the req to the egg fragment. when it's not there, this # will become an 'unnamed' requirement - req = link.egg_fragment + req_as_string = link.egg_fragment # a requirement specifier else: - req = name + req_as_string = name - if extras: - extras = Requirement("placeholder" + extras.lower()).extras + if extras_as_string: + extras = Requirement("placeholder" + extras_as_string.lower()).extras else: extras = () - if req is not None: + if req_as_string is not None: try: - req = Requirement(req) + req = Requirement(req_as_string) except InvalidRequirement: - if os.path.sep in req: + if os.path.sep in req_as_string: add_msg = "It looks like a path." - add_msg += deduce_helpful_msg(req) - elif '=' in req and not any(op in req for op in operators): + add_msg += deduce_helpful_msg(req_as_string) + elif ('=' in req_as_string and + not any(op in req_as_string for op in operators)): add_msg = "= is not a valid operator. Did you mean == ?" else: - add_msg = traceback.format_exc() + add_msg = "" raise InstallationError( - "Invalid requirement: '%s'\n%s" % (req, add_msg) + "Invalid requirement: '%s'\n%s" % (req_as_string, add_msg) ) + else: + req = None return InstallRequirement( req, comes_from, link=link, markers=markers, - isolated=isolated, + use_pep517=use_pep517, isolated=isolated, options=options if options else {}, wheel_cache=wheel_cache, constraint=constraint, @@ -273,19 +308,25 @@ def install_req_from_line( ) -def install_req_from_req( - req, comes_from=None, isolated=False, wheel_cache=None +def install_req_from_req_string( + req_string, # type: str + comes_from=None, # type: Optional[InstallRequirement] + isolated=False, # type: bool + wheel_cache=None, # type: Optional[WheelCache] + use_pep517=None # type: Optional[bool] ): + # type: (...) -> InstallRequirement try: - req = Requirement(req) + req = Requirement(req_string) except InvalidRequirement: - raise InstallationError("Invalid requirement: '%s'" % req) + raise InstallationError("Invalid requirement: '%s'" % req_string) domains_not_allowed = [ PyPI.file_storage_domain, TestPyPI.file_storage_domain, ] - if req.url and comes_from.link.netloc in domains_not_allowed: + if (req.url and comes_from and comes_from.link and + comes_from.link.netloc in domains_not_allowed): # Explicitly disallow pypi packages that depend on external urls raise InstallationError( "Packages installed from PyPI cannot depend on packages " @@ -294,5 +335,6 @@ def install_req_from_req( ) return InstallRequirement( - req, comes_from, isolated=isolated, wheel_cache=wheel_cache + req, comes_from, isolated=isolated, wheel_cache=wheel_cache, + use_pep517=use_pep517 ) diff --git a/env/lib/python3.7/site-packages/pip/_internal/req/req_file.py b/env/lib/python3.7/site-packages/pip/_internal/req/req_file.py index e7acf7c..270b75c 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/req/req_file.py +++ b/env/lib/python3.7/site-packages/pip/_internal/req/req_file.py @@ -19,6 +19,18 @@ from pip._internal.exceptions import RequirementsFileParseError from pip._internal.req.constructors import ( install_req_from_editable, install_req_from_line, ) +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + from typing import ( + Any, Callable, Iterator, List, NoReturn, Optional, Text, Tuple, + ) + from pip._internal.req import InstallRequirement + from pip._internal.cache import WheelCache + from pip._internal.index import PackageFinder + from pip._internal.download import PipSession + + ReqFileLines = Iterator[Tuple[int, Text]] __all__ = ['parse_requirements'] @@ -43,24 +55,32 @@ SUPPORTED_OPTIONS = [ cmdoptions.no_binary, cmdoptions.only_binary, cmdoptions.pre, - cmdoptions.process_dependency_links, cmdoptions.trusted_host, cmdoptions.require_hashes, -] +] # type: List[Callable[..., optparse.Option]] # options to be passed to requirements SUPPORTED_OPTIONS_REQ = [ cmdoptions.install_options, cmdoptions.global_options, cmdoptions.hash, -] +] # type: List[Callable[..., optparse.Option]] # the 'dest' string values -SUPPORTED_OPTIONS_REQ_DEST = [o().dest for o in SUPPORTED_OPTIONS_REQ] +SUPPORTED_OPTIONS_REQ_DEST = [str(o().dest) for o in SUPPORTED_OPTIONS_REQ] -def parse_requirements(filename, finder=None, comes_from=None, options=None, - session=None, constraint=False, wheel_cache=None): +def parse_requirements( + filename, # type: str + finder=None, # type: Optional[PackageFinder] + comes_from=None, # type: Optional[str] + options=None, # type: Optional[optparse.Values] + session=None, # type: Optional[PipSession] + constraint=False, # type: bool + wheel_cache=None, # type: Optional[WheelCache] + use_pep517=None # type: Optional[bool] +): + # type: (...) -> Iterator[InstallRequirement] """Parse a requirements file and yield InstallRequirement instances. :param filename: Path or url of requirements file. @@ -71,6 +91,7 @@ def parse_requirements(filename, finder=None, comes_from=None, options=None, :param constraint: If true, parsing a constraint file rather than requirements file. :param wheel_cache: Instance of pip.wheel.WheelCache + :param use_pep517: Value of the --use-pep517 option. """ if session is None: raise TypeError( @@ -87,18 +108,19 @@ def parse_requirements(filename, finder=None, comes_from=None, options=None, for line_number, line in lines_enum: req_iter = process_line(line, filename, line_number, finder, comes_from, options, session, wheel_cache, - constraint=constraint) + use_pep517=use_pep517, constraint=constraint) for req in req_iter: yield req def preprocess(content, options): + # type: (Text, Optional[optparse.Values]) -> ReqFileLines """Split, filter, and join lines, and return a line iterator :param content: the content of the requirements file :param options: cli options """ - lines_enum = enumerate(content.splitlines(), start=1) + lines_enum = enumerate(content.splitlines(), start=1) # type: ReqFileLines lines_enum = join_lines(lines_enum) lines_enum = ignore_comments(lines_enum) lines_enum = skip_regex(lines_enum, options) @@ -106,9 +128,19 @@ def preprocess(content, options): return lines_enum -def process_line(line, filename, line_number, finder=None, comes_from=None, - options=None, session=None, wheel_cache=None, - constraint=False): +def process_line( + line, # type: Text + filename, # type: str + line_number, # type: int + finder=None, # type: Optional[PackageFinder] + comes_from=None, # type: Optional[str] + options=None, # type: Optional[optparse.Values] + session=None, # type: Optional[PipSession] + wheel_cache=None, # type: Optional[WheelCache] + use_pep517=None, # type: Optional[bool] + constraint=False # type: bool +): + # type: (...) -> Iterator[InstallRequirement] """Process a single requirements line; This can result in creating/yielding requirements, or updating the finder. @@ -130,13 +162,15 @@ def process_line(line, filename, line_number, finder=None, comes_from=None, defaults = parser.get_default_values() defaults.index_url = None if finder: - # `finder.format_control` will be updated during parsing defaults.format_control = finder.format_control args_str, options_str = break_args_options(line) + # Prior to 2.7.3, shlex cannot deal with unicode entries if sys.version_info < (2, 7, 3): - # Prior to 2.7.3, shlex cannot deal with unicode entries - options_str = options_str.encode('utf8') - opts, _ = parser.parse_args(shlex.split(options_str), defaults) + # https://github.com/python/mypy/issues/1174 + options_str = options_str.encode('utf8') # type: ignore + # https://github.com/python/mypy/issues/1174 + opts, _ = parser.parse_args( + shlex.split(options_str), defaults) # type: ignore # preserve for the nested code path line_comes_from = '%s %s (line %s)' % ( @@ -155,6 +189,7 @@ def process_line(line, filename, line_number, finder=None, comes_from=None, req_options[dest] = opts.__dict__[dest] yield install_req_from_line( args_str, line_comes_from, constraint=constraint, + use_pep517=use_pep517, isolated=isolated, options=req_options, wheel_cache=wheel_cache ) @@ -163,6 +198,7 @@ def process_line(line, filename, line_number, finder=None, comes_from=None, isolated = options.isolated_mode if options else False yield install_req_from_editable( opts.editables[0], comes_from=line_comes_from, + use_pep517=use_pep517, constraint=constraint, isolated=isolated, wheel_cache=wheel_cache ) @@ -183,11 +219,11 @@ def process_line(line, filename, line_number, finder=None, comes_from=None, # do a join so relative paths work req_path = os.path.join(os.path.dirname(filename), req_path) # TODO: Why not use `comes_from='-r {} (line {})'` here as well? - parser = parse_requirements( + parsed_reqs = parse_requirements( req_path, finder, comes_from, options, session, constraint=nested_constraint, wheel_cache=wheel_cache ) - for req in parser: + for req in parsed_reqs: yield req # percolate hash-checking option upward @@ -214,14 +250,13 @@ def process_line(line, filename, line_number, finder=None, comes_from=None, finder.find_links.append(value) if opts.pre: finder.allow_all_prereleases = True - if opts.process_dependency_links: - finder.process_dependency_links = True if opts.trusted_hosts: finder.secure_origins.extend( ("*", host, "*") for host in opts.trusted_hosts) def break_args_options(line): + # type: (Text) -> Tuple[str, Text] """Break up the line into an args and options string. We only want to shlex (and then optparse) the options, not the args. args can contain markers which are corrupted by shlex. @@ -235,10 +270,11 @@ def break_args_options(line): else: args.append(token) options.pop(0) - return ' '.join(args), ' '.join(options) + return ' '.join(args), ' '.join(options) # type: ignore def build_parser(line): + # type: (Text) -> optparse.OptionParser """ Return a parser for parsing requirement lines """ @@ -252,20 +288,24 @@ def build_parser(line): # By default optparse sys.exits on parsing errors. We want to wrap # that in our own exception. def parser_exit(self, msg): + # type: (Any, str) -> NoReturn # add offending line msg = 'Invalid requirement: %s\n%s' % (line, msg) raise RequirementsFileParseError(msg) - parser.exit = parser_exit + # NOTE: mypy disallows assigning to a method + # https://github.com/python/mypy/issues/2427 + parser.exit = parser_exit # type: ignore return parser def join_lines(lines_enum): + # type: (ReqFileLines) -> ReqFileLines """Joins a line ending in '\' with the previous line (except when following comments). The joined line takes on the index of the first line. """ primary_line_number = None - new_line = [] + new_line = [] # type: List[Text] for line_number, line in lines_enum: if not line.endswith('\\') or COMMENT_RE.match(line): if COMMENT_RE.match(line): @@ -290,6 +330,7 @@ def join_lines(lines_enum): def ignore_comments(lines_enum): + # type: (ReqFileLines) -> ReqFileLines """ Strips comments and filter empty lines. """ @@ -301,6 +342,7 @@ def ignore_comments(lines_enum): def skip_regex(lines_enum, options): + # type: (ReqFileLines, Optional[optparse.Values]) -> ReqFileLines """ Skip lines that match '--skip-requirements-regex' pattern @@ -314,6 +356,7 @@ def skip_regex(lines_enum, options): def expand_env_variables(lines_enum): + # type: (ReqFileLines) -> ReqFileLines """Replace all environment variables that can be retrieved via `os.getenv`. The only allowed format for environment variables defined in the @@ -322,7 +365,7 @@ def expand_env_variables(lines_enum): 1. Strings that contain a `$` aren't accidentally (partially) expanded. 2. Ensure consistency across platforms for requirement files. - These points are the result of a discusssion on the `github pull + These points are the result of a discussion on the `github pull request #3514 `_. Valid characters in variable names follow the `POSIX standard diff --git a/env/lib/python3.7/site-packages/pip/_internal/req/req_install.py b/env/lib/python3.7/site-packages/pip/_internal/req/req_install.py index c2624fe..25a692e 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/req/req_install.py +++ b/env/lib/python3.7/site-packages/pip/_internal/req/req_install.py @@ -22,7 +22,7 @@ from pip._internal.locations import ( PIP_DELETE_MARKER_FILENAME, running_under_virtualenv, ) from pip._internal.models.link import Link -from pip._internal.pyproject import load_pyproject_toml +from pip._internal.pyproject import load_pyproject_toml, make_pyproject_path from pip._internal.req.req_uninstall import UninstallPathSet from pip._internal.utils.compat import native_str from pip._internal.utils.hashes import Hashes @@ -30,29 +30,55 @@ from pip._internal.utils.logging import indent_log from pip._internal.utils.misc import ( _make_build_dir, ask_path_exists, backup_dir, call_subprocess, display_path, dist_in_site_packages, dist_in_usersite, ensure_dir, - get_installed_version, rmtree, + get_installed_version, redact_password_from_url, rmtree, ) from pip._internal.utils.packaging import get_metadata from pip._internal.utils.setuptools_build import SETUPTOOLS_SHIM from pip._internal.utils.temp_dir import TempDirectory +from pip._internal.utils.typing import MYPY_CHECK_RUNNING from pip._internal.utils.ui import open_spinner from pip._internal.vcs import vcs from pip._internal.wheel import move_wheel_files +if MYPY_CHECK_RUNNING: + from typing import ( + Any, Dict, Iterable, List, Mapping, Optional, Sequence, Union, + ) + from pip._internal.build_env import BuildEnvironment + from pip._internal.cache import WheelCache + from pip._internal.index import PackageFinder + from pip._vendor.pkg_resources import Distribution + from pip._vendor.packaging.specifiers import SpecifierSet + from pip._vendor.packaging.markers import Marker + + logger = logging.getLogger(__name__) class InstallRequirement(object): """ Represents something that may be installed later on, may have information - about where to fetch the relavant requirement and also contains logic for + about where to fetch the relevant requirement and also contains logic for installing the said requirement. """ - def __init__(self, req, comes_from, source_dir=None, editable=False, - link=None, update=True, markers=None, - isolated=False, options=None, wheel_cache=None, - constraint=False, extras=()): + def __init__( + self, + req, # type: Optional[Requirement] + comes_from, # type: Optional[Union[str, InstallRequirement]] + source_dir=None, # type: Optional[str] + editable=False, # type: bool + link=None, # type: Optional[Link] + update=True, # type: bool + markers=None, # type: Optional[Marker] + use_pep517=None, # type: Optional[bool] + isolated=False, # type: bool + options=None, # type: Optional[Dict[str, Any]] + wheel_cache=None, # type: Optional[WheelCache] + constraint=False, # type: bool + extras=() # type: Iterable[str] + ): + # type: (...) -> None assert req is None or isinstance(req, Requirement), req self.req = req self.comes_from = comes_from @@ -64,10 +90,10 @@ class InstallRequirement(object): self.editable = editable self._wheel_cache = wheel_cache - if link is not None: - self.link = self.original_link = link - else: - self.link = self.original_link = req and req.url and Link(req.url) + if link is None and req and req.url: + # PEP 508 URL requirement + link = Link(req.url) + self.link = self.original_link = link if extras: self.extras = extras @@ -77,11 +103,11 @@ class InstallRequirement(object): } else: self.extras = set() - if markers is not None: - self.markers = markers - else: - self.markers = req and req.marker - self._egg_info_path = None + if markers is None and req: + markers = req.marker + self.markers = markers + + self._egg_info_path = None # type: Optional[str] # This holds the pkg_resources.Distribution object if this requirement # is already available: self.satisfied_by = None @@ -92,11 +118,11 @@ class InstallRequirement(object): self._temp_build_dir = TempDirectory(kind="req-build") # Used to store the global directory where the _temp_build_dir should # have been created. Cf _correct_build_location method. - self._ideal_build_dir = None + self._ideal_build_dir = None # type: Optional[str] # True if the editable should be updated: self.update = update # Set to True after successful installation - self.install_succeeded = None + self.install_succeeded = None # type: Optional[bool] # UninstallPathSet of uninstalled distribution (for possible rollback) self.uninstalled_pathset = None self.options = options if options else {} @@ -105,32 +131,38 @@ class InstallRequirement(object): self.is_direct = False self.isolated = isolated - self.build_env = NoOpBuildEnvironment() + self.build_env = NoOpBuildEnvironment() # type: BuildEnvironment + + # For PEP 517, the directory where we request the project metadata + # gets stored. We need this to pass to build_wheel, so the backend + # can ensure that the wheel matches the metadata (see the PEP for + # details). + self.metadata_directory = None # type: Optional[str] # The static build requirements (from pyproject.toml) - self.pyproject_requires = None + self.pyproject_requires = None # type: Optional[List[str]] # Build requirements that we will check are available - # TODO: We don't do this for --no-build-isolation. Should we? - self.requirements_to_check = [] + self.requirements_to_check = [] # type: List[str] # The PEP 517 backend we should use to build the project - self.pep517_backend = None + self.pep517_backend = None # type: Optional[Pep517HookCaller] # Are we using PEP 517 for this requirement? # After pyproject.toml has been loaded, the only valid values are True # and False. Before loading, None is valid (meaning "use the default"). # Setting an explicit value before loading pyproject.toml is supported, # but after loading this flag should be treated as read only. - self.use_pep517 = None + self.use_pep517 = use_pep517 def __str__(self): + # type: () -> str if self.req: s = str(self.req) if self.link: - s += ' from %s' % self.link.url + s += ' from %s' % redact_password_from_url(self.link.url) elif self.link: - s = self.link.url + s = redact_password_from_url(self.link.url) else: s = '' if self.satisfied_by is not None: @@ -145,10 +177,12 @@ class InstallRequirement(object): return s def __repr__(self): + # type: () -> str return '<%s object: %s editable=%r>' % ( self.__class__.__name__, str(self), self.editable) def populate_link(self, finder, upgrade, require_hashes): + # type: (PackageFinder, bool, bool) -> None """Ensure that if a link can be found for this, that it is found. Note that self.link may still be None - if Upgrade is False and the @@ -171,16 +205,19 @@ class InstallRequirement(object): # Things that are valid for all kinds of requirements? @property def name(self): + # type: () -> Optional[str] if self.req is None: return None return native_str(pkg_resources.safe_name(self.req.name)) @property def specifier(self): + # type: () -> SpecifierSet return self.req.specifier @property def is_pinned(self): + # type: () -> bool """Return whether I am pinned to an exact version. For example, some-package==1.2 is pinned; some-package>1.2 is not. @@ -191,9 +228,11 @@ class InstallRequirement(object): @property def installed_version(self): + # type: () -> Optional[str] return get_installed_version(self.name) def match_markers(self, extras_requested=None): + # type: (Optional[Iterable[str]]) -> bool if not extras_requested: # Provide an extra to safely evaluate the markers # without matching any extra @@ -207,6 +246,7 @@ class InstallRequirement(object): @property def has_hash_options(self): + # type: () -> bool """Return whether any known-good hashes are specified as options. These activate --require-hashes mode; hashes specified as part of a @@ -216,6 +256,7 @@ class InstallRequirement(object): return bool(self.options.get('hashes', {})) def hashes(self, trust_internet=True): + # type: (bool) -> Hashes """Return a hash-comparer that considers my option- and URL-based hashes to be known-good. @@ -237,6 +278,7 @@ class InstallRequirement(object): return Hashes(good_hashes) def from_path(self): + # type: () -> Optional[str] """Format a nice indicator to show where this "comes from" """ if self.req is None: @@ -252,6 +294,7 @@ class InstallRequirement(object): return s def build_location(self, build_dir): + # type: (str) -> Optional[str] assert build_dir is not None if self._temp_build_dir.path is not None: return self._temp_build_dir.path @@ -279,6 +322,7 @@ class InstallRequirement(object): return os.path.join(build_dir, name) def _correct_build_location(self): + # type: () -> None """Move self._temp_build_dir to self._ideal_build_dir/self.req.name For some requirements (e.g. a path to a directory), the name of the @@ -292,7 +336,8 @@ class InstallRequirement(object): return assert self.req is not None assert self._temp_build_dir.path - assert self._ideal_build_dir.path + assert (self._ideal_build_dir is not None and + self._ideal_build_dir.path) # type: ignore old_location = self._temp_build_dir.path self._temp_build_dir.path = None @@ -311,7 +356,16 @@ class InstallRequirement(object): self.source_dir = os.path.normpath(os.path.abspath(new_location)) self._egg_info_path = None + # Correct the metadata directory, if it exists + if self.metadata_directory: + old_meta = self.metadata_directory + rel = os.path.relpath(old_meta, start=old_location) + new_meta = os.path.join(new_location, rel) + new_meta = os.path.normpath(os.path.abspath(new_meta)) + self.metadata_directory = new_meta + def remove_temporary_source(self): + # type: () -> None """Remove the source files from this requirement, if they are marked for deletion""" if self.source_dir and os.path.exists( @@ -323,6 +377,7 @@ class InstallRequirement(object): self.build_env.cleanup() def check_if_exists(self, use_user_site): + # type: (bool) -> bool """Find an installed distribution that satisfies or conflicts with this requirement, and set self.satisfied_by or self.conflicts_with appropriately. @@ -366,11 +421,22 @@ class InstallRequirement(object): # Things valid for wheels @property def is_wheel(self): - return self.link and self.link.is_wheel + # type: () -> bool + if not self.link: + return False + return self.link.is_wheel - def move_wheel_files(self, wheeldir, root=None, home=None, prefix=None, - warn_script_location=True, use_user_site=False, - pycompile=True): + def move_wheel_files( + self, + wheeldir, # type: str + root=None, # type: Optional[str] + home=None, # type: Optional[str] + prefix=None, # type: Optional[str] + warn_script_location=True, # type: bool + use_user_site=False, # type: bool + pycompile=True # type: bool + ): + # type: (...) -> None move_wheel_files( self.name, self.req, wheeldir, user=use_user_site, @@ -385,12 +451,14 @@ class InstallRequirement(object): # Things valid for sdists @property def setup_py_dir(self): + # type: () -> str return os.path.join( self.source_dir, self.link and self.link.subdirectory_fragment or '') @property def setup_py(self): + # type: () -> str assert self.source_dir, "No source dir for %s" % self setup_py = os.path.join(self.setup_py_dir, 'setup.py') @@ -403,17 +471,13 @@ class InstallRequirement(object): @property def pyproject_toml(self): + # type: () -> str assert self.source_dir, "No source dir for %s" % self - pp_toml = os.path.join(self.setup_py_dir, 'pyproject.toml') - - # Python2 __file__ should not be unicode - if six.PY2 and isinstance(pp_toml, six.text_type): - pp_toml = pp_toml.encode(sys.getfilesystemencoding()) - - return pp_toml + return make_pyproject_path(self.setup_py_dir) def load_pyproject_toml(self): + # type: () -> None """Load the pyproject.toml file. After calling this routine, all of the attributes related to PEP 517 @@ -437,40 +501,40 @@ class InstallRequirement(object): self.pyproject_requires = requires self.pep517_backend = Pep517HookCaller(self.setup_py_dir, backend) - def run_egg_info(self): + # Use a custom function to call subprocesses + self.spin_message = "" + + def runner( + cmd, # type: List[str] + cwd=None, # type: Optional[str] + extra_environ=None # type: Optional[Mapping[str, Any]] + ): + # type: (...) -> None + with open_spinner(self.spin_message) as spinner: + call_subprocess( + cmd, + cwd=cwd, + extra_environ=extra_environ, + spinner=spinner + ) + self.spin_message = "" + + self.pep517_backend._subprocess_runner = runner + + def prepare_metadata(self): + # type: () -> None + """Ensure that project metadata is available. + + Under PEP 517, call the backend hook to prepare the metadata. + Under legacy processing, call setup.py egg-info. + """ assert self.source_dir - if self.name: - logger.debug( - 'Running setup.py (path:%s) egg_info for package %s', - self.setup_py, self.name, - ) - else: - logger.debug( - 'Running setup.py (path:%s) egg_info for package from %s', - self.setup_py, self.link, - ) with indent_log(): - script = SETUPTOOLS_SHIM % self.setup_py - base_cmd = [sys.executable, '-c', script] - if self.isolated: - base_cmd += ["--no-user-cfg"] - egg_info_cmd = base_cmd + ['egg_info'] - # We can't put the .egg-info files at the root, because then the - # source code will be mistaken for an installed egg, causing - # problems - if self.editable: - egg_base_option = [] + if self.use_pep517: + self.prepare_pep517_metadata() else: - egg_info_dir = os.path.join(self.setup_py_dir, 'pip-egg-info') - ensure_dir(egg_info_dir) - egg_base_option = ['--egg-base', 'pip-egg-info'] - with self.build_env: - call_subprocess( - egg_info_cmd + egg_base_option, - cwd=self.setup_py_dir, - show_stdout=False, - command_desc='python setup.py egg_info') + self.run_egg_info() if not self.req: if isinstance(parse_version(self.metadata["Version"]), Version): @@ -489,15 +553,70 @@ class InstallRequirement(object): metadata_name = canonicalize_name(self.metadata["Name"]) if canonicalize_name(self.req.name) != metadata_name: logger.warning( - 'Running setup.py (path:%s) egg_info for package %s ' + 'Generating metadata for package %s ' 'produced metadata for project name %s. Fix your ' '#egg=%s fragments.', - self.setup_py, self.name, metadata_name, self.name + self.name, metadata_name, self.name ) self.req = Requirement(metadata_name) + def prepare_pep517_metadata(self): + # type: () -> None + assert self.pep517_backend is not None + + metadata_dir = os.path.join( + self.setup_py_dir, + 'pip-wheel-metadata' + ) + ensure_dir(metadata_dir) + + with self.build_env: + # Note that Pep517HookCaller implements a fallback for + # prepare_metadata_for_build_wheel, so we don't have to + # consider the possibility that this hook doesn't exist. + backend = self.pep517_backend + self.spin_message = "Preparing wheel metadata" + distinfo_dir = backend.prepare_metadata_for_build_wheel( + metadata_dir + ) + + self.metadata_directory = os.path.join(metadata_dir, distinfo_dir) + + def run_egg_info(self): + # type: () -> None + if self.name: + logger.debug( + 'Running setup.py (path:%s) egg_info for package %s', + self.setup_py, self.name, + ) + else: + logger.debug( + 'Running setup.py (path:%s) egg_info for package from %s', + self.setup_py, self.link, + ) + script = SETUPTOOLS_SHIM % self.setup_py + base_cmd = [sys.executable, '-c', script] + if self.isolated: + base_cmd += ["--no-user-cfg"] + egg_info_cmd = base_cmd + ['egg_info'] + # We can't put the .egg-info files at the root, because then the + # source code will be mistaken for an installed egg, causing + # problems + if self.editable: + egg_base_option = [] # type: List[str] + else: + egg_info_dir = os.path.join(self.setup_py_dir, 'pip-egg-info') + ensure_dir(egg_info_dir) + egg_base_option = ['--egg-base', 'pip-egg-info'] + with self.build_env: + call_subprocess( + egg_info_cmd + egg_base_option, + cwd=self.setup_py_dir, + command_desc='python setup.py egg_info') + @property def egg_info_path(self): + # type: () -> str if self._egg_info_path is None: if self.editable: base = self.source_dir @@ -550,24 +669,38 @@ class InstallRequirement(object): @property def metadata(self): + # type: () -> Any if not hasattr(self, '_metadata'): self._metadata = get_metadata(self.get_dist()) return self._metadata def get_dist(self): - """Return a pkg_resources.Distribution built from self.egg_info_path""" - egg_info = self.egg_info_path.rstrip(os.path.sep) - base_dir = os.path.dirname(egg_info) - metadata = pkg_resources.PathMetadata(base_dir, egg_info) - dist_name = os.path.splitext(os.path.basename(egg_info))[0] - return pkg_resources.Distribution( - os.path.dirname(egg_info), + # type: () -> Distribution + """Return a pkg_resources.Distribution for this requirement""" + if self.metadata_directory: + base_dir, distinfo = os.path.split(self.metadata_directory) + metadata = pkg_resources.PathMetadata( + base_dir, self.metadata_directory + ) + dist_name = os.path.splitext(distinfo)[0] + typ = pkg_resources.DistInfoDistribution + else: + egg_info = self.egg_info_path.rstrip(os.path.sep) + base_dir = os.path.dirname(egg_info) + metadata = pkg_resources.PathMetadata(base_dir, egg_info) + dist_name = os.path.splitext(os.path.basename(egg_info))[0] + # https://github.com/python/mypy/issues/1174 + typ = pkg_resources.Distribution # type: ignore + + return typ( + base_dir, project_name=dist_name, metadata=metadata, ) def assert_source_matches_version(self): + # type: () -> None assert self.source_dir version = self.metadata['version'] if self.req.specifier and version not in self.req.specifier: @@ -586,6 +719,7 @@ class InstallRequirement(object): # For both source distributions and editables def ensure_has_source_dir(self, parent_dir): + # type: (str) -> str """Ensure that a source_dir is set. This will create a temporary build dir if the name of the requirement @@ -600,8 +734,13 @@ class InstallRequirement(object): return self.source_dir # For editable installations - def install_editable(self, install_options, - global_options=(), prefix=None): + def install_editable( + self, + install_options, # type: List[str] + global_options=(), # type: Sequence[str] + prefix=None # type: Optional[str] + ): + # type: (...) -> None logger.info('Running setup.py develop for %s', self.name) if self.isolated: @@ -625,12 +764,12 @@ class InstallRequirement(object): list(install_options), cwd=self.setup_py_dir, - show_stdout=False, ) self.install_succeeded = True def update_editable(self, obtain=True): + # type: (bool) -> None if not self.link: logger.debug( "Cannot update repository at %s; repository location is " @@ -662,6 +801,7 @@ class InstallRequirement(object): # Top-level Actions def uninstall(self, auto_confirm=False, verbose=False, use_user_site=False): + # type: (bool, bool, bool) -> Optional[UninstallPathSet] """ Uninstall the distribution currently satisfying this requirement. @@ -676,7 +816,7 @@ class InstallRequirement(object): """ if not self.check_if_exists(use_user_site): logger.warning("Skipping %s as it is not installed.", self.name) - return + return None dist = self.satisfied_by or self.conflicts_with uninstalled_pathset = UninstallPathSet.from_dist(dist) @@ -684,6 +824,7 @@ class InstallRequirement(object): return uninstalled_pathset def _clean_zip_name(self, name, prefix): # only used by archive. + # type: (str, str) -> str assert name.startswith(prefix + os.path.sep), ( "name %r doesn't start with prefix %r" % (name, prefix) ) @@ -691,9 +832,16 @@ class InstallRequirement(object): name = name.replace(os.path.sep, '/') return name + def _get_archive_name(self, path, parentdir, rootdir): + # type: (str, str, str) -> str + path = os.path.join(parentdir, path) + name = self._clean_zip_name(path, rootdir) + return self.name + '/' + name + # TODO: Investigate if this should be kept in InstallRequirement # Seems to be used only when VCS + downloads def archive(self, build_dir): + # type: (str) -> None assert self.source_dir create_archive = True archive_name = '%s-%s.zip' % (self.name, self.metadata["version"]) @@ -727,23 +875,35 @@ class InstallRequirement(object): if 'pip-egg-info' in dirnames: dirnames.remove('pip-egg-info') for dirname in dirnames: - dirname = os.path.join(dirpath, dirname) - name = self._clean_zip_name(dirname, dir) - zipdir = zipfile.ZipInfo(self.name + '/' + name + '/') + dir_arcname = self._get_archive_name(dirname, + parentdir=dirpath, + rootdir=dir) + zipdir = zipfile.ZipInfo(dir_arcname + '/') zipdir.external_attr = 0x1ED << 16 # 0o755 zip.writestr(zipdir, '') for filename in filenames: if filename == PIP_DELETE_MARKER_FILENAME: continue + file_arcname = self._get_archive_name(filename, + parentdir=dirpath, + rootdir=dir) filename = os.path.join(dirpath, filename) - name = self._clean_zip_name(filename, dir) - zip.write(filename, self.name + '/' + name) + zip.write(filename, file_arcname) zip.close() logger.info('Saved %s', display_path(archive_path)) - def install(self, install_options, global_options=None, root=None, - home=None, prefix=None, warn_script_location=True, - use_user_site=False, pycompile=True): + def install( + self, + install_options, # type: List[str] + global_options=None, # type: Optional[Sequence[str]] + root=None, # type: Optional[str] + home=None, # type: Optional[str] + prefix=None, # type: Optional[str] + warn_script_location=True, # type: bool + use_user_site=False, # type: bool + pycompile=True # type: bool + ): + # type: (...) -> None global_options = global_options if global_options is not None else [] if self.editable: self.install_editable( @@ -773,7 +933,8 @@ class InstallRequirement(object): self.options.get('install_options', []) if self.isolated: - global_options = global_options + ["--no-user-cfg"] + # https://github.com/python/mypy/issues/1174 + global_options = global_options + ["--no-user-cfg"] # type: ignore with TempDirectory(kind="record") as temp_dir: record_filename = os.path.join(temp_dir.path, 'install-record.txt') @@ -787,7 +948,6 @@ class InstallRequirement(object): call_subprocess( install_args + install_options, cwd=self.setup_py_dir, - show_stdout=False, spinner=spinner, ) @@ -797,6 +957,7 @@ class InstallRequirement(object): self.install_succeeded = True def prepend_root(path): + # type: (str) -> str if root is None or not os.path.isabs(path): return path else: @@ -832,8 +993,15 @@ class InstallRequirement(object): with open(inst_files_path, 'w') as f: f.write('\n'.join(new_lines) + '\n') - def get_install_args(self, global_options, record_filename, root, prefix, - pycompile): + def get_install_args( + self, + global_options, # type: Sequence[str] + record_filename, # type: str + root, # type: Optional[str] + prefix, # type: Optional[str] + pycompile # type: bool + ): + # type: (...) -> List[str] install_args = [sys.executable, "-u"] install_args.append('-c') install_args.append(SETUPTOOLS_SHIM % self.setup_py) diff --git a/env/lib/python3.7/site-packages/pip/_internal/req/req_set.py b/env/lib/python3.7/site-packages/pip/_internal/req/req_set.py index b198317..d1966a4 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/req/req_set.py +++ b/env/lib/python3.7/site-packages/pip/_internal/req/req_set.py @@ -5,42 +5,56 @@ from collections import OrderedDict from pip._internal.exceptions import InstallationError from pip._internal.utils.logging import indent_log +from pip._internal.utils.typing import MYPY_CHECK_RUNNING from pip._internal.wheel import Wheel +if MYPY_CHECK_RUNNING: + from typing import Dict, Iterable, List, Optional, Tuple + from pip._internal.req.req_install import InstallRequirement + + logger = logging.getLogger(__name__) class RequirementSet(object): def __init__(self, require_hashes=False, check_supported_wheels=True): + # type: (bool, bool) -> None """Create a RequirementSet. """ - self.requirements = OrderedDict() + self.requirements = OrderedDict() # type: Dict[str, InstallRequirement] # noqa: E501 self.require_hashes = require_hashes self.check_supported_wheels = check_supported_wheels # Mapping of alias: real_name - self.requirement_aliases = {} - self.unnamed_requirements = [] - self.successfully_downloaded = [] - self.reqs_to_cleanup = [] + self.requirement_aliases = {} # type: Dict[str, str] + self.unnamed_requirements = [] # type: List[InstallRequirement] + self.successfully_downloaded = [] # type: List[InstallRequirement] + self.reqs_to_cleanup = [] # type: List[InstallRequirement] def __str__(self): + # type: () -> str reqs = [req for req in self.requirements.values() if not req.comes_from] reqs.sort(key=lambda req: req.name.lower()) return ' '.join([str(req.req) for req in reqs]) def __repr__(self): + # type: () -> str reqs = [req for req in self.requirements.values()] reqs.sort(key=lambda req: req.name.lower()) reqs_str = ', '.join([str(req.req) for req in reqs]) return ('<%s object; %d requirement(s): %s>' % (self.__class__.__name__, len(reqs), reqs_str)) - def add_requirement(self, install_req, parent_req_name=None, - extras_requested=None): + def add_requirement( + self, + install_req, # type: InstallRequirement + parent_req_name=None, # type: Optional[str] + extras_requested=None # type: Optional[Iterable[str]] + ): + # type: (...) -> Tuple[List[InstallRequirement], Optional[InstallRequirement]] # noqa: E501 """Add install_req as a requirement to install. :param parent_req_name: The name of the requirement that needed this @@ -152,6 +166,7 @@ class RequirementSet(object): return [existing_req], existing_req def has_requirement(self, project_name): + # type: (str) -> bool name = project_name.lower() if (name in self.requirements and not self.requirements[name].constraint or @@ -160,12 +175,8 @@ class RequirementSet(object): return True return False - @property - def has_requirements(self): - return list(req for req in self.requirements.values() if not - req.constraint) or self.unnamed_requirements - def get_requirement(self, project_name): + # type: (str) -> InstallRequirement for name in project_name, project_name.lower(): if name in self.requirements: return self.requirements[name] @@ -174,6 +185,7 @@ class RequirementSet(object): raise KeyError("No project with the name %r" % project_name) def cleanup_files(self): + # type: () -> None """Clean up files, remove builds.""" logger.debug('Cleaning up...') with indent_log(): diff --git a/env/lib/python3.7/site-packages/pip/_internal/req/req_tracker.py b/env/lib/python3.7/site-packages/pip/_internal/req/req_tracker.py index 0a86f4c..e36a3f6 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/req/req_tracker.py +++ b/env/lib/python3.7/site-packages/pip/_internal/req/req_tracker.py @@ -7,6 +7,13 @@ import logging import os from pip._internal.utils.temp_dir import TempDirectory +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + from types import TracebackType + from typing import Iterator, Optional, Set, Type + from pip._internal.req.req_install import InstallRequirement + from pip._internal.models.link import Link logger = logging.getLogger(__name__) @@ -14,6 +21,7 @@ logger = logging.getLogger(__name__) class RequirementTracker(object): def __init__(self): + # type: () -> None self._root = os.environ.get('PIP_REQ_TRACKER') if self._root is None: self._temp_dir = TempDirectory(delete=False, kind='req-tracker') @@ -23,19 +31,28 @@ class RequirementTracker(object): else: self._temp_dir = None logger.debug('Re-using requirements tracker %r', self._root) - self._entries = set() + self._entries = set() # type: Set[InstallRequirement] def __enter__(self): + # type: () -> RequirementTracker return self - def __exit__(self, exc_type, exc_val, exc_tb): + def __exit__( + self, + exc_type, # type: Optional[Type[BaseException]] + exc_val, # type: Optional[BaseException] + exc_tb # type: Optional[TracebackType] + ): + # type: (...) -> None self.cleanup() def _entry_path(self, link): + # type: (Link) -> str hashed = hashlib.sha224(link.url_without_fragment.encode()).hexdigest() return os.path.join(self._root, hashed) def add(self, req): + # type: (InstallRequirement) -> None link = req.link info = str(req) entry_path = self._entry_path(link) @@ -54,12 +71,14 @@ class RequirementTracker(object): logger.debug('Added %s to build tracker %r', req, self._root) def remove(self, req): + # type: (InstallRequirement) -> None link = req.link self._entries.remove(req) os.unlink(self._entry_path(link)) logger.debug('Removed %s from build tracker %r', req, self._root) def cleanup(self): + # type: () -> None for req in set(self._entries): self.remove(req) remove = self._temp_dir is not None @@ -71,6 +90,7 @@ class RequirementTracker(object): @contextlib.contextmanager def track(self, req): + # type: (InstallRequirement) -> Iterator[None] self.add(req) yield self.remove(req) diff --git a/env/lib/python3.7/site-packages/pip/_internal/req/req_uninstall.py b/env/lib/python3.7/site-packages/pip/_internal/req/req_uninstall.py index a7d8230..733301c 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/req/req_uninstall.py +++ b/env/lib/python3.7/site-packages/pip/_internal/req/req_uninstall.py @@ -15,14 +15,22 @@ from pip._internal.utils.compat import WINDOWS, cache_from_source, uses_pycache from pip._internal.utils.logging import indent_log from pip._internal.utils.misc import ( FakeFile, ask, dist_in_usersite, dist_is_local, egg_link_path, is_local, - normalize_path, renames, + normalize_path, renames, rmtree, ) -from pip._internal.utils.temp_dir import TempDirectory +from pip._internal.utils.temp_dir import AdjacentTempDirectory, TempDirectory +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + from typing import ( + Any, Callable, Dict, Iterable, Iterator, List, Optional, Set, Tuple, + ) + from pip._vendor.pkg_resources import Distribution logger = logging.getLogger(__name__) def _script_names(dist, script_name, is_gui): + # type: (Distribution, str, bool) -> List[str] """Create the fully qualified name of the files created by {console,gui}_scripts for the given ``dist``. Returns the list of file names @@ -44,9 +52,11 @@ def _script_names(dist, script_name, is_gui): def _unique(fn): + # type: (Callable) -> Callable[..., Iterator[Any]] @functools.wraps(fn) def unique(*args, **kw): - seen = set() + # type: (Any, Any) -> Iterator[Any] + seen = set() # type: Set[Any] for item in fn(*args, **kw): if item not in seen: seen.add(item) @@ -56,6 +66,7 @@ def _unique(fn): @_unique def uninstallation_paths(dist): + # type: (Distribution) -> Iterator[str] """ Yield all the uninstallation paths for dist based on RECORD-without-.py[co] @@ -78,25 +89,67 @@ def uninstallation_paths(dist): def compact(paths): + # type: (Iterable[str]) -> Set[str] """Compact a path set to contain the minimal number of paths necessary to contain all paths in the set. If /a/path/ and /a/path/to/a/file.txt are both in the set, leave only the shorter path.""" sep = os.path.sep - short_paths = set() + short_paths = set() # type: Set[str] for path in sorted(paths, key=len): - should_add = any( + should_skip = any( path.startswith(shortpath.rstrip("*")) and path[len(shortpath.rstrip("*").rstrip(sep))] == sep for shortpath in short_paths ) - if not should_add: + if not should_skip: short_paths.add(path) return short_paths +def compress_for_rename(paths): + # type: (Iterable[str]) -> Set[str] + """Returns a set containing the paths that need to be renamed. + + This set may include directories when the original sequence of paths + included every file on disk. + """ + case_map = dict((os.path.normcase(p), p) for p in paths) + remaining = set(case_map) + unchecked = sorted(set(os.path.split(p)[0] + for p in case_map.values()), key=len) + wildcards = set() # type: Set[str] + + def norm_join(*a): + # type: (str) -> str + return os.path.normcase(os.path.join(*a)) + + for root in unchecked: + if any(os.path.normcase(root).startswith(w) + for w in wildcards): + # This directory has already been handled. + continue + + all_files = set() # type: Set[str] + all_subdirs = set() # type: Set[str] + for dirname, subdirs, files in os.walk(root): + all_subdirs.update(norm_join(root, dirname, d) + for d in subdirs) + all_files.update(norm_join(root, dirname, f) + for f in files) + # If all the files we found are in our remaining set of files to + # remove, then remove them from the latter set and add a wildcard + # for the directory. + if not (all_files - remaining): + remaining.difference_update(all_files) + wildcards.add(root + os.sep) + + return set(map(case_map.__getitem__, remaining)) | wildcards + + def compress_for_output_listing(paths): + # type: (Iterable[str]) -> Tuple[Set[str], Set[str]] """Returns a tuple of 2 sets of which paths to display to user The first set contains paths that would be deleted. Files of a package @@ -107,7 +160,7 @@ def compress_for_output_listing(paths): folders. """ - will_remove = list(paths) + will_remove = set(paths) will_skip = set() # Determine folders and files @@ -120,7 +173,8 @@ def compress_for_output_listing(paths): folders.add(os.path.dirname(path)) files.add(path) - _normcased_files = set(map(os.path.normcase, files)) + # probably this one https://github.com/python/mypy/issues/390 + _normcased_files = set(map(os.path.normcase, files)) # type: ignore folders = compact(folders) @@ -145,18 +199,131 @@ def compress_for_output_listing(paths): return will_remove, will_skip +class StashedUninstallPathSet(object): + """A set of file rename operations to stash files while + tentatively uninstalling them.""" + def __init__(self): + # type: () -> None + # Mapping from source file root to [Adjacent]TempDirectory + # for files under that directory. + self._save_dirs = {} # type: Dict[str, TempDirectory] + # (old path, new path) tuples for each move that may need + # to be undone. + self._moves = [] # type: List[Tuple[str, str]] + + def _get_directory_stash(self, path): + # type: (str) -> str + """Stashes a directory. + + Directories are stashed adjacent to their original location if + possible, or else moved/copied into the user's temp dir.""" + + try: + save_dir = AdjacentTempDirectory(path) # type: TempDirectory + save_dir.create() + except OSError: + save_dir = TempDirectory(kind="uninstall") + save_dir.create() + self._save_dirs[os.path.normcase(path)] = save_dir + + return save_dir.path + + def _get_file_stash(self, path): + # type: (str) -> str + """Stashes a file. + + If no root has been provided, one will be created for the directory + in the user's temp directory.""" + path = os.path.normcase(path) + head, old_head = os.path.dirname(path), None + save_dir = None + + while head != old_head: + try: + save_dir = self._save_dirs[head] + break + except KeyError: + pass + head, old_head = os.path.dirname(head), head + else: + # Did not find any suitable root + head = os.path.dirname(path) + save_dir = TempDirectory(kind='uninstall') + save_dir.create() + self._save_dirs[head] = save_dir + + relpath = os.path.relpath(path, head) + if relpath and relpath != os.path.curdir: + return os.path.join(save_dir.path, relpath) + return save_dir.path + + def stash(self, path): + # type: (str) -> str + """Stashes the directory or file and returns its new location. + """ + if os.path.isdir(path): + new_path = self._get_directory_stash(path) + else: + new_path = self._get_file_stash(path) + + self._moves.append((path, new_path)) + if os.path.isdir(path) and os.path.isdir(new_path): + # If we're moving a directory, we need to + # remove the destination first or else it will be + # moved to inside the existing directory. + # We just created new_path ourselves, so it will + # be removable. + os.rmdir(new_path) + renames(path, new_path) + return new_path + + def commit(self): + # type: () -> None + """Commits the uninstall by removing stashed files.""" + for _, save_dir in self._save_dirs.items(): + save_dir.cleanup() + self._moves = [] + self._save_dirs = {} + + def rollback(self): + # type: () -> None + """Undoes the uninstall by moving stashed files back.""" + for p in self._moves: + logging.info("Moving to %s\n from %s", *p) + + for new_path, path in self._moves: + try: + logger.debug('Replacing %s from %s', new_path, path) + if os.path.isfile(new_path): + os.unlink(new_path) + elif os.path.isdir(new_path): + rmtree(new_path) + renames(path, new_path) + except OSError as ex: + logger.error("Failed to restore %s", new_path) + logger.debug("Exception: %s", ex) + + self.commit() + + @property + def can_rollback(self): + # type: () -> bool + return bool(self._moves) + + class UninstallPathSet(object): """A set of file paths to be removed in the uninstallation of a requirement.""" def __init__(self, dist): - self.paths = set() - self._refuse = set() - self.pth = {} + # type: (Distribution) -> None + self.paths = set() # type: Set[str] + self._refuse = set() # type: Set[str] + self.pth = {} # type: Dict[str, UninstallPthEntries] self.dist = dist - self.save_dir = TempDirectory(kind="uninstall") - self._moved_paths = [] + self._moved_paths = StashedUninstallPathSet() def _permitted(self, path): + # type: (str) -> bool """ Return True if the given path is one we are permitted to remove/modify, False otherwise. @@ -165,6 +332,7 @@ class UninstallPathSet(object): return is_local(path) def add(self, path): + # type: (str) -> None head, tail = os.path.split(path) # we normalize the head to resolve parent directory symlinks, but not @@ -184,6 +352,7 @@ class UninstallPathSet(object): self.add(cache_from_source(path)) def add_pth(self, pth_file, entry): + # type: (str, str) -> None pth_file = normalize_path(pth_file) if self._permitted(pth_file): if pth_file not in self.pth: @@ -192,12 +361,8 @@ class UninstallPathSet(object): else: self._refuse.add(pth_file) - def _stash(self, path): - return os.path.join( - self.save_dir.path, os.path.splitdrive(path)[1].lstrip(os.path.sep) - ) - def remove(self, auto_confirm=False, verbose=False): + # type: (bool, bool) -> None """Remove paths in ``self.paths`` with confirmation (unless ``auto_confirm`` is True).""" @@ -215,23 +380,26 @@ class UninstallPathSet(object): with indent_log(): if auto_confirm or self._allowed_to_proceed(verbose): - self.save_dir.create() + moved = self._moved_paths - for path in sorted(compact(self.paths)): - new_path = self._stash(path) + for_rename = compress_for_rename(self.paths) + + for path in sorted(compact(for_rename)): + moved.stash(path) logger.debug('Removing file or directory %s', path) - self._moved_paths.append(path) - renames(path, new_path) + for pth in self.pth.values(): pth.remove() logger.info('Successfully uninstalled %s', dist_name_version) def _allowed_to_proceed(self, verbose): + # type: (bool) -> bool """Display which files would be deleted and prompt for confirmation """ def _display(msg, paths): + # type: (str, Iterable[str]) -> None if not paths: return @@ -245,38 +413,39 @@ class UninstallPathSet(object): else: # In verbose mode, display all the files that are going to be # deleted. - will_remove = list(self.paths) + will_remove = set(self.paths) will_skip = set() _display('Would remove:', will_remove) _display('Would not remove (might be manually added):', will_skip) _display('Would not remove (outside of prefix):', self._refuse) + if verbose: + _display('Will actually move:', compress_for_rename(self.paths)) return ask('Proceed (y/n)? ', ('y', 'n')) == 'y' def rollback(self): + # type: () -> None """Rollback the changes previously made by remove().""" - if self.save_dir.path is None: + if not self._moved_paths.can_rollback: logger.error( "Can't roll back %s; was not uninstalled", self.dist.project_name, ) - return False + return logger.info('Rolling back uninstall of %s', self.dist.project_name) - for path in self._moved_paths: - tmp_path = self._stash(path) - logger.debug('Replacing %s', path) - renames(tmp_path, path) + self._moved_paths.rollback() for pth in self.pth.values(): pth.rollback() def commit(self): + # type: () -> None """Remove temporary save dir: rollback will no longer be possible.""" - self.save_dir.cleanup() - self._moved_paths = [] + self._moved_paths.commit() @classmethod def from_dist(cls, dist): + # type: (Distribution) -> UninstallPathSet dist_path = normalize_path(dist.location) if not dist_is_local(dist): logger.info( @@ -408,15 +577,17 @@ class UninstallPathSet(object): class UninstallPthEntries(object): def __init__(self, pth_file): + # type: (str) -> None if not os.path.isfile(pth_file): raise UninstallationError( "Cannot remove entries from nonexistent file %s" % pth_file ) self.file = pth_file - self.entries = set() - self._saved_lines = None + self.entries = set() # type: Set[str] + self._saved_lines = None # type: Optional[List[bytes]] def add(self, entry): + # type: (str) -> None entry = os.path.normcase(entry) # On Windows, os.path.normcase converts the entry to use # backslashes. This is correct for entries that describe absolute @@ -427,6 +598,7 @@ class UninstallPthEntries(object): self.entries.add(entry) def remove(self): + # type: () -> None logger.debug('Removing pth entries from %s:', self.file) with open(self.file, 'rb') as fh: # windows uses '\r\n' with py3k, but uses '\n' with py2.x @@ -449,6 +621,7 @@ class UninstallPthEntries(object): fh.writelines(lines) def rollback(self): + # type: () -> bool if self._saved_lines is None: logger.error( 'Cannot roll back changes to %s, none were made', self.file diff --git a/env/lib/python3.7/site-packages/pip/_internal/resolve.py b/env/lib/python3.7/site-packages/pip/_internal/resolve.py index 2d9f1c5..f49667b 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/resolve.py +++ b/env/lib/python3.7/site-packages/pip/_internal/resolve.py @@ -18,10 +18,22 @@ from pip._internal.exceptions import ( BestVersionAlreadyInstalled, DistributionNotFound, HashError, HashErrors, UnsupportedPythonVersion, ) -from pip._internal.req.constructors import install_req_from_req +from pip._internal.req.constructors import install_req_from_req_string from pip._internal.utils.logging import indent_log from pip._internal.utils.misc import dist_in_usersite, ensure_dir from pip._internal.utils.packaging import check_dist_requires_python +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + from typing import Optional, DefaultDict, List, Set + from pip._internal.download import PipSession + from pip._internal.req.req_install import InstallRequirement + from pip._internal.index import PackageFinder + from pip._internal.req.req_set import RequirementSet + from pip._internal.operations.prepare import ( + DistAbstraction, RequirementPreparer + ) + from pip._internal.cache import WheelCache logger = logging.getLogger(__name__) @@ -33,9 +45,22 @@ class Resolver(object): _allowed_strategies = {"eager", "only-if-needed", "to-satisfy-only"} - def __init__(self, preparer, session, finder, wheel_cache, use_user_site, - ignore_dependencies, ignore_installed, ignore_requires_python, - force_reinstall, isolated, upgrade_strategy): + def __init__( + self, + preparer, # type: RequirementPreparer + session, # type: PipSession + finder, # type: PackageFinder + wheel_cache, # type: Optional[WheelCache] + use_user_site, # type: bool + ignore_dependencies, # type: bool + ignore_installed, # type: bool + ignore_requires_python, # type: bool + force_reinstall, # type: bool + isolated, # type: bool + upgrade_strategy, # type: str + use_pep517=None # type: Optional[bool] + ): + # type: (...) -> None super(Resolver, self).__init__() assert upgrade_strategy in self._allowed_strategies @@ -47,7 +72,8 @@ class Resolver(object): # information about both sdist and wheels transparently. self.wheel_cache = wheel_cache - self.require_hashes = None # This is set in resolve + # This is set in resolve + self.require_hashes = None # type: Optional[bool] self.upgrade_strategy = upgrade_strategy self.force_reinstall = force_reinstall @@ -56,10 +82,13 @@ class Resolver(object): self.ignore_installed = ignore_installed self.ignore_requires_python = ignore_requires_python self.use_user_site = use_user_site + self.use_pep517 = use_pep517 - self._discovered_dependencies = defaultdict(list) + self._discovered_dependencies = \ + defaultdict(list) # type: DefaultDict[str, List] def resolve(self, requirement_set): + # type: (RequirementSet) -> None """Resolve what operations need to be done As a side-effect of this method, the packages (and their dependencies) @@ -94,7 +123,7 @@ class Resolver(object): # exceptions cannot be checked ahead of time, because # req.populate_link() needs to be called before we can make decisions # based on link type. - discovered_reqs = [] + discovered_reqs = [] # type: List[InstallRequirement] hash_errors = HashErrors() for req in chain(root_reqs, discovered_reqs): try: @@ -109,6 +138,7 @@ class Resolver(object): raise hash_errors def _is_upgrade_allowed(self, req): + # type: (InstallRequirement) -> bool if self.upgrade_strategy == "to-satisfy-only": return False elif self.upgrade_strategy == "eager": @@ -118,6 +148,7 @@ class Resolver(object): return req.is_direct def _set_req_to_reinstall(self, req): + # type: (InstallRequirement) -> None """ Set a requirement to be installed. """ @@ -129,6 +160,7 @@ class Resolver(object): # XXX: Stop passing requirement_set for options def _check_skip_installed(self, req_to_install): + # type: (InstallRequirement) -> Optional[str] """Check if req_to_install should be skipped. This will check if the req is installed, and whether we should upgrade @@ -181,6 +213,7 @@ class Resolver(object): return None def _get_abstract_dist_for(self, req): + # type: (InstallRequirement) -> DistAbstraction """Takes a InstallRequirement and returns a single AbstractDist \ representing a prepared variant of the same. """ @@ -237,7 +270,12 @@ class Resolver(object): return abstract_dist - def _resolve_one(self, requirement_set, req_to_install): + def _resolve_one( + self, + requirement_set, # type: RequirementSet + req_to_install # type: InstallRequirement + ): + # type: (...) -> List[InstallRequirement] """Prepare a single requirements file. :return: A list of additional InstallRequirements to also install. @@ -256,7 +294,7 @@ class Resolver(object): abstract_dist = self._get_abstract_dist_for(req_to_install) # Parse and return dependencies - dist = abstract_dist.dist(self.finder) + dist = abstract_dist.dist() try: check_dist_requires_python(dist) except UnsupportedPythonVersion as err: @@ -265,14 +303,15 @@ class Resolver(object): else: raise - more_reqs = [] + more_reqs = [] # type: List[InstallRequirement] def add_req(subreq, extras_requested): - sub_install_req = install_req_from_req( + sub_install_req = install_req_from_req_string( str(subreq), req_to_install, isolated=self.isolated, wheel_cache=self.wheel_cache, + use_pep517=self.use_pep517 ) parent_req_name = req_to_install.name to_scan_again, add_to_parent = requirement_set.add_requirement( @@ -326,6 +365,7 @@ class Resolver(object): return more_reqs def get_installation_order(self, req_set): + # type: (RequirementSet) -> List[InstallRequirement] """Create the installation order. The installation order is topological - requirements are installed @@ -336,7 +376,7 @@ class Resolver(object): # installs the user specified things in the order given, except when # dependencies must come earlier to achieve topological order. order = [] - ordered_reqs = set() + ordered_reqs = set() # type: Set[InstallRequirement] def schedule(req): if req.satisfied_by or req in ordered_reqs: diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/__init__.cpython-37.pyc index a69d93b..4c1a0bb 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/appdirs.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/appdirs.cpython-37.pyc index 042096c..aeebe65 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/appdirs.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/appdirs.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/compat.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/compat.cpython-37.pyc index 471db17..b3f374d 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/compat.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/compat.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/deprecation.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/deprecation.cpython-37.pyc index 5effa13..605a26c 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/deprecation.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/deprecation.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/encoding.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/encoding.cpython-37.pyc index f7332aa..9f13569 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/encoding.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/encoding.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/filesystem.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/filesystem.cpython-37.pyc index 9039fbf..6e09564 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/filesystem.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/filesystem.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/glibc.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/glibc.cpython-37.pyc index 5ea7c42..b7dc6c6 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/glibc.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/glibc.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/hashes.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/hashes.cpython-37.pyc index 15bfa4e..2e5868a 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/hashes.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/hashes.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/logging.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/logging.cpython-37.pyc index 4bd1892..1096526 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/logging.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/logging.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/misc.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/misc.cpython-37.pyc index ea8c15a..fdf2475 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/misc.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/misc.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/models.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/models.cpython-37.pyc index 604cb69..ce91eb1 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/models.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/models.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/outdated.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/outdated.cpython-37.pyc index 6e45efd..e1cade5 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/outdated.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/outdated.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/packaging.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/packaging.cpython-37.pyc index 618754a..7001e56 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/packaging.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/packaging.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/setuptools_build.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/setuptools_build.cpython-37.pyc index 695b670..b0686c9 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/setuptools_build.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/setuptools_build.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/temp_dir.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/temp_dir.cpython-37.pyc index dd72710..0378b31 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/temp_dir.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/temp_dir.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/typing.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/typing.cpython-37.pyc index d287fe3..f0da31c 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/typing.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/typing.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/ui.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/ui.cpython-37.pyc index 4534fed..3c17a07 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/ui.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/utils/__pycache__/ui.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/appdirs.py b/env/lib/python3.7/site-packages/pip/_internal/utils/appdirs.py index cc96f98..fb26111 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/utils/appdirs.py +++ b/env/lib/python3.7/site-packages/pip/_internal/utils/appdirs.py @@ -10,9 +10,14 @@ import sys from pip._vendor.six import PY2, text_type from pip._internal.utils.compat import WINDOWS, expanduser +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + from typing import List def user_cache_dir(appname): + # type: (str) -> str r""" Return full path to the user-specific cache dir for this application. @@ -61,6 +66,7 @@ def user_cache_dir(appname): def user_data_dir(appname, roaming=False): + # type: (str, bool) -> str r""" Return full path to the user-specific data dir for this application. @@ -113,6 +119,7 @@ def user_data_dir(appname, roaming=False): def user_config_dir(appname, roaming=True): + # type: (str, bool) -> str """Return full path to the user-specific config dir for this application. "appname" is the name of application. @@ -146,6 +153,7 @@ def user_config_dir(appname, roaming=True): # for the discussion regarding site_config_dirs locations # see def site_config_dirs(appname): + # type: (str) -> List[str] r"""Return a list of potential user-shared config dirs for this application. "appname" is the name of application. @@ -186,6 +194,7 @@ def site_config_dirs(appname): # -- Windows support functions -- def _get_win_folder_from_registry(csidl_name): + # type: (str) -> str """ This is a fallback technique at best. I'm not sure if using the registry for this guarantees us the correct answer for all CSIDL_* @@ -208,6 +217,7 @@ def _get_win_folder_from_registry(csidl_name): def _get_win_folder_with_ctypes(csidl_name): + # type: (str) -> str csidl_const = { "CSIDL_APPDATA": 26, "CSIDL_COMMON_APPDATA": 35, diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/compat.py b/env/lib/python3.7/site-packages/pip/_internal/utils/compat.py index 3114f2d..845436e 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/utils/compat.py +++ b/env/lib/python3.7/site-packages/pip/_internal/utils/compat.py @@ -11,6 +11,11 @@ import sys from pip._vendor.six import text_type +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + from typing import Tuple, Text + try: import ipaddress except ImportError: @@ -18,8 +23,8 @@ except ImportError: from pip._vendor import ipaddress # type: ignore except ImportError: import ipaddr as ipaddress # type: ignore - ipaddress.ip_address = ipaddress.IPAddress - ipaddress.ip_network = ipaddress.IPNetwork + ipaddress.ip_address = ipaddress.IPAddress # type: ignore + ipaddress.ip_network = ipaddress.IPNetwork # type: ignore __all__ = [ @@ -68,6 +73,7 @@ else: def console_to_str(data): + # type: (bytes) -> Text """Return a string, safe for output, of subprocess output. We assume the data is in the locale preferred encoding. @@ -88,13 +94,13 @@ def console_to_str(data): # Now try to decode the data - if we fail, warn the user and # decode with replacement. try: - s = data.decode(encoding) + decoded_data = data.decode(encoding) except UnicodeDecodeError: logger.warning( "Subprocess output does not appear to be encoded as %s", encoding, ) - s = data.decode(encoding, errors=backslashreplace_decode) + decoded_data = data.decode(encoding, errors=backslashreplace_decode) # Make sure we can print the output, by encoding it to the output # encoding with replacement of unencodable characters, and then @@ -112,20 +118,25 @@ def console_to_str(data): "encoding", None) if output_encoding: - s = s.encode(output_encoding, errors="backslashreplace") - s = s.decode(output_encoding) + output_encoded = decoded_data.encode( + output_encoding, + errors="backslashreplace" + ) + decoded_data = output_encoded.decode(output_encoding) - return s + return decoded_data if sys.version_info >= (3,): def native_str(s, replace=False): + # type: (str, bool) -> str if isinstance(s, bytes): return s.decode('utf-8', 'replace' if replace else 'strict') return s else: def native_str(s, replace=False): + # type: (str, bool) -> str # Replace is ignored -- unicode to UTF-8 can't fail if isinstance(s, text_type): return s.encode('utf-8') @@ -133,6 +144,7 @@ else: def get_path_uid(path): + # type: (str) -> int """ Return path's uid. @@ -174,6 +186,7 @@ else: def expanduser(path): + # type: (str) -> str """ Expand ~ and ~user constructions. @@ -199,6 +212,7 @@ WINDOWS = (sys.platform.startswith("win") or def samefile(file1, file2): + # type: (str, str) -> bool """Provide an alternative for os.path.samefile on Windows/Python2""" if hasattr(os.path, 'samefile'): return os.path.samefile(file1, file2) @@ -210,13 +224,15 @@ def samefile(file1, file2): if hasattr(shutil, 'get_terminal_size'): def get_terminal_size(): + # type: () -> Tuple[int, int] """ Returns a tuple (x, y) representing the width(x) and the height(y) in characters of the terminal window. """ - return tuple(shutil.get_terminal_size()) + return tuple(shutil.get_terminal_size()) # type: ignore else: def get_terminal_size(): + # type: () -> Tuple[int, int] """ Returns a tuple (x, y) representing the width(x) and the height(y) in characters of the terminal window. diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/deprecation.py b/env/lib/python3.7/site-packages/pip/_internal/utils/deprecation.py index bd744cf..8c896f8 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/utils/deprecation.py +++ b/env/lib/python3.7/site-packages/pip/_internal/utils/deprecation.py @@ -12,7 +12,10 @@ from pip import __version__ as current_version from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: - from typing import Any, Optional # noqa: F401 + from typing import Any, Optional + + +DEPRECATION_MSG_PREFIX = "DEPRECATION: " class PipDeprecationWarning(Warning): @@ -41,6 +44,7 @@ def _showwarning(message, category, filename, lineno, file=None, line=None): def install_warning_logger(): + # type: () -> None # Enable our Deprecation Warnings warnings.simplefilter("default", PipDeprecationWarning, append=True) @@ -76,7 +80,7 @@ def deprecated(reason, replacement, gone_in, issue=None): # Construct a nice message. # This is purposely eagerly formatted as we want it to appear as if someone # typed this entire message out. - message = "DEPRECATION: " + reason + message = DEPRECATION_MSG_PREFIX + reason if replacement is not None: message += " A possible replacement is {}.".format(replacement) if issue is not None: diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/encoding.py b/env/lib/python3.7/site-packages/pip/_internal/utils/encoding.py index 56f6036..30139f2 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/utils/encoding.py +++ b/env/lib/python3.7/site-packages/pip/_internal/utils/encoding.py @@ -3,20 +3,26 @@ import locale import re import sys +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + from typing import List, Tuple, Text + BOMS = [ - (codecs.BOM_UTF8, 'utf8'), - (codecs.BOM_UTF16, 'utf16'), - (codecs.BOM_UTF16_BE, 'utf16-be'), - (codecs.BOM_UTF16_LE, 'utf16-le'), - (codecs.BOM_UTF32, 'utf32'), - (codecs.BOM_UTF32_BE, 'utf32-be'), - (codecs.BOM_UTF32_LE, 'utf32-le'), -] + (codecs.BOM_UTF8, 'utf-8'), + (codecs.BOM_UTF16, 'utf-16'), + (codecs.BOM_UTF16_BE, 'utf-16-be'), + (codecs.BOM_UTF16_LE, 'utf-16-le'), + (codecs.BOM_UTF32, 'utf-32'), + (codecs.BOM_UTF32_BE, 'utf-32-be'), + (codecs.BOM_UTF32_LE, 'utf-32-le'), +] # type: List[Tuple[bytes, Text]] ENCODING_RE = re.compile(br'coding[:=]\s*([-\w.]+)') def auto_decode(data): + # type: (bytes) -> Text """Check a bytes string for a BOM to correctly detect the encoding Fallback to locale.getpreferredencoding(False) like open() on Python3""" diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/filesystem.py b/env/lib/python3.7/site-packages/pip/_internal/utils/filesystem.py index 1e9cebd..1e6b033 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/utils/filesystem.py +++ b/env/lib/python3.7/site-packages/pip/_internal/utils/filesystem.py @@ -5,6 +5,7 @@ from pip._internal.utils.compat import get_path_uid def check_path_owner(path): + # type: (str) -> bool # If we don't have a way to check the effective uid of this process, then # we'll just assume that we own the directory. if not hasattr(os, "geteuid"): @@ -26,3 +27,4 @@ def check_path_owner(path): return os.access(path, os.W_OK) else: previous, path = path, os.path.dirname(path) + return False # assume we don't own the path diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/glibc.py b/env/lib/python3.7/site-packages/pip/_internal/utils/glibc.py index ebcfc5b..5bea655 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/utils/glibc.py +++ b/env/lib/python3.7/site-packages/pip/_internal/utils/glibc.py @@ -4,8 +4,14 @@ import ctypes import re import warnings +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + from typing import Optional, Tuple + def glibc_version_string(): + # type: () -> Optional[str] "Returns glibc version string, or None if not using glibc." # ctypes.CDLL(None) internally calls dlopen(NULL), and as the dlopen @@ -32,6 +38,7 @@ def glibc_version_string(): # Separated out from have_compatible_glibc for easier unit testing def check_glibc_version(version_str, required_major, minimum_minor): + # type: (str, int, int) -> bool # Parse string and check against requested version. # # We use a regexp instead of str.split because we want to discard any @@ -48,7 +55,8 @@ def check_glibc_version(version_str, required_major, minimum_minor): def have_compatible_glibc(required_major, minimum_minor): - version_str = glibc_version_string() + # type: (int, int) -> bool + version_str = glibc_version_string() # type: Optional[str] if version_str is None: return False return check_glibc_version(version_str, required_major, minimum_minor) @@ -72,6 +80,7 @@ def have_compatible_glibc(required_major, minimum_minor): # misleading. Solution: instead of using platform, use our code that actually # works. def libc_ver(): + # type: () -> Tuple[str, str] """Try to determine the glibc version Returns a tuple of strings (lib, version) which default to empty strings diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/hashes.py b/env/lib/python3.7/site-packages/pip/_internal/utils/hashes.py index 8b909ba..a714206 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/utils/hashes.py +++ b/env/lib/python3.7/site-packages/pip/_internal/utils/hashes.py @@ -8,6 +8,18 @@ from pip._internal.exceptions import ( HashMismatch, HashMissing, InstallationError, ) from pip._internal.utils.misc import read_chunks +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + from typing import ( + Dict, List, BinaryIO, NoReturn, Iterator + ) + from pip._vendor.six import PY3 + if PY3: + from hashlib import _Hash + else: + from hashlib import _hash as _Hash + # The recommended hash algo of the moment. Change this whenever the state of # the art changes; it won't hurt backward compatibility. @@ -25,6 +37,7 @@ class Hashes(object): """ def __init__(self, hashes=None): + # type: (Dict[str, List[str]]) -> None """ :param hashes: A dict of algorithm names pointing to lists of allowed hex digests @@ -32,6 +45,7 @@ class Hashes(object): self._allowed = {} if hashes is None else hashes def check_against_chunks(self, chunks): + # type: (Iterator[bytes]) -> None """Check good hashes against ones built from iterable of chunks of data. @@ -55,9 +69,11 @@ class Hashes(object): self._raise(gots) def _raise(self, gots): + # type: (Dict[str, _Hash]) -> NoReturn raise HashMismatch(self._allowed, gots) def check_against_file(self, file): + # type: (BinaryIO) -> None """Check good hashes against a file-like object Raise HashMismatch if none match. @@ -66,14 +82,17 @@ class Hashes(object): return self.check_against_chunks(read_chunks(file)) def check_against_path(self, path): + # type: (str) -> None with open(path, 'rb') as file: return self.check_against_file(file) def __nonzero__(self): + # type: () -> bool """Return whether I know any known-good hashes.""" return bool(self._allowed) def __bool__(self): + # type: () -> bool return self.__nonzero__() @@ -85,10 +104,12 @@ class MissingHashes(Hashes): """ def __init__(self): + # type: () -> None """Don't offer the ``hashes`` kwarg.""" # Pass our favorite hash in to generate a "gotten hash". With the # empty list, it will never match, so an error will always raise. super(MissingHashes, self).__init__(hashes={FAVORITE_HASH: []}) def _raise(self, gots): + # type: (Dict[str, _Hash]) -> NoReturn raise HashMissing(gots[FAVORITE_HASH].hexdigest()) diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/logging.py b/env/lib/python3.7/site-packages/pip/_internal/utils/logging.py index d9b9541..a28e88c 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/utils/logging.py +++ b/env/lib/python3.7/site-packages/pip/_internal/utils/logging.py @@ -1,12 +1,18 @@ from __future__ import absolute_import import contextlib +import errno import logging import logging.handlers import os +import sys +from logging import Filter + +from pip._vendor.six import PY2 from pip._internal.utils.compat import WINDOWS -from pip._internal.utils.misc import ensure_dir +from pip._internal.utils.deprecation import DEPRECATION_MSG_PREFIX +from pip._internal.utils.misc import ensure_dir, subprocess_logger try: import threading @@ -26,6 +32,48 @@ _log_state = threading.local() _log_state.indentation = 0 +class BrokenStdoutLoggingError(Exception): + """ + Raised if BrokenPipeError occurs for the stdout stream while logging. + """ + pass + + +# BrokenPipeError does not exist in Python 2 and, in addition, manifests +# differently in Windows and non-Windows. +if WINDOWS: + # In Windows, a broken pipe can show up as EINVAL rather than EPIPE: + # https://bugs.python.org/issue19612 + # https://bugs.python.org/issue30418 + if PY2: + def _is_broken_pipe_error(exc_class, exc): + """See the docstring for non-Windows Python 3 below.""" + return (exc_class is IOError and + exc.errno in (errno.EINVAL, errno.EPIPE)) + else: + # In Windows, a broken pipe IOError became OSError in Python 3. + def _is_broken_pipe_error(exc_class, exc): + """See the docstring for non-Windows Python 3 below.""" + return ((exc_class is BrokenPipeError) or # noqa: F821 + (exc_class is OSError and + exc.errno in (errno.EINVAL, errno.EPIPE))) +elif PY2: + def _is_broken_pipe_error(exc_class, exc): + """See the docstring for non-Windows Python 3 below.""" + return (exc_class is IOError and exc.errno == errno.EPIPE) +else: + # Then we are in the non-Windows Python 3 case. + def _is_broken_pipe_error(exc_class, exc): + """ + Return whether an exception is a broken pipe error. + + Args: + exc_class: an exception class. + exc: an exception instance. + """ + return (exc_class is BrokenPipeError) # noqa: F821 + + @contextlib.contextmanager def indent_log(num=2): """ @@ -44,15 +92,47 @@ def get_indentation(): class IndentingFormatter(logging.Formatter): + def __init__(self, *args, **kwargs): + """ + A logging.Formatter that obeys the indent_log() context manager. + + :param add_timestamp: A bool indicating output lines should be prefixed + with their record's timestamp. + """ + self.add_timestamp = kwargs.pop("add_timestamp", False) + super(IndentingFormatter, self).__init__(*args, **kwargs) + + def get_message_start(self, formatted, levelno): + """ + Return the start of the formatted log message (not counting the + prefix to add to each line). + """ + if levelno < logging.WARNING: + return '' + if formatted.startswith(DEPRECATION_MSG_PREFIX): + # Then the message already has a prefix. We don't want it to + # look like "WARNING: DEPRECATION: ...." + return '' + if levelno < logging.ERROR: + return 'WARNING: ' + + return 'ERROR: ' def format(self, record): """ Calls the standard formatter, but will indent all of the log messages by our current indentation level. """ - formatted = logging.Formatter.format(self, record) + formatted = super(IndentingFormatter, self).format(record) + message_start = self.get_message_start(formatted, record.levelno) + formatted = message_start + formatted + + prefix = '' + if self.add_timestamp: + prefix = self.formatTime(record, "%Y-%m-%dT%H:%M:%S ") + prefix += " " * get_indentation() formatted = "".join([ - (" " * get_indentation()) + line + prefix + line for line in formatted.splitlines(True) ]) return formatted @@ -83,6 +163,16 @@ class ColorizedStreamHandler(logging.StreamHandler): if WINDOWS and colorama: self.stream = colorama.AnsiToWin32(self.stream) + def _using_stdout(self): + """ + Return whether the handler is using sys.stdout. + """ + if WINDOWS and colorama: + # Then self.stream is an AnsiToWin32 object. + return self.stream.wrapped is sys.stdout + + return self.stream is sys.stdout + def should_color(self): # Don't colorize things if we do not have colorama or if told not to if not colorama or self._no_color: @@ -115,6 +205,19 @@ class ColorizedStreamHandler(logging.StreamHandler): return msg + # The logging module says handleError() can be customized. + def handleError(self, record): + exc_class, exc = sys.exc_info()[:2] + # If a broken pipe occurred while calling write() or flush() on the + # stdout stream in logging's Handler.emit(), then raise our special + # exception so we can handle it in main() instead of logging the + # broken pipe error and continuing. + if (exc_class and self._using_stdout() and + _is_broken_pipe_error(exc_class, exc)): + raise BrokenStdoutLoggingError() + + return super(ColorizedStreamHandler, self).handleError(record) + class BetterRotatingFileHandler(logging.handlers.RotatingFileHandler): @@ -123,7 +226,7 @@ class BetterRotatingFileHandler(logging.handlers.RotatingFileHandler): return logging.handlers.RotatingFileHandler._open(self) -class MaxLevelFilter(logging.Filter): +class MaxLevelFilter(Filter): def __init__(self, level): self.level = level @@ -132,8 +235,22 @@ class MaxLevelFilter(logging.Filter): return record.levelno < self.level +class ExcludeLoggerFilter(Filter): + + """ + A logging Filter that excludes records from a logger (or its children). + """ + + def filter(self, record): + # The base Filter class allows only records from a logger (or its + # children). + return not super(ExcludeLoggerFilter, self).filter(record) + + def setup_logging(verbosity, no_color, user_log_file): """Configures and sets up all of the logging + + Returns the requested logging level, as its integer value. """ # Determine the level to be logging at. @@ -148,6 +265,8 @@ def setup_logging(verbosity, no_color, user_log_file): else: level = "INFO" + level_number = getattr(logging, level) + # The "root" logger should match the "console" level *unless* we also need # to log to a user log file. include_user_log = user_log_file is not None @@ -171,6 +290,9 @@ def setup_logging(verbosity, no_color, user_log_file): "stream": "pip._internal.utils.logging.ColorizedStreamHandler", "file": "pip._internal.utils.logging.BetterRotatingFileHandler", } + handlers = ["console", "console_errors", "console_subprocess"] + ( + ["user_log"] if include_user_log else [] + ) logging.config.dictConfig({ "version": 1, @@ -180,12 +302,25 @@ def setup_logging(verbosity, no_color, user_log_file): "()": "pip._internal.utils.logging.MaxLevelFilter", "level": logging.WARNING, }, + "restrict_to_subprocess": { + "()": "logging.Filter", + "name": subprocess_logger.name, + }, + "exclude_subprocess": { + "()": "pip._internal.utils.logging.ExcludeLoggerFilter", + "name": subprocess_logger.name, + }, }, "formatters": { "indent": { "()": IndentingFormatter, "format": "%(message)s", }, + "indent_with_timestamp": { + "()": IndentingFormatter, + "format": "%(message)s", + "add_timestamp": True, + }, }, "handlers": { "console": { @@ -193,7 +328,7 @@ def setup_logging(verbosity, no_color, user_log_file): "class": handler_classes["stream"], "no_color": no_color, "stream": log_streams["stdout"], - "filters": ["exclude_warnings"], + "filters": ["exclude_subprocess", "exclude_warnings"], "formatter": "indent", }, "console_errors": { @@ -201,6 +336,17 @@ def setup_logging(verbosity, no_color, user_log_file): "class": handler_classes["stream"], "no_color": no_color, "stream": log_streams["stderr"], + "filters": ["exclude_subprocess"], + "formatter": "indent", + }, + # A handler responsible for logging to the console messages + # from the "subprocessor" logger. + "console_subprocess": { + "level": level, + "class": handler_classes["stream"], + "no_color": no_color, + "stream": log_streams["stderr"], + "filters": ["restrict_to_subprocess"], "formatter": "indent", }, "user_log": { @@ -208,14 +354,12 @@ def setup_logging(verbosity, no_color, user_log_file): "class": handler_classes["file"], "filename": additional_log_file, "delay": True, - "formatter": "indent", + "formatter": "indent_with_timestamp", }, }, "root": { "level": root_level, - "handlers": ["console", "console_errors"] + ( - ["user_log"] if include_user_log else [] - ), + "handlers": handlers, }, "loggers": { "pip._vendor": { @@ -223,3 +367,5 @@ def setup_logging(verbosity, no_color, user_log_file): } }, }) + + return level_number diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/misc.py b/env/lib/python3.7/site-packages/pip/_internal/utils/misc.py index 84a421f..ca7a529 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/utils/misc.py +++ b/env/lib/python3.7/site-packages/pip/_internal/utils/misc.py @@ -3,7 +3,6 @@ from __future__ import absolute_import import contextlib import errno import io -import locale # we have a submodule named 'logging' which would shadow this if we used the # regular name: import logging as std_logging @@ -23,8 +22,9 @@ from pip._vendor import pkg_resources # why we ignore the type on this import. from pip._vendor.retrying import retry # type: ignore from pip._vendor.six import PY2 -from pip._vendor.six.moves import input +from pip._vendor.six.moves import input, shlex_quote from pip._vendor.six.moves.urllib import parse as urllib_parse +from pip._vendor.six.moves.urllib.parse import unquote as urllib_unquote from pip._internal.exceptions import CommandError, InstallationError from pip._internal.locations import ( @@ -34,12 +34,23 @@ from pip._internal.locations import ( from pip._internal.utils.compat import ( WINDOWS, console_to_str, expanduser, stdlib_pkgs, ) +from pip._internal.utils.typing import MYPY_CHECK_RUNNING if PY2: from io import BytesIO as StringIO else: from io import StringIO +if MYPY_CHECK_RUNNING: + from typing import ( + Optional, Tuple, Iterable, List, Match, Union, Any, Mapping, Text, + AnyStr, Container + ) + from pip._vendor.pkg_resources import Distribution + from pip._internal.models.link import Link + from pip._internal.utils.ui import SpinnerInterface + + __all__ = ['rmtree', 'display_path', 'backup_dir', 'ask', 'splitext', 'format_size', 'is_installable_dir', @@ -49,19 +60,24 @@ __all__ = ['rmtree', 'display_path', 'backup_dir', 'renames', 'get_prog', 'unzip_file', 'untar_file', 'unpack_file', 'call_subprocess', 'captured_stdout', 'ensure_dir', - 'ARCHIVE_EXTENSIONS', 'SUPPORTED_EXTENSIONS', + 'ARCHIVE_EXTENSIONS', 'SUPPORTED_EXTENSIONS', 'WHEEL_EXTENSION', 'get_installed_version', 'remove_auth_from_url'] logger = std_logging.getLogger(__name__) +subprocess_logger = std_logging.getLogger('pip.subprocessor') +LOG_DIVIDER = '----------------------------------------' + +WHEEL_EXTENSION = '.whl' BZ2_EXTENSIONS = ('.tar.bz2', '.tbz') XZ_EXTENSIONS = ('.tar.xz', '.txz', '.tlz', '.tar.lz', '.tar.lzma') -ZIP_EXTENSIONS = ('.zip', '.whl') +ZIP_EXTENSIONS = ('.zip', WHEEL_EXTENSION) TAR_EXTENSIONS = ('.tar.gz', '.tgz', '.tar') ARCHIVE_EXTENSIONS = ( ZIP_EXTENSIONS + BZ2_EXTENSIONS + TAR_EXTENSIONS + XZ_EXTENSIONS) SUPPORTED_EXTENSIONS = ZIP_EXTENSIONS + TAR_EXTENSIONS + try: import bz2 # noqa SUPPORTED_EXTENSIONS += BZ2_EXTENSIONS @@ -76,14 +92,8 @@ except ImportError: logger.debug('lzma module is not available') -def import_or_raise(pkg_or_module_string, ExceptionType, *args, **kwargs): - try: - return __import__(pkg_or_module_string) - except ImportError: - raise ExceptionType(*args, **kwargs) - - def ensure_dir(path): + # type: (AnyStr) -> None """os.path.makedirs without EEXIST.""" try: os.makedirs(path) @@ -93,6 +103,7 @@ def ensure_dir(path): def get_prog(): + # type: () -> str try: prog = os.path.basename(sys.argv[0]) if prog in ('__main__.py', '-c'): @@ -107,6 +118,7 @@ def get_prog(): # Retry every half second for up to 3 seconds @retry(stop_max_delay=3000, wait_fixed=500) def rmtree(dir, ignore_errors=False): + # type: (str, bool) -> None shutil.rmtree(dir, ignore_errors=ignore_errors, onerror=rmtree_errorhandler) @@ -127,6 +139,7 @@ def rmtree_errorhandler(func, path, exc_info): def display_path(path): + # type: (Union[str, Text]) -> str """Gives the display value for a given path, making it relative to cwd if possible.""" path = os.path.normcase(os.path.abspath(path)) @@ -139,6 +152,7 @@ def display_path(path): def backup_dir(dir, ext='.bak'): + # type: (str, str) -> str """Figure out the name of a directory to back up the given dir to (adding .bak, .bak2, etc)""" n = 1 @@ -150,6 +164,7 @@ def backup_dir(dir, ext='.bak'): def ask_path_exists(message, options): + # type: (str, Iterable[str]) -> str for action in os.environ.get('PIP_EXISTS_ACTION', '').split(): if action in options: return action @@ -157,6 +172,7 @@ def ask_path_exists(message, options): def ask(message, options): + # type: (str, Iterable[str]) -> str """Ask the message interactively, with the given possible responses""" while 1: if os.environ.get('PIP_NO_INPUT'): @@ -176,6 +192,7 @@ def ask(message, options): def format_size(bytes): + # type: (float) -> str if bytes > 1000 * 1000: return '%.1fMB' % (bytes / 1000.0 / 1000) elif bytes > 10 * 1000: @@ -187,6 +204,7 @@ def format_size(bytes): def is_installable_dir(path): + # type: (str) -> bool """Is path is a directory containing setup.py or pyproject.toml? """ if not os.path.isdir(path): @@ -201,6 +219,7 @@ def is_installable_dir(path): def is_svn_page(html): + # type: (Union[str, Text]) -> Optional[Match[Union[str, Text]]] """ Returns true if the page appears to be the index page of an svn repository """ @@ -209,6 +228,7 @@ def is_svn_page(html): def file_contents(filename): + # type: (str) -> Text with open(filename, 'rb') as fp: return fp.read().decode('utf-8') @@ -223,6 +243,7 @@ def read_chunks(file, size=io.DEFAULT_BUFFER_SIZE): def split_leading_dir(path): + # type: (Union[str, Text]) -> List[Union[str, Text]] path = path.lstrip('/').lstrip('\\') if '/' in path and (('\\' in path and path.find('/') < path.find('\\')) or '\\' not in path): @@ -230,10 +251,11 @@ def split_leading_dir(path): elif '\\' in path: return path.split('\\', 1) else: - return path, '' + return [path, ''] def has_leading_dir(paths): + # type: (Iterable[Union[str, Text]]) -> bool """Returns true if all the paths have the same leading path name (i.e., everything is in one subdirectory in an archive)""" common_prefix = None @@ -249,6 +271,7 @@ def has_leading_dir(paths): def normalize_path(path, resolve_symlinks=True): + # type: (str, bool) -> str """ Convert a path to its canonical, case-normalized, absolute version. @@ -262,6 +285,7 @@ def normalize_path(path, resolve_symlinks=True): def splitext(path): + # type: (str) -> Tuple[str, str] """Like os.path.splitext, but take off .tar too""" base, ext = posixpath.splitext(path) if base.lower().endswith('.tar'): @@ -271,6 +295,7 @@ def splitext(path): def renames(old, new): + # type: (str, str) -> None """Like os.renames(), but handles renaming across devices.""" # Implementation borrowed from os.renames(). head, tail = os.path.split(new) @@ -288,6 +313,7 @@ def renames(old, new): def is_local(path): + # type: (str) -> bool """ Return True if path is within sys.prefix, if we're running in a virtualenv. @@ -300,6 +326,7 @@ def is_local(path): def dist_is_local(dist): + # type: (Distribution) -> bool """ Return True if given Distribution object is installed locally (i.e. within current virtualenv). @@ -311,6 +338,7 @@ def dist_is_local(dist): def dist_in_usersite(dist): + # type: (Distribution) -> bool """ Return True if given Distribution is installed in user site. """ @@ -319,6 +347,7 @@ def dist_in_usersite(dist): def dist_in_site_packages(dist): + # type: (Distribution) -> bool """ Return True if given Distribution is installed in sysconfig.get_python_lib(). @@ -329,7 +358,10 @@ def dist_in_site_packages(dist): def dist_is_editable(dist): - """Is distribution an editable install?""" + # type: (Distribution) -> bool + """ + Return True if given Distribution is an editable install. + """ for path_item in sys.path: egg_link = os.path.join(path_item, dist.project_name + '.egg-link') if os.path.isfile(egg_link): @@ -342,6 +374,7 @@ def get_installed_distributions(local_only=True, include_editables=True, editables_only=False, user_only=False): + # type: (bool, Container[str], bool, bool, bool) -> List[Distribution] """ Return a list of installed Distribution objects. @@ -385,7 +418,8 @@ def get_installed_distributions(local_only=True, def user_test(d): return True - return [d for d in pkg_resources.working_set + # because of pkg_resources vendoring, mypy cannot find stub in typeshed + return [d for d in pkg_resources.working_set # type: ignore if local_test(d) and d.key not in skip and editable_test(d) and @@ -395,6 +429,7 @@ def get_installed_distributions(local_only=True, def egg_link_path(dist): + # type: (Distribution) -> Optional[str] """ Return the path for the .egg-link file if it exists, otherwise, None. @@ -429,9 +464,11 @@ def egg_link_path(dist): egglink = os.path.join(site, dist.project_name) + '.egg-link' if os.path.isfile(egglink): return egglink + return None def dist_location(dist): + # type: (Distribution) -> str """ Get the site-packages location of this distribution. Generally this is dist.location, except in the case of develop-installed @@ -453,6 +490,7 @@ def current_umask(): def unzip_file(filename, location, flatten=True): + # type: (str, str, bool) -> None """ Unzip the file (with path `filename`) to the destination `location`. All files are written based on system defaults and umask (i.e. permissions are @@ -468,7 +506,6 @@ def unzip_file(filename, location, flatten=True): leading = has_leading_dir(zip.namelist()) and flatten for info in zip.infolist(): name = info.filename - data = zip.read(name) fn = name if leading: fn = split_leading_dir(name)[1] @@ -479,9 +516,12 @@ def unzip_file(filename, location, flatten=True): ensure_dir(fn) else: ensure_dir(dir) - fp = open(fn, 'wb') + # Don't use read() to avoid allocating an arbitrarily large + # chunk of memory for the file's content + fp = zip.open(name) try: - fp.write(data) + with open(fn, 'wb') as destfp: + shutil.copyfileobj(fp, destfp) finally: fp.close() mode = info.external_attr >> 16 @@ -496,6 +536,7 @@ def unzip_file(filename, location, flatten=True): def untar_file(filename, location): + # type: (str, str) -> None """ Untar the file (with path `filename`) to the destination `location`. All files are written based on system defaults and umask (i.e. permissions @@ -520,23 +561,21 @@ def untar_file(filename, location): mode = 'r:*' tar = tarfile.open(filename, mode) try: - # note: python<=2.5 doesn't seem to know about pax headers, filter them leading = has_leading_dir([ member.name for member in tar.getmembers() - if member.name != 'pax_global_header' ]) for member in tar.getmembers(): fn = member.name - if fn == 'pax_global_header': - continue if leading: - fn = split_leading_dir(fn)[1] + # https://github.com/python/mypy/issues/1174 + fn = split_leading_dir(fn)[1] # type: ignore path = os.path.join(location, fn) if member.isdir(): ensure_dir(path) elif member.issym(): try: - tar._extract_member(member, path) + # https://github.com/python/typeshed/issues/2673 + tar._extract_member(member, path) # type: ignore except Exception as exc: # Some corrupt tar files seem to produce this # (specifically bad symlinks) @@ -561,7 +600,8 @@ def untar_file(filename, location): shutil.copyfileobj(fp, destfp) fp.close() # Update the timestamp (useful for cython compiled files) - tar.utime(member, path) + # https://github.com/python/typeshed/issues/2673 + tar.utime(member, path) # type: ignore # member have any execute permissions for user/group/world? if member.mode & 0o111: # make dest file have execute for user/group/world @@ -571,7 +611,13 @@ def untar_file(filename, location): tar.close() -def unpack_file(filename, location, content_type, link): +def unpack_file( + filename, # type: str + location, # type: str + content_type, # type: Optional[str] + link # type: Optional[Link] +): + # type: (...) -> None filename = os.path.realpath(filename) if (content_type == 'application/zip' or filename.lower().endswith(ZIP_EXTENSIONS) or @@ -604,50 +650,75 @@ def unpack_file(filename, location, content_type, link): ) -def call_subprocess(cmd, show_stdout=True, cwd=None, - on_returncode='raise', - command_desc=None, - extra_environ=None, unset_environ=None, spinner=None): +def format_command_args(args): + # type: (List[str]) -> str + """ + Format command arguments for display. + """ + return ' '.join(shlex_quote(arg) for arg in args) + + +def call_subprocess( + cmd, # type: List[str] + show_stdout=False, # type: bool + cwd=None, # type: Optional[str] + on_returncode='raise', # type: str + extra_ok_returncodes=None, # type: Optional[Iterable[int]] + command_desc=None, # type: Optional[str] + extra_environ=None, # type: Optional[Mapping[str, Any]] + unset_environ=None, # type: Optional[Iterable[str]] + spinner=None # type: Optional[SpinnerInterface] +): + # type: (...) -> Optional[Text] """ Args: + show_stdout: if true, use INFO to log the subprocess's stderr and + stdout streams. Otherwise, use DEBUG. Defaults to False. + extra_ok_returncodes: an iterable of integer return codes that are + acceptable, in addition to 0. Defaults to None, which means []. unset_environ: an iterable of environment variable names to unset prior to calling subprocess.Popen(). """ + if extra_ok_returncodes is None: + extra_ok_returncodes = [] if unset_environ is None: unset_environ = [] - # This function's handling of subprocess output is confusing and I - # previously broke it terribly, so as penance I will write a long comment - # explaining things. + # Most places in pip use show_stdout=False. What this means is-- # - # The obvious thing that affects output is the show_stdout= - # kwarg. show_stdout=True means, let the subprocess write directly to our - # stdout. Even though it is nominally the default, it is almost never used - # inside pip (and should not be used in new code without a very good - # reason); as of 2016-02-22 it is only used in a few places inside the VCS - # wrapper code. Ideally we should get rid of it entirely, because it - # creates a lot of complexity here for a rarely used feature. + # - We connect the child's output (combined stderr and stdout) to a + # single pipe, which we read. + # - We log this output to stderr at DEBUG level as it is received. + # - If DEBUG logging isn't enabled (e.g. if --verbose logging wasn't + # requested), then we show a spinner so the user can still see the + # subprocess is in progress. + # - If the subprocess exits with an error, we log the output to stderr + # at ERROR level if it hasn't already been displayed to the console + # (e.g. if --verbose logging wasn't enabled). This way we don't log + # the output to the console twice. # - # Most places in pip set show_stdout=False. What this means is: - # - We connect the child stdout to a pipe, which we read. - # - By default, we hide the output but show a spinner -- unless the - # subprocess exits with an error, in which case we show the output. - # - If the --verbose option was passed (= loglevel is DEBUG), then we show - # the output unconditionally. (But in this case we don't want to show - # the output a second time if it turns out that there was an error.) - # - # stderr is always merged with stdout (even if show_stdout=True). + # If show_stdout=True, then the above is still done, but with DEBUG + # replaced by INFO. if show_stdout: - stdout = None + # Then log the subprocess output at INFO level. + log_subprocess = subprocess_logger.info + used_level = std_logging.INFO else: - stdout = subprocess.PIPE + # Then log the subprocess output using DEBUG. This also ensures + # it will be logged to the log file (aka user_log), if enabled. + log_subprocess = subprocess_logger.debug + used_level = std_logging.DEBUG + + # Whether the subprocess will be visible in the console. + showing_subprocess = subprocess_logger.getEffectiveLevel() <= used_level + + # Only use the spinner if we're not showing the subprocess output + # and we have a spinner. + use_spinner = not showing_subprocess and spinner is not None + if command_desc is None: - cmd_parts = [] - for part in cmd: - if ' ' in part or '\n' in part or '"' in part or "'" in part: - part = '"%s"' % part.replace('"', '\\"') - cmd_parts.append(part) - command_desc = ' '.join(cmd_parts) - logger.debug("Running command %s", command_desc) + command_desc = format_command_args(cmd) + + log_subprocess("Running command %s", command_desc) env = os.environ.copy() if extra_environ: env.update(extra_environ) @@ -656,55 +727,55 @@ def call_subprocess(cmd, show_stdout=True, cwd=None, try: proc = subprocess.Popen( cmd, stderr=subprocess.STDOUT, stdin=subprocess.PIPE, - stdout=stdout, cwd=cwd, env=env, + stdout=subprocess.PIPE, cwd=cwd, env=env, ) proc.stdin.close() except Exception as exc: - logger.critical( + subprocess_logger.critical( "Error %s while executing command %s", exc, command_desc, ) raise all_output = [] - if stdout is not None: - while True: - line = console_to_str(proc.stdout.readline()) - if not line: - break - line = line.rstrip() - all_output.append(line + '\n') - if logger.getEffectiveLevel() <= std_logging.DEBUG: - # Show the line immediately - logger.debug(line) - else: - # Update the spinner - if spinner is not None: - spinner.spin() + while True: + line = console_to_str(proc.stdout.readline()) + if not line: + break + line = line.rstrip() + all_output.append(line + '\n') + + # Show the line immediately. + log_subprocess(line) + # Update the spinner. + if use_spinner: + spinner.spin() try: proc.wait() finally: if proc.stdout: proc.stdout.close() - if spinner is not None: - if proc.returncode: + proc_had_error = ( + proc.returncode and proc.returncode not in extra_ok_returncodes + ) + if use_spinner: + if proc_had_error: spinner.finish("error") else: spinner.finish("done") - if proc.returncode: + if proc_had_error: if on_returncode == 'raise': - if (logger.getEffectiveLevel() > std_logging.DEBUG and - not show_stdout): - logger.info( + if not showing_subprocess: + # Then the subprocess streams haven't been logged to the + # console yet. + subprocess_logger.error( 'Complete output from command %s:', command_desc, ) - logger.info( - ''.join(all_output) + - '\n----------------------------------------' - ) + # The all_output value already ends in a newline. + subprocess_logger.error(''.join(all_output) + LOG_DIVIDER) raise InstallationError( 'Command "%s" failed with error code %s in %s' % (command_desc, proc.returncode, cwd)) elif on_returncode == 'warn': - logger.warning( + subprocess_logger.warning( 'Command "%s" had error code %s in %s', command_desc, proc.returncode, cwd, ) @@ -713,32 +784,7 @@ def call_subprocess(cmd, show_stdout=True, cwd=None, else: raise ValueError('Invalid value: on_returncode=%s' % repr(on_returncode)) - if not show_stdout: - return ''.join(all_output) - - -def read_text_file(filename): - """Return the contents of *filename*. - - Try to decode the file contents with utf-8, the preferred system encoding - (e.g., cp1252 on some Windows machines), and latin1, in that order. - Decoding a byte string with latin1 will never raise an error. In the worst - case, the returned string will contain some garbage characters. - - """ - with open(filename, 'rb') as fp: - data = fp.read() - - encodings = ['utf-8', locale.getpreferredencoding(False), 'latin1'] - for enc in encodings: - try: - data = data.decode(enc) - except UnicodeDecodeError: - continue - break - - assert type(data) != bytes # Latin1 should have worked. - return data + return ''.join(all_output) def _make_build_dir(build_dir): @@ -805,6 +851,13 @@ def captured_stdout(): return captured_output('stdout') +def captured_stderr(): + """ + See captured_stdout(). + """ + return captured_output('stderr') + + class cached_property(object): """A property that is only computed once per instance and then replaces itself with an ordinary attribute. Deleting the attribute resets the @@ -856,20 +909,6 @@ def enum(*sequential, **named): return type('Enum', (), enums) -def make_vcs_requirement_url(repo_url, rev, egg_project_name, subdir=None): - """ - Return the URL for a VCS requirement. - - Args: - repo_url: the remote VCS url, with any needed VCS prefix (e.g. "git+"). - """ - req = '{}@{}#egg={}'.format(repo_url, rev, egg_project_name) - if subdir: - req += '&subdirectory={}'.format(subdir) - - return req - - def split_auth_from_netloc(netloc): """ Parse out and remove the auth information from a netloc. @@ -887,22 +926,36 @@ def split_auth_from_netloc(netloc): # Split from the left because that's how urllib.parse.urlsplit() # behaves if more than one : is present (which again can be checked # using the password attribute of the return value) - user_pass = tuple(auth.split(':', 1)) + user_pass = auth.split(':', 1) else: user_pass = auth, None + user_pass = tuple( + None if x is None else urllib_unquote(x) for x in user_pass + ) + return netloc, user_pass -def remove_auth_from_url(url): - # Return a copy of url with 'username:password@' removed. - # username/pass params are passed to subversion through flags - # and are not recognized in the url. +def redact_netloc(netloc): + # type: (str) -> str + """ + Replace the password in a netloc with "****", if it exists. - # parsed url + For example, "user:pass@example.com" returns "user:****@example.com". + """ + netloc, (user, password) = split_auth_from_netloc(netloc) + if user is None: + return netloc + password = '' if password is None else ':****' + return '{user}{password}@{netloc}'.format(user=urllib_parse.quote(user), + password=password, + netloc=netloc) + + +def _transform_url(url, transform_netloc): purl = urllib_parse.urlsplit(url) - netloc, user_pass = split_auth_from_netloc(purl.netloc) - + netloc = transform_netloc(purl.netloc) # stripped url url_pieces = ( purl.scheme, netloc, purl.path, purl.query, purl.fragment @@ -911,6 +964,24 @@ def remove_auth_from_url(url): return surl +def _get_netloc(netloc): + return split_auth_from_netloc(netloc)[0] + + +def remove_auth_from_url(url): + # type: (str) -> str + # Return a copy of url with 'username:password@' removed. + # username/pass params are passed to subversion through flags + # and are not recognized in the url. + return _transform_url(url, _get_netloc) + + +def redact_password_from_url(url): + # type: (str) -> str + """Replace the password in a given url with ****.""" + return _transform_url(url, redact_netloc) + + def protect_pip_from_modification_on_windows(modifying_pip): """Protection of pip.exe from modification on Windows diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/outdated.py b/env/lib/python3.7/site-packages/pip/_internal/utils/outdated.py index 5bfbfe1..3b58cd5 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/utils/outdated.py +++ b/env/lib/python3.7/site-packages/pip/_internal/utils/outdated.py @@ -13,6 +13,13 @@ from pip._internal.index import PackageFinder from pip._internal.utils.compat import WINDOWS from pip._internal.utils.filesystem import check_path_owner from pip._internal.utils.misc import ensure_dir, get_installed_version +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + import optparse + from typing import Any, Dict + from pip._internal.download import PipSession + SELFCHECK_DATE_FMT = "%Y-%m-%dT%H:%M:%SZ" @@ -22,7 +29,8 @@ logger = logging.getLogger(__name__) class SelfCheckState(object): def __init__(self, cache_dir): - self.state = {} + # type: (str) -> None + self.state = {} # type: Dict[str, Any] self.statefile_path = None # Try to load the existing state @@ -37,6 +45,7 @@ class SelfCheckState(object): pass def save(self, pypi_version, current_time): + # type: (str, datetime.datetime) -> None # If we do not have a path to cache in, don't bother saving. if not self.statefile_path: return @@ -68,6 +77,7 @@ class SelfCheckState(object): def was_installed_by_pip(pkg): + # type: (str) -> bool """Checks whether pkg was installed by pip This is used not to display the upgrade message when pip is in fact @@ -82,6 +92,7 @@ def was_installed_by_pip(pkg): def pip_version_check(session, options): + # type: (PipSession, optparse.Values) -> None """Check for an update for pip. Limit the frequency of checks to once per week. State is stored either in @@ -116,15 +127,12 @@ def pip_version_check(session, options): index_urls=[options.index_url] + options.extra_index_urls, allow_all_prereleases=False, # Explicitly set to False trusted_hosts=options.trusted_hosts, - process_dependency_links=options.process_dependency_links, session=session, ) - all_candidates = finder.find_all_candidates("pip") - if not all_candidates: + candidate = finder.find_candidates("pip").get_best() + if candidate is None: return - pypi_version = str( - max(all_candidates, key=lambda c: c.version).version - ) + pypi_version = str(candidate.version) # save that we've performed a check state.save(pypi_version, current_time) diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/packaging.py b/env/lib/python3.7/site-packages/pip/_internal/utils/packaging.py index c43142f..449f3fd 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/utils/packaging.py +++ b/env/lib/python3.7/site-packages/pip/_internal/utils/packaging.py @@ -2,18 +2,26 @@ from __future__ import absolute_import import logging import sys -from email.parser import FeedParser # type: ignore +from email.parser import FeedParser from pip._vendor import pkg_resources from pip._vendor.packaging import specifiers, version from pip._internal import exceptions from pip._internal.utils.misc import display_path +from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +if MYPY_CHECK_RUNNING: + from typing import Optional + from email.message import Message + from pip._vendor.pkg_resources import Distribution + logger = logging.getLogger(__name__) def check_requires_python(requires_python): + # type: (Optional[str]) -> bool """ Check if the python version in use match the `requires_python` specifier. @@ -34,6 +42,7 @@ def check_requires_python(requires_python): def get_metadata(dist): + # type: (Distribution) -> Message if (isinstance(dist, pkg_resources.DistInfoDistribution) and dist.has_metadata('METADATA')): metadata = dist.get_metadata('METADATA') @@ -68,6 +77,7 @@ def check_dist_requires_python(dist): def get_installer(dist): + # type: (Distribution) -> str if dist.has_metadata('INSTALLER'): for line in dist.get_metadata_lines('INSTALLER'): if line.strip(): diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/temp_dir.py b/env/lib/python3.7/site-packages/pip/_internal/utils/temp_dir.py index edc506b..2c81ad5 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/utils/temp_dir.py +++ b/env/lib/python3.7/site-packages/pip/_internal/utils/temp_dir.py @@ -1,5 +1,7 @@ from __future__ import absolute_import +import errno +import itertools import logging import os.path import tempfile @@ -58,7 +60,7 @@ class TempDirectory(object): self.cleanup() def create(self): - """Create a temporary directory and store it's path in self.path + """Create a temporary directory and store its path in self.path """ if self.path is not None: logger.debug( @@ -80,3 +82,74 @@ class TempDirectory(object): if self.path is not None and os.path.exists(self.path): rmtree(self.path) self.path = None + + +class AdjacentTempDirectory(TempDirectory): + """Helper class that creates a temporary directory adjacent to a real one. + + Attributes: + original + The original directory to create a temp directory for. + path + After calling create() or entering, contains the full + path to the temporary directory. + delete + Whether the directory should be deleted when exiting + (when used as a contextmanager) + + """ + # The characters that may be used to name the temp directory + # We always prepend a ~ and then rotate through these until + # a usable name is found. + # pkg_resources raises a different error for .dist-info folder + # with leading '-' and invalid metadata + LEADING_CHARS = "-~.=%0123456789" + + def __init__(self, original, delete=None): + super(AdjacentTempDirectory, self).__init__(delete=delete) + self.original = original.rstrip('/\\') + + @classmethod + def _generate_names(cls, name): + """Generates a series of temporary names. + + The algorithm replaces the leading characters in the name + with ones that are valid filesystem characters, but are not + valid package names (for both Python and pip definitions of + package). + """ + for i in range(1, len(name)): + for candidate in itertools.combinations_with_replacement( + cls.LEADING_CHARS, i - 1): + new_name = '~' + ''.join(candidate) + name[i:] + if new_name != name: + yield new_name + + # If we make it this far, we will have to make a longer name + for i in range(len(cls.LEADING_CHARS)): + for candidate in itertools.combinations_with_replacement( + cls.LEADING_CHARS, i): + new_name = '~' + ''.join(candidate) + name + if new_name != name: + yield new_name + + def create(self): + root, name = os.path.split(self.original) + for candidate in self._generate_names(name): + path = os.path.join(root, candidate) + try: + os.mkdir(path) + except OSError as ex: + # Continue if the name exists already + if ex.errno != errno.EEXIST: + raise + else: + self.path = os.path.realpath(path) + break + + if not self.path: + # Final fallback on the default behavior. + self.path = os.path.realpath( + tempfile.mkdtemp(prefix="pip-{}-".format(self.kind)) + ) + logger.debug("Created temporary directory: {}".format(self.path)) diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/typing.py b/env/lib/python3.7/site-packages/pip/_internal/utils/typing.py index e085cdf..10170ce 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/utils/typing.py +++ b/env/lib/python3.7/site-packages/pip/_internal/utils/typing.py @@ -21,7 +21,7 @@ In pip, all static-typing related imports should be guarded as follows: from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: - from typing import ... # noqa: F401 + from typing import ... Ref: https://github.com/python/mypy/issues/3216 """ diff --git a/env/lib/python3.7/site-packages/pip/_internal/utils/ui.py b/env/lib/python3.7/site-packages/pip/_internal/utils/ui.py index 6bab904..0902ce7 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/utils/ui.py +++ b/env/lib/python3.7/site-packages/pip/_internal/utils/ui.py @@ -8,11 +8,8 @@ import time from signal import SIGINT, default_int_handler, signal from pip._vendor import six -from pip._vendor.progress.bar import ( - Bar, ChargingBar, FillingCirclesBar, FillingSquaresBar, IncrementalBar, - ShadyBar, -) -from pip._vendor.progress.helpers import HIDE_CURSOR, SHOW_CURSOR, WritelnMixin +from pip._vendor.progress import HIDE_CURSOR, SHOW_CURSOR +from pip._vendor.progress.bar import Bar, FillingCirclesBar, IncrementalBar from pip._vendor.progress.spinner import Spinner from pip._internal.utils.compat import WINDOWS @@ -21,7 +18,7 @@ from pip._internal.utils.misc import format_size from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: - from typing import Any # noqa: F401 + from typing import Any, Iterator, IO try: from pip._vendor import colorama @@ -168,7 +165,7 @@ class WindowsMixin(object): # The Windows terminal does not support the hide/show cursor ANSI codes # even with colorama. So we'll ensure that hide_cursor is False on # Windows. - # This call neds to go before the super() call, so that hide_cursor + # This call needs to go before the super() call, so that hide_cursor # is set in time. The base progress bar class writes the "hide cursor" # code to the terminal in its init, so if we don't set this soon # enough, we get a "hide" with no corresponding "show"... @@ -203,7 +200,7 @@ class BaseDownloadProgressBar(WindowsMixin, InterruptibleMixin, class DefaultDownloadProgressBar(BaseDownloadProgressBar, - _BaseBar): # type: ignore + _BaseBar): pass @@ -216,20 +213,6 @@ class DownloadIncrementalBar(BaseDownloadProgressBar, # type: ignore pass -class DownloadChargingBar(BaseDownloadProgressBar, # type: ignore - ChargingBar): - pass - - -class DownloadShadyBar(BaseDownloadProgressBar, ShadyBar): # type: ignore - pass - - -class DownloadFillingSquaresBar(BaseDownloadProgressBar, # type: ignore - FillingSquaresBar): - pass - - class DownloadFillingCirclesBar(BaseDownloadProgressBar, # type: ignore FillingCirclesBar): pass @@ -241,7 +224,7 @@ class DownloadBlueEmojiProgressBar(BaseDownloadProgressBar, # type: ignore class DownloadProgressSpinner(WindowsMixin, InterruptibleMixin, - DownloadProgressMixin, WritelnMixin, Spinner): + DownloadProgressMixin, Spinner): file = sys.stdout suffix = "%(downloaded)s %(download_speed)s" @@ -292,6 +275,7 @@ def DownloadProgressProvider(progress_bar, max=None): @contextlib.contextmanager def hidden_cursor(file): + # type: (IO) -> Iterator[None] # The Windows terminal does not support the hide/show cursor ANSI codes, # even via colorama. So don't even try. if WINDOWS: @@ -311,19 +295,32 @@ def hidden_cursor(file): class RateLimiter(object): def __init__(self, min_update_interval_seconds): + # type: (float) -> None self._min_update_interval_seconds = min_update_interval_seconds - self._last_update = 0 + self._last_update = 0 # type: float def ready(self): + # type: () -> bool now = time.time() delta = now - self._last_update return delta >= self._min_update_interval_seconds def reset(self): + # type: () -> None self._last_update = time.time() -class InteractiveSpinner(object): +class SpinnerInterface(object): + def spin(self): + # type: () -> None + raise NotImplementedError() + + def finish(self, final_status): + # type: (str) -> None + raise NotImplementedError() + + +class InteractiveSpinner(SpinnerInterface): def __init__(self, message, file=None, spin_chars="-\\|/", # Empirically, 8 updates/second looks nice min_update_interval_seconds=0.125): @@ -352,6 +349,7 @@ class InteractiveSpinner(object): self._rate_limiter.reset() def spin(self): + # type: () -> None if self._finished: return if not self._rate_limiter.ready(): @@ -359,6 +357,7 @@ class InteractiveSpinner(object): self._write(next(self._spin_cycle)) def finish(self, final_status): + # type: (str) -> None if self._finished: return self._write(final_status) @@ -371,8 +370,9 @@ class InteractiveSpinner(object): # We still print updates occasionally (once every 60 seconds by default) to # act as a keep-alive for systems like Travis-CI that take lack-of-output as # an indication that a task has frozen. -class NonInteractiveSpinner(object): +class NonInteractiveSpinner(SpinnerInterface): def __init__(self, message, min_update_interval_seconds=60): + # type: (str, float) -> None self._message = message self._finished = False self._rate_limiter = RateLimiter(min_update_interval_seconds) @@ -384,6 +384,7 @@ class NonInteractiveSpinner(object): logger.info("%s: %s", self._message, status) def spin(self): + # type: () -> None if self._finished: return if not self._rate_limiter.ready(): @@ -391,6 +392,7 @@ class NonInteractiveSpinner(object): self._update("still running...") def finish(self, final_status): + # type: (str) -> None if self._finished: return self._update("finished with status '%s'" % (final_status,)) @@ -399,13 +401,14 @@ class NonInteractiveSpinner(object): @contextlib.contextmanager def open_spinner(message): + # type: (str) -> Iterator[SpinnerInterface] # Interactive spinner goes directly to sys.stdout rather than being routed # through the logging system, but it acts like it has level INFO, # i.e. it's only displayed if we're at level INFO or better. # Non-interactive spinner goes through the logging system, so it is always # in sync with logging configuration. if sys.stdout.isatty() and logger.getEffectiveLevel() <= logging.INFO: - spinner = InteractiveSpinner(message) + spinner = InteractiveSpinner(message) # type: SpinnerInterface else: spinner = NonInteractiveSpinner(message) try: diff --git a/env/lib/python3.7/site-packages/pip/_internal/vcs/__init__.py b/env/lib/python3.7/site-packages/pip/_internal/vcs/__init__.py index 794b35d..6fca079 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/vcs/__init__.py +++ b/env/lib/python3.7/site-packages/pip/_internal/vcs/__init__.py @@ -7,24 +7,49 @@ import os import shutil import sys +from pip._vendor import pkg_resources from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._internal.exceptions import BadCommand from pip._internal.utils.misc import ( - display_path, backup_dir, call_subprocess, rmtree, ask_path_exists, + ask_path_exists, backup_dir, call_subprocess, display_path, rmtree, ) from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: - from typing import Dict, Optional, Tuple # noqa: F401 - from pip._internal.cli.base_command import Command # noqa: F401 + from typing import ( + Any, Dict, Iterable, List, Mapping, Optional, Text, Tuple, Type + ) + from pip._internal.utils.ui import SpinnerInterface -__all__ = ['vcs', 'get_src_requirement'] + AuthInfo = Tuple[Optional[str], Optional[str]] + +__all__ = ['vcs'] logger = logging.getLogger(__name__) +def make_vcs_requirement_url(repo_url, rev, project_name, subdir=None): + """ + Return the URL for a VCS requirement. + + Args: + repo_url: the remote VCS url, with any needed VCS prefix (e.g. "git+"). + project_name: the (unescaped) project name. + """ + egg_project_name = pkg_resources.to_filename(project_name) + req = '{}@{}#egg={}'.format(repo_url, rev, egg_project_name) + if subdir: + req += '&subdirectory={}'.format(subdir) + + return req + + +class RemoteNotFoundError(Exception): + pass + + class RevOptions(object): """ @@ -34,10 +59,16 @@ class RevOptions(object): Instances of this class should be treated as if immutable. """ - def __init__(self, vcs, rev=None, extra_args=None): + def __init__( + self, + vc_class, # type: Type[VersionControl] + rev=None, # type: Optional[str] + extra_args=None, # type: Optional[List[str]] + ): + # type: (...) -> None """ Args: - vcs: a VersionControl object. + vc_class: a VersionControl subclass. rev: the name of the revision to install. extra_args: a list of extra options. """ @@ -46,51 +77,56 @@ class RevOptions(object): self.extra_args = extra_args self.rev = rev - self.vcs = vcs + self.vc_class = vc_class def __repr__(self): - return ''.format(self.vcs.name, self.rev) + return ''.format(self.vc_class.name, self.rev) @property def arg_rev(self): + # type: () -> Optional[str] if self.rev is None: - return self.vcs.default_arg_rev + return self.vc_class.default_arg_rev return self.rev def to_args(self): + # type: () -> List[str] """ Return the VCS-specific command arguments. """ - args = [] + args = [] # type: List[str] rev = self.arg_rev if rev is not None: - args += self.vcs.get_base_rev_args(rev) + args += self.vc_class.get_base_rev_args(rev) args += self.extra_args return args def to_display(self): + # type: () -> str if not self.rev: return '' return ' (to revision {})'.format(self.rev) def make_new(self, rev): + # type: (str) -> RevOptions """ Make a copy of the current instance, but with a new rev. Args: rev: the name of the revision for the new object. """ - return self.vcs.make_rev_options(rev, extra_args=self.extra_args) + return self.vc_class.make_rev_options(rev, extra_args=self.extra_args) class VcsSupport(object): - _registry = {} # type: Dict[str, Command] + _registry = {} # type: Dict[str, Type[VersionControl]] schemes = ['ssh', 'git', 'hg', 'bzr', 'sftp', 'svn'] def __init__(self): + # type: () -> None # Register more schemes with urlparse for various version control # systems urllib_parse.uses_netloc.extend(self.schemes) @@ -104,20 +140,24 @@ class VcsSupport(object): @property def backends(self): + # type: () -> List[Type[VersionControl]] return list(self._registry.values()) @property def dirnames(self): + # type: () -> List[str] return [backend.dirname for backend in self.backends] @property def all_schemes(self): - schemes = [] + # type: () -> List[str] + schemes = [] # type: List[str] for backend in self.backends: schemes.extend(backend.schemes) return schemes def register(self, cls): + # type: (Type[VersionControl]) -> None if not hasattr(cls, 'name'): logger.warning('Cannot register VCS %s', cls.__name__) return @@ -126,6 +166,7 @@ class VcsSupport(object): logger.debug('Registered VCS backend: %s', cls.name) def unregister(self, cls=None, name=None): + # type: (Optional[Type[VersionControl]], Optional[str]) -> None if name in self._registry: del self._registry[name] elif cls in self._registry.values(): @@ -133,27 +174,24 @@ class VcsSupport(object): else: logger.warning('Cannot unregister because no class or name given') - def get_backend_name(self, location): + def get_backend_type(self, location): + # type: (str) -> Optional[Type[VersionControl]] """ - Return the name of the version control backend if found at given - location, e.g. vcs.get_backend_name('/path/to/vcs/checkout') + Return the type of the version control backend if found at given + location, e.g. vcs.get_backend_type('/path/to/vcs/checkout') """ for vc_type in self._registry.values(): if vc_type.controls_location(location): logger.debug('Determine that %s uses VCS: %s', location, vc_type.name) - return vc_type.name + return vc_type return None def get_backend(self, name): + # type: (str) -> Optional[Type[VersionControl]] name = name.lower() if name in self._registry: return self._registry[name] - - def get_backend_from_location(self, location): - vc_type = self.get_backend_name(location) - if vc_type: - return self.get_backend(vc_type) return None @@ -163,17 +201,68 @@ vcs = VcsSupport() class VersionControl(object): name = '' dirname = '' + repo_name = '' # List of supported schemes for this Version Control schemes = () # type: Tuple[str, ...] # Iterable of environment variable names to pass to call_subprocess(). unset_environ = () # type: Tuple[str, ...] default_arg_rev = None # type: Optional[str] + @classmethod + def should_add_vcs_url_prefix(cls, remote_url): + """ + Return whether the vcs prefix (e.g. "git+") should be added to a + repository's remote url when used in a requirement. + """ + return not remote_url.lower().startswith('{}:'.format(cls.name)) + + @classmethod + def get_subdirectory(cls, repo_dir): + """ + Return the path to setup.py, relative to the repo root. + """ + return None + + @classmethod + def get_requirement_revision(cls, repo_dir): + """ + Return the revision string that should be used in a requirement. + """ + return cls.get_revision(repo_dir) + + @classmethod + def get_src_requirement(cls, repo_dir, project_name): + """ + Return the requirement string to use to redownload the files + currently at the given repository directory. + + Args: + project_name: the (unescaped) project name. + + The return value has a form similar to the following: + + {repository_url}@{revision}#egg={project_name} + """ + repo_url = cls.get_remote_url(repo_dir) + if repo_url is None: + return None + + if cls.should_add_vcs_url_prefix(repo_url): + repo_url = '{}+{}'.format(cls.name, repo_url) + + revision = cls.get_requirement_revision(repo_dir) + subdir = cls.get_subdirectory(repo_dir) + req = make_vcs_requirement_url(repo_url, revision, project_name, + subdir=subdir) + + return req + def __init__(self, url=None, *args, **kwargs): self.url = url super(VersionControl, self).__init__(*args, **kwargs) - def get_base_rev_args(self, rev): + @staticmethod + def get_base_rev_args(rev): """ Return the base revision arguments for a vcs command. @@ -182,7 +271,9 @@ class VersionControl(object): """ raise NotImplementedError - def make_rev_options(self, rev=None, extra_args=None): + @classmethod + def make_rev_options(cls, rev=None, extra_args=None): + # type: (Optional[str], Optional[List[str]]) -> RevOptions """ Return a RevOptions object. @@ -190,15 +281,17 @@ class VersionControl(object): rev: the name of a revision to install. extra_args: a list of extra options. """ - return RevOptions(self, rev, extra_args=extra_args) + return RevOptions(cls, rev, extra_args=extra_args) - def _is_local_repository(self, repo): + @classmethod + def _is_local_repository(cls, repo): + # type: (str) -> bool """ posix absolute paths start with os.path.sep, win32 ones start with drive (like c:\\folder) """ drive, tail = os.path.splitdrive(repo) - return repo.startswith(os.path.sep) or drive + return repo.startswith(os.path.sep) or bool(drive) def export(self, location): """ @@ -207,7 +300,8 @@ class VersionControl(object): """ raise NotImplementedError - def get_netloc_and_auth(self, netloc, scheme): + @classmethod + def get_netloc_and_auth(cls, netloc, scheme): """ Parse the repository URL's netloc, and return the new netloc to use along with auth information. @@ -225,7 +319,9 @@ class VersionControl(object): """ return netloc, (None, None) - def get_url_rev_and_auth(self, url): + @classmethod + def get_url_rev_and_auth(cls, url): + # type: (str) -> Tuple[str, Optional[str], AuthInfo] """ Parse the repository URL to use, and return the URL, revision, and auth info to use. @@ -241,20 +337,22 @@ class VersionControl(object): ) # Remove the vcs prefix. scheme = scheme.split('+', 1)[1] - netloc, user_pass = self.get_netloc_and_auth(netloc, scheme) + netloc, user_pass = cls.get_netloc_and_auth(netloc, scheme) rev = None if '@' in path: path, rev = path.rsplit('@', 1) url = urllib_parse.urlunsplit((scheme, netloc, path, query, '')) return url, rev, user_pass - def make_rev_args(self, username, password): + @staticmethod + def make_rev_args(username, password): """ Return the RevOptions "extra arguments" to use in obtain(). """ return [] def get_url_rev_options(self, url): + # type: (str) -> Tuple[str, RevOptions] """ Return the URL and RevOptions object to use in obtain() and in some cases export(), as a tuple (url, rev_options). @@ -266,20 +364,25 @@ class VersionControl(object): return url, rev_options - def normalize_url(self, url): + @staticmethod + def normalize_url(url): + # type: (str) -> str """ Normalize a URL for comparison by unquoting it and removing any trailing slash. """ return urllib_parse.unquote(url).rstrip('/') - def compare_urls(self, url1, url2): + @classmethod + def compare_urls(cls, url1, url2): + # type: (str, str) -> bool """ Compare two repo URLs for identity, ignoring incidental differences. """ - return (self.normalize_url(url1) == self.normalize_url(url2)) + return (cls.normalize_url(url1) == cls.normalize_url(url2)) - def fetch_new(self, dest, url, rev_options): + @classmethod + def fetch_new(cls, dest, url, rev_options): """ Fetch a revision from a repository, in the case that this is the first fetch from the repository. @@ -308,7 +411,8 @@ class VersionControl(object): """ raise NotImplementedError - def is_commit_id_equal(self, dest, name): + @classmethod + def is_commit_id_equal(cls, dest, name): """ Return whether the id of the current commit equals the given name. @@ -319,6 +423,7 @@ class VersionControl(object): raise NotImplementedError def obtain(self, dest): + # type: (str) -> None """ Install or update in editable mode the package represented by this VersionControl object. @@ -334,7 +439,7 @@ class VersionControl(object): rev_display = rev_options.to_display() if self.is_repository_directory(dest): - existing_url = self.get_url(dest) + existing_url = self.get_remote_url(dest) if self.compare_urls(existing_url, url): logger.debug( '%s in %s exists, and has correct URL (%s)', @@ -370,7 +475,9 @@ class VersionControl(object): self.name, self.repo_name, ) - prompt = ('(i)gnore, (w)ipe, (b)ackup ', ('i', 'w', 'b')) + # https://github.com/python/mypy/issues/1174 + prompt = ('(i)gnore, (w)ipe, (b)ackup ', # type: ignore + ('i', 'w', 'b')) logger.warning( 'The plan is to install the %s repository %s', @@ -409,6 +516,7 @@ class VersionControl(object): self.switch(dest, url, rev_options) def unpack(self, location): + # type: (str) -> None """ Clean up current location and download the url repository (and vcs infos) into location @@ -417,42 +525,49 @@ class VersionControl(object): rmtree(location) self.obtain(location) - def get_src_requirement(self, dist, location): - """ - Return a string representing the requirement needed to - redownload the files currently present in location, something - like: - {repository_url}@{revision}#egg={project_name}-{version_identifier} - """ - raise NotImplementedError - - def get_url(self, location): + @classmethod + def get_remote_url(cls, location): """ Return the url used at location + + Raises RemoteNotFoundError if the repository does not have a remote + url configured. """ raise NotImplementedError - def get_revision(self, location): + @classmethod + def get_revision(cls, location): """ Return the current commit id of the files at the given location. """ raise NotImplementedError - def run_command(self, cmd, show_stdout=True, cwd=None, - on_returncode='raise', - command_desc=None, - extra_environ=None, spinner=None): + @classmethod + def run_command( + cls, + cmd, # type: List[str] + show_stdout=True, # type: bool + cwd=None, # type: Optional[str] + on_returncode='raise', # type: str + extra_ok_returncodes=None, # type: Optional[Iterable[int]] + command_desc=None, # type: Optional[str] + extra_environ=None, # type: Optional[Mapping[str, Any]] + spinner=None # type: Optional[SpinnerInterface] + ): + # type: (...) -> Optional[Text] """ Run a VCS subcommand This is simply a wrapper around call_subprocess that adds the VCS command name, and checks that the VCS is available """ - cmd = [self.name] + cmd + cmd = [cls.name] + cmd try: return call_subprocess(cmd, show_stdout, cwd, - on_returncode, - command_desc, extra_environ, - unset_environ=self.unset_environ, + on_returncode=on_returncode, + extra_ok_returncodes=extra_ok_returncodes, + command_desc=command_desc, + extra_environ=extra_environ, + unset_environ=cls.unset_environ, spinner=spinner) except OSError as e: # errno.ENOENT = no such file or directory @@ -461,12 +576,13 @@ class VersionControl(object): raise BadCommand( 'Cannot find command %r - do you have ' '%r installed and in your ' - 'PATH?' % (self.name, self.name)) + 'PATH?' % (cls.name, cls.name)) else: raise # re-raise exception if a different error occurred @classmethod def is_repository_directory(cls, path): + # type: (str) -> bool """ Return whether a directory path is a repository directory. """ @@ -476,6 +592,7 @@ class VersionControl(object): @classmethod def controls_location(cls, location): + # type: (str) -> bool """ Check if a location is controlled by the vcs. It is meant to be overridden to implement smarter detection @@ -485,25 +602,3 @@ class VersionControl(object): the Git override checks that Git is actually available. """ return cls.is_repository_directory(location) - - -def get_src_requirement(dist, location): - version_control = vcs.get_backend_from_location(location) - if version_control: - try: - return version_control().get_src_requirement(dist, - location) - except BadCommand: - logger.warning( - 'cannot determine version of editable source in %s ' - '(%s command not found in path)', - location, - version_control.name, - ) - return dist.as_requirement() - logger.warning( - 'cannot determine version of editable source in %s (is not SVN ' - 'checkout, Git clone, Mercurial clone or Bazaar branch)', - location, - ) - return dist.as_requirement() diff --git a/env/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/__init__.cpython-37.pyc index 411f9ab..69b5b4f 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/bazaar.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/bazaar.cpython-37.pyc index c8bd1ff..80c537a 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/bazaar.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/bazaar.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/git.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/git.cpython-37.pyc index fb770c6..913fdc9 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/git.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/git.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/mercurial.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/mercurial.cpython-37.pyc index d7a86f6..f396d44 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/mercurial.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/mercurial.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/subversion.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/subversion.cpython-37.pyc index dc9de52..816b0fd 100644 Binary files a/env/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/subversion.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/subversion.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_internal/vcs/bazaar.py b/env/lib/python3.7/site-packages/pip/_internal/vcs/bazaar.py index 3cc66c9..3587b3d 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/vcs/bazaar.py +++ b/env/lib/python3.7/site-packages/pip/_internal/vcs/bazaar.py @@ -6,10 +6,7 @@ import os from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._internal.download import path_to_url -from pip._internal.utils.misc import ( - display_path, make_vcs_requirement_url, rmtree, -) -from pip._internal.utils.temp_dir import TempDirectory +from pip._internal.utils.misc import display_path, rmtree from pip._internal.vcs import VersionControl, vcs logger = logging.getLogger(__name__) @@ -31,7 +28,8 @@ class Bazaar(VersionControl): if getattr(urllib_parse, 'uses_fragment', None): urllib_parse.uses_fragment.extend(['lp']) - def get_base_rev_args(self, rev): + @staticmethod + def get_base_rev_args(rev): return ['-r', rev] def export(self, location): @@ -42,15 +40,14 @@ class Bazaar(VersionControl): if os.path.exists(location): rmtree(location) - with TempDirectory(kind="export") as temp_dir: - self.unpack(temp_dir.path) + url, rev_options = self.get_url_rev_options(self.url) + self.run_command( + ['export', location, url] + rev_options.to_args(), + show_stdout=False, + ) - self.run_command( - ['export', location], - cwd=temp_dir.path, show_stdout=False, - ) - - def fetch_new(self, dest, url, rev_options): + @classmethod + def fetch_new(cls, dest, url, rev_options): rev_display = rev_options.to_display() logger.info( 'Checking out %s%s to %s', @@ -59,7 +56,7 @@ class Bazaar(VersionControl): display_path(dest), ) cmd_args = ['branch', '-q'] + rev_options.to_args() + [url, dest] - self.run_command(cmd_args) + cls.run_command(cmd_args) def switch(self, dest, url, rev_options): self.run_command(['switch', url], cwd=dest) @@ -68,43 +65,37 @@ class Bazaar(VersionControl): cmd_args = ['pull', '-q'] + rev_options.to_args() self.run_command(cmd_args, cwd=dest) - def get_url_rev_and_auth(self, url): + @classmethod + def get_url_rev_and_auth(cls, url): # hotfix the URL scheme after removing bzr+ from bzr+ssh:// readd it - url, rev, user_pass = super(Bazaar, self).get_url_rev_and_auth(url) + url, rev, user_pass = super(Bazaar, cls).get_url_rev_and_auth(url) if url.startswith('ssh://'): url = 'bzr+' + url return url, rev, user_pass - def get_url(self, location): - urls = self.run_command(['info'], show_stdout=False, cwd=location) + @classmethod + def get_remote_url(cls, location): + urls = cls.run_command(['info'], show_stdout=False, cwd=location) for line in urls.splitlines(): line = line.strip() for x in ('checkout of branch: ', 'parent branch: '): if line.startswith(x): repo = line.split(x)[1] - if self._is_local_repository(repo): + if cls._is_local_repository(repo): return path_to_url(repo) return repo return None - def get_revision(self, location): - revision = self.run_command( + @classmethod + def get_revision(cls, location): + revision = cls.run_command( ['revno'], show_stdout=False, cwd=location, ) return revision.splitlines()[-1] - def get_src_requirement(self, dist, location): - repo = self.get_url(location) - if not repo: - return None - if not repo.lower().startswith('bzr:'): - repo = 'bzr+' + repo - current_rev = self.get_revision(location) - egg_project_name = dist.egg_name().split('-', 1)[0] - return make_vcs_requirement_url(repo, current_rev, egg_project_name) - - def is_commit_id_equal(self, dest, name): + @classmethod + def is_commit_id_equal(cls, dest, name): """Always assume the versions don't match""" return False diff --git a/env/lib/python3.7/site-packages/pip/_internal/vcs/git.py b/env/lib/python3.7/site-packages/pip/_internal/vcs/git.py index 9778539..35ea930 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/vcs/git.py +++ b/env/lib/python3.7/site-packages/pip/_internal/vcs/git.py @@ -10,9 +10,9 @@ from pip._vendor.six.moves.urllib import request as urllib_request from pip._internal.exceptions import BadCommand from pip._internal.utils.compat import samefile -from pip._internal.utils.misc import display_path, make_vcs_requirement_url +from pip._internal.utils.misc import display_path, redact_password_from_url from pip._internal.utils.temp_dir import TempDirectory -from pip._internal.vcs import VersionControl, vcs +from pip._internal.vcs import RemoteNotFoundError, VersionControl, vcs urlsplit = urllib_parse.urlsplit urlunsplit = urllib_parse.urlunsplit @@ -61,7 +61,8 @@ class Git(VersionControl): super(Git, self).__init__(url, *args, **kwargs) - def get_base_rev_args(self, rev): + @staticmethod + def get_base_rev_args(rev): return [rev] def get_git_version(self): @@ -71,25 +72,32 @@ class Git(VersionControl): version = version[len(VERSION_PFX):].split()[0] else: version = '' - # get first 3 positions of the git version becasue + # get first 3 positions of the git version because # on windows it is x.y.z.windows.t, and this parses as # LegacyVersion which always smaller than a Version. version = '.'.join(version.split('.')[:3]) return parse_version(version) - def get_branch(self, location): + @classmethod + def get_current_branch(cls, location): """ Return the current branch, or None if HEAD isn't at a branch (e.g. detached HEAD). """ - args = ['rev-parse', '--abbrev-ref', 'HEAD'] - output = self.run_command(args, show_stdout=False, cwd=location) - branch = output.strip() + # git-symbolic-ref exits with empty stdout if "HEAD" is a detached + # HEAD rather than a symbolic ref. In addition, the -q causes the + # command to exit with status code 1 instead of 128 in this case + # and to suppress the message to stderr. + args = ['symbolic-ref', '-q', 'HEAD'] + output = cls.run_command( + args, extra_ok_returncodes=(1, ), show_stdout=False, cwd=location, + ) + ref = output.strip() - if branch == 'HEAD': - return None + if ref.startswith('refs/heads/'): + return ref[len('refs/heads/'):] - return branch + return None def export(self, location): """Export the Git repository at the url to the destination location""" @@ -103,7 +111,8 @@ class Git(VersionControl): show_stdout=False, cwd=temp_dir.path ) - def get_revision_sha(self, dest, rev): + @classmethod + def get_revision_sha(cls, dest, rev): """ Return (sha_or_none, is_branch), where sha_or_none is a commit hash if the revision names a remote branch or tag, otherwise None. @@ -113,8 +122,8 @@ class Git(VersionControl): rev: the revision name. """ # Pass rev to pre-filter the list. - output = self.run_command(['show-ref', rev], cwd=dest, - show_stdout=False, on_returncode='ignore') + output = cls.run_command(['show-ref', rev], cwd=dest, + show_stdout=False, on_returncode='ignore') refs = {} for line in output.strip().splitlines(): try: @@ -137,7 +146,8 @@ class Git(VersionControl): return (sha, False) - def resolve_revision(self, dest, url, rev_options): + @classmethod + def resolve_revision(cls, dest, url, rev_options): """ Resolve a revision to a new RevOptions object with the SHA1 of the branch, tag, or ref if found. @@ -146,7 +156,7 @@ class Git(VersionControl): rev_options: a RevOptions object. """ rev = rev_options.arg_rev - sha, is_branch = self.get_revision_sha(dest, rev) + sha, is_branch = cls.get_revision_sha(dest, rev) if sha is not None: rev_options = rev_options.make_new(sha) @@ -166,17 +176,18 @@ class Git(VersionControl): return rev_options # If it looks like a ref, we have to fetch it explicitly. - self.run_command( + cls.run_command( ['fetch', '-q', url] + rev_options.to_args(), cwd=dest, ) # Change the revision to the SHA of the ref we fetched - sha = self.get_revision(dest, rev='FETCH_HEAD') + sha = cls.get_revision(dest, rev='FETCH_HEAD') rev_options = rev_options.make_new(sha) return rev_options - def is_commit_id_equal(self, dest, name): + @classmethod + def is_commit_id_equal(cls, dest, name): """ Return whether the current commit hash equals the given name. @@ -188,36 +199,38 @@ class Git(VersionControl): # Then avoid an unnecessary subprocess call. return False - return self.get_revision(dest) == name + return cls.get_revision(dest) == name - def fetch_new(self, dest, url, rev_options): + @classmethod + def fetch_new(cls, dest, url, rev_options): rev_display = rev_options.to_display() logger.info( - 'Cloning %s%s to %s', url, rev_display, display_path(dest), + 'Cloning %s%s to %s', redact_password_from_url(url), + rev_display, display_path(dest), ) - self.run_command(['clone', '-q', url, dest]) + cls.run_command(['clone', '-q', url, dest]) if rev_options.rev: # Then a specific revision was requested. - rev_options = self.resolve_revision(dest, url, rev_options) + rev_options = cls.resolve_revision(dest, url, rev_options) branch_name = getattr(rev_options, 'branch_name', None) if branch_name is None: # Only do a checkout if the current commit id doesn't match # the requested revision. - if not self.is_commit_id_equal(dest, rev_options.rev): + if not cls.is_commit_id_equal(dest, rev_options.rev): cmd_args = ['checkout', '-q'] + rev_options.to_args() - self.run_command(cmd_args, cwd=dest) - elif self.get_branch(dest) != branch_name: + cls.run_command(cmd_args, cwd=dest) + elif cls.get_current_branch(dest) != branch_name: # Then a specific branch was requested, and that branch # is not yet checked out. track_branch = 'origin/{}'.format(branch_name) cmd_args = [ 'checkout', '-b', branch_name, '--track', track_branch, ] - self.run_command(cmd_args, cwd=dest) + cls.run_command(cmd_args, cwd=dest) #: repo may contain submodules - self.update_submodules(dest) + cls.update_submodules(dest) def switch(self, dest, url, rev_options): self.run_command(['config', 'remote.origin.url', url], cwd=dest) @@ -240,14 +253,26 @@ class Git(VersionControl): #: update submodules self.update_submodules(dest) - def get_url(self, location): - """Return URL of the first remote encountered.""" - remotes = self.run_command( + @classmethod + def get_remote_url(cls, location): + """ + Return URL of the first remote encountered. + + Raises RemoteNotFoundError if the repository does not have a remote + url configured. + """ + # We need to pass 1 for extra_ok_returncodes since the command + # exits with return code 1 if there are no matching lines. + stdout = cls.run_command( ['config', '--get-regexp', r'remote\..*\.url'], - show_stdout=False, cwd=location, + extra_ok_returncodes=(1, ), show_stdout=False, cwd=location, ) - remotes = remotes.splitlines() - found_remote = remotes[0] + remotes = stdout.splitlines() + try: + found_remote = remotes[0] + except IndexError: + raise RemoteNotFoundError + for remote in remotes: if remote.startswith('remote.origin.url '): found_remote = remote @@ -255,19 +280,20 @@ class Git(VersionControl): url = found_remote.split(' ')[1] return url.strip() - def get_revision(self, location, rev=None): + @classmethod + def get_revision(cls, location, rev=None): if rev is None: rev = 'HEAD' - current_rev = self.run_command( + current_rev = cls.run_command( ['rev-parse', rev], show_stdout=False, cwd=location, ) return current_rev.strip() - def _get_subdirectory(self, location): - """Return the relative path of setup.py to the git repo root.""" + @classmethod + def get_subdirectory(cls, location): # find the repo root - git_dir = self.run_command(['rev-parse', '--git-dir'], - show_stdout=False, cwd=location).strip() + git_dir = cls.run_command(['rev-parse', '--git-dir'], + show_stdout=False, cwd=location).strip() if not os.path.isabs(git_dir): git_dir = os.path.join(location, git_dir) root_dir = os.path.join(git_dir, '..') @@ -290,19 +316,8 @@ class Git(VersionControl): return None return os.path.relpath(location, root_dir) - def get_src_requirement(self, dist, location): - repo = self.get_url(location) - if not repo.lower().startswith('git:'): - repo = 'git+' + repo - current_rev = self.get_revision(location) - egg_project_name = dist.egg_name().split('-', 1)[0] - subdir = self._get_subdirectory(location) - req = make_vcs_requirement_url(repo, current_rev, egg_project_name, - subdir=subdir) - - return req - - def get_url_rev_and_auth(self, url): + @classmethod + def get_url_rev_and_auth(cls, url): """ Prefixes stub URLs like 'user@hostname:user/repo.git' with 'ssh://'. That's required because although they use SSH they sometimes don't @@ -312,17 +327,18 @@ class Git(VersionControl): if '://' not in url: assert 'file:' not in url url = url.replace('git+', 'git+ssh://') - url, rev, user_pass = super(Git, self).get_url_rev_and_auth(url) + url, rev, user_pass = super(Git, cls).get_url_rev_and_auth(url) url = url.replace('ssh://', '') else: - url, rev, user_pass = super(Git, self).get_url_rev_and_auth(url) + url, rev, user_pass = super(Git, cls).get_url_rev_and_auth(url) return url, rev, user_pass - def update_submodules(self, location): + @classmethod + def update_submodules(cls, location): if not os.path.exists(os.path.join(location, '.gitmodules')): return - self.run_command( + cls.run_command( ['submodule', 'update', '--init', '--recursive', '-q'], cwd=location, ) @@ -332,10 +348,10 @@ class Git(VersionControl): if super(Git, cls).controls_location(location): return True try: - r = cls().run_command(['rev-parse'], - cwd=location, - show_stdout=False, - on_returncode='ignore') + r = cls.run_command(['rev-parse'], + cwd=location, + show_stdout=False, + on_returncode='ignore') return not r except BadCommand: logger.debug("could not determine if %s is under git control " diff --git a/env/lib/python3.7/site-packages/pip/_internal/vcs/mercurial.py b/env/lib/python3.7/site-packages/pip/_internal/vcs/mercurial.py index 17cfb67..81edc4a 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/vcs/mercurial.py +++ b/env/lib/python3.7/site-packages/pip/_internal/vcs/mercurial.py @@ -6,7 +6,7 @@ import os from pip._vendor.six.moves import configparser from pip._internal.download import path_to_url -from pip._internal.utils.misc import display_path, make_vcs_requirement_url +from pip._internal.utils.misc import display_path from pip._internal.utils.temp_dir import TempDirectory from pip._internal.vcs import VersionControl, vcs @@ -19,7 +19,8 @@ class Mercurial(VersionControl): repo_name = 'clone' schemes = ('hg', 'hg+http', 'hg+https', 'hg+ssh', 'hg+static-http') - def get_base_rev_args(self, rev): + @staticmethod + def get_base_rev_args(rev): return [rev] def export(self, location): @@ -31,7 +32,8 @@ class Mercurial(VersionControl): ['archive', location], show_stdout=False, cwd=temp_dir.path ) - def fetch_new(self, dest, url, rev_options): + @classmethod + def fetch_new(cls, dest, url, rev_options): rev_display = rev_options.to_display() logger.info( 'Cloning hg %s%s to %s', @@ -39,9 +41,9 @@ class Mercurial(VersionControl): rev_display, display_path(dest), ) - self.run_command(['clone', '--noupdate', '-q', url, dest]) + cls.run_command(['clone', '--noupdate', '-q', url, dest]) cmd_args = ['update', '-q'] + rev_options.to_args() - self.run_command(cmd_args, cwd=dest) + cls.run_command(cmd_args, cwd=dest) def switch(self, dest, url, rev_options): repo_config = os.path.join(dest, self.dirname, 'hgrc') @@ -64,36 +66,38 @@ class Mercurial(VersionControl): cmd_args = ['update', '-q'] + rev_options.to_args() self.run_command(cmd_args, cwd=dest) - def get_url(self, location): - url = self.run_command( + @classmethod + def get_remote_url(cls, location): + url = cls.run_command( ['showconfig', 'paths.default'], show_stdout=False, cwd=location).strip() - if self._is_local_repository(url): + if cls._is_local_repository(url): url = path_to_url(url) return url.strip() - def get_revision(self, location): - current_revision = self.run_command( + @classmethod + def get_revision(cls, location): + """ + Return the repository-local changeset revision number, as an integer. + """ + current_revision = cls.run_command( ['parents', '--template={rev}'], show_stdout=False, cwd=location).strip() return current_revision - def get_revision_hash(self, location): - current_rev_hash = self.run_command( + @classmethod + def get_requirement_revision(cls, location): + """ + Return the changeset identification hash, as a 40-character + hexadecimal string + """ + current_rev_hash = cls.run_command( ['parents', '--template={node}'], show_stdout=False, cwd=location).strip() return current_rev_hash - def get_src_requirement(self, dist, location): - repo = self.get_url(location) - if not repo.lower().startswith('hg:'): - repo = 'hg+' + repo - current_rev_hash = self.get_revision_hash(location) - egg_project_name = dist.egg_name().split('-', 1)[0] - return make_vcs_requirement_url(repo, current_rev_hash, - egg_project_name) - - def is_commit_id_equal(self, dest, name): + @classmethod + def is_commit_id_equal(cls, dest, name): """Always assume the versions don't match""" return False diff --git a/env/lib/python3.7/site-packages/pip/_internal/vcs/subversion.py b/env/lib/python3.7/site-packages/pip/_internal/vcs/subversion.py index 6f7cb5d..01bb161 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/vcs/subversion.py +++ b/env/lib/python3.7/site-packages/pip/_internal/vcs/subversion.py @@ -4,11 +4,11 @@ import logging import os import re -from pip._internal.models.link import Link from pip._internal.utils.logging import indent_log from pip._internal.utils.misc import ( - display_path, make_vcs_requirement_url, rmtree, split_auth_from_netloc, + display_path, rmtree, split_auth_from_netloc, ) +from pip._internal.utils.typing import MYPY_CHECK_RUNNING from pip._internal.vcs import VersionControl, vcs _svn_xml_url_re = re.compile('url="([^"]+)"') @@ -17,6 +17,9 @@ _svn_info_xml_rev_re = re.compile(r'\s*revision="(\d+)"') _svn_info_xml_url_re = re.compile(r'(.*)') +if MYPY_CHECK_RUNNING: + from typing import Optional, Tuple + logger = logging.getLogger(__name__) @@ -26,9 +29,44 @@ class Subversion(VersionControl): repo_name = 'checkout' schemes = ('svn', 'svn+ssh', 'svn+http', 'svn+https', 'svn+svn') - def get_base_rev_args(self, rev): + @classmethod + def should_add_vcs_url_prefix(cls, remote_url): + return True + + @staticmethod + def get_base_rev_args(rev): return ['-r', rev] + def get_vcs_version(self): + # type: () -> Optional[Tuple[int, ...]] + """Return the version of the currently installed Subversion client. + + :return: A tuple containing the parts of the version information or + ``None`` if the version returned from ``svn`` could not be parsed. + :raises: BadCommand: If ``svn`` is not installed. + """ + # Example versions: + # svn, version 1.10.3 (r1842928) + # compiled Feb 25 2019, 14:20:39 on x86_64-apple-darwin17.0.0 + # svn, version 1.7.14 (r1542130) + # compiled Mar 28 2018, 08:49:13 on x86_64-pc-linux-gnu + version_prefix = 'svn, version ' + version = self.run_command(['--version'], show_stdout=False) + if not version.startswith(version_prefix): + return None + + version = version[len(version_prefix):].split()[0] + version_list = version.split('.') + try: + parsed_version = tuple(map(int, version_list)) + except ValueError: + return None + + if not parsed_version: + return None + + return parsed_version + def export(self, location): """Export the svn repository at the url to the destination location""" url, rev_options = self.get_url_rev_options(self.url) @@ -42,7 +80,8 @@ class Subversion(VersionControl): cmd_args = ['export'] + rev_options.to_args() + [url, location] self.run_command(cmd_args, show_stdout=False) - def fetch_new(self, dest, url, rev_options): + @classmethod + def fetch_new(cls, dest, url, rev_options): rev_display = rev_options.to_display() logger.info( 'Checking out %s%s to %s', @@ -51,7 +90,7 @@ class Subversion(VersionControl): display_path(dest), ) cmd_args = ['checkout', '-q'] + rev_options.to_args() + [url, dest] - self.run_command(cmd_args) + cls.run_command(cmd_args) def switch(self, dest, url, rev_options): cmd_args = ['switch'] + rev_options.to_args() + [url, dest] @@ -61,21 +100,8 @@ class Subversion(VersionControl): cmd_args = ['update'] + rev_options.to_args() + [dest] self.run_command(cmd_args) - def get_location(self, dist, dependency_links): - for url in dependency_links: - egg_fragment = Link(url).egg_fragment - if not egg_fragment: - continue - if '-' in egg_fragment: - # FIXME: will this work when a package has - in the name? - key = '-'.join(egg_fragment.split('-')[:-1]).lower() - else: - key = egg_fragment - if key == dist.key: - return url.split('#', 1)[0] - return None - - def get_revision(self, location): + @classmethod + def get_revision(cls, location): """ Return the maximum revision for all files under a given location """ @@ -83,16 +109,16 @@ class Subversion(VersionControl): revision = 0 for base, dirs, files in os.walk(location): - if self.dirname not in dirs: + if cls.dirname not in dirs: dirs[:] = [] continue # no sense walking uncontrolled subdirs - dirs.remove(self.dirname) - entries_fn = os.path.join(base, self.dirname, 'entries') + dirs.remove(cls.dirname) + entries_fn = os.path.join(base, cls.dirname, 'entries') if not os.path.exists(entries_fn): # FIXME: should we warn? continue - dirurl, localrev = self._get_svn_url_rev(base) + dirurl, localrev = cls._get_svn_url_rev(base) if base == location: base = dirurl + '/' # save the root url @@ -102,7 +128,8 @@ class Subversion(VersionControl): revision = max(revision, localrev) return revision - def get_netloc_and_auth(self, netloc, scheme): + @classmethod + def get_netloc_and_auth(cls, netloc, scheme): """ This override allows the auth information to be passed to svn via the --username and --password options instead of via the URL. @@ -110,19 +137,20 @@ class Subversion(VersionControl): if scheme == 'ssh': # The --username and --password options can't be used for # svn+ssh URLs, so keep the auth information in the URL. - return super(Subversion, self).get_netloc_and_auth( - netloc, scheme) + return super(Subversion, cls).get_netloc_and_auth(netloc, scheme) return split_auth_from_netloc(netloc) - def get_url_rev_and_auth(self, url): + @classmethod + def get_url_rev_and_auth(cls, url): # hotfix the URL scheme after removing svn+ from svn+ssh:// readd it - url, rev, user_pass = super(Subversion, self).get_url_rev_and_auth(url) + url, rev, user_pass = super(Subversion, cls).get_url_rev_and_auth(url) if url.startswith('ssh://'): url = 'svn+' + url return url, rev, user_pass - def make_rev_args(self, username, password): + @staticmethod + def make_rev_args(username, password): extra_args = [] if username: extra_args += ['--username', username] @@ -131,7 +159,8 @@ class Subversion(VersionControl): return extra_args - def get_url(self, location): + @classmethod + def get_remote_url(cls, location): # In cases where the source is in a subdirectory, not alongside # setup.py we have to look up in the location until we find a real # setup.py @@ -149,12 +178,13 @@ class Subversion(VersionControl): ) return None - return self._get_svn_url_rev(location)[0] + return cls._get_svn_url_rev(location)[0] - def _get_svn_url_rev(self, location): + @classmethod + def _get_svn_url_rev(cls, location): from pip._internal.exceptions import InstallationError - entries_path = os.path.join(location, self.dirname, 'entries') + entries_path = os.path.join(location, cls.dirname, 'entries') if os.path.exists(entries_path): with open(entries_path) as f: data = f.read() @@ -177,7 +207,7 @@ class Subversion(VersionControl): else: try: # subversion >= 1.7 - xml = self.run_command( + xml = cls.run_command( ['info', '--xml', location], show_stdout=False, ) @@ -195,17 +225,8 @@ class Subversion(VersionControl): return url, rev - def get_src_requirement(self, dist, location): - repo = self.get_url(location) - if repo is None: - return None - repo = 'svn+' + repo - rev = self.get_revision(location) - # FIXME: why not project name? - egg_project_name = dist.egg_name().split('-', 1)[0] - return make_vcs_requirement_url(repo, rev, egg_project_name) - - def is_commit_id_equal(self, dest, name): + @classmethod + def is_commit_id_equal(cls, dest, name): """Always assume the versions don't match""" return False diff --git a/env/lib/python3.7/site-packages/pip/_internal/wheel.py b/env/lib/python3.7/site-packages/pip/_internal/wheel.py index 5ce890e..1bdbe93 100644 --- a/env/lib/python3.7/site-packages/pip/_internal/wheel.py +++ b/env/lib/python3.7/site-packages/pip/_internal/wheel.py @@ -30,9 +30,11 @@ from pip._internal.exceptions import ( from pip._internal.locations import ( PIP_DELETE_MARKER_FILENAME, distutils_scheme, ) +from pip._internal.models.link import Link from pip._internal.utils.logging import indent_log from pip._internal.utils.misc import ( - call_subprocess, captured_stdout, ensure_dir, read_chunks, + LOG_DIVIDER, call_subprocess, captured_stdout, ensure_dir, + format_command_args, read_chunks, ) from pip._internal.utils.setuptools_build import SETUPTOOLS_SHIM from pip._internal.utils.temp_dir import TempDirectory @@ -40,9 +42,21 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING from pip._internal.utils.ui import open_spinner if MYPY_CHECK_RUNNING: - from typing import Dict, List, Optional # noqa: F401 + from typing import ( + Dict, List, Optional, Sequence, Mapping, Tuple, IO, Text, Any, Iterable + ) + from pip._vendor.packaging.requirements import Requirement + from pip._internal.req.req_install import InstallRequirement + from pip._internal.download import PipSession + from pip._internal.index import FormatControl, PackageFinder + from pip._internal.operations.prepare import ( + RequirementPreparer + ) + from pip._internal.cache import WheelCache + from pip._internal.pep425tags import Pep425Tag + + InstalledCSVRow = Tuple[str, ...] -wheel_ext = '.whl' VERSION_COMPATIBLE = (1, 0) @@ -50,7 +64,12 @@ VERSION_COMPATIBLE = (1, 0) logger = logging.getLogger(__name__) +def normpath(src, p): + return os.path.relpath(src, p).replace(os.path.sep, '/') + + def rehash(path, blocksize=1 << 20): + # type: (str, int) -> Tuple[str, str] """Return (hash, length) for path using hashlib.sha256()""" h = hashlib.sha256() length = 0 @@ -61,20 +80,32 @@ def rehash(path, blocksize=1 << 20): digest = 'sha256=' + urlsafe_b64encode( h.digest() ).decode('latin1').rstrip('=') - return (digest, length) + # unicode/str python2 issues + return (digest, str(length)) # type: ignore def open_for_csv(name, mode): + # type: (str, Text) -> IO if sys.version_info[0] < 3: - nl = {} + nl = {} # type: Dict[str, Any] bin = 'b' else: - nl = {'newline': ''} + nl = {'newline': ''} # type: Dict[str, Any] bin = '' return open(name, mode + bin, **nl) +def replace_python_tag(wheelname, new_tag): + # type: (str, str) -> str + """Replace the Python tag in a wheel file name with a new value. + """ + parts = wheelname.split('-') + parts[-3] = new_tag + return '-'.join(parts) + + def fix_script(path): + # type: (str) -> Optional[bool] """Replace #!python with #!/path/to/python Return True if file was changed.""" # XXX RECORD hashes will need to be updated @@ -90,6 +121,7 @@ def fix_script(path): script.write(firstline) script.write(rest) return True + return None dist_info_re = re.compile(r"""^(?P(?P.+?)(-(?P.+?))?) @@ -97,6 +129,7 @@ dist_info_re = re.compile(r"""^(?P(?P.+?)(-(?P.+?))?) def root_is_purelib(name, wheeldir): + # type: (str, str) -> bool """ Return True if the extracted wheel in wheeldir should go into purelib. """ @@ -113,6 +146,7 @@ def root_is_purelib(name, wheeldir): def get_entrypoints(filename): + # type: (str) -> Tuple[Dict[str, str], Dict[str, str]] if not os.path.exists(filename): return {}, {} @@ -144,7 +178,7 @@ def get_entrypoints(filename): def message_about_scripts_not_on_PATH(scripts): - # type: (List[str]) -> Optional[str] + # type: (Sequence[str]) -> Optional[str] """Determine if any scripts are not on PATH and format a warning. Returns a warning message if one or more scripts are not on PATH, @@ -178,12 +212,12 @@ def message_about_scripts_not_on_PATH(scripts): # Format a message msg_lines = [] for parent_dir, scripts in warn_for.items(): - scripts = sorted(scripts) - if len(scripts) == 1: - start_text = "script {} is".format(scripts[0]) + sorted_scripts = sorted(scripts) # type: List[str] + if len(sorted_scripts) == 1: + start_text = "script {} is".format(sorted_scripts[0]) else: start_text = "scripts {} are".format( - ", ".join(scripts[:-1]) + " and " + scripts[-1] + ", ".join(sorted_scripts[:-1]) + " and " + sorted_scripts[-1] ) msg_lines.append( @@ -204,10 +238,81 @@ def message_about_scripts_not_on_PATH(scripts): return "\n".join(msg_lines) -def move_wheel_files(name, req, wheeldir, user=False, home=None, root=None, - pycompile=True, scheme=None, isolated=False, prefix=None, - warn_script_location=True): +def sorted_outrows(outrows): + # type: (Iterable[InstalledCSVRow]) -> List[InstalledCSVRow] + """ + Return the given rows of a RECORD file in sorted order. + + Each row is a 3-tuple (path, hash, size) and corresponds to a record of + a RECORD file (see PEP 376 and PEP 427 for details). For the rows + passed to this function, the size can be an integer as an int or string, + or the empty string. + """ + # Normally, there should only be one row per path, in which case the + # second and third elements don't come into play when sorting. + # However, in cases in the wild where a path might happen to occur twice, + # we don't want the sort operation to trigger an error (but still want + # determinism). Since the third element can be an int or string, we + # coerce each element to a string to avoid a TypeError in this case. + # For additional background, see-- + # https://github.com/pypa/pip/issues/5868 + return sorted(outrows, key=lambda row: tuple(str(x) for x in row)) + + +def get_csv_rows_for_installed( + old_csv_rows, # type: Iterable[List[str]] + installed, # type: Dict[str, str] + changed, # type: set + generated, # type: List[str] + lib_dir, # type: str +): + # type: (...) -> List[InstalledCSVRow] + """ + :param installed: A map from archive RECORD path to installation RECORD + path. + """ + installed_rows = [] # type: List[InstalledCSVRow] + for row in old_csv_rows: + if len(row) > 3: + logger.warning( + 'RECORD line has more than three elements: {}'.format(row) + ) + # Make a copy because we are mutating the row. + row = list(row) + old_path = row[0] + new_path = installed.pop(old_path, old_path) + row[0] = new_path + if new_path in changed: + digest, length = rehash(new_path) + row[1] = digest + row[2] = length + installed_rows.append(tuple(row)) + for f in generated: + digest, length = rehash(f) + installed_rows.append((normpath(f, lib_dir), digest, str(length))) + for f in installed: + installed_rows.append((installed[f], '', '')) + return installed_rows + + +def move_wheel_files( + name, # type: str + req, # type: Requirement + wheeldir, # type: str + user=False, # type: bool + home=None, # type: Optional[str] + root=None, # type: Optional[str] + pycompile=True, # type: bool + scheme=None, # type: Optional[Mapping[str, str]] + isolated=False, # type: bool + prefix=None, # type: Optional[str] + warn_script_location=True # type: bool +): + # type: (...) -> None """Install a wheel""" + # TODO: Investigate and break this up. + # TODO: Look into moving this into a dedicated class for representing an + # installation. if not scheme: scheme = distutils_scheme( @@ -220,7 +325,7 @@ def move_wheel_files(name, req, wheeldir, user=False, home=None, root=None, else: lib_dir = scheme['platlib'] - info_dir = [] + info_dir = [] # type: List[str] data_dirs = [] source = wheeldir.rstrip(os.path.sep) + os.path.sep @@ -228,9 +333,9 @@ def move_wheel_files(name, req, wheeldir, user=False, home=None, root=None, # installed = files copied from the wheel to the destination # changed = files changed while installing (scripts #! line typically) # generated = files newly generated during the install (script wrappers) - installed = {} + installed = {} # type: Dict[str, str] changed = set() - generated = [] + generated = [] # type: List[str] # Compile all of the pyc files that we're going to be installing if pycompile: @@ -240,9 +345,6 @@ def move_wheel_files(name, req, wheeldir, user=False, home=None, root=None, compileall.compile_dir(source, force=True, quiet=True) logger.debug(stdout.getvalue()) - def normpath(src, p): - return os.path.relpath(src, p).replace(os.path.sep, '/') - def record_installed(srcfile, destfile, modified=False): """Map archive RECORD paths to installation RECORD paths.""" oldpath = normpath(srcfile, wheeldir) @@ -388,8 +490,9 @@ def move_wheel_files(name, req, wheeldir, user=False, home=None, root=None, "import_name": entry.suffix.split(".")[0], "func": entry.suffix, } - - maker._get_script_text = _get_script_text + # ignore type, because mypy disallows assigning to a method, + # see https://github.com/python/mypy/issues/2427 + maker._get_script_text = _get_script_text # type: ignore maker.script_template = r"""# -*- coding: utf-8 -*- import re import sys @@ -499,28 +602,23 @@ if __name__ == '__main__': with open_for_csv(record, 'r') as record_in: with open_for_csv(temp_record, 'w+') as record_out: reader = csv.reader(record_in) + outrows = get_csv_rows_for_installed( + reader, installed=installed, changed=changed, + generated=generated, lib_dir=lib_dir, + ) writer = csv.writer(record_out) - outrows = [] - for row in reader: - row[0] = installed.pop(row[0], row[0]) - if row[0] in changed: - row[1], row[2] = rehash(row[0]) - outrows.append(tuple(row)) - for f in generated: - digest, length = rehash(f) - outrows.append((normpath(f, lib_dir), digest, length)) - for f in installed: - outrows.append((installed[f], '', '')) - for row in sorted(outrows): + # Sort to simplify testing. + for row in sorted_outrows(outrows): writer.writerow(row) shutil.move(temp_record, record) def wheel_version(source_dir): + # type: (Optional[str]) -> Optional[Tuple[int, ...]] """ Return the Wheel-Version of an extracted wheel, if possible. - Otherwise, return False if we couldn't parse / extract it. + Otherwise, return None if we couldn't parse / extract it. """ try: dist = [d for d in pkg_resources.find_on_path(None, source_dir)][0] @@ -532,10 +630,11 @@ def wheel_version(source_dir): version = tuple(map(int, version.split('.'))) return version except Exception: - return False + return None def check_compatibility(version, name): + # type: (Optional[Tuple[int, ...]], str) -> None """ Raises errors or warns if called with an incompatible Wheel-Version. @@ -567,7 +666,8 @@ def check_compatibility(version, name): class Wheel(object): """A wheel file""" - # TODO: maybe move the install code into this class + # TODO: Maybe move the class into the models sub-package + # TODO: Maybe move the install code into this class wheel_file_re = re.compile( r"""^(?P(?P.+?)-(?P.*?)) @@ -577,6 +677,7 @@ class Wheel(object): ) def __init__(self, filename): + # type: (str) -> None """ :raises InvalidWheelFilename: when the filename is invalid for a wheel """ @@ -602,6 +703,7 @@ class Wheel(object): } def support_index_min(self, tags=None): + # type: (Optional[List[Pep425Tag]]) -> Optional[int] """ Return the lowest index that one of the wheel's file_tag combinations achieves in the supported_tags list e.g. if there are 8 supported tags, @@ -614,17 +716,144 @@ class Wheel(object): return min(indexes) if indexes else None def supported(self, tags=None): + # type: (Optional[List[Pep425Tag]]) -> bool """Is this wheel supported on this system?""" if tags is None: # for mock tags = pep425tags.get_supported() return bool(set(tags).intersection(self.file_tags)) +def _contains_egg_info( + s, _egg_info_re=re.compile(r'([a-z0-9_.]+)-([a-z0-9_.!+-]+)', re.I)): + """Determine whether the string looks like an egg_info. + + :param s: The string to parse. E.g. foo-2.1 + """ + return bool(_egg_info_re.search(s)) + + +def should_use_ephemeral_cache( + req, # type: InstallRequirement + format_control, # type: FormatControl + autobuilding, # type: bool + cache_available # type: bool +): + # type: (...) -> Optional[bool] + """ + Return whether to build an InstallRequirement object using the + ephemeral cache. + + :param cache_available: whether a cache directory is available for the + autobuilding=True case. + + :return: True or False to build the requirement with ephem_cache=True + or False, respectively; or None not to build the requirement. + """ + if req.constraint: + return None + if req.is_wheel: + if not autobuilding: + logger.info( + 'Skipping %s, due to already being wheel.', req.name, + ) + return None + if not autobuilding: + return False + + if req.editable or not req.source_dir: + return None + + if req.link and not req.link.is_artifact: + # VCS checkout. Build wheel just for this run. + return True + + if "binary" not in format_control.get_allowed_formats( + canonicalize_name(req.name)): + logger.info( + "Skipping bdist_wheel for %s, due to binaries " + "being disabled for it.", req.name, + ) + return None + + link = req.link + base, ext = link.splitext() + if cache_available and _contains_egg_info(base): + return False + + # Otherwise, build the wheel just for this run using the ephemeral + # cache since we are either in the case of e.g. a local directory, or + # no cache directory is available to use. + return True + + +def format_command_result( + command_args, # type: List[str] + command_output, # type: str +): + # type: (...) -> str + """ + Format command information for logging. + """ + command_desc = format_command_args(command_args) + text = 'Command arguments: {}\n'.format(command_desc) + + if not command_output: + text += 'Command output: None' + elif logger.getEffectiveLevel() > logging.DEBUG: + text += 'Command output: [use --verbose to show]' + else: + if not command_output.endswith('\n'): + command_output += '\n' + text += 'Command output:\n{}{}'.format(command_output, LOG_DIVIDER) + + return text + + +def get_legacy_build_wheel_path( + names, # type: List[str] + temp_dir, # type: str + req, # type: InstallRequirement + command_args, # type: List[str] + command_output, # type: str +): + # type: (...) -> Optional[str] + """ + Return the path to the wheel in the temporary build directory. + """ + # Sort for determinism. + names = sorted(names) + if not names: + msg = ( + 'Legacy build of wheel for {!r} created no files.\n' + ).format(req.name) + msg += format_command_result(command_args, command_output) + logger.warning(msg) + return None + + if len(names) > 1: + msg = ( + 'Legacy build of wheel for {!r} created more than one file.\n' + 'Filenames (choosing first): {}\n' + ).format(req.name, names) + msg += format_command_result(command_args, command_output) + logger.warning(msg) + + return os.path.join(temp_dir, names[0]) + + class WheelBuilder(object): """Build wheels from a RequirementSet.""" - def __init__(self, finder, preparer, wheel_cache, - build_options=None, global_options=None, no_clean=False): + def __init__( + self, + finder, # type: PackageFinder + preparer, # type: RequirementPreparer + wheel_cache, # type: WheelCache + build_options=None, # type: Optional[List[str]] + global_options=None, # type: Optional[List[str]] + no_clean=False # type: bool + ): + # type: (...) -> None self.finder = finder self.preparer = preparer self.wheel_cache = wheel_cache @@ -647,15 +876,18 @@ class WheelBuilder(object): def _build_one_inside_env(self, req, output_dir, python_tag=None): with TempDirectory(kind="wheel") as temp_dir: - if self.__build_one(req, temp_dir.path, python_tag=python_tag): + if req.use_pep517: + builder = self._build_one_pep517 + else: + builder = self._build_one_legacy + wheel_path = builder(req, temp_dir.path, python_tag=python_tag) + if wheel_path is not None: + wheel_name = os.path.basename(wheel_path) + dest_path = os.path.join(output_dir, wheel_name) try: - wheel_name = os.listdir(temp_dir.path)[0] - wheel_path = os.path.join(output_dir, wheel_name) - shutil.move( - os.path.join(temp_dir.path, wheel_name), wheel_path - ) + shutil.move(wheel_path, dest_path) logger.info('Stored in directory: %s', output_dir) - return wheel_path + return dest_path except Exception: pass # Ignore return, we can't do anything else useful. @@ -672,10 +904,48 @@ class WheelBuilder(object): SETUPTOOLS_SHIM % req.setup_py ] + list(self.global_options) - def __build_one(self, req, tempd, python_tag=None): + def _build_one_pep517(self, req, tempd, python_tag=None): + """Build one InstallRequirement using the PEP 517 build process. + + Returns path to wheel if successfully built. Otherwise, returns None. + """ + assert req.metadata_directory is not None + if self.build_options: + # PEP 517 does not support --build-options + logger.error('Cannot build wheel for %s using PEP 517 when ' + '--build-options is present' % (req.name,)) + return None + try: + req.spin_message = 'Building wheel for %s (PEP 517)' % (req.name,) + logger.debug('Destination directory: %s', tempd) + wheel_name = req.pep517_backend.build_wheel( + tempd, + metadata_directory=req.metadata_directory + ) + if python_tag: + # General PEP 517 backends don't necessarily support + # a "--python-tag" option, so we rename the wheel + # file directly. + new_name = replace_python_tag(wheel_name, python_tag) + os.rename( + os.path.join(tempd, wheel_name), + os.path.join(tempd, new_name) + ) + # Reassign to simplify the return at the end of function + wheel_name = new_name + except Exception: + logger.error('Failed building wheel for %s', req.name) + return None + return os.path.join(tempd, wheel_name) + + def _build_one_legacy(self, req, tempd, python_tag=None): + """Build one InstallRequirement using the "legacy" build process. + + Returns path to wheel if successfully built. Otherwise, returns None. + """ base_args = self._base_setup_args(req) - spin_message = 'Running setup.py bdist_wheel for %s' % (req.name,) + spin_message = 'Building wheel for %s (setup.py)' % (req.name,) with open_spinner(spin_message) as spinner: logger.debug('Destination directory: %s', tempd) wheel_args = base_args + ['bdist_wheel', '-d', tempd] \ @@ -685,13 +955,21 @@ class WheelBuilder(object): wheel_args += ["--python-tag", python_tag] try: - call_subprocess(wheel_args, cwd=req.setup_py_dir, - show_stdout=False, spinner=spinner) - return True + output = call_subprocess(wheel_args, cwd=req.setup_py_dir, + spinner=spinner) except Exception: spinner.finish("error") logger.error('Failed building wheel for %s', req.name) - return False + return None + names = os.listdir(tempd) + wheel_path = get_legacy_build_wheel_path( + names=names, + temp_dir=tempd, + req=req, + command_args=wheel_args, + command_output=output, + ) + return wheel_path def _clean_one(self, req): base_args = self._base_setup_args(req) @@ -699,63 +977,52 @@ class WheelBuilder(object): logger.info('Running setup.py clean for %s', req.name) clean_args = base_args + ['clean', '--all'] try: - call_subprocess(clean_args, cwd=req.source_dir, show_stdout=False) + call_subprocess(clean_args, cwd=req.source_dir) return True except Exception: logger.error('Failed cleaning build dir for %s', req.name) return False - def build(self, requirements, session, autobuilding=False): + def build( + self, + requirements, # type: Iterable[InstallRequirement] + session, # type: PipSession + autobuilding=False # type: bool + ): + # type: (...) -> List[InstallRequirement] """Build wheels. :param unpack: If True, replace the sdist we built from with the newly built wheel, in preparation for installation. :return: True if all the wheels built correctly. """ - from pip._internal import index - from pip._internal.models.link import Link - - building_is_possible = self._wheel_dir or ( - autobuilding and self.wheel_cache.cache_dir - ) - assert building_is_possible - buildset = [] format_control = self.finder.format_control + # Whether a cache directory is available for autobuilding=True. + cache_available = bool(self._wheel_dir or self.wheel_cache.cache_dir) + for req in requirements: - if req.constraint: + ephem_cache = should_use_ephemeral_cache( + req, format_control=format_control, autobuilding=autobuilding, + cache_available=cache_available, + ) + if ephem_cache is None: continue - if req.is_wheel: - if not autobuilding: - logger.info( - 'Skipping %s, due to already being wheel.', req.name, - ) - elif autobuilding and req.editable: - pass - elif autobuilding and not req.source_dir: - pass - elif autobuilding and req.link and not req.link.is_artifact: - # VCS checkout. Build wheel just for this run. - buildset.append((req, True)) - else: - ephem_cache = False - if autobuilding: - link = req.link - base, ext = link.splitext() - if index.egg_info_matches(base, None, link) is None: - # E.g. local directory. Build wheel just for this run. - ephem_cache = True - if "binary" not in format_control.get_allowed_formats( - canonicalize_name(req.name)): - logger.info( - "Skipping bdist_wheel for %s, due to binaries " - "being disabled for it.", req.name, - ) - continue - buildset.append((req, ephem_cache)) + + buildset.append((req, ephem_cache)) if not buildset: - return True + return [] + + # Is any wheel build not using the ephemeral cache? + if any(not ephem_cache for _, ephem_cache in buildset): + have_directory_for_build = self._wheel_dir or ( + autobuilding and self.wheel_cache.cache_dir + ) + assert have_directory_for_build + + # TODO by @pradyunsg + # Should break up this method into 2 separate methods. # Build the wheels. logger.info( @@ -827,5 +1094,5 @@ class WheelBuilder(object): 'Failed to build %s', ' '.join([req.name for req in build_failure]), ) - # Return True if all builds were successful - return len(build_failure) == 0 + # Return a list of requirements that failed to build + return build_failure diff --git a/env/lib/python3.7/site-packages/pip/_vendor/__init__.py b/env/lib/python3.7/site-packages/pip/_vendor/__init__.py index a0aae81..c1d9508 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/__init__.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/__init__.py @@ -30,24 +30,21 @@ def vendored(modulename): vendored_name = "{0}.{1}".format(__name__, modulename) try: - __import__(vendored_name, globals(), locals(), level=0) + __import__(modulename, globals(), locals(), level=0) except ImportError: - try: - __import__(modulename, globals(), locals(), level=0) - except ImportError: - # We can just silently allow import failures to pass here. If we - # got to this point it means that ``import pip._vendor.whatever`` - # failed and so did ``import whatever``. Since we're importing this - # upfront in an attempt to alias imports, not erroring here will - # just mean we get a regular import error whenever pip *actually* - # tries to import one of these modules to use it, which actually - # gives us a better error message than we would have otherwise - # gotten. - pass - else: - sys.modules[vendored_name] = sys.modules[modulename] - base, head = vendored_name.rsplit(".", 1) - setattr(sys.modules[base], head, sys.modules[modulename]) + # We can just silently allow import failures to pass here. If we + # got to this point it means that ``import pip._vendor.whatever`` + # failed and so did ``import whatever``. Since we're importing this + # upfront in an attempt to alias imports, not erroring here will + # just mean we get a regular import error whenever pip *actually* + # tries to import one of these modules to use it, which actually + # gives us a better error message than we would have otherwise + # gotten. + pass + else: + sys.modules[vendored_name] = sys.modules[modulename] + base, head = vendored_name.rsplit(".", 1) + setattr(sys.modules[base], head, sys.modules[modulename]) # If we're operating in a debundled setup, then we want to go ahead and trigger @@ -74,11 +71,13 @@ if DEBUNDLED: vendored("packaging") vendored("packaging.version") vendored("packaging.specifiers") + vendored("pep517") vendored("pkg_resources") vendored("progress") vendored("pytoml") vendored("retrying") vendored("requests") + vendored("requests.exceptions") vendored("requests.packages") vendored("requests.packages.urllib3") vendored("requests.packages.urllib3._collections") diff --git a/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/__init__.cpython-37.pyc index 70608d2..6b6cdaf 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/appdirs.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/appdirs.cpython-37.pyc index 75df8f2..194ad4b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/appdirs.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/appdirs.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/distro.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/distro.cpython-37.pyc index 4d70874..4cff2b0 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/distro.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/distro.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/ipaddress.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/ipaddress.cpython-37.pyc index b29d55d..c3ca7cd 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/ipaddress.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/ipaddress.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/pyparsing.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/pyparsing.cpython-37.pyc index d1d0782..7765250 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/pyparsing.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/pyparsing.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/retrying.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/retrying.cpython-37.pyc index 1e33738..2881d2d 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/retrying.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/retrying.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/six.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/six.cpython-37.pyc index 3e612ea..d6e2035 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/six.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/__pycache__/six.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/__init__.cpython-37.pyc index 3314c27..3a2594b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/_cmd.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/_cmd.cpython-37.pyc index 210cb12..cac59a4 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/_cmd.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/_cmd.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/adapter.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/adapter.cpython-37.pyc index 9a8a8e5..c26f646 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/adapter.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/adapter.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/cache.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/cache.cpython-37.pyc index de9a968..151b430 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/cache.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/cache.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/compat.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/compat.cpython-37.pyc index 70a1703..79d1d8b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/compat.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/compat.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/controller.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/controller.cpython-37.pyc index 8341d45..f0dff8e 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/controller.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/controller.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/filewrapper.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/filewrapper.cpython-37.pyc index 608f4c1..5c8b1cf 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/filewrapper.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/filewrapper.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/heuristics.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/heuristics.cpython-37.pyc index 1a24a43..66f9924 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/heuristics.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/heuristics.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/serialize.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/serialize.cpython-37.pyc index 9c3a419..9dc2d85 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/serialize.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/serialize.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/wrapper.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/wrapper.cpython-37.pyc index b5da00d..1f165f6 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/wrapper.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__pycache__/wrapper.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/__init__.cpython-37.pyc index 5b213dc..7e4801d 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/file_cache.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/file_cache.cpython-37.pyc index 9ab8948..a7a8d91 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/file_cache.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/file_cache.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/redis_cache.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/redis_cache.cpython-37.pyc index 213c373..ca5b6c3 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/redis_cache.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/redis_cache.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/certifi/__init__.py b/env/lib/python3.7/site-packages/pip/_vendor/certifi/__init__.py index aa329fb..632db8e 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/certifi/__init__.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/certifi/__init__.py @@ -1,3 +1,3 @@ -from .core import where, old_where +from .core import where -__version__ = "2018.08.24" +__version__ = "2019.03.09" diff --git a/env/lib/python3.7/site-packages/pip/_vendor/certifi/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/certifi/__pycache__/__init__.cpython-37.pyc index 6313534..ff26625 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/certifi/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/certifi/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/certifi/__pycache__/__main__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/certifi/__pycache__/__main__.cpython-37.pyc index d213063..b7a0720 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/certifi/__pycache__/__main__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/certifi/__pycache__/__main__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/certifi/__pycache__/core.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/certifi/__pycache__/core.cpython-37.pyc index 810b26a..eb33653 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/certifi/__pycache__/core.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/certifi/__pycache__/core.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/certifi/cacert.pem b/env/lib/python3.7/site-packages/pip/_vendor/certifi/cacert.pem index 85de024..84636dd 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/certifi/cacert.pem +++ b/env/lib/python3.7/site-packages/pip/_vendor/certifi/cacert.pem @@ -326,36 +326,6 @@ OCiNUW7dFGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH QMAJKOSLakhT2+zNVVXxxvjpoixMptEmX36vWkzaH6byHCx+rgIW0lbQL1dTR+iS -----END CERTIFICATE----- -# Issuer: CN=Visa eCommerce Root O=VISA OU=Visa International Service Association -# Subject: CN=Visa eCommerce Root O=VISA OU=Visa International Service Association -# Label: "Visa eCommerce Root" -# Serial: 25952180776285836048024890241505565794 -# MD5 Fingerprint: fc:11:b8:d8:08:93:30:00:6d:23:f9:7e:eb:52:1e:02 -# SHA1 Fingerprint: 70:17:9b:86:8c:00:a4:fa:60:91:52:22:3f:9f:3e:32:bd:e0:05:62 -# SHA256 Fingerprint: 69:fa:c9:bd:55:fb:0a:c7:8d:53:bb:ee:5c:f1:d5:97:98:9f:d0:aa:ab:20:a2:51:51:bd:f1:73:3e:e7:d1:22 ------BEGIN CERTIFICATE----- -MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBr -MQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRl -cm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv -bW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2WhcNMjIwNjI0MDAxNjEyWjBrMQsw -CQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5h -dGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1l -cmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h -2mCxlCfLF9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4E -lpF7sDPwsRROEW+1QK8bRaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdV -ZqW1LS7YgFmypw23RuwhY/81q6UCzyr0TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq -299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI/k4+oKsGGelT84ATB+0t -vz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzsGHxBvfaL -dXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQD -AgEGMB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUF -AAOCAQEAX/FBfXxcCLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcR -zCSs00Rsca4BIGsDoo8Ytyk6feUWYFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3 -LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pzzkWKsKZJ/0x9nXGIxHYdkFsd -7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBuYQa7FkKMcPcw -++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt -398znM/jra6O1I7mT1GvFpLgXPYHDw== ------END CERTIFICATE----- - # Issuer: CN=AAA Certificate Services O=Comodo CA Limited # Subject: CN=AAA Certificate Services O=Comodo CA Limited # Label: "Comodo AAA Services root" @@ -4298,3 +4268,391 @@ rYy0UGYwEAYJKwYBBAGCNxUBBAMCAQAwCgYIKoZIzj0EAwMDaAAwZQIwJsdpW9zV 57LnyAyMjMPdeYwbY9XJUpROTYJKcx6ygISpJcBMWm1JKWB4E+J+SOtkAjEA2zQg Mgj/mkkCtojeFK9dbJlxjRo/i9fgojaGHAeCOnZT/cKi7e97sIBPWA9LUzm9 -----END CERTIFICATE----- + +# Issuer: CN=GTS Root R1 O=Google Trust Services LLC +# Subject: CN=GTS Root R1 O=Google Trust Services LLC +# Label: "GTS Root R1" +# Serial: 146587175971765017618439757810265552097 +# MD5 Fingerprint: 82:1a:ef:d4:d2:4a:f2:9f:e2:3d:97:06:14:70:72:85 +# SHA1 Fingerprint: e1:c9:50:e6:ef:22:f8:4c:56:45:72:8b:92:20:60:d7:d5:a7:a3:e8 +# SHA256 Fingerprint: 2a:57:54:71:e3:13:40:bc:21:58:1c:bd:2c:f1:3e:15:84:63:20:3e:ce:94:bc:f9:d3:cc:19:6b:f0:9a:54:72 +-----BEGIN CERTIFICATE----- +MIIFWjCCA0KgAwIBAgIQbkepxUtHDA3sM9CJuRz04TANBgkqhkiG9w0BAQwFADBH +MQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExM +QzEUMBIGA1UEAxMLR1RTIFJvb3QgUjEwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIy +MDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNl +cnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjEwggIiMA0GCSqGSIb3DQEB +AQUAA4ICDwAwggIKAoICAQC2EQKLHuOhd5s73L+UPreVp0A8of2C+X0yBoJx9vaM +f/vo27xqLpeXo4xL+Sv2sfnOhB2x+cWX3u+58qPpvBKJXqeqUqv4IyfLpLGcY9vX +mX7wCl7raKb0xlpHDU0QM+NOsROjyBhsS+z8CZDfnWQpJSMHobTSPS5g4M/SCYe7 +zUjwTcLCeoiKu7rPWRnWr4+wB7CeMfGCwcDfLqZtbBkOtdh+JhpFAz2weaSUKK0P +fyblqAj+lug8aJRT7oM6iCsVlgmy4HqMLnXWnOunVmSPlk9orj2XwoSPwLxAwAtc +vfaHszVsrBhQf4TgTM2S0yDpM7xSma8ytSmzJSq0SPly4cpk9+aCEI3oncKKiPo4 +Zor8Y/kB+Xj9e1x3+naH+uzfsQ55lVe0vSbv1gHR6xYKu44LtcXFilWr06zqkUsp +zBmkMiVOKvFlRNACzqrOSbTqn3yDsEB750Orp2yjj32JgfpMpf/VjsPOS+C12LOO +Rc92wO1AK/1TD7Cn1TsNsYqiA94xrcx36m97PtbfkSIS5r762DL8EGMUUXLeXdYW +k70paDPvOmbsB4om3xPXV2V4J95eSRQAogB/mqghtqmxlbCluQ0WEdrHbEg8QOB+ +DVrNVjzRlwW5y0vtOUucxD/SVRNuJLDWcfr0wbrM7Rv1/oFB2ACYPTrIrnqYNxgF +lQIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV +HQ4EFgQU5K8rJnEaK0gnhS9SZizv8IkTcT4wDQYJKoZIhvcNAQEMBQADggIBADiW +Cu49tJYeX++dnAsznyvgyv3SjgofQXSlfKqE1OXyHuY3UjKcC9FhHb8owbZEKTV1 +d5iyfNm9dKyKaOOpMQkpAWBz40d8U6iQSifvS9efk+eCNs6aaAyC58/UEBZvXw6Z +XPYfcX3v73svfuo21pdwCxXu11xWajOl40k4DLh9+42FpLFZXvRq4d2h9mREruZR +gyFmxhE+885H7pwoHyXa/6xmld01D1zvICxi/ZG6qcz8WpyTgYMpl0p8WnK0OdC3 +d8t5/Wk6kjftbjhlRn7pYL15iJdfOBL07q9bgsiG1eGZbYwE8na6SfZu6W0eX6Dv +J4J2QPim01hcDyxC2kLGe4g0x8HYRZvBPsVhHdljUEn2NIVq4BjFbkerQUIpm/Zg +DdIx02OYI5NaAIFItO/Nis3Jz5nu2Z6qNuFoS3FJFDYoOj0dzpqPJeaAcWErtXvM ++SUWgeExX6GjfhaknBZqlxi9dnKlC54dNuYvoS++cJEPqOba+MSSQGwlfnuzCdyy +F62ARPBopY+Udf90WuioAnwMCeKpSwughQtiue+hMZL77/ZRBIls6Kl0obsXs7X9 +SQ98POyDGCBDTtWTurQ0sR8WNh8M5mQ5Fkzc4P4dyKliPUDqysU0ArSuiYgzNdws +E3PYJ/HQcu51OyLemGhmW/HGY0dVHLqlCFF1pkgl +-----END CERTIFICATE----- + +# Issuer: CN=GTS Root R2 O=Google Trust Services LLC +# Subject: CN=GTS Root R2 O=Google Trust Services LLC +# Label: "GTS Root R2" +# Serial: 146587176055767053814479386953112547951 +# MD5 Fingerprint: 44:ed:9a:0e:a4:09:3b:00:f2:ae:4c:a3:c6:61:b0:8b +# SHA1 Fingerprint: d2:73:96:2a:2a:5e:39:9f:73:3f:e1:c7:1e:64:3f:03:38:34:fc:4d +# SHA256 Fingerprint: c4:5d:7b:b0:8e:6d:67:e6:2e:42:35:11:0b:56:4e:5f:78:fd:92:ef:05:8c:84:0a:ea:4e:64:55:d7:58:5c:60 +-----BEGIN CERTIFICATE----- +MIIFWjCCA0KgAwIBAgIQbkepxlqz5yDFMJo/aFLybzANBgkqhkiG9w0BAQwFADBH +MQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExM +QzEUMBIGA1UEAxMLR1RTIFJvb3QgUjIwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIy +MDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNl +cnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjIwggIiMA0GCSqGSIb3DQEB +AQUAA4ICDwAwggIKAoICAQDO3v2m++zsFDQ8BwZabFn3GTXd98GdVarTzTukk3Lv +CvptnfbwhYBboUhSnznFt+4orO/LdmgUud+tAWyZH8QiHZ/+cnfgLFuv5AS/T3Kg +GjSY6Dlo7JUle3ah5mm5hRm9iYz+re026nO8/4Piy33B0s5Ks40FnotJk9/BW9Bu +XvAuMC6C/Pq8tBcKSOWIm8Wba96wyrQD8Nr0kLhlZPdcTK3ofmZemde4wj7I0BOd +re7kRXuJVfeKH2JShBKzwkCX44ofR5GmdFrS+LFjKBC4swm4VndAoiaYecb+3yXu +PuWgf9RhD1FLPD+M2uFwdNjCaKH5wQzpoeJ/u1U8dgbuak7MkogwTZq9TwtImoS1 +mKPV+3PBV2HdKFZ1E66HjucMUQkQdYhMvI35ezzUIkgfKtzra7tEscszcTJGr61K +8YzodDqs5xoic4DSMPclQsciOzsSrZYuxsN2B6ogtzVJV+mSSeh2FnIxZyuWfoqj +x5RWIr9qS34BIbIjMt/kmkRtWVtd9QCgHJvGeJeNkP+byKq0rxFROV7Z+2et1VsR +nTKaG73VululycslaVNVJ1zgyjbLiGH7HrfQy+4W+9OmTN6SpdTi3/UGVN4unUu0 +kzCqgc7dGtxRcw1PcOnlthYhGXmy5okLdWTK1au8CcEYof/UVKGFPP0UJAOyh9Ok +twIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV +HQ4EFgQUu//KjiOfT5nK2+JopqUVJxce2Q4wDQYJKoZIhvcNAQEMBQADggIBALZp +8KZ3/p7uC4Gt4cCpx/k1HUCCq+YEtN/L9x0Pg/B+E02NjO7jMyLDOfxA325BS0JT +vhaI8dI4XsRomRyYUpOM52jtG2pzegVATX9lO9ZY8c6DR2Dj/5epnGB3GFW1fgiT +z9D2PGcDFWEJ+YF59exTpJ/JjwGLc8R3dtyDovUMSRqodt6Sm2T4syzFJ9MHwAiA +pJiS4wGWAqoC7o87xdFtCjMwc3i5T1QWvwsHoaRc5svJXISPD+AVdyx+Jn7axEvb +pxZ3B7DNdehyQtaVhJ2Gg/LkkM0JR9SLA3DaWsYDQvTtN6LwG1BUSw7YhN4ZKJmB +R64JGz9I0cNv4rBgF/XuIwKl2gBbbZCr7qLpGzvpx0QnRY5rn/WkhLx3+WuXrD5R +RaIRpsyF7gpo8j5QOHokYh4XIDdtak23CZvJ/KRY9bb7nE4Yu5UC56GtmwfuNmsk +0jmGwZODUNKBRqhfYlcsu2xkiAhu7xNUX90txGdj08+JN7+dIPT7eoOboB6BAFDC +5AwiWVIQ7UNWhwD4FFKnHYuTjKJNRn8nxnGbJN7k2oaLDX5rIMHAnuFl2GqjpuiF +izoHCBy69Y9Vmhh1fuXsgWbRIXOhNUQLgD1bnF5vKheW0YMjiGZt5obicDIvUiLn +yOd/xCxgXS/Dr55FBcOEArf9LAhST4Ldo/DUhgkC +-----END CERTIFICATE----- + +# Issuer: CN=GTS Root R3 O=Google Trust Services LLC +# Subject: CN=GTS Root R3 O=Google Trust Services LLC +# Label: "GTS Root R3" +# Serial: 146587176140553309517047991083707763997 +# MD5 Fingerprint: 1a:79:5b:6b:04:52:9c:5d:c7:74:33:1b:25:9a:f9:25 +# SHA1 Fingerprint: 30:d4:24:6f:07:ff:db:91:89:8a:0b:e9:49:66:11:eb:8c:5e:46:e5 +# SHA256 Fingerprint: 15:d5:b8:77:46:19:ea:7d:54:ce:1c:a6:d0:b0:c4:03:e0:37:a9:17:f1:31:e8:a0:4e:1e:6b:7a:71:ba:bc:e5 +-----BEGIN CERTIFICATE----- +MIICDDCCAZGgAwIBAgIQbkepx2ypcyRAiQ8DVd2NHTAKBggqhkjOPQQDAzBHMQsw +CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEU +MBIGA1UEAxMLR1RTIFJvb3QgUjMwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAw +MDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZp +Y2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjMwdjAQBgcqhkjOPQIBBgUrgQQA +IgNiAAQfTzOHMymKoYTey8chWEGJ6ladK0uFxh1MJ7x/JlFyb+Kf1qPKzEUURout +736GjOyxfi//qXGdGIRFBEFVbivqJn+7kAHjSxm65FSWRQmx1WyRRK2EE46ajA2A +DDL24CejQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1Ud +DgQWBBTB8Sa6oC2uhYHP0/EqEr24Cmf9vDAKBggqhkjOPQQDAwNpADBmAjEAgFuk +fCPAlaUs3L6JbyO5o91lAFJekazInXJ0glMLfalAvWhgxeG4VDvBNhcl2MG9AjEA +njWSdIUlUfUk7GRSJFClH9voy8l27OyCbvWFGFPouOOaKaqW04MjyaR7YbPMAuhd +-----END CERTIFICATE----- + +# Issuer: CN=GTS Root R4 O=Google Trust Services LLC +# Subject: CN=GTS Root R4 O=Google Trust Services LLC +# Label: "GTS Root R4" +# Serial: 146587176229350439916519468929765261721 +# MD5 Fingerprint: 5d:b6:6a:c4:60:17:24:6a:1a:99:a8:4b:ee:5e:b4:26 +# SHA1 Fingerprint: 2a:1d:60:27:d9:4a:b1:0a:1c:4d:91:5c:cd:33:a0:cb:3e:2d:54:cb +# SHA256 Fingerprint: 71:cc:a5:39:1f:9e:79:4b:04:80:25:30:b3:63:e1:21:da:8a:30:43:bb:26:66:2f:ea:4d:ca:7f:c9:51:a4:bd +-----BEGIN CERTIFICATE----- +MIICCjCCAZGgAwIBAgIQbkepyIuUtui7OyrYorLBmTAKBggqhkjOPQQDAzBHMQsw +CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEU +MBIGA1UEAxMLR1RTIFJvb3QgUjQwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAw +MDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZp +Y2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjQwdjAQBgcqhkjOPQIBBgUrgQQA +IgNiAATzdHOnaItgrkO4NcWBMHtLSZ37wWHO5t5GvWvVYRg1rkDdc/eJkTBa6zzu +hXyiQHY7qca4R9gq55KRanPpsXI5nymfopjTX15YhmUPoYRlBtHci8nHc8iMai/l +xKvRHYqjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1Ud +DgQWBBSATNbrdP9JNqPV2Py1PsVq8JQdjDAKBggqhkjOPQQDAwNnADBkAjBqUFJ0 +CMRw3J5QdCHojXohw0+WbhXRIjVhLfoIN+4Zba3bssx9BzT1YBkstTTZbyACMANx +sbqjYAuG7ZoIapVon+Kz4ZNkfF6Tpt95LY2F45TPI11xzPKwTdb+mciUqXWi4w== +-----END CERTIFICATE----- + +# Issuer: CN=UCA Global G2 Root O=UniTrust +# Subject: CN=UCA Global G2 Root O=UniTrust +# Label: "UCA Global G2 Root" +# Serial: 124779693093741543919145257850076631279 +# MD5 Fingerprint: 80:fe:f0:c4:4a:f0:5c:62:32:9f:1c:ba:78:a9:50:f8 +# SHA1 Fingerprint: 28:f9:78:16:19:7a:ff:18:25:18:aa:44:fe:c1:a0:ce:5c:b6:4c:8a +# SHA256 Fingerprint: 9b:ea:11:c9:76:fe:01:47:64:c1:be:56:a6:f9:14:b5:a5:60:31:7a:bd:99:88:39:33:82:e5:16:1a:a0:49:3c +-----BEGIN CERTIFICATE----- +MIIFRjCCAy6gAwIBAgIQXd+x2lqj7V2+WmUgZQOQ7zANBgkqhkiG9w0BAQsFADA9 +MQswCQYDVQQGEwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxGzAZBgNVBAMMElVDQSBH +bG9iYWwgRzIgUm9vdDAeFw0xNjAzMTEwMDAwMDBaFw00MDEyMzEwMDAwMDBaMD0x +CzAJBgNVBAYTAkNOMREwDwYDVQQKDAhVbmlUcnVzdDEbMBkGA1UEAwwSVUNBIEds +b2JhbCBHMiBSb290MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxeYr +b3zvJgUno4Ek2m/LAfmZmqkywiKHYUGRO8vDaBsGxUypK8FnFyIdK+35KYmToni9 +kmugow2ifsqTs6bRjDXVdfkX9s9FxeV67HeToI8jrg4aA3++1NDtLnurRiNb/yzm +VHqUwCoV8MmNsHo7JOHXaOIxPAYzRrZUEaalLyJUKlgNAQLx+hVRZ2zA+te2G3/R +VogvGjqNO7uCEeBHANBSh6v7hn4PJGtAnTRnvI3HLYZveT6OqTwXS3+wmeOwcWDc +C/Vkw85DvG1xudLeJ1uK6NjGruFZfc8oLTW4lVYa8bJYS7cSN8h8s+1LgOGN+jIj +tm+3SJUIsUROhYw6AlQgL9+/V087OpAh18EmNVQg7Mc/R+zvWr9LesGtOxdQXGLY +D0tK3Cv6brxzks3sx1DoQZbXqX5t2Okdj4q1uViSukqSKwxW/YDrCPBeKW4bHAyv +j5OJrdu9o54hyokZ7N+1wxrrFv54NkzWbtA+FxyQF2smuvt6L78RHBgOLXMDj6Dl +NaBa4kx1HXHhOThTeEDMg5PXCp6dW4+K5OXgSORIskfNTip1KnvyIvbJvgmRlld6 +iIis7nCs+dwp4wwcOxJORNanTrAmyPPZGpeRaOrvjUYG0lZFWJo8DA+DuAUlwznP +O6Q0ibd5Ei9Hxeepl2n8pndntd978XplFeRhVmUCAwEAAaNCMEAwDgYDVR0PAQH/ +BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFIHEjMz15DD/pQwIX4wV +ZyF0Ad/fMA0GCSqGSIb3DQEBCwUAA4ICAQATZSL1jiutROTL/7lo5sOASD0Ee/oj +L3rtNtqyzm325p7lX1iPyzcyochltq44PTUbPrw7tgTQvPlJ9Zv3hcU2tsu8+Mg5 +1eRfB70VVJd0ysrtT7q6ZHafgbiERUlMjW+i67HM0cOU2kTC5uLqGOiiHycFutfl +1qnN3e92mI0ADs0b+gO3joBYDic/UvuUospeZcnWhNq5NXHzJsBPd+aBJ9J3O5oU +b3n09tDh05S60FdRvScFDcH9yBIw7m+NESsIndTUv4BFFJqIRNow6rSn4+7vW4LV +PtateJLbXDzz2K36uGt/xDYotgIVilQsnLAXc47QN6MUPJiVAAwpBVueSUmxX8fj +y88nZY41F7dXyDDZQVu5FLbowg+UMaeUmMxq67XhJ/UQqAHojhJi6IjMtX9Gl8Cb +EGY4GjZGXyJoPd/JxhMnq1MGrKI8hgZlb7F+sSlEmqO6SWkoaY/X5V+tBIZkbxqg +DMUIYs6Ao9Dz7GjevjPHF1t/gMRMTLGmhIrDO7gJzRSBuhjjVFc2/tsvfEehOjPI ++Vg7RE+xygKJBJYoaMVLuCaJu9YzL1DV/pqJuhgyklTGW+Cd+V7lDSKb9triyCGy +YiGqhkCyLmTTX8jjfhFnRR8F/uOi77Oos/N9j/gMHyIfLXC0uAE0djAA5SN4p1bX +UB+K+wb1whnw0A== +-----END CERTIFICATE----- + +# Issuer: CN=UCA Extended Validation Root O=UniTrust +# Subject: CN=UCA Extended Validation Root O=UniTrust +# Label: "UCA Extended Validation Root" +# Serial: 106100277556486529736699587978573607008 +# MD5 Fingerprint: a1:f3:5f:43:c6:34:9b:da:bf:8c:7e:05:53:ad:96:e2 +# SHA1 Fingerprint: a3:a1:b0:6f:24:61:23:4a:e3:36:a5:c2:37:fc:a6:ff:dd:f0:d7:3a +# SHA256 Fingerprint: d4:3a:f9:b3:54:73:75:5c:96:84:fc:06:d7:d8:cb:70:ee:5c:28:e7:73:fb:29:4e:b4:1e:e7:17:22:92:4d:24 +-----BEGIN CERTIFICATE----- +MIIFWjCCA0KgAwIBAgIQT9Irj/VkyDOeTzRYZiNwYDANBgkqhkiG9w0BAQsFADBH +MQswCQYDVQQGEwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxJTAjBgNVBAMMHFVDQSBF +eHRlbmRlZCBWYWxpZGF0aW9uIFJvb3QwHhcNMTUwMzEzMDAwMDAwWhcNMzgxMjMx +MDAwMDAwWjBHMQswCQYDVQQGEwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxJTAjBgNV +BAMMHFVDQSBFeHRlbmRlZCBWYWxpZGF0aW9uIFJvb3QwggIiMA0GCSqGSIb3DQEB +AQUAA4ICDwAwggIKAoICAQCpCQcoEwKwmeBkqh5DFnpzsZGgdT6o+uM4AHrsiWog +D4vFsJszA1qGxliG1cGFu0/GnEBNyr7uaZa4rYEwmnySBesFK5pI0Lh2PpbIILvS +sPGP2KxFRv+qZ2C0d35qHzwaUnoEPQc8hQ2E0B92CvdqFN9y4zR8V05WAT558aop +O2z6+I9tTcg1367r3CTueUWnhbYFiN6IXSV8l2RnCdm/WhUFhvMJHuxYMjMR83dk +sHYf5BA1FxvyDrFspCqjc/wJHx4yGVMR59mzLC52LqGj3n5qiAno8geK+LLNEOfi +c0CTuwjRP+H8C5SzJe98ptfRr5//lpr1kXuYC3fUfugH0mK1lTnj8/FtDw5lhIpj +VMWAtuCeS31HJqcBCF3RiJ7XwzJE+oJKCmhUfzhTA8ykADNkUVkLo4KRel7sFsLz +KuZi2irbWWIQJUoqgQtHB0MGcIfS+pMRKXpITeuUx3BNr2fVUbGAIAEBtHoIppB/ +TuDvB0GHr2qlXov7z1CymlSvw4m6WC31MJixNnI5fkkE/SmnTHnkBVfblLkWU41G +sx2VYVdWf6/wFlthWG82UBEL2KwrlRYaDh8IzTY0ZRBiZtWAXxQgXy0MoHgKaNYs +1+lvK9JKBZP8nm9rZ/+I8U6laUpSNwXqxhaN0sSZ0YIrO7o1dfdRUVjzyAfd5LQD +fwIDAQABo0IwQDAdBgNVHQ4EFgQU2XQ65DA9DfcS3H5aBZ8eNJr34RQwDwYDVR0T +AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggIBADaN +l8xCFWQpN5smLNb7rhVpLGsaGvdftvkHTFnq88nIua7Mui563MD1sC3AO6+fcAUR +ap8lTwEpcOPlDOHqWnzcSbvBHiqB9RZLcpHIojG5qtr8nR/zXUACE/xOHAbKsxSQ +VBcZEhrxH9cMaVr2cXj0lH2RC47skFSOvG+hTKv8dGT9cZr4QQehzZHkPJrgmzI5 +c6sq1WnIeJEmMX3ixzDx/BR4dxIOE/TdFpS/S2d7cFOFyrC78zhNLJA5wA3CXWvp +4uXViI3WLL+rG761KIcSF3Ru/H38j9CHJrAb+7lsq+KePRXBOy5nAliRn+/4Qh8s +t2j1da3Ptfb/EX3C8CSlrdP6oDyp+l3cpaDvRKS+1ujl5BOWF3sGPjLtx7dCvHaj +2GU4Kzg1USEODm8uNBNA4StnDG1KQTAYI1oyVZnJF+A83vbsea0rWBmirSwiGpWO +vpaQXUJXxPkUAzUrHC1RVwinOt4/5Mi0A3PCwSaAuwtCH60NryZy2sy+s6ODWA2C +xR9GUeOcGMyNm43sSet1UNWMKFnKdDTajAshqx7qG+XH/RU+wBeq+yNuJkbL+vmx +cmtpzyKEC2IPrNkZAJSidjzULZrtBJ4tBmIQN1IchXIbJ+XMxjHsN+xjWZsLHXbM +fjKaiJUINlK73nZfdklJrX+9ZSCyycErdhh2n1ax +-----END CERTIFICATE----- + +# Issuer: CN=Certigna Root CA O=Dhimyotis OU=0002 48146308100036 +# Subject: CN=Certigna Root CA O=Dhimyotis OU=0002 48146308100036 +# Label: "Certigna Root CA" +# Serial: 269714418870597844693661054334862075617 +# MD5 Fingerprint: 0e:5c:30:62:27:eb:5b:bc:d7:ae:62:ba:e9:d5:df:77 +# SHA1 Fingerprint: 2d:0d:52:14:ff:9e:ad:99:24:01:74:20:47:6e:6c:85:27:27:f5:43 +# SHA256 Fingerprint: d4:8d:3d:23:ee:db:50:a4:59:e5:51:97:60:1c:27:77:4b:9d:7b:18:c9:4d:5a:05:95:11:a1:02:50:b9:31:68 +-----BEGIN CERTIFICATE----- +MIIGWzCCBEOgAwIBAgIRAMrpG4nxVQMNo+ZBbcTjpuEwDQYJKoZIhvcNAQELBQAw +WjELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczEcMBoGA1UECwwTMDAw +MiA0ODE0NjMwODEwMDAzNjEZMBcGA1UEAwwQQ2VydGlnbmEgUm9vdCBDQTAeFw0x +MzEwMDEwODMyMjdaFw0zMzEwMDEwODMyMjdaMFoxCzAJBgNVBAYTAkZSMRIwEAYD +VQQKDAlEaGlteW90aXMxHDAaBgNVBAsMEzAwMDIgNDgxNDYzMDgxMDAwMzYxGTAX +BgNVBAMMEENlcnRpZ25hIFJvb3QgQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +ggIKAoICAQDNGDllGlmx6mQWDoyUJJV8g9PFOSbcDO8WV43X2KyjQn+Cyu3NW9sO +ty3tRQgXstmzy9YXUnIo245Onoq2C/mehJpNdt4iKVzSs9IGPjA5qXSjklYcoW9M +CiBtnyN6tMbaLOQdLNyzKNAT8kxOAkmhVECe5uUFoC2EyP+YbNDrihqECB63aCPu +I9Vwzm1RaRDuoXrC0SIxwoKF0vJVdlB8JXrJhFwLrN1CTivngqIkicuQstDuI7pm +TLtipPlTWmR7fJj6o0ieD5Wupxj0auwuA0Wv8HT4Ks16XdG+RCYyKfHx9WzMfgIh +C59vpD++nVPiz32pLHxYGpfhPTc3GGYo0kDFUYqMwy3OU4gkWGQwFsWq4NYKpkDf +ePb1BHxpE4S80dGnBs8B92jAqFe7OmGtBIyT46388NtEbVncSVmurJqZNjBBe3Yz +IoejwpKGbvlw7q6Hh5UbxHq9MfPU0uWZ/75I7HX1eBYdpnDBfzwboZL7z8g81sWT +Co/1VTp2lc5ZmIoJlXcymoO6LAQ6l73UL77XbJuiyn1tJslV1c/DeVIICZkHJC1k +JWumIWmbat10TWuXekG9qxf5kBdIjzb5LdXF2+6qhUVB+s06RbFo5jZMm5BX7CO5 +hwjCxAnxl4YqKE3idMDaxIzb3+KhF1nOJFl0Mdp//TBt2dzhauH8XwIDAQABo4IB +GjCCARYwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE +FBiHVuBud+4kNTxOc5of1uHieX4rMB8GA1UdIwQYMBaAFBiHVuBud+4kNTxOc5of +1uHieX4rMEQGA1UdIAQ9MDswOQYEVR0gADAxMC8GCCsGAQUFBwIBFiNodHRwczov +L3d3d3cuY2VydGlnbmEuZnIvYXV0b3JpdGVzLzBtBgNVHR8EZjBkMC+gLaArhilo +dHRwOi8vY3JsLmNlcnRpZ25hLmZyL2NlcnRpZ25hcm9vdGNhLmNybDAxoC+gLYYr +aHR0cDovL2NybC5kaGlteW90aXMuY29tL2NlcnRpZ25hcm9vdGNhLmNybDANBgkq +hkiG9w0BAQsFAAOCAgEAlLieT/DjlQgi581oQfccVdV8AOItOoldaDgvUSILSo3L +6btdPrtcPbEo/uRTVRPPoZAbAh1fZkYJMyjhDSSXcNMQH+pkV5a7XdrnxIxPTGRG +HVyH41neQtGbqH6mid2PHMkwgu07nM3A6RngatgCdTer9zQoKJHyBApPNeNgJgH6 +0BGM+RFq7q89w1DTj18zeTyGqHNFkIwgtnJzFyO+B2XleJINugHA64wcZr+shncB +lA2c5uk5jR+mUYyZDDl34bSb+hxnV29qao6pK0xXeXpXIs/NX2NGjVxZOob4Mkdi +o2cNGJHc+6Zr9UhhcyNZjgKnvETq9Emd8VRY+WCv2hikLyhF3HqgiIZd8zvn/yk1 +gPxkQ5Tm4xxvvq0OKmOZK8l+hfZx6AYDlf7ej0gcWtSS6Cvu5zHbugRqh5jnxV/v +faci9wHYTfmJ0A6aBVmknpjZbyvKcL5kwlWj9Omvw5Ip3IgWJJk8jSaYtlu3zM63 +Nwf9JtmYhST/WSMDmu2dnajkXjjO11INb9I/bbEFa0nOipFGc/T2L/Coc3cOZayh +jWZSaX5LaAzHHjcng6WMxwLkFM1JAbBzs/3GkDpv0mztO+7skb6iQ12LAEpmJURw +3kAP+HwV96LOPNdeE4yBFxgX0b3xdxA61GU5wSesVywlVP+i2k+KYTlerj1KjL0= +-----END CERTIFICATE----- + +# Issuer: CN=emSign Root CA - G1 O=eMudhra Technologies Limited OU=emSign PKI +# Subject: CN=emSign Root CA - G1 O=eMudhra Technologies Limited OU=emSign PKI +# Label: "emSign Root CA - G1" +# Serial: 235931866688319308814040 +# MD5 Fingerprint: 9c:42:84:57:dd:cb:0b:a7:2e:95:ad:b6:f3:da:bc:ac +# SHA1 Fingerprint: 8a:c7:ad:8f:73:ac:4e:c1:b5:75:4d:a5:40:f4:fc:cf:7c:b5:8e:8c +# SHA256 Fingerprint: 40:f6:af:03:46:a9:9a:a1:cd:1d:55:5a:4e:9c:ce:62:c7:f9:63:46:03:ee:40:66:15:83:3d:c8:c8:d0:03:67 +-----BEGIN CERTIFICATE----- +MIIDlDCCAnygAwIBAgIKMfXkYgxsWO3W2DANBgkqhkiG9w0BAQsFADBnMQswCQYD +VQQGEwJJTjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBU +ZWNobm9sb2dpZXMgTGltaXRlZDEcMBoGA1UEAxMTZW1TaWduIFJvb3QgQ0EgLSBH +MTAeFw0xODAyMTgxODMwMDBaFw00MzAyMTgxODMwMDBaMGcxCzAJBgNVBAYTAklO +MRMwEQYDVQQLEwplbVNpZ24gUEtJMSUwIwYDVQQKExxlTXVkaHJhIFRlY2hub2xv +Z2llcyBMaW1pdGVkMRwwGgYDVQQDExNlbVNpZ24gUm9vdCBDQSAtIEcxMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk0u76WaK7p1b1TST0Bsew+eeuGQz +f2N4aLTNLnF115sgxk0pvLZoYIr3IZpWNVrzdr3YzZr/k1ZLpVkGoZM0Kd0WNHVO +8oG0x5ZOrRkVUkr+PHB1cM2vK6sVmjM8qrOLqs1D/fXqcP/tzxE7lM5OMhbTI0Aq +d7OvPAEsbO2ZLIvZTmmYsvePQbAyeGHWDV/D+qJAkh1cF+ZwPjXnorfCYuKrpDhM +tTk1b+oDafo6VGiFbdbyL0NVHpENDtjVaqSW0RM8LHhQ6DqS0hdW5TUaQBw+jSzt +Od9C4INBdN+jzcKGYEho42kLVACL5HZpIQ15TjQIXhTCzLG3rdd8cIrHhQIDAQAB +o0IwQDAdBgNVHQ4EFgQU++8Nhp6w492pufEhF38+/PB3KxowDgYDVR0PAQH/BAQD +AgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAFn/8oz1h31x +PaOfG1vR2vjTnGs2vZupYeveFix0PZ7mddrXuqe8QhfnPZHr5X3dPpzxz5KsbEjM +wiI/aTvFthUvozXGaCocV685743QNcMYDHsAVhzNixl03r4PEuDQqqE/AjSxcM6d +GNYIAwlG7mDgfrbESQRRfXBgvKqy/3lyeqYdPV8q+Mri/Tm3R7nrft8EI6/6nAYH +6ftjk4BAtcZsCjEozgyfz7MjNYBBjWzEN3uBL4ChQEKF6dk4jeihU80Bv2noWgby +RQuQ+q7hv53yrlc8pa6yVvSLZUDp/TGBLPQ5Cdjua6e0ph0VpZj3AYHYhX3zUVxx +iN66zB+Afko= +-----END CERTIFICATE----- + +# Issuer: CN=emSign ECC Root CA - G3 O=eMudhra Technologies Limited OU=emSign PKI +# Subject: CN=emSign ECC Root CA - G3 O=eMudhra Technologies Limited OU=emSign PKI +# Label: "emSign ECC Root CA - G3" +# Serial: 287880440101571086945156 +# MD5 Fingerprint: ce:0b:72:d1:9f:88:8e:d0:50:03:e8:e3:b8:8b:67:40 +# SHA1 Fingerprint: 30:43:fa:4f:f2:57:dc:a0:c3:80:ee:2e:58:ea:78:b2:3f:e6:bb:c1 +# SHA256 Fingerprint: 86:a1:ec:ba:08:9c:4a:8d:3b:be:27:34:c6:12:ba:34:1d:81:3e:04:3c:f9:e8:a8:62:cd:5c:57:a3:6b:be:6b +-----BEGIN CERTIFICATE----- +MIICTjCCAdOgAwIBAgIKPPYHqWhwDtqLhDAKBggqhkjOPQQDAzBrMQswCQYDVQQG +EwJJTjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNo +bm9sb2dpZXMgTGltaXRlZDEgMB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0g +RzMwHhcNMTgwMjE4MTgzMDAwWhcNNDMwMjE4MTgzMDAwWjBrMQswCQYDVQQGEwJJ +TjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNobm9s +b2dpZXMgTGltaXRlZDEgMB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0gRzMw +djAQBgcqhkjOPQIBBgUrgQQAIgNiAAQjpQy4LRL1KPOxst3iAhKAnjlfSU2fySU0 +WXTsuwYc58Byr+iuL+FBVIcUqEqy6HyC5ltqtdyzdc6LBtCGI79G1Y4PPwT01xyS +fvalY8L1X44uT6EYGQIrMgqCZH0Wk9GjQjBAMB0GA1UdDgQWBBR8XQKEE9TMipuB +zhccLikenEhjQjAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggq +hkjOPQQDAwNpADBmAjEAvvNhzwIQHWSVB7gYboiFBS+DCBeQyh+KTOgNG3qxrdWB +CUfvO6wIBHxcmbHtRwfSAjEAnbpV/KlK6O3t5nYBQnvI+GDZjVGLVTv7jHvrZQnD ++JbNR6iC8hZVdyR+EhCVBCyj +-----END CERTIFICATE----- + +# Issuer: CN=emSign Root CA - C1 O=eMudhra Inc OU=emSign PKI +# Subject: CN=emSign Root CA - C1 O=eMudhra Inc OU=emSign PKI +# Label: "emSign Root CA - C1" +# Serial: 825510296613316004955058 +# MD5 Fingerprint: d8:e3:5d:01:21:fa:78:5a:b0:df:ba:d2:ee:2a:5f:68 +# SHA1 Fingerprint: e7:2e:f1:df:fc:b2:09:28:cf:5d:d4:d5:67:37:b1:51:cb:86:4f:01 +# SHA256 Fingerprint: 12:56:09:aa:30:1d:a0:a2:49:b9:7a:82:39:cb:6a:34:21:6f:44:dc:ac:9f:39:54:b1:42:92:f2:e8:c8:60:8f +-----BEGIN CERTIFICATE----- +MIIDczCCAlugAwIBAgILAK7PALrEzzL4Q7IwDQYJKoZIhvcNAQELBQAwVjELMAkG +A1UEBhMCVVMxEzARBgNVBAsTCmVtU2lnbiBQS0kxFDASBgNVBAoTC2VNdWRocmEg +SW5jMRwwGgYDVQQDExNlbVNpZ24gUm9vdCBDQSAtIEMxMB4XDTE4MDIxODE4MzAw +MFoXDTQzMDIxODE4MzAwMFowVjELMAkGA1UEBhMCVVMxEzARBgNVBAsTCmVtU2ln +biBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMRwwGgYDVQQDExNlbVNpZ24gUm9v +dCBDQSAtIEMxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz+upufGZ +BczYKCFK83M0UYRWEPWgTywS4/oTmifQz/l5GnRfHXk5/Fv4cI7gklL35CX5VIPZ +HdPIWoU/Xse2B+4+wM6ar6xWQio5JXDWv7V7Nq2s9nPczdcdioOl+yuQFTdrHCZH +3DspVpNqs8FqOp099cGXOFgFixwR4+S0uF2FHYP+eF8LRWgYSKVGczQ7/g/IdrvH +GPMF0Ybzhe3nudkyrVWIzqa2kbBPrH4VI5b2P/AgNBbeCsbEBEV5f6f9vtKppa+c +xSMq9zwhbL2vj07FOrLzNBL834AaSaTUqZX3noleoomslMuoaJuvimUnzYnu3Yy1 +aylwQ6BpC+S5DwIDAQABo0IwQDAdBgNVHQ4EFgQU/qHgcB4qAzlSWkK+XJGFehiq +TbUwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL +BQADggEBAMJKVvoVIXsoounlHfv4LcQ5lkFMOycsxGwYFYDGrK9HWS8mC+M2sO87 +/kOXSTKZEhVb3xEp/6tT+LvBeA+snFOvV71ojD1pM/CjoCNjO2RnIkSt1XHLVip4 +kqNPEjE2NuLe/gDEo2APJ62gsIq1NnpSob0n9CAnYuhNlCQT5AoE6TyrLshDCUrG +YQTlSTR+08TI9Q/Aqum6VF7zYytPT1DU/rl7mYw9wC68AivTxEDkigcxHpvOJpkT ++xHqmiIMERnHXhuBUDDIlhJu58tBf5E7oke3VIAb3ADMmpDqw8NQBmIMMMAVSKeo +WXzhriKi4gp6D/piq1JM4fHfyr6DDUI= +-----END CERTIFICATE----- + +# Issuer: CN=emSign ECC Root CA - C3 O=eMudhra Inc OU=emSign PKI +# Subject: CN=emSign ECC Root CA - C3 O=eMudhra Inc OU=emSign PKI +# Label: "emSign ECC Root CA - C3" +# Serial: 582948710642506000014504 +# MD5 Fingerprint: 3e:53:b3:a3:81:ee:d7:10:f8:d3:b0:1d:17:92:f5:d5 +# SHA1 Fingerprint: b6:af:43:c2:9b:81:53:7d:f6:ef:6b:c3:1f:1f:60:15:0c:ee:48:66 +# SHA256 Fingerprint: bc:4d:80:9b:15:18:9d:78:db:3e:1d:8c:f4:f9:72:6a:79:5d:a1:64:3c:a5:f1:35:8e:1d:db:0e:dc:0d:7e:b3 +-----BEGIN CERTIFICATE----- +MIICKzCCAbGgAwIBAgIKe3G2gla4EnycqDAKBggqhkjOPQQDAzBaMQswCQYDVQQG +EwJVUzETMBEGA1UECxMKZW1TaWduIFBLSTEUMBIGA1UEChMLZU11ZGhyYSBJbmMx +IDAeBgNVBAMTF2VtU2lnbiBFQ0MgUm9vdCBDQSAtIEMzMB4XDTE4MDIxODE4MzAw +MFoXDTQzMDIxODE4MzAwMFowWjELMAkGA1UEBhMCVVMxEzARBgNVBAsTCmVtU2ln +biBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMSAwHgYDVQQDExdlbVNpZ24gRUND +IFJvb3QgQ0EgLSBDMzB2MBAGByqGSM49AgEGBSuBBAAiA2IABP2lYa57JhAd6bci +MK4G9IGzsUJxlTm801Ljr6/58pc1kjZGDoeVjbk5Wum739D+yAdBPLtVb4Ojavti +sIGJAnB9SMVK4+kiVCJNk7tCDK93nCOmfddhEc5lx/h//vXyqaNCMEAwHQYDVR0O +BBYEFPtaSNCAIEDyqOkAB2kZd6fmw/TPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB +Af8EBTADAQH/MAoGCCqGSM49BAMDA2gAMGUCMQC02C8Cif22TGK6Q04ThHK1rt0c +3ta13FaPWEBaLd4gTCKDypOofu4SQMfWh0/434UCMBwUZOR8loMRnLDRWmFLpg9J +0wD8ofzkpf9/rdcw0Md3f76BB1UwUCAU9Vc4CqgxUQ== +-----END CERTIFICATE----- + +# Issuer: CN=Hongkong Post Root CA 3 O=Hongkong Post +# Subject: CN=Hongkong Post Root CA 3 O=Hongkong Post +# Label: "Hongkong Post Root CA 3" +# Serial: 46170865288971385588281144162979347873371282084 +# MD5 Fingerprint: 11:fc:9f:bd:73:30:02:8a:fd:3f:f3:58:b9:cb:20:f0 +# SHA1 Fingerprint: 58:a2:d0:ec:20:52:81:5b:c1:f3:f8:64:02:24:4e:c2:8e:02:4b:02 +# SHA256 Fingerprint: 5a:2f:c0:3f:0c:83:b0:90:bb:fa:40:60:4b:09:88:44:6c:76:36:18:3d:f9:84:6e:17:10:1a:44:7f:b8:ef:d6 +-----BEGIN CERTIFICATE----- +MIIFzzCCA7egAwIBAgIUCBZfikyl7ADJk0DfxMauI7gcWqQwDQYJKoZIhvcNAQEL +BQAwbzELMAkGA1UEBhMCSEsxEjAQBgNVBAgTCUhvbmcgS29uZzESMBAGA1UEBxMJ +SG9uZyBLb25nMRYwFAYDVQQKEw1Ib25na29uZyBQb3N0MSAwHgYDVQQDExdIb25n +a29uZyBQb3N0IFJvb3QgQ0EgMzAeFw0xNzA2MDMwMjI5NDZaFw00MjA2MDMwMjI5 +NDZaMG8xCzAJBgNVBAYTAkhLMRIwEAYDVQQIEwlIb25nIEtvbmcxEjAQBgNVBAcT +CUhvbmcgS29uZzEWMBQGA1UEChMNSG9uZ2tvbmcgUG9zdDEgMB4GA1UEAxMXSG9u +Z2tvbmcgUG9zdCBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK +AoICAQCziNfqzg8gTr7m1gNt7ln8wlffKWihgw4+aMdoWJwcYEuJQwy51BWy7sFO +dem1p+/l6TWZ5Mwc50tfjTMwIDNT2aa71T4Tjukfh0mtUC1Qyhi+AViiE3CWu4mI +VoBc+L0sPOFMV4i707mV78vH9toxdCim5lSJ9UExyuUmGs2C4HDaOym71QP1mbpV +9WTRYA6ziUm4ii8F0oRFKHyPaFASePwLtVPLwpgchKOesL4jpNrcyCse2m5FHomY +2vkALgbpDDtw1VAliJnLzXNg99X/NWfFobxeq81KuEXryGgeDQ0URhLj0mRiikKY +vLTGCAj4/ahMZJx2Ab0vqWwzD9g/KLg8aQFChn5pwckGyuV6RmXpwtZQQS4/t+Tt +bNe/JgERohYpSms0BpDsE9K2+2p20jzt8NYt3eEV7KObLyzJPivkaTv/ciWxNoZb +x39ri1UbSsUgYT2uy1DhCDq+sI9jQVMwCFk8mB13umOResoQUGC/8Ne8lYePl8X+ +l2oBlKN8W4UdKjk60FSh0Tlxnf0h+bV78OLgAo9uliQlLKAeLKjEiafv7ZkGL7YK +TE/bosw3Gq9HhS2KX8Q0NEwA/RiTZxPRN+ZItIsGxVd7GYYKecsAyVKvQv83j+Gj +Hno9UKtjBucVtT+2RTeUN7F+8kjDf8V1/peNRY8apxpyKBpADwIDAQABo2MwYTAP +BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBQXnc0e +i9Y5K3DTXNSguB+wAPzFYTAdBgNVHQ4EFgQUF53NHovWOStw01zUoLgfsAD8xWEw +DQYJKoZIhvcNAQELBQADggIBAFbVe27mIgHSQpsY1Q7XZiNc4/6gx5LS6ZStS6LG +7BJ8dNVI0lkUmcDrudHr9EgwW62nV3OZqdPlt9EuWSRY3GguLmLYauRwCy0gUCCk +MpXRAJi70/33MvJJrsZ64Ee+bs7Lo3I6LWldy8joRTnU+kLBEUx3XZL7av9YROXr +gZ6voJmtvqkBZss4HTzfQx/0TW60uhdG/H39h4F5ag0zD/ov+BS5gLNdTaqX4fnk +GMX41TiMJjz98iji7lpJiCzfeT2OnpA8vUFKOt1b9pq0zj8lMH8yfaIDlNDceqFS +3m6TjRgm/VWsvY+b0s+v54Ysyx8Jb6NvqYTUc79NoXQbTiNg8swOqn+knEwlqLJm +Ozj/2ZQw9nKEvmhVEA/GcywWaZMH/rFF7buiVWqw2rVKAiUnhde3t4ZEFolsgCs+ +l6mc1X5VTMbeRRAc6uk7nwNT7u56AQIWeNTowr5GdogTPyK7SBIdUgC0An4hGh6c +JfTzPV4e0hz5sy229zdcxsshTrD3mUcYhcErulWuBurQB7Lcq9CClnXO0lD+mefP +L5/ndtFhKvshuzHQqp9HpLIiyhY6UFfEW0NnxWViA0kB60PZ2Pierc+xYw5F9KBa +LJstxabArahH9CdMOA0uG0k7UvToiIMrVCjU8jVStDKDYmlkDJGcn5fqdBb9HxEG +mpv0 +-----END CERTIFICATE----- diff --git a/env/lib/python3.7/site-packages/pip/_vendor/certifi/core.py b/env/lib/python3.7/site-packages/pip/_vendor/certifi/core.py index eab9d1d..7271acf 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/certifi/core.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/certifi/core.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- """ @@ -8,30 +7,9 @@ certifi.py This module returns the installation location of cacert.pem. """ import os -import warnings - - -class DeprecatedBundleWarning(DeprecationWarning): - """ - The weak security bundle is being deprecated. Please bother your service - provider to get them to stop using cross-signed roots. - """ def where(): f = os.path.dirname(__file__) return os.path.join(f, 'cacert.pem') - - -def old_where(): - warnings.warn( - "The weak security bundle has been removed. certifi.old_where() is now an alias " - "of certifi.where(). Please update your code to use certifi.where() instead. " - "certifi.old_where() will be removed in 2018.", - DeprecatedBundleWarning - ) - return where() - -if __name__ == '__main__': - print(where()) diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/__init__.cpython-37.pyc index d388777..3a53db8 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/big5freq.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/big5freq.cpython-37.pyc index d0d79d4..2a2833b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/big5freq.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/big5freq.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/big5prober.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/big5prober.cpython-37.pyc index 4717a20..38b09c8 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/big5prober.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/big5prober.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/chardistribution.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/chardistribution.cpython-37.pyc index 33276bd..714ad06 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/chardistribution.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/chardistribution.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/charsetgroupprober.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/charsetgroupprober.cpython-37.pyc index 1b7f8c2..18a80c3 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/charsetgroupprober.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/charsetgroupprober.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/charsetprober.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/charsetprober.cpython-37.pyc index fc1a8d7..5da55ee 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/charsetprober.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/charsetprober.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/codingstatemachine.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/codingstatemachine.cpython-37.pyc index a797655..49fb9a4 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/codingstatemachine.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/codingstatemachine.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/compat.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/compat.cpython-37.pyc index 7a4927e..b613077 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/compat.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/compat.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/cp949prober.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/cp949prober.cpython-37.pyc index b55bc7b..be344fd 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/cp949prober.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/cp949prober.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/enums.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/enums.cpython-37.pyc index 525eaea..6a79722 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/enums.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/enums.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/escprober.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/escprober.cpython-37.pyc index 6d12de9..7b02274 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/escprober.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/escprober.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/escsm.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/escsm.cpython-37.pyc index 418861b..88d81de 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/escsm.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/escsm.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/eucjpprober.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/eucjpprober.cpython-37.pyc index cfb6ac4..8aa6796 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/eucjpprober.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/eucjpprober.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/euckrfreq.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/euckrfreq.cpython-37.pyc index 3904c88..1b335b6 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/euckrfreq.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/euckrfreq.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/euckrprober.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/euckrprober.cpython-37.pyc index 862a887..37edc2a 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/euckrprober.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/euckrprober.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/euctwfreq.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/euctwfreq.cpython-37.pyc index d114d71..57428f5 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/euctwfreq.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/euctwfreq.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/euctwprober.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/euctwprober.cpython-37.pyc index bb391b1..b2dd35d 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/euctwprober.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/euctwprober.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/gb2312freq.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/gb2312freq.cpython-37.pyc index 767804e..fe14c45 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/gb2312freq.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/gb2312freq.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/gb2312prober.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/gb2312prober.cpython-37.pyc index 687ed12..6cb426d 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/gb2312prober.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/gb2312prober.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/hebrewprober.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/hebrewprober.cpython-37.pyc index d8f7e93..e224f49 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/hebrewprober.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/hebrewprober.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/jisfreq.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/jisfreq.cpython-37.pyc index 8ad840b..8de8c08 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/jisfreq.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/jisfreq.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/jpcntx.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/jpcntx.cpython-37.pyc index 3060872..29d9e9a 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/jpcntx.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/jpcntx.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langbulgarianmodel.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langbulgarianmodel.cpython-37.pyc index 30acaf5..b28db55 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langbulgarianmodel.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langbulgarianmodel.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langcyrillicmodel.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langcyrillicmodel.cpython-37.pyc index 5a16309..8c7cb00 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langcyrillicmodel.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langcyrillicmodel.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langgreekmodel.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langgreekmodel.cpython-37.pyc index f3e2935..b2b64ed 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langgreekmodel.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langgreekmodel.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langhebrewmodel.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langhebrewmodel.cpython-37.pyc index d456a42..b5b88a7 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langhebrewmodel.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langhebrewmodel.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langhungarianmodel.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langhungarianmodel.cpython-37.pyc index f83acd4..019f1ed 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langhungarianmodel.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langhungarianmodel.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langthaimodel.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langthaimodel.cpython-37.pyc index 0f85f87..3bf4eb5 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langthaimodel.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langthaimodel.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langturkishmodel.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langturkishmodel.cpython-37.pyc index faee8f4..d48c91b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langturkishmodel.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/langturkishmodel.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/latin1prober.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/latin1prober.cpython-37.pyc index 0ff4af6..048ab24 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/latin1prober.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/latin1prober.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/mbcharsetprober.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/mbcharsetprober.cpython-37.pyc index c9f4a9c..6918e59 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/mbcharsetprober.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/mbcharsetprober.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/mbcsgroupprober.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/mbcsgroupprober.cpython-37.pyc index a2a8085..dae9f1c 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/mbcsgroupprober.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/mbcsgroupprober.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/mbcssm.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/mbcssm.cpython-37.pyc index d2cb60c..a2fb1b1 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/mbcssm.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/mbcssm.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/sbcharsetprober.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/sbcharsetprober.cpython-37.pyc index f2b15fb..84f1e31 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/sbcharsetprober.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/sbcharsetprober.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/sbcsgroupprober.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/sbcsgroupprober.cpython-37.pyc index 0b2e01d..f0e3d62 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/sbcsgroupprober.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/sbcsgroupprober.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/sjisprober.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/sjisprober.cpython-37.pyc index 588f498..f22f5f1 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/sjisprober.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/sjisprober.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/universaldetector.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/universaldetector.cpython-37.pyc index de87d51..eaf77dc 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/universaldetector.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/universaldetector.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/utf8prober.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/utf8prober.cpython-37.pyc index 07958fd..2930a59 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/utf8prober.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/utf8prober.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/version.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/version.cpython-37.pyc index a2c08d6..bca11d5 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/version.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/__pycache__/version.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/cli/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/cli/__pycache__/__init__.cpython-37.pyc index 3d8424a..eaaa543 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/cli/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/cli/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/chardet/cli/__pycache__/chardetect.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/chardet/cli/__pycache__/chardetect.cpython-37.pyc index c6a9f6e..c9d159b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/chardet/cli/__pycache__/chardetect.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/chardet/cli/__pycache__/chardetect.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/colorama/__init__.py b/env/lib/python3.7/site-packages/pip/_vendor/colorama/__init__.py index f4d9ce2..2a3bf47 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/colorama/__init__.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/colorama/__init__.py @@ -3,5 +3,4 @@ from .initialise import init, deinit, reinit, colorama_text from .ansi import Fore, Back, Style, Cursor from .ansitowin32 import AnsiToWin32 -__version__ = '0.3.9' - +__version__ = '0.4.1' diff --git a/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/__init__.cpython-37.pyc index 36b53e1..4b8a10e 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/ansi.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/ansi.cpython-37.pyc index 82d49ae..bfa446b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/ansi.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/ansi.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/ansitowin32.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/ansitowin32.cpython-37.pyc index 835ef58..4b73d6b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/ansitowin32.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/ansitowin32.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/initialise.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/initialise.cpython-37.pyc index 8d6c12e..84bfb15 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/initialise.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/initialise.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/win32.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/win32.cpython-37.pyc index b583af5..e42093f 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/win32.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/win32.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/winterm.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/winterm.cpython-37.pyc index aa14dc9..9be612b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/winterm.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/colorama/__pycache__/winterm.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/colorama/ansitowin32.py b/env/lib/python3.7/site-packages/pip/_vendor/colorama/ansitowin32.py index 1d6e605..359c92b 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/colorama/ansitowin32.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/colorama/ansitowin32.py @@ -13,14 +13,6 @@ if windll is not None: winterm = WinTerm() -def is_stream_closed(stream): - return not hasattr(stream, 'closed') or stream.closed - - -def is_a_tty(stream): - return hasattr(stream, 'isatty') and stream.isatty() - - class StreamWrapper(object): ''' Wraps a stream (such as stdout), acting as a transparent proxy for all @@ -36,9 +28,38 @@ class StreamWrapper(object): def __getattr__(self, name): return getattr(self.__wrapped, name) + def __enter__(self, *args, **kwargs): + # special method lookup bypasses __getattr__/__getattribute__, see + # https://stackoverflow.com/questions/12632894/why-doesnt-getattr-work-with-exit + # thus, contextlib magic methods are not proxied via __getattr__ + return self.__wrapped.__enter__(*args, **kwargs) + + def __exit__(self, *args, **kwargs): + return self.__wrapped.__exit__(*args, **kwargs) + def write(self, text): self.__convertor.write(text) + def isatty(self): + stream = self.__wrapped + if 'PYCHARM_HOSTED' in os.environ: + if stream is not None and (stream is sys.__stdout__ or stream is sys.__stderr__): + return True + try: + stream_isatty = stream.isatty + except AttributeError: + return False + else: + return stream_isatty() + + @property + def closed(self): + stream = self.__wrapped + try: + return stream.closed + except AttributeError: + return True + class AnsiToWin32(object): ''' @@ -68,12 +89,12 @@ class AnsiToWin32(object): # should we strip ANSI sequences from our output? if strip is None: - strip = conversion_supported or (not is_stream_closed(wrapped) and not is_a_tty(wrapped)) + strip = conversion_supported or (not self.stream.closed and not self.stream.isatty()) self.strip = strip # should we should convert ANSI sequences into win32 calls? if convert is None: - convert = conversion_supported and not is_stream_closed(wrapped) and is_a_tty(wrapped) + convert = conversion_supported and not self.stream.closed and self.stream.isatty() self.convert = convert # dict of ansi codes to win32 functions and parameters @@ -149,7 +170,7 @@ class AnsiToWin32(object): def reset_all(self): if self.convert: self.call_win32('m', (0,)) - elif not self.strip and not is_stream_closed(self.wrapped): + elif not self.strip and not self.stream.closed: self.wrapped.write(Style.RESET_ALL) diff --git a/env/lib/python3.7/site-packages/pip/_vendor/colorama/initialise.py b/env/lib/python3.7/site-packages/pip/_vendor/colorama/initialise.py index 834962a..430d066 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/colorama/initialise.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/colorama/initialise.py @@ -78,5 +78,3 @@ def wrap_stream(stream, convert, strip, autoreset, wrap): if wrapper.should_wrap(): stream = wrapper.stream return stream - - diff --git a/env/lib/python3.7/site-packages/pip/_vendor/colorama/win32.py b/env/lib/python3.7/site-packages/pip/_vendor/colorama/win32.py index 8262e35..c2d8360 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/colorama/win32.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/colorama/win32.py @@ -89,11 +89,6 @@ else: ] _SetConsoleTitleW.restype = wintypes.BOOL - handles = { - STDOUT: _GetStdHandle(STDOUT), - STDERR: _GetStdHandle(STDERR), - } - def _winapi_test(handle): csbi = CONSOLE_SCREEN_BUFFER_INFO() success = _GetConsoleScreenBufferInfo( @@ -101,17 +96,18 @@ else: return bool(success) def winapi_test(): - return any(_winapi_test(h) for h in handles.values()) + return any(_winapi_test(h) for h in + (_GetStdHandle(STDOUT), _GetStdHandle(STDERR))) def GetConsoleScreenBufferInfo(stream_id=STDOUT): - handle = handles[stream_id] + handle = _GetStdHandle(stream_id) csbi = CONSOLE_SCREEN_BUFFER_INFO() success = _GetConsoleScreenBufferInfo( handle, byref(csbi)) return csbi def SetConsoleTextAttribute(stream_id, attrs): - handle = handles[stream_id] + handle = _GetStdHandle(stream_id) return _SetConsoleTextAttribute(handle, attrs) def SetConsoleCursorPosition(stream_id, position, adjust=True): @@ -129,11 +125,11 @@ else: adjusted_position.Y += sr.Top adjusted_position.X += sr.Left # Resume normal processing - handle = handles[stream_id] + handle = _GetStdHandle(stream_id) return _SetConsoleCursorPosition(handle, adjusted_position) def FillConsoleOutputCharacter(stream_id, char, length, start): - handle = handles[stream_id] + handle = _GetStdHandle(stream_id) char = c_char(char.encode()) length = wintypes.DWORD(length) num_written = wintypes.DWORD(0) @@ -144,7 +140,7 @@ else: def FillConsoleOutputAttribute(stream_id, attr, length, start): ''' FillConsoleOutputAttribute( hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten )''' - handle = handles[stream_id] + handle = _GetStdHandle(stream_id) attribute = wintypes.WORD(attr) length = wintypes.DWORD(length) num_written = wintypes.DWORD(0) diff --git a/env/lib/python3.7/site-packages/pip/_vendor/colorama/winterm.py b/env/lib/python3.7/site-packages/pip/_vendor/colorama/winterm.py index 60309d3..0fdb4ec 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/colorama/winterm.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/colorama/winterm.py @@ -44,6 +44,7 @@ class WinTerm(object): def reset_all(self, on_stderr=None): self.set_attrs(self._default) self.set_console(attrs=self._default) + self._light = 0 def fore(self, fore=None, light=False, on_stderr=False): if fore is None: @@ -122,12 +123,15 @@ class WinTerm(object): if mode == 0: from_coord = csbi.dwCursorPosition cells_to_erase = cells_in_screen - cells_before_cursor - if mode == 1: + elif mode == 1: from_coord = win32.COORD(0, 0) cells_to_erase = cells_before_cursor elif mode == 2: from_coord = win32.COORD(0, 0) cells_to_erase = cells_in_screen + else: + # invalid mode + return # fill the entire screen with blanks win32.FillConsoleOutputCharacter(handle, ' ', cells_to_erase, from_coord) # now set the buffer's attributes accordingly @@ -147,12 +151,15 @@ class WinTerm(object): if mode == 0: from_coord = csbi.dwCursorPosition cells_to_erase = csbi.dwSize.X - csbi.dwCursorPosition.X - if mode == 1: + elif mode == 1: from_coord = win32.COORD(0, csbi.dwCursorPosition.Y) cells_to_erase = csbi.dwCursorPosition.X elif mode == 2: from_coord = win32.COORD(0, csbi.dwCursorPosition.Y) cells_to_erase = csbi.dwSize.X + else: + # invalid mode + return # fill the entire screen with blanks win32.FillConsoleOutputCharacter(handle, ' ', cells_to_erase, from_coord) # now set the buffer's attributes accordingly diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__init__.py b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__init__.py index d4aab45..a786b4d 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__init__.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__init__.py @@ -6,7 +6,7 @@ # import logging -__version__ = '0.2.7' +__version__ = '0.2.8' class DistlibException(Exception): pass diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/__init__.cpython-37.pyc index 8111b58..da58f59 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/compat.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/compat.cpython-37.pyc index b98327a..59b7825 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/compat.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/compat.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/database.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/database.cpython-37.pyc index 86d3794..33977ec 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/database.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/database.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/index.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/index.cpython-37.pyc index bc86c72..c8c5203 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/index.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/index.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/locators.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/locators.cpython-37.pyc index 1aa0083..99b5f86 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/locators.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/locators.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/manifest.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/manifest.cpython-37.pyc index d0ffb1a..dd751f2 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/manifest.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/manifest.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/markers.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/markers.cpython-37.pyc index 0a8401a..c2a8402 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/markers.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/markers.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/metadata.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/metadata.cpython-37.pyc index 6d5ec31..6538c06 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/metadata.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/metadata.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/resources.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/resources.cpython-37.pyc index dc3d40b..b789475 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/resources.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/resources.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/scripts.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/scripts.cpython-37.pyc index 8b6c47d..bedfc41 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/scripts.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/scripts.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/util.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/util.cpython-37.pyc index 01e28db..a918a88 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/util.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/util.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/version.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/version.cpython-37.pyc index e02d0f9..0dc1d39 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/version.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/version.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/wheel.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/wheel.cpython-37.pyc index e2cf888..0147223 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/wheel.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/distlib/__pycache__/wheel.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__pycache__/__init__.cpython-37.pyc index f9b52fe..1a0d50b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__pycache__/misc.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__pycache__/misc.cpython-37.pyc index 16a493d..57975de 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__pycache__/misc.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__pycache__/misc.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__pycache__/shutil.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__pycache__/shutil.cpython-37.pyc index 29b1fe0..b841ddc 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__pycache__/shutil.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__pycache__/shutil.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__pycache__/sysconfig.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__pycache__/sysconfig.cpython-37.pyc index 938f077..35649cd 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__pycache__/sysconfig.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__pycache__/sysconfig.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__pycache__/tarfile.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__pycache__/tarfile.cpython-37.pyc index dd9bc35..7da0f4b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__pycache__/tarfile.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__pycache__/tarfile.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/database.py b/env/lib/python3.7/site-packages/pip/_vendor/distlib/database.py index a19905e..b13cdac 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/distlib/database.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/distlib/database.py @@ -20,7 +20,8 @@ import zipimport from . import DistlibException, resources from .compat import StringIO from .version import get_scheme, UnsupportedVersionError -from .metadata import Metadata, METADATA_FILENAME, WHEEL_METADATA_FILENAME +from .metadata import (Metadata, METADATA_FILENAME, WHEEL_METADATA_FILENAME, + LEGACY_METADATA_FILENAME) from .util import (parse_requirement, cached_property, parse_name_and_version, read_exports, write_exports, CSVReader, CSVWriter) @@ -132,7 +133,9 @@ class DistributionPath(object): if not r or r.path in seen: continue if self._include_dist and entry.endswith(DISTINFO_EXT): - possible_filenames = [METADATA_FILENAME, WHEEL_METADATA_FILENAME] + possible_filenames = [METADATA_FILENAME, + WHEEL_METADATA_FILENAME, + LEGACY_METADATA_FILENAME] for metadata_filename in possible_filenames: metadata_path = posixpath.join(entry, metadata_filename) pydist = finder.find(metadata_path) diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/locators.py b/env/lib/python3.7/site-packages/pip/_vendor/distlib/locators.py index 11d2636..5c655c3 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/distlib/locators.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/distlib/locators.py @@ -255,7 +255,9 @@ class Locator(object): if path.endswith('.whl'): try: wheel = Wheel(path) - if is_compatible(wheel, self.wheel_tags): + if not is_compatible(wheel, self.wheel_tags): + logger.debug('Wheel not compatible: %s', path) + else: if project_name is None: include = True else: @@ -613,6 +615,7 @@ class SimpleScrapingLocator(Locator): # as it is for coordinating our internal threads - the ones created # in _prepare_threads. self._gplock = threading.RLock() + self.platform_check = False # See issue #112 def _prepare_threads(self): """ @@ -658,8 +661,8 @@ class SimpleScrapingLocator(Locator): del self.result return result - platform_dependent = re.compile(r'\b(linux-(i\d86|x86_64|arm\w+)|' - r'win(32|-amd64)|macosx-?\d+)\b', re.I) + platform_dependent = re.compile(r'\b(linux_(i\d86|x86_64|arm\w+)|' + r'win(32|_amd64)|macosx_?\d+)\b', re.I) def _is_platform_dependent(self, url): """ @@ -677,7 +680,7 @@ class SimpleScrapingLocator(Locator): Note that the return value isn't actually used other than as a boolean value. """ - if self._is_platform_dependent(url): + if self.platform_check and self._is_platform_dependent(url): info = None else: info = self.convert_url_to_download_info(url, self.project_name) diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/metadata.py b/env/lib/python3.7/site-packages/pip/_vendor/distlib/metadata.py index 6d6470f..77eed7f 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/distlib/metadata.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/distlib/metadata.py @@ -91,7 +91,9 @@ _426_FIELDS = ('Metadata-Version', 'Name', 'Version', 'Platform', _426_MARKERS = ('Private-Version', 'Provides-Extra', 'Obsoleted-By', 'Setup-Requires-Dist', 'Extension') -_566_FIELDS = _426_FIELDS + ('Description-Content-Type',) +# See issue #106: Sometimes 'Requires' occurs wrongly in the metadata. Include +# it in the tuple literal below to allow it (for now) +_566_FIELDS = _426_FIELDS + ('Description-Content-Type', 'Requires') _566_MARKERS = ('Description-Content-Type',) @@ -377,8 +379,8 @@ class LegacyMetadata(object): value = msg[field] if value is not None and value != 'UNKNOWN': self.set(field, value) - logger.debug('Attempting to set metadata for %s', self) - self.set_metadata_version() + # logger.debug('Attempting to set metadata for %s', self) + # self.set_metadata_version() def write(self, filepath, skip_unknown=False): """Write the metadata fields to filepath.""" @@ -648,6 +650,7 @@ class LegacyMetadata(object): METADATA_FILENAME = 'pydist.json' WHEEL_METADATA_FILENAME = 'metadata.json' +LEGACY_METADATA_FILENAME = 'METADATA' class Metadata(object): diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/scripts.py b/env/lib/python3.7/site-packages/pip/_vendor/distlib/scripts.py index 0b7c3d0..8e22cb9 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/distlib/scripts.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/distlib/scripts.py @@ -236,8 +236,10 @@ class ScriptMaker(object): def _write_script(self, names, shebang, script_bytes, filenames, ext): use_launcher = self.add_launchers and self._is_nt linesep = os.linesep.encode('utf-8') + if not shebang.endswith(linesep): + shebang += linesep if not use_launcher: - script_bytes = shebang + linesep + script_bytes + script_bytes = shebang + script_bytes else: # pragma: no cover if ext == 'py': launcher = self._get_launcher('t') @@ -247,7 +249,7 @@ class ScriptMaker(object): with ZipFile(stream, 'w') as zf: zf.writestr('__main__.py', script_bytes) zip_data = stream.getvalue() - script_bytes = launcher + shebang + linesep + zip_data + script_bytes = launcher + shebang + zip_data for name in names: outname = os.path.join(self.target_dir, name) if use_launcher: # pragma: no cover diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/util.py b/env/lib/python3.7/site-packages/pip/_vendor/distlib/util.py index 0b14a93..9d4bfd3 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/distlib/util.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/distlib/util.py @@ -545,16 +545,14 @@ class FileOperator(object): def write_binary_file(self, path, data): self.ensure_dir(os.path.dirname(path)) if not self.dry_run: + if os.path.exists(path): + os.remove(path) with open(path, 'wb') as f: f.write(data) self.record_as_written(path) def write_text_file(self, path, data, encoding): - self.ensure_dir(os.path.dirname(path)) - if not self.dry_run: - with open(path, 'wb') as f: - f.write(data.encode(encoding)) - self.record_as_written(path) + self.write_binary_file(path, data.encode(encoding)) def set_mode(self, bits, mask, files): if os.name == 'posix' or (os.name == 'java' and os._name == 'posix'): @@ -582,7 +580,7 @@ class FileOperator(object): if self.record: self.dirs_created.add(path) - def byte_compile(self, path, optimize=False, force=False, prefix=None): + def byte_compile(self, path, optimize=False, force=False, prefix=None, hashed_invalidation=False): dpath = cache_from_source(path, not optimize) logger.info('Byte-compiling %s to %s', path, dpath) if not self.dry_run: @@ -592,7 +590,10 @@ class FileOperator(object): else: assert path.startswith(prefix) diagpath = path[len(prefix):] - py_compile.compile(path, dpath, diagpath, True) # raise error + compile_kwargs = {} + if hashed_invalidation and hasattr(py_compile, 'PycInvalidationMode'): + compile_kwargs['invalidation_mode'] = py_compile.PycInvalidationMode.CHECKED_HASH + py_compile.compile(path, dpath, diagpath, True, **compile_kwargs) # raise error self.record_as_written(dpath) return dpath diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distlib/wheel.py b/env/lib/python3.7/site-packages/pip/_vendor/distlib/wheel.py index 7737223..b04bfae 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/distlib/wheel.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/distlib/wheel.py @@ -442,7 +442,9 @@ class Wheel(object): This can be used to issue any warnings to raise any exceptions. If kwarg ``lib_only`` is True, only the purelib/platlib files are installed, and the headers, scripts, data and dist-info metadata are - not written. + not written. If kwarg ``bytecode_hashed_invalidation`` is True, written + bytecode will try to use file-hash based invalidation (PEP-552) on + supported interpreter versions (CPython 2.7+). The return value is a :class:`InstalledDistribution` instance unless ``options.lib_only`` is True, in which case the return value is ``None``. @@ -451,6 +453,7 @@ class Wheel(object): dry_run = maker.dry_run warner = kwargs.get('warner') lib_only = kwargs.get('lib_only', False) + bc_hashed_invalidation = kwargs.get('bytecode_hashed_invalidation', False) pathname = os.path.join(self.dirname, self.filename) name_ver = '%s-%s' % (self.name, self.version) @@ -557,7 +560,8 @@ class Wheel(object): '%s' % outfile) if bc and outfile.endswith('.py'): try: - pyc = fileop.byte_compile(outfile) + pyc = fileop.byte_compile(outfile, + hashed_invalidation=bc_hashed_invalidation) outfiles.append(pyc) except Exception: # Don't give up if byte-compilation fails, diff --git a/env/lib/python3.7/site-packages/pip/_vendor/distro.py b/env/lib/python3.7/site-packages/pip/_vendor/distro.py index aa4defc..3306163 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/distro.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/distro.py @@ -17,12 +17,12 @@ The ``distro`` package (``distro`` stands for Linux Distribution) provides information about the Linux distribution it runs on, such as a reliable machine-readable distro ID, or version information. -It is a renewed alternative implementation for Python's original +It is the recommended replacement for Python's original :py:func:`platform.linux_distribution` function, but it provides much more functionality. An alternative implementation became necessary because Python -3.5 deprecated this function, and Python 3.7 is expected to remove it -altogether. Its predecessor function :py:func:`platform.dist` was already -deprecated since Python 2.6 and is also expected to be removed in Python 3.7. +3.5 deprecated this function, and Python 3.8 will remove it altogether. +Its predecessor function :py:func:`platform.dist` was already +deprecated since Python 2.6 and will also be removed in Python 3.8. Still, there are many cases in which access to OS distribution information is needed. See `Python issue 1322 `_ for more information. @@ -48,7 +48,9 @@ _OS_RELEASE_BASENAME = 'os-release' #: with blanks translated to underscores. #: #: * Value: Normalized value. -NORMALIZED_OS_ID = {} +NORMALIZED_OS_ID = { + 'ol': 'oracle', # Oracle Enterprise Linux +} #: Translation table for normalizing the "Distributor ID" attribute returned by #: the lsb_release command, for use by the :func:`distro.id` method. @@ -812,10 +814,14 @@ class LinuxDistribution(object): For details, see :func:`distro.codename`. """ - return self.os_release_attr('codename') \ - or self.lsb_release_attr('codename') \ - or self.distro_release_attr('codename') \ - or '' + try: + # Handle os_release specially since distros might purposefully set + # this to empty string to have no codename + return self._os_release_info['codename'] + except KeyError: + return self.lsb_release_attr('codename') \ + or self.distro_release_attr('codename') \ + or '' def info(self, pretty=False, best=False): """ @@ -872,6 +878,7 @@ class LinuxDistribution(object): For details, see :func:`distro.uname_info`. """ + return self._uname_info def os_release_attr(self, attribute): """ @@ -963,23 +970,30 @@ class LinuxDistribution(object): if isinstance(v, bytes): v = v.decode('utf-8') props[k.lower()] = v - if k == 'VERSION': - # this handles cases in which the codename is in - # the `(CODENAME)` (rhel, centos, fedora) format - # or in the `, CODENAME` format (Ubuntu). - codename = re.search(r'(\(\D+\))|,(\s+)?\D+', v) - if codename: - codename = codename.group() - codename = codename.strip('()') - codename = codename.strip(',') - codename = codename.strip() - # codename appears within paranthese. - props['codename'] = codename - else: - props['codename'] = '' else: # Ignore any tokens that are not variable assignments pass + + if 'version_codename' in props: + # os-release added a version_codename field. Use that in + # preference to anything else Note that some distros purposefully + # do not have code names. They should be setting + # version_codename="" + props['codename'] = props['version_codename'] + elif 'ubuntu_codename' in props: + # Same as above but a non-standard field name used on older Ubuntus + props['codename'] = props['ubuntu_codename'] + elif 'version' in props: + # If there is no version_codename, parse it from the version + codename = re.search(r'(\(\D+\))|,(\s+)?\D+', props['version']) + if codename: + codename = codename.group() + codename = codename.strip('()') + codename = codename.strip(',') + codename = codename.strip() + # codename appears within paranthese. + props['codename'] = codename + return props @cached_property @@ -1072,7 +1086,10 @@ class LinuxDistribution(object): # file), because we want to use what was specified as best as # possible. match = _DISTRO_RELEASE_BASENAME_PATTERN.match(basename) - if match: + if 'name' in distro_info \ + and 'cloudlinux' in distro_info['name'].lower(): + distro_info['id'] = 'cloudlinux' + elif match: distro_info['id'] = match.group(1) return distro_info else: @@ -1113,6 +1130,8 @@ class LinuxDistribution(object): # The name is always present if the pattern matches self.distro_release_file = filepath distro_info['id'] = match.group(1) + if 'cloudlinux' in distro_info['name'].lower(): + distro_info['id'] = 'cloudlinux' return distro_info return {} diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/__init__.cpython-37.pyc index fd125ab..1e28eb1 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/_ihatexml.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/_ihatexml.cpython-37.pyc index feda7af..6d040fd 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/_ihatexml.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/_ihatexml.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/_inputstream.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/_inputstream.cpython-37.pyc index 789fb99..6c836a3 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/_inputstream.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/_inputstream.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/_tokenizer.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/_tokenizer.cpython-37.pyc index 2c332ca..887a5f9 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/_tokenizer.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/_tokenizer.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/_utils.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/_utils.cpython-37.pyc index 2f67cc5..608b22b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/_utils.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/_utils.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/constants.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/constants.cpython-37.pyc index 7e8ac24..fd70f09 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/constants.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/constants.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/html5parser.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/html5parser.cpython-37.pyc index 8ef42cf..01c889f 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/html5parser.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/html5parser.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/serializer.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/serializer.cpython-37.pyc index 55ddcb7..cae17c0 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/serializer.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/__pycache__/serializer.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/__pycache__/__init__.cpython-37.pyc index 1d91d86..006dfb4 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/__pycache__/_base.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/__pycache__/_base.cpython-37.pyc index 18788af..49be76f 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/__pycache__/_base.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/__pycache__/_base.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/__pycache__/datrie.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/__pycache__/datrie.cpython-37.pyc index 65aeb72..fbf55d4 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/__pycache__/datrie.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/__pycache__/datrie.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/__pycache__/py.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/__pycache__/py.cpython-37.pyc index 24a1608..cb90a77 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/__pycache__/py.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/__pycache__/py.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/__init__.cpython-37.pyc index dee7907..77eaa41 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/alphabeticalattributes.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/alphabeticalattributes.cpython-37.pyc index 1d6da0e..d2b1275 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/alphabeticalattributes.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/alphabeticalattributes.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/base.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/base.cpython-37.pyc index 8052b44..2d22637 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/base.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/base.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/inject_meta_charset.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/inject_meta_charset.cpython-37.pyc index b688c37..a952f1b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/inject_meta_charset.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/inject_meta_charset.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/lint.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/lint.cpython-37.pyc index 4931536..0809387 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/lint.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/lint.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/optionaltags.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/optionaltags.cpython-37.pyc index 26eae2a..a8f6378 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/optionaltags.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/optionaltags.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/sanitizer.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/sanitizer.cpython-37.pyc index d465996..efac0fb 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/sanitizer.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/sanitizer.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/whitespace.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/whitespace.cpython-37.pyc index 0510bcb..e18e893 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/whitespace.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__pycache__/whitespace.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treeadapters/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treeadapters/__pycache__/__init__.cpython-37.pyc index a660f4d..18e3f2d 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treeadapters/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treeadapters/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treeadapters/__pycache__/genshi.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treeadapters/__pycache__/genshi.cpython-37.pyc index 7e048d1..d9a5ae0 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treeadapters/__pycache__/genshi.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treeadapters/__pycache__/genshi.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treeadapters/__pycache__/sax.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treeadapters/__pycache__/sax.cpython-37.pyc index cc089e9..c4d9a3f 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treeadapters/__pycache__/sax.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treeadapters/__pycache__/sax.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/__init__.cpython-37.pyc index 2a2ff0f..fce6e54 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/base.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/base.cpython-37.pyc index 2f5878f..c706aff 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/base.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/base.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/dom.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/dom.cpython-37.pyc index 981e291..51b52e2 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/dom.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/dom.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/etree.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/etree.cpython-37.pyc index 4615a21..37c7392 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/etree.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/etree.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/etree_lxml.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/etree_lxml.cpython-37.pyc index 607b237..c9ad906 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/etree_lxml.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/etree_lxml.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/__init__.cpython-37.pyc index 43291d3..1fde618 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/base.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/base.cpython-37.pyc index 10b3a2d..428806a 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/base.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/base.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/dom.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/dom.cpython-37.pyc index caa33ab..0c0ade6 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/dom.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/dom.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/etree.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/etree.cpython-37.pyc index 7699f4b..ef04999 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/etree.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/etree.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/etree_lxml.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/etree_lxml.cpython-37.pyc index 4b4af34..6aaa7d3 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/etree_lxml.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/etree_lxml.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/genshi.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/genshi.cpython-37.pyc index b4259de..103a133 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/genshi.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/__pycache__/genshi.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/__init__.cpython-37.pyc index 4d072e4..f0f8742 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/codec.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/codec.cpython-37.pyc index efe10c4..fa6749b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/codec.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/codec.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/compat.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/compat.cpython-37.pyc index 868d8f7..9108b59 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/compat.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/compat.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/core.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/core.cpython-37.pyc index a6cf1fc..cd69a1b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/core.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/core.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/idnadata.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/idnadata.cpython-37.pyc index 6d0f886..96d856c 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/idnadata.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/idnadata.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/intranges.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/intranges.cpython-37.pyc index c0abbad..95b7aff 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/intranges.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/intranges.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/package_data.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/package_data.cpython-37.pyc index 869bd76..78acb45 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/package_data.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/package_data.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-37.pyc index 7316327..3c539fb 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/idna/core.py b/env/lib/python3.7/site-packages/pip/_vendor/idna/core.py index 090c2c1..104624a 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/idna/core.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/idna/core.py @@ -267,10 +267,7 @@ def alabel(label): try: label = label.encode('ascii') - try: - ulabel(label) - except IDNAError: - raise IDNAError('The label {0} is not a valid A-label'.format(label)) + ulabel(label) if not valid_label_length(label): raise IDNAError('Label too long') return label diff --git a/env/lib/python3.7/site-packages/pip/_vendor/idna/idnadata.py b/env/lib/python3.7/site-packages/pip/_vendor/idna/idnadata.py index 17974e2..a80c959 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/idna/idnadata.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/idna/idnadata.py @@ -1,6 +1,6 @@ # This file is automatically generated by tools/idna-data -__version__ = "10.0.0" +__version__ = "11.0.0" scripts = { 'Greek': ( 0x37000000374, @@ -49,7 +49,7 @@ scripts = { 0x30210000302a, 0x30380000303c, 0x340000004db6, - 0x4e0000009feb, + 0x4e0000009ff0, 0xf9000000fa6e, 0xfa700000fada, 0x200000002a6d7, @@ -62,7 +62,7 @@ scripts = { 'Hebrew': ( 0x591000005c8, 0x5d0000005eb, - 0x5f0000005f5, + 0x5ef000005f5, 0xfb1d0000fb37, 0xfb380000fb3d, 0xfb3e0000fb3f, @@ -248,6 +248,7 @@ joining_types = { 0x6fb: 68, 0x6fc: 68, 0x6ff: 68, + 0x70f: 84, 0x710: 82, 0x712: 68, 0x713: 68, @@ -522,6 +523,7 @@ joining_types = { 0x1875: 68, 0x1876: 68, 0x1877: 68, + 0x1878: 68, 0x1880: 85, 0x1881: 85, 0x1882: 85, @@ -690,6 +692,70 @@ joining_types = { 0x10bad: 68, 0x10bae: 68, 0x10baf: 85, + 0x10d00: 76, + 0x10d01: 68, + 0x10d02: 68, + 0x10d03: 68, + 0x10d04: 68, + 0x10d05: 68, + 0x10d06: 68, + 0x10d07: 68, + 0x10d08: 68, + 0x10d09: 68, + 0x10d0a: 68, + 0x10d0b: 68, + 0x10d0c: 68, + 0x10d0d: 68, + 0x10d0e: 68, + 0x10d0f: 68, + 0x10d10: 68, + 0x10d11: 68, + 0x10d12: 68, + 0x10d13: 68, + 0x10d14: 68, + 0x10d15: 68, + 0x10d16: 68, + 0x10d17: 68, + 0x10d18: 68, + 0x10d19: 68, + 0x10d1a: 68, + 0x10d1b: 68, + 0x10d1c: 68, + 0x10d1d: 68, + 0x10d1e: 68, + 0x10d1f: 68, + 0x10d20: 68, + 0x10d21: 68, + 0x10d22: 82, + 0x10d23: 68, + 0x10f30: 68, + 0x10f31: 68, + 0x10f32: 68, + 0x10f33: 82, + 0x10f34: 68, + 0x10f35: 68, + 0x10f36: 68, + 0x10f37: 68, + 0x10f38: 68, + 0x10f39: 68, + 0x10f3a: 68, + 0x10f3b: 68, + 0x10f3c: 68, + 0x10f3d: 68, + 0x10f3e: 68, + 0x10f3f: 68, + 0x10f40: 68, + 0x10f41: 68, + 0x10f42: 68, + 0x10f43: 68, + 0x10f44: 68, + 0x10f45: 85, + 0x10f51: 68, + 0x10f52: 68, + 0x10f53: 68, + 0x10f54: 82, + 0x110bd: 85, + 0x110cd: 85, 0x1e900: 68, 0x1e901: 68, 0x1e902: 68, @@ -1034,14 +1100,15 @@ codepoint_classes = { 0x52d0000052e, 0x52f00000530, 0x5590000055a, - 0x56100000587, + 0x56000000587, + 0x58800000589, 0x591000005be, 0x5bf000005c0, 0x5c1000005c3, 0x5c4000005c6, 0x5c7000005c8, 0x5d0000005eb, - 0x5f0000005f3, + 0x5ef000005f3, 0x6100000061b, 0x62000000640, 0x64100000660, @@ -1054,12 +1121,13 @@ codepoint_classes = { 0x7100000074b, 0x74d000007b2, 0x7c0000007f6, + 0x7fd000007fe, 0x8000000082e, 0x8400000085c, 0x8600000086b, 0x8a0000008b5, 0x8b6000008be, - 0x8d4000008e2, + 0x8d3000008e2, 0x8e300000958, 0x96000000964, 0x96600000970, @@ -1077,6 +1145,7 @@ codepoint_classes = { 0x9e0000009e4, 0x9e6000009f2, 0x9fc000009fd, + 0x9fe000009ff, 0xa0100000a04, 0xa0500000a0b, 0xa0f00000a11, @@ -1136,8 +1205,7 @@ codepoint_classes = { 0xbd000000bd1, 0xbd700000bd8, 0xbe600000bf0, - 0xc0000000c04, - 0xc0500000c0d, + 0xc0000000c0d, 0xc0e00000c11, 0xc1200000c29, 0xc2a00000c3a, @@ -1276,7 +1344,7 @@ codepoint_classes = { 0x17dc000017de, 0x17e0000017ea, 0x18100000181a, - 0x182000001878, + 0x182000001879, 0x1880000018ab, 0x18b0000018f6, 0x19000000191f, @@ -1544,11 +1612,11 @@ codepoint_classes = { 0x309d0000309f, 0x30a1000030fb, 0x30fc000030ff, - 0x31050000312f, + 0x310500003130, 0x31a0000031bb, 0x31f000003200, 0x340000004db6, - 0x4e0000009feb, + 0x4e0000009ff0, 0xa0000000a48d, 0xa4d00000a4fe, 0xa5000000a60d, @@ -1655,8 +1723,10 @@ codepoint_classes = { 0xa7a50000a7a6, 0xa7a70000a7a8, 0xa7a90000a7aa, + 0xa7af0000a7b0, 0xa7b50000a7b6, 0xa7b70000a7b8, + 0xa7b90000a7ba, 0xa7f70000a7f8, 0xa7fa0000a828, 0xa8400000a874, @@ -1664,8 +1734,7 @@ codepoint_classes = { 0xa8d00000a8da, 0xa8e00000a8f8, 0xa8fb0000a8fc, - 0xa8fd0000a8fe, - 0xa9000000a92e, + 0xa8fd0000a92e, 0xa9300000a954, 0xa9800000a9c1, 0xa9cf0000a9da, @@ -1743,7 +1812,7 @@ codepoint_classes = { 0x10a0500010a07, 0x10a0c00010a14, 0x10a1500010a18, - 0x10a1900010a34, + 0x10a1900010a36, 0x10a3800010a3b, 0x10a3f00010a40, 0x10a6000010a7d, @@ -1756,6 +1825,11 @@ codepoint_classes = { 0x10b8000010b92, 0x10c0000010c49, 0x10cc000010cf3, + 0x10d0000010d28, + 0x10d3000010d3a, + 0x10f0000010f1d, + 0x10f2700010f28, + 0x10f3000010f51, 0x1100000011047, 0x1106600011070, 0x1107f000110bb, @@ -1763,10 +1837,11 @@ codepoint_classes = { 0x110f0000110fa, 0x1110000011135, 0x1113600011140, + 0x1114400011147, 0x1115000011174, 0x1117600011177, 0x11180000111c5, - 0x111ca000111cd, + 0x111c9000111cd, 0x111d0000111db, 0x111dc000111dd, 0x1120000011212, @@ -1786,7 +1861,7 @@ codepoint_classes = { 0x1132a00011331, 0x1133200011334, 0x113350001133a, - 0x1133c00011345, + 0x1133b00011345, 0x1134700011349, 0x1134b0001134e, 0x1135000011351, @@ -1796,6 +1871,7 @@ codepoint_classes = { 0x1137000011375, 0x114000001144b, 0x114500001145a, + 0x1145e0001145f, 0x11480000114c6, 0x114c7000114c8, 0x114d0000114da, @@ -1807,15 +1883,17 @@ codepoint_classes = { 0x116500001165a, 0x11680000116b8, 0x116c0000116ca, - 0x117000001171a, + 0x117000001171b, 0x1171d0001172c, 0x117300001173a, + 0x118000001183b, 0x118c0000118ea, 0x118ff00011900, 0x11a0000011a3f, 0x11a4700011a48, 0x11a5000011a84, 0x11a8600011a9a, + 0x11a9d00011a9e, 0x11ac000011af9, 0x11c0000011c09, 0x11c0a00011c37, @@ -1831,6 +1909,13 @@ codepoint_classes = { 0x11d3c00011d3e, 0x11d3f00011d48, 0x11d5000011d5a, + 0x11d6000011d66, + 0x11d6700011d69, + 0x11d6a00011d8f, + 0x11d9000011d92, + 0x11d9300011d99, + 0x11da000011daa, + 0x11ee000011ef7, 0x120000001239a, 0x1248000012544, 0x130000001342f, @@ -1845,11 +1930,12 @@ codepoint_classes = { 0x16b5000016b5a, 0x16b6300016b78, 0x16b7d00016b90, + 0x16e6000016e80, 0x16f0000016f45, 0x16f5000016f7f, 0x16f8f00016fa0, 0x16fe000016fe2, - 0x17000000187ed, + 0x17000000187f2, 0x1880000018af3, 0x1b0000001b11f, 0x1b1700001b2fc, diff --git a/env/lib/python3.7/site-packages/pip/_vendor/idna/package_data.py b/env/lib/python3.7/site-packages/pip/_vendor/idna/package_data.py index 39c192b..257e898 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/idna/package_data.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/idna/package_data.py @@ -1,2 +1,2 @@ -__version__ = '2.7' +__version__ = '2.8' diff --git a/env/lib/python3.7/site-packages/pip/_vendor/idna/uts46data.py b/env/lib/python3.7/site-packages/pip/_vendor/idna/uts46data.py index 79731cb..a68ed4c 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/idna/uts46data.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/idna/uts46data.py @@ -4,7 +4,7 @@ """IDNA Mapping Table from UTS46.""" -__version__ = "10.0.0" +__version__ = "11.0.0" def _seg_0(): return [ (0x0, '3'), @@ -1029,11 +1029,8 @@ def _seg_9(): (0x556, 'M', u'ֆ'), (0x557, 'X'), (0x559, 'V'), - (0x560, 'X'), - (0x561, 'V'), (0x587, 'M', u'եւ'), - (0x588, 'X'), - (0x589, 'V'), + (0x588, 'V'), (0x58B, 'X'), (0x58D, 'V'), (0x590, 'X'), @@ -1041,15 +1038,15 @@ def _seg_9(): (0x5C8, 'X'), (0x5D0, 'V'), (0x5EB, 'X'), - (0x5F0, 'V'), + (0x5EF, 'V'), (0x5F5, 'X'), + (0x606, 'V'), + (0x61C, 'X'), + (0x61E, 'V'), ] def _seg_10(): return [ - (0x606, 'V'), - (0x61C, 'X'), - (0x61E, 'V'), (0x675, 'M', u'اٴ'), (0x676, 'M', u'وٴ'), (0x677, 'M', u'ۇٴ'), @@ -1064,7 +1061,7 @@ def _seg_10(): (0x7B2, 'X'), (0x7C0, 'V'), (0x7FB, 'X'), - (0x800, 'V'), + (0x7FD, 'V'), (0x82E, 'X'), (0x830, 'V'), (0x83F, 'X'), @@ -1078,7 +1075,7 @@ def _seg_10(): (0x8B5, 'X'), (0x8B6, 'V'), (0x8BE, 'X'), - (0x8D4, 'V'), + (0x8D3, 'V'), (0x8E2, 'X'), (0x8E3, 'V'), (0x958, 'M', u'क़'), @@ -1118,7 +1115,7 @@ def _seg_10(): (0x9E0, 'V'), (0x9E4, 'X'), (0x9E6, 'V'), - (0x9FE, 'X'), + (0x9FF, 'X'), (0xA01, 'V'), (0xA04, 'X'), (0xA05, 'V'), @@ -1147,19 +1144,19 @@ def _seg_10(): (0xA4E, 'X'), (0xA51, 'V'), (0xA52, 'X'), + (0xA59, 'M', u'ਖ਼'), + (0xA5A, 'M', u'ਗ਼'), + (0xA5B, 'M', u'ਜ਼'), ] def _seg_11(): return [ - (0xA59, 'M', u'ਖ਼'), - (0xA5A, 'M', u'ਗ਼'), - (0xA5B, 'M', u'ਜ਼'), (0xA5C, 'V'), (0xA5D, 'X'), (0xA5E, 'M', u'ਫ਼'), (0xA5F, 'X'), (0xA66, 'V'), - (0xA76, 'X'), + (0xA77, 'X'), (0xA81, 'V'), (0xA84, 'X'), (0xA85, 'V'), @@ -1250,16 +1247,14 @@ def _seg_11(): (0xBE6, 'V'), (0xBFB, 'X'), (0xC00, 'V'), - (0xC04, 'X'), - ] - -def _seg_12(): - return [ - (0xC05, 'V'), (0xC0D, 'X'), (0xC0E, 'V'), (0xC11, 'X'), (0xC12, 'V'), + ] + +def _seg_12(): + return [ (0xC29, 'X'), (0xC2A, 'V'), (0xC3A, 'X'), @@ -1278,8 +1273,6 @@ def _seg_12(): (0xC66, 'V'), (0xC70, 'X'), (0xC78, 'V'), - (0xC84, 'X'), - (0xC85, 'V'), (0xC8D, 'X'), (0xC8E, 'V'), (0xC91, 'X'), @@ -1355,10 +1348,6 @@ def _seg_12(): (0xE83, 'X'), (0xE84, 'V'), (0xE85, 'X'), - ] - -def _seg_13(): - return [ (0xE87, 'V'), (0xE89, 'X'), (0xE8A, 'V'), @@ -1366,6 +1355,10 @@ def _seg_13(): (0xE8D, 'V'), (0xE8E, 'X'), (0xE94, 'V'), + ] + +def _seg_13(): + return [ (0xE98, 'X'), (0xE99, 'V'), (0xEA0, 'X'), @@ -1459,10 +1452,6 @@ def _seg_13(): (0x124E, 'X'), (0x1250, 'V'), (0x1257, 'X'), - ] - -def _seg_14(): - return [ (0x1258, 'V'), (0x1259, 'X'), (0x125A, 'V'), @@ -1470,6 +1459,10 @@ def _seg_14(): (0x1260, 'V'), (0x1289, 'X'), (0x128A, 'V'), + ] + +def _seg_14(): + return [ (0x128E, 'X'), (0x1290, 'V'), (0x12B1, 'X'), @@ -1538,7 +1531,7 @@ def _seg_14(): (0x1810, 'V'), (0x181A, 'X'), (0x1820, 'V'), - (0x1878, 'X'), + (0x1879, 'X'), (0x1880, 'V'), (0x18AB, 'X'), (0x18B0, 'V'), @@ -1563,10 +1556,6 @@ def _seg_14(): (0x19DB, 'X'), (0x19DE, 'V'), (0x1A1C, 'X'), - ] - -def _seg_15(): - return [ (0x1A1E, 'V'), (0x1A5F, 'X'), (0x1A60, 'V'), @@ -1574,6 +1563,10 @@ def _seg_15(): (0x1A7F, 'V'), (0x1A8A, 'X'), (0x1A90, 'V'), + ] + +def _seg_15(): + return [ (0x1A9A, 'X'), (0x1AA0, 'V'), (0x1AAE, 'X'), @@ -1667,10 +1660,6 @@ def _seg_15(): (0x1D68, 'M', u'ρ'), (0x1D69, 'M', u'φ'), (0x1D6A, 'M', u'χ'), - ] - -def _seg_16(): - return [ (0x1D6B, 'V'), (0x1D78, 'M', u'н'), (0x1D79, 'V'), @@ -1678,6 +1667,10 @@ def _seg_16(): (0x1D9C, 'M', u'c'), (0x1D9D, 'M', u'ɕ'), (0x1D9E, 'M', u'ð'), + ] + +def _seg_16(): + return [ (0x1D9F, 'M', u'ɜ'), (0x1DA0, 'M', u'f'), (0x1DA1, 'M', u'ɟ'), @@ -1771,10 +1764,6 @@ def _seg_16(): (0x1E36, 'M', u'ḷ'), (0x1E37, 'V'), (0x1E38, 'M', u'ḹ'), - ] - -def _seg_17(): - return [ (0x1E39, 'V'), (0x1E3A, 'M', u'ḻ'), (0x1E3B, 'V'), @@ -1782,6 +1771,10 @@ def _seg_17(): (0x1E3D, 'V'), (0x1E3E, 'M', u'ḿ'), (0x1E3F, 'V'), + ] + +def _seg_17(): + return [ (0x1E40, 'M', u'ṁ'), (0x1E41, 'V'), (0x1E42, 'M', u'ṃ'), @@ -1875,10 +1868,6 @@ def _seg_17(): (0x1E9F, 'V'), (0x1EA0, 'M', u'ạ'), (0x1EA1, 'V'), - ] - -def _seg_18(): - return [ (0x1EA2, 'M', u'ả'), (0x1EA3, 'V'), (0x1EA4, 'M', u'ấ'), @@ -1886,6 +1875,10 @@ def _seg_18(): (0x1EA6, 'M', u'ầ'), (0x1EA7, 'V'), (0x1EA8, 'M', u'ẩ'), + ] + +def _seg_18(): + return [ (0x1EA9, 'V'), (0x1EAA, 'M', u'ẫ'), (0x1EAB, 'V'), @@ -1979,10 +1972,6 @@ def _seg_18(): (0x1F0B, 'M', u'ἃ'), (0x1F0C, 'M', u'ἄ'), (0x1F0D, 'M', u'ἅ'), - ] - -def _seg_19(): - return [ (0x1F0E, 'M', u'ἆ'), (0x1F0F, 'M', u'ἇ'), (0x1F10, 'V'), @@ -1990,6 +1979,10 @@ def _seg_19(): (0x1F18, 'M', u'ἐ'), (0x1F19, 'M', u'ἑ'), (0x1F1A, 'M', u'ἒ'), + ] + +def _seg_19(): + return [ (0x1F1B, 'M', u'ἓ'), (0x1F1C, 'M', u'ἔ'), (0x1F1D, 'M', u'ἕ'), @@ -2083,10 +2076,6 @@ def _seg_19(): (0x1F9A, 'M', u'ἢι'), (0x1F9B, 'M', u'ἣι'), (0x1F9C, 'M', u'ἤι'), - ] - -def _seg_20(): - return [ (0x1F9D, 'M', u'ἥι'), (0x1F9E, 'M', u'ἦι'), (0x1F9F, 'M', u'ἧι'), @@ -2094,6 +2083,10 @@ def _seg_20(): (0x1FA1, 'M', u'ὡι'), (0x1FA2, 'M', u'ὢι'), (0x1FA3, 'M', u'ὣι'), + ] + +def _seg_20(): + return [ (0x1FA4, 'M', u'ὤι'), (0x1FA5, 'M', u'ὥι'), (0x1FA6, 'M', u'ὦι'), @@ -2187,10 +2180,6 @@ def _seg_20(): (0x2024, 'X'), (0x2027, 'V'), (0x2028, 'X'), - ] - -def _seg_21(): - return [ (0x202F, '3', u' '), (0x2030, 'V'), (0x2033, 'M', u'′′'), @@ -2198,6 +2187,10 @@ def _seg_21(): (0x2035, 'V'), (0x2036, 'M', u'‵‵'), (0x2037, 'M', u'‵‵‵'), + ] + +def _seg_21(): + return [ (0x2038, 'V'), (0x203C, '3', u'!!'), (0x203D, 'V'), @@ -2291,10 +2284,6 @@ def _seg_21(): (0x2120, 'M', u'sm'), (0x2121, 'M', u'tel'), (0x2122, 'M', u'tm'), - ] - -def _seg_22(): - return [ (0x2123, 'V'), (0x2124, 'M', u'z'), (0x2125, 'V'), @@ -2302,6 +2291,10 @@ def _seg_22(): (0x2127, 'V'), (0x2128, 'M', u'z'), (0x2129, 'V'), + ] + +def _seg_22(): + return [ (0x212A, 'M', u'k'), (0x212B, 'M', u'å'), (0x212C, 'M', u'b'), @@ -2395,10 +2388,6 @@ def _seg_22(): (0x226E, '3'), (0x2270, 'V'), (0x2329, 'M', u'〈'), - ] - -def _seg_23(): - return [ (0x232A, 'M', u'〉'), (0x232B, 'V'), (0x2427, 'X'), @@ -2406,6 +2395,10 @@ def _seg_23(): (0x244B, 'X'), (0x2460, 'M', u'1'), (0x2461, 'M', u'2'), + ] + +def _seg_23(): + return [ (0x2462, 'M', u'3'), (0x2463, 'M', u'4'), (0x2464, 'M', u'5'), @@ -2499,10 +2492,6 @@ def _seg_23(): (0x24CF, 'M', u'z'), (0x24D0, 'M', u'a'), (0x24D1, 'M', u'b'), - ] - -def _seg_24(): - return [ (0x24D2, 'M', u'c'), (0x24D3, 'M', u'd'), (0x24D4, 'M', u'e'), @@ -2510,6 +2499,10 @@ def _seg_24(): (0x24D6, 'M', u'g'), (0x24D7, 'M', u'h'), (0x24D8, 'M', u'i'), + ] + +def _seg_24(): + return [ (0x24D9, 'M', u'j'), (0x24DA, 'M', u'k'), (0x24DB, 'M', u'l'), @@ -2541,13 +2534,9 @@ def _seg_24(): (0x2B76, 'V'), (0x2B96, 'X'), (0x2B98, 'V'), - (0x2BBA, 'X'), - (0x2BBD, 'V'), (0x2BC9, 'X'), (0x2BCA, 'V'), - (0x2BD3, 'X'), - (0x2BEC, 'V'), - (0x2BF0, 'X'), + (0x2BFF, 'X'), (0x2C00, 'M', u'ⰰ'), (0x2C01, 'M', u'ⰱ'), (0x2C02, 'M', u'ⰲ'), @@ -2603,10 +2592,6 @@ def _seg_24(): (0x2C62, 'M', u'ɫ'), (0x2C63, 'M', u'ᵽ'), (0x2C64, 'M', u'ɽ'), - ] - -def _seg_25(): - return [ (0x2C65, 'V'), (0x2C67, 'M', u'ⱨ'), (0x2C68, 'V'), @@ -2618,6 +2603,10 @@ def _seg_25(): (0x2C6E, 'M', u'ɱ'), (0x2C6F, 'M', u'ɐ'), (0x2C70, 'M', u'ɒ'), + ] + +def _seg_25(): + return [ (0x2C71, 'V'), (0x2C72, 'M', u'ⱳ'), (0x2C73, 'V'), @@ -2707,10 +2696,6 @@ def _seg_25(): (0x2CCD, 'V'), (0x2CCE, 'M', u'ⳏ'), (0x2CCF, 'V'), - ] - -def _seg_26(): - return [ (0x2CD0, 'M', u'ⳑ'), (0x2CD1, 'V'), (0x2CD2, 'M', u'ⳓ'), @@ -2722,6 +2707,10 @@ def _seg_26(): (0x2CD8, 'M', u'ⳙ'), (0x2CD9, 'V'), (0x2CDA, 'M', u'ⳛ'), + ] + +def _seg_26(): + return [ (0x2CDB, 'V'), (0x2CDC, 'M', u'ⳝ'), (0x2CDD, 'V'), @@ -2768,7 +2757,7 @@ def _seg_26(): (0x2DD8, 'V'), (0x2DDF, 'X'), (0x2DE0, 'V'), - (0x2E4A, 'X'), + (0x2E4F, 'X'), (0x2E80, 'V'), (0x2E9A, 'X'), (0x2E9B, 'V'), @@ -2811,10 +2800,6 @@ def _seg_26(): (0x2F20, 'M', u'士'), (0x2F21, 'M', u'夂'), (0x2F22, 'M', u'夊'), - ] - -def _seg_27(): - return [ (0x2F23, 'M', u'夕'), (0x2F24, 'M', u'大'), (0x2F25, 'M', u'女'), @@ -2826,6 +2811,10 @@ def _seg_27(): (0x2F2B, 'M', u'尸'), (0x2F2C, 'M', u'屮'), (0x2F2D, 'M', u'山'), + ] + +def _seg_27(): + return [ (0x2F2E, 'M', u'巛'), (0x2F2F, 'M', u'工'), (0x2F30, 'M', u'己'), @@ -2915,10 +2904,6 @@ def _seg_27(): (0x2F84, 'M', u'至'), (0x2F85, 'M', u'臼'), (0x2F86, 'M', u'舌'), - ] - -def _seg_28(): - return [ (0x2F87, 'M', u'舛'), (0x2F88, 'M', u'舟'), (0x2F89, 'M', u'艮'), @@ -2930,6 +2915,10 @@ def _seg_28(): (0x2F8F, 'M', u'行'), (0x2F90, 'M', u'衣'), (0x2F91, 'M', u'襾'), + ] + +def _seg_28(): + return [ (0x2F92, 'M', u'見'), (0x2F93, 'M', u'角'), (0x2F94, 'M', u'言'), @@ -3019,13 +3008,9 @@ def _seg_28(): (0x309F, 'M', u'より'), (0x30A0, 'V'), (0x30FF, 'M', u'コト'), - ] - -def _seg_29(): - return [ (0x3100, 'X'), (0x3105, 'V'), - (0x312F, 'X'), + (0x3130, 'X'), (0x3131, 'M', u'ᄀ'), (0x3132, 'M', u'ᄁ'), (0x3133, 'M', u'ᆪ'), @@ -3034,6 +3019,10 @@ def _seg_29(): (0x3136, 'M', u'ᆭ'), (0x3137, 'M', u'ᄃ'), (0x3138, 'M', u'ᄄ'), + ] + +def _seg_29(): + return [ (0x3139, 'M', u'ᄅ'), (0x313A, 'M', u'ᆰ'), (0x313B, 'M', u'ᆱ'), @@ -3123,10 +3112,6 @@ def _seg_29(): (0x318F, 'X'), (0x3190, 'V'), (0x3192, 'M', u'一'), - ] - -def _seg_30(): - return [ (0x3193, 'M', u'二'), (0x3194, 'M', u'三'), (0x3195, 'M', u'四'), @@ -3138,6 +3123,10 @@ def _seg_30(): (0x319B, 'M', u'丙'), (0x319C, 'M', u'丁'), (0x319D, 'M', u'天'), + ] + +def _seg_30(): + return [ (0x319E, 'M', u'地'), (0x319F, 'M', u'人'), (0x31A0, 'V'), @@ -3227,10 +3216,6 @@ def _seg_30(): (0x3256, 'M', u'26'), (0x3257, 'M', u'27'), (0x3258, 'M', u'28'), - ] - -def _seg_31(): - return [ (0x3259, 'M', u'29'), (0x325A, 'M', u'30'), (0x325B, 'M', u'31'), @@ -3242,6 +3227,10 @@ def _seg_31(): (0x3261, 'M', u'ᄂ'), (0x3262, 'M', u'ᄃ'), (0x3263, 'M', u'ᄅ'), + ] + +def _seg_31(): + return [ (0x3264, 'M', u'ᄆ'), (0x3265, 'M', u'ᄇ'), (0x3266, 'M', u'ᄉ'), @@ -3331,10 +3320,6 @@ def _seg_31(): (0x32BA, 'M', u'45'), (0x32BB, 'M', u'46'), (0x32BC, 'M', u'47'), - ] - -def _seg_32(): - return [ (0x32BD, 'M', u'48'), (0x32BE, 'M', u'49'), (0x32BF, 'M', u'50'), @@ -3346,6 +3331,10 @@ def _seg_32(): (0x32C5, 'M', u'6月'), (0x32C6, 'M', u'7月'), (0x32C7, 'M', u'8月'), + ] + +def _seg_32(): + return [ (0x32C8, 'M', u'9月'), (0x32C9, 'M', u'10月'), (0x32CA, 'M', u'11月'), @@ -3435,10 +3424,6 @@ def _seg_32(): (0x331E, 'M', u'コーポ'), (0x331F, 'M', u'サイクル'), (0x3320, 'M', u'サンチーム'), - ] - -def _seg_33(): - return [ (0x3321, 'M', u'シリング'), (0x3322, 'M', u'センチ'), (0x3323, 'M', u'セント'), @@ -3450,6 +3435,10 @@ def _seg_33(): (0x3329, 'M', u'ノット'), (0x332A, 'M', u'ハイツ'), (0x332B, 'M', u'パーセント'), + ] + +def _seg_33(): + return [ (0x332C, 'M', u'パーツ'), (0x332D, 'M', u'バーレル'), (0x332E, 'M', u'ピアストル'), @@ -3539,10 +3528,6 @@ def _seg_33(): (0x3382, 'M', u'μa'), (0x3383, 'M', u'ma'), (0x3384, 'M', u'ka'), - ] - -def _seg_34(): - return [ (0x3385, 'M', u'kb'), (0x3386, 'M', u'mb'), (0x3387, 'M', u'gb'), @@ -3554,6 +3539,10 @@ def _seg_34(): (0x338D, 'M', u'μg'), (0x338E, 'M', u'mg'), (0x338F, 'M', u'kg'), + ] + +def _seg_34(): + return [ (0x3390, 'M', u'hz'), (0x3391, 'M', u'khz'), (0x3392, 'M', u'mhz'), @@ -3643,10 +3632,6 @@ def _seg_34(): (0x33E6, 'M', u'7日'), (0x33E7, 'M', u'8日'), (0x33E8, 'M', u'9日'), - ] - -def _seg_35(): - return [ (0x33E9, 'M', u'10日'), (0x33EA, 'M', u'11日'), (0x33EB, 'M', u'12日'), @@ -3658,6 +3643,10 @@ def _seg_35(): (0x33F1, 'M', u'18日'), (0x33F2, 'M', u'19日'), (0x33F3, 'M', u'20日'), + ] + +def _seg_35(): + return [ (0x33F4, 'M', u'21日'), (0x33F5, 'M', u'22日'), (0x33F6, 'M', u'23日'), @@ -3673,7 +3662,7 @@ def _seg_35(): (0x3400, 'V'), (0x4DB6, 'X'), (0x4DC0, 'V'), - (0x9FEB, 'X'), + (0x9FF0, 'X'), (0xA000, 'V'), (0xA48D, 'X'), (0xA490, 'V'), @@ -3747,10 +3736,6 @@ def _seg_35(): (0xA692, 'M', u'ꚓ'), (0xA693, 'V'), (0xA694, 'M', u'ꚕ'), - ] - -def _seg_36(): - return [ (0xA695, 'V'), (0xA696, 'M', u'ꚗ'), (0xA697, 'V'), @@ -3762,6 +3747,10 @@ def _seg_36(): (0xA69D, 'M', u'ь'), (0xA69E, 'V'), (0xA6F8, 'X'), + ] + +def _seg_36(): + return [ (0xA700, 'V'), (0xA722, 'M', u'ꜣ'), (0xA723, 'V'), @@ -3851,10 +3840,6 @@ def _seg_36(): (0xA780, 'M', u'ꞁ'), (0xA781, 'V'), (0xA782, 'M', u'ꞃ'), - ] - -def _seg_37(): - return [ (0xA783, 'V'), (0xA784, 'M', u'ꞅ'), (0xA785, 'V'), @@ -3866,6 +3851,10 @@ def _seg_37(): (0xA78E, 'V'), (0xA790, 'M', u'ꞑ'), (0xA791, 'V'), + ] + +def _seg_37(): + return [ (0xA792, 'M', u'ꞓ'), (0xA793, 'V'), (0xA796, 'M', u'ꞗ'), @@ -3893,7 +3882,7 @@ def _seg_37(): (0xA7AC, 'M', u'ɡ'), (0xA7AD, 'M', u'ɬ'), (0xA7AE, 'M', u'ɪ'), - (0xA7AF, 'X'), + (0xA7AF, 'V'), (0xA7B0, 'M', u'ʞ'), (0xA7B1, 'M', u'ʇ'), (0xA7B2, 'M', u'ʝ'), @@ -3903,6 +3892,8 @@ def _seg_37(): (0xA7B6, 'M', u'ꞷ'), (0xA7B7, 'V'), (0xA7B8, 'X'), + (0xA7B9, 'V'), + (0xA7BA, 'X'), (0xA7F7, 'V'), (0xA7F8, 'M', u'ħ'), (0xA7F9, 'M', u'œ'), @@ -3917,8 +3908,6 @@ def _seg_37(): (0xA8CE, 'V'), (0xA8DA, 'X'), (0xA8E0, 'V'), - (0xA8FE, 'X'), - (0xA900, 'V'), (0xA954, 'X'), (0xA95F, 'V'), (0xA97D, 'X'), @@ -3955,10 +3944,6 @@ def _seg_37(): (0xAB5F, 'M', u'ꭒ'), (0xAB60, 'V'), (0xAB66, 'X'), - ] - -def _seg_38(): - return [ (0xAB70, 'M', u'Ꭰ'), (0xAB71, 'M', u'Ꭱ'), (0xAB72, 'M', u'Ꭲ'), @@ -3970,6 +3955,10 @@ def _seg_38(): (0xAB78, 'M', u'Ꭸ'), (0xAB79, 'M', u'Ꭹ'), (0xAB7A, 'M', u'Ꭺ'), + ] + +def _seg_38(): + return [ (0xAB7B, 'M', u'Ꭻ'), (0xAB7C, 'M', u'Ꭼ'), (0xAB7D, 'M', u'Ꭽ'), @@ -4059,10 +4048,6 @@ def _seg_38(): (0xF907, 'M', u'龜'), (0xF909, 'M', u'契'), (0xF90A, 'M', u'金'), - ] - -def _seg_39(): - return [ (0xF90B, 'M', u'喇'), (0xF90C, 'M', u'奈'), (0xF90D, 'M', u'懶'), @@ -4074,6 +4059,10 @@ def _seg_39(): (0xF913, 'M', u'邏'), (0xF914, 'M', u'樂'), (0xF915, 'M', u'洛'), + ] + +def _seg_39(): + return [ (0xF916, 'M', u'烙'), (0xF917, 'M', u'珞'), (0xF918, 'M', u'落'), @@ -4163,10 +4152,6 @@ def _seg_39(): (0xF96C, 'M', u'塞'), (0xF96D, 'M', u'省'), (0xF96E, 'M', u'葉'), - ] - -def _seg_40(): - return [ (0xF96F, 'M', u'說'), (0xF970, 'M', u'殺'), (0xF971, 'M', u'辰'), @@ -4178,6 +4163,10 @@ def _seg_40(): (0xF977, 'M', u'亮'), (0xF978, 'M', u'兩'), (0xF979, 'M', u'凉'), + ] + +def _seg_40(): + return [ (0xF97A, 'M', u'梁'), (0xF97B, 'M', u'糧'), (0xF97C, 'M', u'良'), @@ -4267,10 +4256,6 @@ def _seg_40(): (0xF9D0, 'M', u'類'), (0xF9D1, 'M', u'六'), (0xF9D2, 'M', u'戮'), - ] - -def _seg_41(): - return [ (0xF9D3, 'M', u'陸'), (0xF9D4, 'M', u'倫'), (0xF9D5, 'M', u'崙'), @@ -4282,6 +4267,10 @@ def _seg_41(): (0xF9DB, 'M', u'率'), (0xF9DC, 'M', u'隆'), (0xF9DD, 'M', u'利'), + ] + +def _seg_41(): + return [ (0xF9DE, 'M', u'吏'), (0xF9DF, 'M', u'履'), (0xF9E0, 'M', u'易'), @@ -4371,10 +4360,6 @@ def _seg_41(): (0xFA39, 'M', u'塀'), (0xFA3A, 'M', u'墨'), (0xFA3B, 'M', u'層'), - ] - -def _seg_42(): - return [ (0xFA3C, 'M', u'屮'), (0xFA3D, 'M', u'悔'), (0xFA3E, 'M', u'慨'), @@ -4386,6 +4371,10 @@ def _seg_42(): (0xFA44, 'M', u'梅'), (0xFA45, 'M', u'海'), (0xFA46, 'M', u'渚'), + ] + +def _seg_42(): + return [ (0xFA47, 'M', u'漢'), (0xFA48, 'M', u'煮'), (0xFA49, 'M', u'爫'), @@ -4475,10 +4464,6 @@ def _seg_42(): (0xFA9F, 'M', u'犯'), (0xFAA0, 'M', u'猪'), (0xFAA1, 'M', u'瑱'), - ] - -def _seg_43(): - return [ (0xFAA2, 'M', u'甆'), (0xFAA3, 'M', u'画'), (0xFAA4, 'M', u'瘝'), @@ -4490,6 +4475,10 @@ def _seg_43(): (0xFAAA, 'M', u'着'), (0xFAAB, 'M', u'磌'), (0xFAAC, 'M', u'窱'), + ] + +def _seg_43(): + return [ (0xFAAD, 'M', u'節'), (0xFAAE, 'M', u'类'), (0xFAAF, 'M', u'絛'), @@ -4579,10 +4568,6 @@ def _seg_43(): (0xFB38, 'M', u'טּ'), (0xFB39, 'M', u'יּ'), (0xFB3A, 'M', u'ךּ'), - ] - -def _seg_44(): - return [ (0xFB3B, 'M', u'כּ'), (0xFB3C, 'M', u'לּ'), (0xFB3D, 'X'), @@ -4594,6 +4579,10 @@ def _seg_44(): (0xFB43, 'M', u'ףּ'), (0xFB44, 'M', u'פּ'), (0xFB45, 'X'), + ] + +def _seg_44(): + return [ (0xFB46, 'M', u'צּ'), (0xFB47, 'M', u'קּ'), (0xFB48, 'M', u'רּ'), @@ -4683,10 +4672,6 @@ def _seg_44(): (0xFC19, 'M', u'خج'), (0xFC1A, 'M', u'خح'), (0xFC1B, 'M', u'خم'), - ] - -def _seg_45(): - return [ (0xFC1C, 'M', u'سج'), (0xFC1D, 'M', u'سح'), (0xFC1E, 'M', u'سخ'), @@ -4698,6 +4683,10 @@ def _seg_45(): (0xFC24, 'M', u'ضخ'), (0xFC25, 'M', u'ضم'), (0xFC26, 'M', u'طح'), + ] + +def _seg_45(): + return [ (0xFC27, 'M', u'طم'), (0xFC28, 'M', u'ظم'), (0xFC29, 'M', u'عج'), @@ -4787,10 +4776,6 @@ def _seg_45(): (0xFC7D, 'M', u'في'), (0xFC7E, 'M', u'قى'), (0xFC7F, 'M', u'قي'), - ] - -def _seg_46(): - return [ (0xFC80, 'M', u'كا'), (0xFC81, 'M', u'كل'), (0xFC82, 'M', u'كم'), @@ -4802,6 +4787,10 @@ def _seg_46(): (0xFC88, 'M', u'ما'), (0xFC89, 'M', u'مم'), (0xFC8A, 'M', u'نر'), + ] + +def _seg_46(): + return [ (0xFC8B, 'M', u'نز'), (0xFC8C, 'M', u'نم'), (0xFC8D, 'M', u'نن'), @@ -4891,10 +4880,6 @@ def _seg_46(): (0xFCE1, 'M', u'بم'), (0xFCE2, 'M', u'به'), (0xFCE3, 'M', u'تم'), - ] - -def _seg_47(): - return [ (0xFCE4, 'M', u'ته'), (0xFCE5, 'M', u'ثم'), (0xFCE6, 'M', u'ثه'), @@ -4906,6 +4891,10 @@ def _seg_47(): (0xFCEC, 'M', u'كم'), (0xFCED, 'M', u'لم'), (0xFCEE, 'M', u'نم'), + ] + +def _seg_47(): + return [ (0xFCEF, 'M', u'نه'), (0xFCF0, 'M', u'يم'), (0xFCF1, 'M', u'يه'), @@ -4995,10 +4984,6 @@ def _seg_47(): (0xFD57, 'M', u'تمخ'), (0xFD58, 'M', u'جمح'), (0xFD5A, 'M', u'حمي'), - ] - -def _seg_48(): - return [ (0xFD5B, 'M', u'حمى'), (0xFD5C, 'M', u'سحج'), (0xFD5D, 'M', u'سجح'), @@ -5010,6 +4995,10 @@ def _seg_48(): (0xFD66, 'M', u'صمم'), (0xFD67, 'M', u'شحم'), (0xFD69, 'M', u'شجي'), + ] + +def _seg_48(): + return [ (0xFD6A, 'M', u'شمخ'), (0xFD6C, 'M', u'شمم'), (0xFD6E, 'M', u'ضحى'), @@ -5099,10 +5088,6 @@ def _seg_48(): (0xFDF3, 'M', u'اكبر'), (0xFDF4, 'M', u'محمد'), (0xFDF5, 'M', u'صلعم'), - ] - -def _seg_49(): - return [ (0xFDF6, 'M', u'رسول'), (0xFDF7, 'M', u'عليه'), (0xFDF8, 'M', u'وسلم'), @@ -5114,6 +5099,10 @@ def _seg_49(): (0xFDFE, 'X'), (0xFE00, 'I'), (0xFE10, '3', u','), + ] + +def _seg_49(): + return [ (0xFE11, 'M', u'、'), (0xFE12, 'X'), (0xFE13, '3', u':'), @@ -5203,10 +5192,6 @@ def _seg_49(): (0xFE8F, 'M', u'ب'), (0xFE93, 'M', u'ة'), (0xFE95, 'M', u'ت'), - ] - -def _seg_50(): - return [ (0xFE99, 'M', u'ث'), (0xFE9D, 'M', u'ج'), (0xFEA1, 'M', u'ح'), @@ -5218,6 +5203,10 @@ def _seg_50(): (0xFEB1, 'M', u'س'), (0xFEB5, 'M', u'ش'), (0xFEB9, 'M', u'ص'), + ] + +def _seg_50(): + return [ (0xFEBD, 'M', u'ض'), (0xFEC1, 'M', u'ط'), (0xFEC5, 'M', u'ظ'), @@ -5307,10 +5296,6 @@ def _seg_50(): (0xFF41, 'M', u'a'), (0xFF42, 'M', u'b'), (0xFF43, 'M', u'c'), - ] - -def _seg_51(): - return [ (0xFF44, 'M', u'd'), (0xFF45, 'M', u'e'), (0xFF46, 'M', u'f'), @@ -5322,6 +5307,10 @@ def _seg_51(): (0xFF4C, 'M', u'l'), (0xFF4D, 'M', u'm'), (0xFF4E, 'M', u'n'), + ] + +def _seg_51(): + return [ (0xFF4F, 'M', u'o'), (0xFF50, 'M', u'p'), (0xFF51, 'M', u'q'), @@ -5411,10 +5400,6 @@ def _seg_51(): (0xFFA5, 'M', u'ᆬ'), (0xFFA6, 'M', u'ᆭ'), (0xFFA7, 'M', u'ᄃ'), - ] - -def _seg_52(): - return [ (0xFFA8, 'M', u'ᄄ'), (0xFFA9, 'M', u'ᄅ'), (0xFFAA, 'M', u'ᆰ'), @@ -5426,6 +5411,10 @@ def _seg_52(): (0xFFB0, 'M', u'ᄚ'), (0xFFB1, 'M', u'ᄆ'), (0xFFB2, 'M', u'ᄇ'), + ] + +def _seg_52(): + return [ (0xFFB3, 'M', u'ᄈ'), (0xFFB4, 'M', u'ᄡ'), (0xFFB5, 'M', u'ᄉ'), @@ -5515,10 +5504,6 @@ def _seg_52(): (0x10300, 'V'), (0x10324, 'X'), (0x1032D, 'V'), - ] - -def _seg_53(): - return [ (0x1034B, 'X'), (0x10350, 'V'), (0x1037B, 'X'), @@ -5530,6 +5515,10 @@ def _seg_53(): (0x103D6, 'X'), (0x10400, 'M', u'𐐨'), (0x10401, 'M', u'𐐩'), + ] + +def _seg_53(): + return [ (0x10402, 'M', u'𐐪'), (0x10403, 'M', u'𐐫'), (0x10404, 'M', u'𐐬'), @@ -5619,10 +5608,6 @@ def _seg_53(): (0x10570, 'X'), (0x10600, 'V'), (0x10737, 'X'), - ] - -def _seg_54(): - return [ (0x10740, 'V'), (0x10756, 'X'), (0x10760, 'V'), @@ -5634,6 +5619,10 @@ def _seg_54(): (0x1080A, 'V'), (0x10836, 'X'), (0x10837, 'V'), + ] + +def _seg_54(): + return [ (0x10839, 'X'), (0x1083C, 'V'), (0x1083D, 'X'), @@ -5666,11 +5655,11 @@ def _seg_54(): (0x10A15, 'V'), (0x10A18, 'X'), (0x10A19, 'V'), - (0x10A34, 'X'), + (0x10A36, 'X'), (0x10A38, 'V'), (0x10A3B, 'X'), (0x10A3F, 'V'), - (0x10A48, 'X'), + (0x10A49, 'X'), (0x10A50, 'V'), (0x10A59, 'X'), (0x10A60, 'V'), @@ -5723,10 +5712,6 @@ def _seg_54(): (0x10C9B, 'M', u'𐳛'), (0x10C9C, 'M', u'𐳜'), (0x10C9D, 'M', u'𐳝'), - ] - -def _seg_55(): - return [ (0x10C9E, 'M', u'𐳞'), (0x10C9F, 'M', u'𐳟'), (0x10CA0, 'M', u'𐳠'), @@ -5738,6 +5723,10 @@ def _seg_55(): (0x10CA6, 'M', u'𐳦'), (0x10CA7, 'M', u'𐳧'), (0x10CA8, 'M', u'𐳨'), + ] + +def _seg_55(): + return [ (0x10CA9, 'M', u'𐳩'), (0x10CAA, 'M', u'𐳪'), (0x10CAB, 'M', u'𐳫'), @@ -5752,9 +5741,15 @@ def _seg_55(): (0x10CC0, 'V'), (0x10CF3, 'X'), (0x10CFA, 'V'), - (0x10D00, 'X'), + (0x10D28, 'X'), + (0x10D30, 'V'), + (0x10D3A, 'X'), (0x10E60, 'V'), (0x10E7F, 'X'), + (0x10F00, 'V'), + (0x10F28, 'X'), + (0x10F30, 'V'), + (0x10F5A, 'X'), (0x11000, 'V'), (0x1104E, 'X'), (0x11052, 'V'), @@ -5770,7 +5765,7 @@ def _seg_55(): (0x11100, 'V'), (0x11135, 'X'), (0x11136, 'V'), - (0x11144, 'X'), + (0x11147, 'X'), (0x11150, 'V'), (0x11177, 'X'), (0x11180, 'V'), @@ -5811,7 +5806,7 @@ def _seg_55(): (0x11334, 'X'), (0x11335, 'V'), (0x1133A, 'X'), - (0x1133C, 'V'), + (0x1133B, 'V'), (0x11345, 'X'), (0x11347, 'V'), (0x11349, 'X'), @@ -5827,16 +5822,16 @@ def _seg_55(): (0x1136D, 'X'), (0x11370, 'V'), (0x11375, 'X'), - ] - -def _seg_56(): - return [ (0x11400, 'V'), (0x1145A, 'X'), (0x1145B, 'V'), (0x1145C, 'X'), (0x1145D, 'V'), - (0x1145E, 'X'), + ] + +def _seg_56(): + return [ + (0x1145F, 'X'), (0x11480, 'V'), (0x114C8, 'X'), (0x114D0, 'V'), @@ -5856,11 +5851,13 @@ def _seg_56(): (0x116C0, 'V'), (0x116CA, 'X'), (0x11700, 'V'), - (0x1171A, 'X'), + (0x1171B, 'X'), (0x1171D, 'V'), (0x1172C, 'X'), (0x11730, 'V'), (0x11740, 'X'), + (0x11800, 'V'), + (0x1183C, 'X'), (0x118A0, 'M', u'𑣀'), (0x118A1, 'M', u'𑣁'), (0x118A2, 'M', u'𑣂'), @@ -5902,8 +5899,6 @@ def _seg_56(): (0x11A50, 'V'), (0x11A84, 'X'), (0x11A86, 'V'), - (0x11A9D, 'X'), - (0x11A9E, 'V'), (0x11AA3, 'X'), (0x11AC0, 'V'), (0x11AF9, 'X'), @@ -5931,14 +5926,28 @@ def _seg_56(): (0x11D3B, 'X'), (0x11D3C, 'V'), (0x11D3E, 'X'), - ] - -def _seg_57(): - return [ (0x11D3F, 'V'), (0x11D48, 'X'), (0x11D50, 'V'), (0x11D5A, 'X'), + (0x11D60, 'V'), + ] + +def _seg_57(): + return [ + (0x11D66, 'X'), + (0x11D67, 'V'), + (0x11D69, 'X'), + (0x11D6A, 'V'), + (0x11D8F, 'X'), + (0x11D90, 'V'), + (0x11D92, 'X'), + (0x11D93, 'V'), + (0x11D99, 'X'), + (0x11DA0, 'V'), + (0x11DAA, 'X'), + (0x11EE0, 'V'), + (0x11EF9, 'X'), (0x12000, 'V'), (0x1239A, 'X'), (0x12400, 'V'), @@ -5973,6 +5982,8 @@ def _seg_57(): (0x16B78, 'X'), (0x16B7D, 'V'), (0x16B90, 'X'), + (0x16E60, 'V'), + (0x16E9B, 'X'), (0x16F00, 'V'), (0x16F45, 'X'), (0x16F50, 'V'), @@ -5982,7 +5993,7 @@ def _seg_57(): (0x16FE0, 'V'), (0x16FE2, 'X'), (0x17000, 'V'), - (0x187ED, 'X'), + (0x187F2, 'X'), (0x18800, 'V'), (0x18AF3, 'X'), (0x1B000, 'V'), @@ -6024,21 +6035,23 @@ def _seg_57(): (0x1D1C1, 'V'), (0x1D1E9, 'X'), (0x1D200, 'V'), + ] + +def _seg_58(): + return [ (0x1D246, 'X'), + (0x1D2E0, 'V'), + (0x1D2F4, 'X'), (0x1D300, 'V'), (0x1D357, 'X'), (0x1D360, 'V'), - (0x1D372, 'X'), + (0x1D379, 'X'), (0x1D400, 'M', u'a'), (0x1D401, 'M', u'b'), (0x1D402, 'M', u'c'), (0x1D403, 'M', u'd'), (0x1D404, 'M', u'e'), (0x1D405, 'M', u'f'), - ] - -def _seg_58(): - return [ (0x1D406, 'M', u'g'), (0x1D407, 'M', u'h'), (0x1D408, 'M', u'i'), @@ -6126,6 +6139,10 @@ def _seg_58(): (0x1D45A, 'M', u'm'), (0x1D45B, 'M', u'n'), (0x1D45C, 'M', u'o'), + ] + +def _seg_59(): + return [ (0x1D45D, 'M', u'p'), (0x1D45E, 'M', u'q'), (0x1D45F, 'M', u'r'), @@ -6139,10 +6156,6 @@ def _seg_58(): (0x1D467, 'M', u'z'), (0x1D468, 'M', u'a'), (0x1D469, 'M', u'b'), - ] - -def _seg_59(): - return [ (0x1D46A, 'M', u'c'), (0x1D46B, 'M', u'd'), (0x1D46C, 'M', u'e'), @@ -6230,6 +6243,10 @@ def _seg_59(): (0x1D4C1, 'M', u'l'), (0x1D4C2, 'M', u'm'), (0x1D4C3, 'M', u'n'), + ] + +def _seg_60(): + return [ (0x1D4C4, 'X'), (0x1D4C5, 'M', u'p'), (0x1D4C6, 'M', u'q'), @@ -6243,10 +6260,6 @@ def _seg_59(): (0x1D4CE, 'M', u'y'), (0x1D4CF, 'M', u'z'), (0x1D4D0, 'M', u'a'), - ] - -def _seg_60(): - return [ (0x1D4D1, 'M', u'b'), (0x1D4D2, 'M', u'c'), (0x1D4D3, 'M', u'd'), @@ -6334,6 +6347,10 @@ def _seg_60(): (0x1D526, 'M', u'i'), (0x1D527, 'M', u'j'), (0x1D528, 'M', u'k'), + ] + +def _seg_61(): + return [ (0x1D529, 'M', u'l'), (0x1D52A, 'M', u'm'), (0x1D52B, 'M', u'n'), @@ -6347,10 +6364,6 @@ def _seg_60(): (0x1D533, 'M', u'v'), (0x1D534, 'M', u'w'), (0x1D535, 'M', u'x'), - ] - -def _seg_61(): - return [ (0x1D536, 'M', u'y'), (0x1D537, 'M', u'z'), (0x1D538, 'M', u'a'), @@ -6438,6 +6451,10 @@ def _seg_61(): (0x1D58C, 'M', u'g'), (0x1D58D, 'M', u'h'), (0x1D58E, 'M', u'i'), + ] + +def _seg_62(): + return [ (0x1D58F, 'M', u'j'), (0x1D590, 'M', u'k'), (0x1D591, 'M', u'l'), @@ -6451,10 +6468,6 @@ def _seg_61(): (0x1D599, 'M', u't'), (0x1D59A, 'M', u'u'), (0x1D59B, 'M', u'v'), - ] - -def _seg_62(): - return [ (0x1D59C, 'M', u'w'), (0x1D59D, 'M', u'x'), (0x1D59E, 'M', u'y'), @@ -6542,6 +6555,10 @@ def _seg_62(): (0x1D5F0, 'M', u'c'), (0x1D5F1, 'M', u'd'), (0x1D5F2, 'M', u'e'), + ] + +def _seg_63(): + return [ (0x1D5F3, 'M', u'f'), (0x1D5F4, 'M', u'g'), (0x1D5F5, 'M', u'h'), @@ -6555,10 +6572,6 @@ def _seg_62(): (0x1D5FD, 'M', u'p'), (0x1D5FE, 'M', u'q'), (0x1D5FF, 'M', u'r'), - ] - -def _seg_63(): - return [ (0x1D600, 'M', u's'), (0x1D601, 'M', u't'), (0x1D602, 'M', u'u'), @@ -6646,6 +6659,10 @@ def _seg_63(): (0x1D654, 'M', u'y'), (0x1D655, 'M', u'z'), (0x1D656, 'M', u'a'), + ] + +def _seg_64(): + return [ (0x1D657, 'M', u'b'), (0x1D658, 'M', u'c'), (0x1D659, 'M', u'd'), @@ -6659,10 +6676,6 @@ def _seg_63(): (0x1D661, 'M', u'l'), (0x1D662, 'M', u'm'), (0x1D663, 'M', u'n'), - ] - -def _seg_64(): - return [ (0x1D664, 'M', u'o'), (0x1D665, 'M', u'p'), (0x1D666, 'M', u'q'), @@ -6750,6 +6763,10 @@ def _seg_64(): (0x1D6B9, 'M', u'θ'), (0x1D6BA, 'M', u'σ'), (0x1D6BB, 'M', u'τ'), + ] + +def _seg_65(): + return [ (0x1D6BC, 'M', u'υ'), (0x1D6BD, 'M', u'φ'), (0x1D6BE, 'M', u'χ'), @@ -6763,10 +6780,6 @@ def _seg_64(): (0x1D6C6, 'M', u'ε'), (0x1D6C7, 'M', u'ζ'), (0x1D6C8, 'M', u'η'), - ] - -def _seg_65(): - return [ (0x1D6C9, 'M', u'θ'), (0x1D6CA, 'M', u'ι'), (0x1D6CB, 'M', u'κ'), @@ -6854,6 +6867,10 @@ def _seg_65(): (0x1D71F, 'M', u'δ'), (0x1D720, 'M', u'ε'), (0x1D721, 'M', u'ζ'), + ] + +def _seg_66(): + return [ (0x1D722, 'M', u'η'), (0x1D723, 'M', u'θ'), (0x1D724, 'M', u'ι'), @@ -6867,10 +6884,6 @@ def _seg_65(): (0x1D72C, 'M', u'ρ'), (0x1D72D, 'M', u'θ'), (0x1D72E, 'M', u'σ'), - ] - -def _seg_66(): - return [ (0x1D72F, 'M', u'τ'), (0x1D730, 'M', u'υ'), (0x1D731, 'M', u'φ'), @@ -6958,6 +6971,10 @@ def _seg_66(): (0x1D785, 'M', u'φ'), (0x1D786, 'M', u'χ'), (0x1D787, 'M', u'ψ'), + ] + +def _seg_67(): + return [ (0x1D788, 'M', u'ω'), (0x1D789, 'M', u'∂'), (0x1D78A, 'M', u'ε'), @@ -6971,10 +6988,6 @@ def _seg_66(): (0x1D792, 'M', u'γ'), (0x1D793, 'M', u'δ'), (0x1D794, 'M', u'ε'), - ] - -def _seg_67(): - return [ (0x1D795, 'M', u'ζ'), (0x1D796, 'M', u'η'), (0x1D797, 'M', u'θ'), @@ -7062,6 +7075,10 @@ def _seg_67(): (0x1D7EC, 'M', u'0'), (0x1D7ED, 'M', u'1'), (0x1D7EE, 'M', u'2'), + ] + +def _seg_68(): + return [ (0x1D7EF, 'M', u'3'), (0x1D7F0, 'M', u'4'), (0x1D7F1, 'M', u'5'), @@ -7075,10 +7092,6 @@ def _seg_67(): (0x1D7F9, 'M', u'3'), (0x1D7FA, 'M', u'4'), (0x1D7FB, 'M', u'5'), - ] - -def _seg_68(): - return [ (0x1D7FC, 'M', u'6'), (0x1D7FD, 'M', u'7'), (0x1D7FE, 'M', u'8'), @@ -7143,6 +7156,8 @@ def _seg_68(): (0x1E95A, 'X'), (0x1E95E, 'V'), (0x1E960, 'X'), + (0x1EC71, 'V'), + (0x1ECB5, 'X'), (0x1EE00, 'M', u'ا'), (0x1EE01, 'M', u'ب'), (0x1EE02, 'M', u'ج'), @@ -7164,6 +7179,10 @@ def _seg_68(): (0x1EE12, 'M', u'ق'), (0x1EE13, 'M', u'ر'), (0x1EE14, 'M', u'ش'), + ] + +def _seg_69(): + return [ (0x1EE15, 'M', u'ت'), (0x1EE16, 'M', u'ث'), (0x1EE17, 'M', u'خ'), @@ -7179,10 +7198,6 @@ def _seg_68(): (0x1EE21, 'M', u'ب'), (0x1EE22, 'M', u'ج'), (0x1EE23, 'X'), - ] - -def _seg_69(): - return [ (0x1EE24, 'M', u'ه'), (0x1EE25, 'X'), (0x1EE27, 'M', u'ح'), @@ -7268,6 +7283,10 @@ def _seg_69(): (0x1EE81, 'M', u'ب'), (0x1EE82, 'M', u'ج'), (0x1EE83, 'M', u'د'), + ] + +def _seg_70(): + return [ (0x1EE84, 'M', u'ه'), (0x1EE85, 'M', u'و'), (0x1EE86, 'M', u'ز'), @@ -7283,10 +7302,6 @@ def _seg_69(): (0x1EE90, 'M', u'ف'), (0x1EE91, 'M', u'ص'), (0x1EE92, 'M', u'ق'), - ] - -def _seg_70(): - return [ (0x1EE93, 'M', u'ر'), (0x1EE94, 'M', u'ش'), (0x1EE95, 'M', u'ت'), @@ -7372,6 +7387,10 @@ def _seg_70(): (0x1F122, '3', u'(s)'), (0x1F123, '3', u'(t)'), (0x1F124, '3', u'(u)'), + ] + +def _seg_71(): + return [ (0x1F125, '3', u'(v)'), (0x1F126, '3', u'(w)'), (0x1F127, '3', u'(x)'), @@ -7382,15 +7401,11 @@ def _seg_70(): (0x1F12C, 'M', u'r'), (0x1F12D, 'M', u'cd'), (0x1F12E, 'M', u'wz'), - (0x1F12F, 'X'), + (0x1F12F, 'V'), (0x1F130, 'M', u'a'), (0x1F131, 'M', u'b'), (0x1F132, 'M', u'c'), (0x1F133, 'M', u'd'), - ] - -def _seg_71(): - return [ (0x1F134, 'M', u'e'), (0x1F135, 'M', u'f'), (0x1F136, 'M', u'g'), @@ -7476,6 +7491,10 @@ def _seg_71(): (0x1F239, 'M', u'割'), (0x1F23A, 'M', u'営'), (0x1F23B, 'M', u'配'), + ] + +def _seg_72(): + return [ (0x1F23C, 'X'), (0x1F240, 'M', u'〔本〕'), (0x1F241, 'M', u'〔三〕'), @@ -7491,21 +7510,17 @@ def _seg_71(): (0x1F251, 'M', u'可'), (0x1F252, 'X'), (0x1F260, 'V'), - ] - -def _seg_72(): - return [ (0x1F266, 'X'), (0x1F300, 'V'), (0x1F6D5, 'X'), (0x1F6E0, 'V'), (0x1F6ED, 'X'), (0x1F6F0, 'V'), - (0x1F6F9, 'X'), + (0x1F6FA, 'X'), (0x1F700, 'V'), (0x1F774, 'X'), (0x1F780, 'V'), - (0x1F7D5, 'X'), + (0x1F7D9, 'X'), (0x1F800, 'V'), (0x1F80C, 'X'), (0x1F810, 'V'), @@ -7521,15 +7536,21 @@ def _seg_72(): (0x1F910, 'V'), (0x1F93F, 'X'), (0x1F940, 'V'), - (0x1F94D, 'X'), - (0x1F950, 'V'), - (0x1F96C, 'X'), - (0x1F980, 'V'), - (0x1F998, 'X'), + (0x1F971, 'X'), + (0x1F973, 'V'), + (0x1F977, 'X'), + (0x1F97A, 'V'), + (0x1F97B, 'X'), + (0x1F97C, 'V'), + (0x1F9A3, 'X'), + (0x1F9B0, 'V'), + (0x1F9BA, 'X'), (0x1F9C0, 'V'), - (0x1F9C1, 'X'), + (0x1F9C3, 'X'), (0x1F9D0, 'V'), - (0x1F9E7, 'X'), + (0x1FA00, 'X'), + (0x1FA60, 'V'), + (0x1FA6E, 'X'), (0x20000, 'V'), (0x2A6D7, 'X'), (0x2A700, 'V'), @@ -7574,6 +7595,10 @@ def _seg_72(): (0x2F81F, 'M', u'㓟'), (0x2F820, 'M', u'刻'), (0x2F821, 'M', u'剆'), + ] + +def _seg_73(): + return [ (0x2F822, 'M', u'割'), (0x2F823, 'M', u'剷'), (0x2F824, 'M', u'㔕'), @@ -7595,10 +7620,6 @@ def _seg_72(): (0x2F836, 'M', u'及'), (0x2F837, 'M', u'叟'), (0x2F838, 'M', u'𠭣'), - ] - -def _seg_73(): - return [ (0x2F839, 'M', u'叫'), (0x2F83A, 'M', u'叱'), (0x2F83B, 'M', u'吆'), @@ -7678,6 +7699,10 @@ def _seg_73(): (0x2F887, 'M', u'幩'), (0x2F888, 'M', u'㡢'), (0x2F889, 'M', u'𢆃'), + ] + +def _seg_74(): + return [ (0x2F88A, 'M', u'㡼'), (0x2F88B, 'M', u'庰'), (0x2F88C, 'M', u'庳'), @@ -7699,10 +7724,6 @@ def _seg_73(): (0x2F89E, 'M', u'志'), (0x2F89F, 'M', u'忹'), (0x2F8A0, 'M', u'悁'), - ] - -def _seg_74(): - return [ (0x2F8A1, 'M', u'㤺'), (0x2F8A2, 'M', u'㤜'), (0x2F8A3, 'M', u'悔'), @@ -7782,6 +7803,10 @@ def _seg_74(): (0x2F8ED, 'M', u'櫛'), (0x2F8EE, 'M', u'㰘'), (0x2F8EF, 'M', u'次'), + ] + +def _seg_75(): + return [ (0x2F8F0, 'M', u'𣢧'), (0x2F8F1, 'M', u'歔'), (0x2F8F2, 'M', u'㱎'), @@ -7803,10 +7828,6 @@ def _seg_74(): (0x2F902, 'M', u'流'), (0x2F903, 'M', u'浩'), (0x2F904, 'M', u'浸'), - ] - -def _seg_75(): - return [ (0x2F905, 'M', u'涅'), (0x2F906, 'M', u'𣴞'), (0x2F907, 'M', u'洴'), @@ -7886,6 +7907,10 @@ def _seg_75(): (0x2F953, 'M', u'祖'), (0x2F954, 'M', u'𥚚'), (0x2F955, 'M', u'𥛅'), + ] + +def _seg_76(): + return [ (0x2F956, 'M', u'福'), (0x2F957, 'M', u'秫'), (0x2F958, 'M', u'䄯'), @@ -7907,10 +7932,6 @@ def _seg_75(): (0x2F969, 'M', u'糣'), (0x2F96A, 'M', u'紀'), (0x2F96B, 'M', u'𥾆'), - ] - -def _seg_76(): - return [ (0x2F96C, 'M', u'絣'), (0x2F96D, 'M', u'䌁'), (0x2F96E, 'M', u'緇'), @@ -7990,6 +8011,10 @@ def _seg_76(): (0x2F9B8, 'M', u'蚈'), (0x2F9B9, 'M', u'蜎'), (0x2F9BA, 'M', u'蛢'), + ] + +def _seg_77(): + return [ (0x2F9BB, 'M', u'蝹'), (0x2F9BC, 'M', u'蜨'), (0x2F9BD, 'M', u'蝫'), @@ -8011,10 +8036,6 @@ def _seg_76(): (0x2F9CD, 'M', u'䚾'), (0x2F9CE, 'M', u'䛇'), (0x2F9CF, 'M', u'誠'), - ] - -def _seg_77(): - return [ (0x2F9D0, 'M', u'諭'), (0x2F9D1, 'M', u'變'), (0x2F9D2, 'M', u'豕'), @@ -8094,6 +8115,10 @@ def _seg_77(): (0x2FA1D, 'M', u'𪘀'), (0x2FA1E, 'X'), (0xE0100, 'I'), + ] + +def _seg_78(): + return [ (0xE01F0, 'X'), ] @@ -8176,4 +8201,5 @@ uts46data = tuple( + _seg_75() + _seg_76() + _seg_77() + + _seg_78() ) diff --git a/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/__init__.cpython-37.pyc index c2a6a9d..abbfa85 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/linklockfile.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/linklockfile.cpython-37.pyc index 183bb94..5ffeff9 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/linklockfile.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/linklockfile.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/mkdirlockfile.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/mkdirlockfile.cpython-37.pyc index 036ef7b..0ce2eca 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/mkdirlockfile.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/mkdirlockfile.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/pidlockfile.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/pidlockfile.cpython-37.pyc index cc9a5ed..3e32b6d 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/pidlockfile.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/pidlockfile.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/sqlitelockfile.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/sqlitelockfile.cpython-37.pyc index 296d15d..2a36825 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/sqlitelockfile.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/sqlitelockfile.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/symlinklockfile.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/symlinklockfile.cpython-37.pyc index ac8c5f8..7fec0bf 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/symlinklockfile.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/lockfile/__pycache__/symlinklockfile.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/msgpack/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/msgpack/__pycache__/__init__.cpython-37.pyc index 1d82eb9..231781b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/msgpack/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/msgpack/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/msgpack/__pycache__/_version.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/msgpack/__pycache__/_version.cpython-37.pyc index c70c95e..ba40d59 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/msgpack/__pycache__/_version.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/msgpack/__pycache__/_version.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/msgpack/__pycache__/exceptions.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/msgpack/__pycache__/exceptions.cpython-37.pyc index b8e24d4..bf05105 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/msgpack/__pycache__/exceptions.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/msgpack/__pycache__/exceptions.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/msgpack/__pycache__/fallback.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/msgpack/__pycache__/fallback.cpython-37.pyc index 44c4ecd..4c62af9 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/msgpack/__pycache__/fallback.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/msgpack/__pycache__/fallback.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__about__.py b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__about__.py index 21fc6ce..7481c9e 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__about__.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__about__.py @@ -4,18 +4,24 @@ from __future__ import absolute_import, division, print_function __all__ = [ - "__title__", "__summary__", "__uri__", "__version__", "__author__", - "__email__", "__license__", "__copyright__", + "__title__", + "__summary__", + "__uri__", + "__version__", + "__author__", + "__email__", + "__license__", + "__copyright__", ] __title__ = "packaging" __summary__ = "Core utilities for Python packages" __uri__ = "https://github.com/pypa/packaging" -__version__ = "18.0" +__version__ = "19.0" __author__ = "Donald Stufft and individual contributors" __email__ = "donald@stufft.io" __license__ = "BSD or Apache License, Version 2.0" -__copyright__ = "Copyright 2014-2018 %s" % __author__ +__copyright__ = "Copyright 2014-2019 %s" % __author__ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__init__.py b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__init__.py index 5ee6220..a0cf67d 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__init__.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__init__.py @@ -4,11 +4,23 @@ from __future__ import absolute_import, division, print_function from .__about__ import ( - __author__, __copyright__, __email__, __license__, __summary__, __title__, - __uri__, __version__ + __author__, + __copyright__, + __email__, + __license__, + __summary__, + __title__, + __uri__, + __version__, ) __all__ = [ - "__title__", "__summary__", "__uri__", "__version__", "__author__", - "__email__", "__license__", "__copyright__", + "__title__", + "__summary__", + "__uri__", + "__version__", + "__author__", + "__email__", + "__license__", + "__copyright__", ] diff --git a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/__about__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/__about__.cpython-37.pyc index d41d760..d578a5a 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/__about__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/__about__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/__init__.cpython-37.pyc index 4e5207b..8ff90c3 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/_compat.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/_compat.cpython-37.pyc index 70de801..0cb8964 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/_compat.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/_compat.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/_structures.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/_structures.cpython-37.pyc index bd929b4..97a26ec 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/_structures.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/_structures.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/markers.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/markers.cpython-37.pyc index df19a28..29ebeff 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/markers.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/markers.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/requirements.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/requirements.cpython-37.pyc index cc30860..3993a9c 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/requirements.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/requirements.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc index 1f4740b..f80886b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/utils.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/utils.cpython-37.pyc index 977a271..099d141 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/utils.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/utils.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/version.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/version.cpython-37.pyc index 07ccea0..73487e9 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/version.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/packaging/__pycache__/version.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/packaging/_compat.py b/env/lib/python3.7/site-packages/pip/_vendor/packaging/_compat.py index 210bb80..25da473 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/packaging/_compat.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/packaging/_compat.py @@ -12,9 +12,9 @@ PY3 = sys.version_info[0] == 3 # flake8: noqa if PY3: - string_types = str, + string_types = (str,) else: - string_types = basestring, + string_types = (basestring,) def with_metaclass(meta, *bases): @@ -27,4 +27,5 @@ def with_metaclass(meta, *bases): class metaclass(meta): def __new__(cls, name, this_bases, d): return meta(name, bases, d) - return type.__new__(metaclass, 'temporary_class', (), {}) + + return type.__new__(metaclass, "temporary_class", (), {}) diff --git a/env/lib/python3.7/site-packages/pip/_vendor/packaging/_structures.py b/env/lib/python3.7/site-packages/pip/_vendor/packaging/_structures.py index e9fc4a0..68dcca6 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/packaging/_structures.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/packaging/_structures.py @@ -5,7 +5,6 @@ from __future__ import absolute_import, division, print_function class Infinity(object): - def __repr__(self): return "Infinity" @@ -38,7 +37,6 @@ Infinity = Infinity() class NegativeInfinity(object): - def __repr__(self): return "-Infinity" diff --git a/env/lib/python3.7/site-packages/pip/_vendor/packaging/markers.py b/env/lib/python3.7/site-packages/pip/_vendor/packaging/markers.py index e5834ce..5482476 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/packaging/markers.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/packaging/markers.py @@ -17,8 +17,11 @@ from .specifiers import Specifier, InvalidSpecifier __all__ = [ - "InvalidMarker", "UndefinedComparison", "UndefinedEnvironmentName", - "Marker", "default_environment", + "InvalidMarker", + "UndefinedComparison", + "UndefinedEnvironmentName", + "Marker", + "default_environment", ] @@ -42,7 +45,6 @@ class UndefinedEnvironmentName(ValueError): class Node(object): - def __init__(self, value): self.value = value @@ -57,62 +59,52 @@ class Node(object): class Variable(Node): - def serialize(self): return str(self) class Value(Node): - def serialize(self): return '"{0}"'.format(self) class Op(Node): - def serialize(self): return str(self) VARIABLE = ( - L("implementation_version") | - L("platform_python_implementation") | - L("implementation_name") | - L("python_full_version") | - L("platform_release") | - L("platform_version") | - L("platform_machine") | - L("platform_system") | - L("python_version") | - L("sys_platform") | - L("os_name") | - L("os.name") | # PEP-345 - L("sys.platform") | # PEP-345 - L("platform.version") | # PEP-345 - L("platform.machine") | # PEP-345 - L("platform.python_implementation") | # PEP-345 - L("python_implementation") | # undocumented setuptools legacy - L("extra") + L("implementation_version") + | L("platform_python_implementation") + | L("implementation_name") + | L("python_full_version") + | L("platform_release") + | L("platform_version") + | L("platform_machine") + | L("platform_system") + | L("python_version") + | L("sys_platform") + | L("os_name") + | L("os.name") + | L("sys.platform") # PEP-345 + | L("platform.version") # PEP-345 + | L("platform.machine") # PEP-345 + | L("platform.python_implementation") # PEP-345 + | L("python_implementation") # PEP-345 + | L("extra") # undocumented setuptools legacy ) ALIASES = { - 'os.name': 'os_name', - 'sys.platform': 'sys_platform', - 'platform.version': 'platform_version', - 'platform.machine': 'platform_machine', - 'platform.python_implementation': 'platform_python_implementation', - 'python_implementation': 'platform_python_implementation' + "os.name": "os_name", + "sys.platform": "sys_platform", + "platform.version": "platform_version", + "platform.machine": "platform_machine", + "platform.python_implementation": "platform_python_implementation", + "python_implementation": "platform_python_implementation", } VARIABLE.setParseAction(lambda s, l, t: Variable(ALIASES.get(t[0], t[0]))) VERSION_CMP = ( - L("===") | - L("==") | - L(">=") | - L("<=") | - L("!=") | - L("~=") | - L(">") | - L("<") + L("===") | L("==") | L(">=") | L("<=") | L("!=") | L("~=") | L(">") | L("<") ) MARKER_OP = VERSION_CMP | L("not in") | L("in") @@ -152,8 +144,11 @@ def _format_marker(marker, first=True): # where the single item is itself it's own list. In that case we want skip # the rest of this function so that we don't get extraneous () on the # outside. - if (isinstance(marker, list) and len(marker) == 1 and - isinstance(marker[0], (list, tuple))): + if ( + isinstance(marker, list) + and len(marker) == 1 + and isinstance(marker[0], (list, tuple)) + ): return _format_marker(marker[0]) if isinstance(marker, list): @@ -239,20 +234,20 @@ def _evaluate_markers(markers, environment): def format_full_version(info): - version = '{0.major}.{0.minor}.{0.micro}'.format(info) + version = "{0.major}.{0.minor}.{0.micro}".format(info) kind = info.releaselevel - if kind != 'final': + if kind != "final": version += kind[0] + str(info.serial) return version def default_environment(): - if hasattr(sys, 'implementation'): + if hasattr(sys, "implementation"): iver = format_full_version(sys.implementation.version) implementation_name = sys.implementation.name else: - iver = '0' - implementation_name = '' + iver = "0" + implementation_name = "" return { "implementation_name": implementation_name, @@ -270,13 +265,13 @@ def default_environment(): class Marker(object): - def __init__(self, marker): try: self._markers = _coerce_parse_result(MARKER.parseString(marker)) except ParseException as e: err_str = "Invalid marker: {0!r}, parse error at {1!r}".format( - marker, marker[e.loc:e.loc + 8]) + marker, marker[e.loc : e.loc + 8] + ) raise InvalidMarker(err_str) def __str__(self): diff --git a/env/lib/python3.7/site-packages/pip/_vendor/packaging/requirements.py b/env/lib/python3.7/site-packages/pip/_vendor/packaging/requirements.py index d40bd8c..dbc5f11 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/packaging/requirements.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/packaging/requirements.py @@ -38,8 +38,8 @@ IDENTIFIER = Combine(ALPHANUM + ZeroOrMore(IDENTIFIER_END)) NAME = IDENTIFIER("name") EXTRA = IDENTIFIER -URI = Regex(r'[^ ]+')("url") -URL = (AT + URI) +URI = Regex(r"[^ ]+")("url") +URL = AT + URI EXTRAS_LIST = EXTRA + ZeroOrMore(COMMA + EXTRA) EXTRAS = (LBRACKET + Optional(EXTRAS_LIST) + RBRACKET)("extras") @@ -48,17 +48,18 @@ VERSION_PEP440 = Regex(Specifier._regex_str, re.VERBOSE | re.IGNORECASE) VERSION_LEGACY = Regex(LegacySpecifier._regex_str, re.VERBOSE | re.IGNORECASE) VERSION_ONE = VERSION_PEP440 ^ VERSION_LEGACY -VERSION_MANY = Combine(VERSION_ONE + ZeroOrMore(COMMA + VERSION_ONE), - joinString=",", adjacent=False)("_raw_spec") +VERSION_MANY = Combine( + VERSION_ONE + ZeroOrMore(COMMA + VERSION_ONE), joinString=",", adjacent=False +)("_raw_spec") _VERSION_SPEC = Optional(((LPAREN + VERSION_MANY + RPAREN) | VERSION_MANY)) -_VERSION_SPEC.setParseAction(lambda s, l, t: t._raw_spec or '') +_VERSION_SPEC.setParseAction(lambda s, l, t: t._raw_spec or "") VERSION_SPEC = originalTextFor(_VERSION_SPEC)("specifier") VERSION_SPEC.setParseAction(lambda s, l, t: t[1]) MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker") MARKER_EXPR.setParseAction( - lambda s, l, t: Marker(s[t._original_start:t._original_end]) + lambda s, l, t: Marker(s[t._original_start : t._original_end]) ) MARKER_SEPARATOR = SEMICOLON MARKER = MARKER_SEPARATOR + MARKER_EXPR @@ -66,8 +67,7 @@ MARKER = MARKER_SEPARATOR + MARKER_EXPR VERSION_AND_MARKER = VERSION_SPEC + Optional(MARKER) URL_AND_MARKER = URL + Optional(MARKER) -NAMED_REQUIREMENT = \ - NAME + Optional(EXTRAS) + (URL_AND_MARKER | VERSION_AND_MARKER) +NAMED_REQUIREMENT = NAME + Optional(EXTRAS) + (URL_AND_MARKER | VERSION_AND_MARKER) REQUIREMENT = stringStart + NAMED_REQUIREMENT + stringEnd # pyparsing isn't thread safe during initialization, so we do it eagerly, see @@ -92,15 +92,21 @@ class Requirement(object): try: req = REQUIREMENT.parseString(requirement_string) except ParseException as e: - raise InvalidRequirement("Parse error at \"{0!r}\": {1}".format( - requirement_string[e.loc:e.loc + 8], e.msg - )) + raise InvalidRequirement( + 'Parse error at "{0!r}": {1}'.format( + requirement_string[e.loc : e.loc + 8], e.msg + ) + ) self.name = req.name if req.url: parsed_url = urlparse.urlparse(req.url) - if not (parsed_url.scheme and parsed_url.netloc) or ( - not parsed_url.scheme and not parsed_url.netloc): + if parsed_url.scheme == "file": + if urlparse.urlunparse(parsed_url) != req.url: + raise InvalidRequirement("Invalid URL given") + elif not (parsed_url.scheme and parsed_url.netloc) or ( + not parsed_url.scheme and not parsed_url.netloc + ): raise InvalidRequirement("Invalid URL: {0}".format(req.url)) self.url = req.url else: @@ -120,6 +126,8 @@ class Requirement(object): if self.url: parts.append("@ {0}".format(self.url)) + if self.marker: + parts.append(" ") if self.marker: parts.append("; {0}".format(self.marker)) diff --git a/env/lib/python3.7/site-packages/pip/_vendor/packaging/specifiers.py b/env/lib/python3.7/site-packages/pip/_vendor/packaging/specifiers.py index 4c79899..743576a 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/packaging/specifiers.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/packaging/specifiers.py @@ -19,7 +19,6 @@ class InvalidSpecifier(ValueError): class BaseSpecifier(with_metaclass(abc.ABCMeta, object)): - @abc.abstractmethod def __str__(self): """ @@ -84,10 +83,7 @@ class _IndividualSpecifier(BaseSpecifier): if not match: raise InvalidSpecifier("Invalid specifier: '{0}'".format(spec)) - self._spec = ( - match.group("operator").strip(), - match.group("version").strip(), - ) + self._spec = (match.group("operator").strip(), match.group("version").strip()) # Store whether or not this Specifier should accept prereleases self._prereleases = prereleases @@ -99,11 +95,7 @@ class _IndividualSpecifier(BaseSpecifier): else "" ) - return "<{0}({1!r}{2})>".format( - self.__class__.__name__, - str(self), - pre, - ) + return "<{0}({1!r}{2})>".format(self.__class__.__name__, str(self), pre) def __str__(self): return "{0}{1}".format(*self._spec) @@ -194,8 +186,9 @@ class _IndividualSpecifier(BaseSpecifier): # If our version is a prerelease, and we were not set to allow # prereleases, then we'll store it for later incase nothing # else matches this specifier. - if (parsed_version.is_prerelease and not - (prereleases or self.prereleases)): + if parsed_version.is_prerelease and not ( + prereleases or self.prereleases + ): found_prereleases.append(version) # Either this is not a prerelease, or we should have been # accepting prereleases from the beginning. @@ -213,8 +206,7 @@ class _IndividualSpecifier(BaseSpecifier): class LegacySpecifier(_IndividualSpecifier): - _regex_str = ( - r""" + _regex_str = r""" (?P(==|!=|<=|>=|<|>)) \s* (?P @@ -225,10 +217,8 @@ class LegacySpecifier(_IndividualSpecifier): # them, and a comma since it's a version separator. ) """ - ) - _regex = re.compile( - r"^\s*" + _regex_str + r"\s*$", re.VERBOSE | re.IGNORECASE) + _regex = re.compile(r"^\s*" + _regex_str + r"\s*$", re.VERBOSE | re.IGNORECASE) _operators = { "==": "equal", @@ -269,13 +259,13 @@ def _require_version_compare(fn): if not isinstance(prospective, Version): return False return fn(self, prospective, spec) + return wrapped class Specifier(_IndividualSpecifier): - _regex_str = ( - r""" + _regex_str = r""" (?P(~=|==|!=|<=|>=|<|>|===)) (?P (?: @@ -367,10 +357,8 @@ class Specifier(_IndividualSpecifier): ) ) """ - ) - _regex = re.compile( - r"^\s*" + _regex_str + r"\s*$", re.VERBOSE | re.IGNORECASE) + _regex = re.compile(r"^\s*" + _regex_str + r"\s*$", re.VERBOSE | re.IGNORECASE) _operators = { "~=": "compatible", @@ -397,8 +385,7 @@ class Specifier(_IndividualSpecifier): prefix = ".".join( list( itertools.takewhile( - lambda x: (not x.startswith("post") and not - x.startswith("dev")), + lambda x: (not x.startswith("post") and not x.startswith("dev")), _version_split(spec), ) )[:-1] @@ -407,8 +394,9 @@ class Specifier(_IndividualSpecifier): # Add the prefix notation to the end of our string prefix += ".*" - return (self._get_operator(">=")(prospective, spec) and - self._get_operator("==")(prospective, prefix)) + return self._get_operator(">=")(prospective, spec) and self._get_operator("==")( + prospective, prefix + ) @_require_version_compare def _compare_equal(self, prospective, spec): @@ -428,7 +416,7 @@ class Specifier(_IndividualSpecifier): # Shorten the prospective version to be the same length as the spec # so that we can determine if the specifier is a prefix of the # prospective version or not. - prospective = prospective[:len(spec)] + prospective = prospective[: len(spec)] # Pad out our two sides with zeros so that they both equal the same # length. @@ -567,27 +555,17 @@ def _pad_version(left, right): right_split.append(list(itertools.takewhile(lambda x: x.isdigit(), right))) # Get the rest of our versions - left_split.append(left[len(left_split[0]):]) - right_split.append(right[len(right_split[0]):]) + left_split.append(left[len(left_split[0]) :]) + right_split.append(right[len(right_split[0]) :]) # Insert our padding - left_split.insert( - 1, - ["0"] * max(0, len(right_split[0]) - len(left_split[0])), - ) - right_split.insert( - 1, - ["0"] * max(0, len(left_split[0]) - len(right_split[0])), - ) + left_split.insert(1, ["0"] * max(0, len(right_split[0]) - len(left_split[0]))) + right_split.insert(1, ["0"] * max(0, len(left_split[0]) - len(right_split[0]))) - return ( - list(itertools.chain(*left_split)), - list(itertools.chain(*right_split)), - ) + return (list(itertools.chain(*left_split)), list(itertools.chain(*right_split))) class SpecifierSet(BaseSpecifier): - def __init__(self, specifiers="", prereleases=None): # Split on , to break each indidivual specifier into it's own item, and # strip each item to remove leading/trailing whitespace. @@ -721,10 +699,7 @@ class SpecifierSet(BaseSpecifier): # given version is contained within all of them. # Note: This use of all() here means that an empty set of specifiers # will always return True, this is an explicit design decision. - return all( - s.contains(item, prereleases=prereleases) - for s in self._specs - ) + return all(s.contains(item, prereleases=prereleases) for s in self._specs) def filter(self, iterable, prereleases=None): # Determine if we're forcing a prerelease or not, if we're not forcing diff --git a/env/lib/python3.7/site-packages/pip/_vendor/packaging/utils.py b/env/lib/python3.7/site-packages/pip/_vendor/packaging/utils.py index 4b94a82..8841878 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/packaging/utils.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/packaging/utils.py @@ -36,13 +36,7 @@ def canonicalize_version(version): # Release segment # NB: This strips trailing '.0's to normalize - parts.append( - re.sub( - r'(\.0)+$', - '', - ".".join(str(x) for x in version.release) - ) - ) + parts.append(re.sub(r"(\.0)+$", "", ".".join(str(x) for x in version.release))) # Pre-release if version.pre is not None: diff --git a/env/lib/python3.7/site-packages/pip/_vendor/packaging/version.py b/env/lib/python3.7/site-packages/pip/_vendor/packaging/version.py index 6ed5cbb..95157a1 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/packaging/version.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/packaging/version.py @@ -10,14 +10,11 @@ import re from ._structures import Infinity -__all__ = [ - "parse", "Version", "LegacyVersion", "InvalidVersion", "VERSION_PATTERN" -] +__all__ = ["parse", "Version", "LegacyVersion", "InvalidVersion", "VERSION_PATTERN"] _Version = collections.namedtuple( - "_Version", - ["epoch", "release", "dev", "pre", "post", "local"], + "_Version", ["epoch", "release", "dev", "pre", "post", "local"] ) @@ -40,7 +37,6 @@ class InvalidVersion(ValueError): class _BaseVersion(object): - def __hash__(self): return hash(self._key) @@ -70,7 +66,6 @@ class _BaseVersion(object): class LegacyVersion(_BaseVersion): - def __init__(self, version): self._version = str(version) self._key = _legacy_cmpkey(self._version) @@ -126,12 +121,14 @@ class LegacyVersion(_BaseVersion): return False -_legacy_version_component_re = re.compile( - r"(\d+ | [a-z]+ | \.| -)", re.VERBOSE, -) +_legacy_version_component_re = re.compile(r"(\d+ | [a-z]+ | \.| -)", re.VERBOSE) _legacy_version_replacement_map = { - "pre": "c", "preview": "c", "-": "final-", "rc": "c", "dev": "@", + "pre": "c", + "preview": "c", + "-": "final-", + "rc": "c", + "dev": "@", } @@ -215,10 +212,7 @@ VERSION_PATTERN = r""" class Version(_BaseVersion): - _regex = re.compile( - r"^\s*" + VERSION_PATTERN + r"\s*$", - re.VERBOSE | re.IGNORECASE, - ) + _regex = re.compile(r"^\s*" + VERSION_PATTERN + r"\s*$", re.VERBOSE | re.IGNORECASE) def __init__(self, version): # Validate the version and parse it into pieces @@ -230,18 +224,11 @@ class Version(_BaseVersion): self._version = _Version( epoch=int(match.group("epoch")) if match.group("epoch") else 0, release=tuple(int(i) for i in match.group("release").split(".")), - pre=_parse_letter_version( - match.group("pre_l"), - match.group("pre_n"), - ), + pre=_parse_letter_version(match.group("pre_l"), match.group("pre_n")), post=_parse_letter_version( - match.group("post_l"), - match.group("post_n1") or match.group("post_n2"), - ), - dev=_parse_letter_version( - match.group("dev_l"), - match.group("dev_n"), + match.group("post_l"), match.group("post_n1") or match.group("post_n2") ), + dev=_parse_letter_version(match.group("dev_l"), match.group("dev_n")), local=_parse_local_version(match.group("local")), ) @@ -395,12 +382,7 @@ def _cmpkey(epoch, release, pre, post, dev, local): # re-reverse it back into the correct order and make it a tuple and use # that for our sorting key. release = tuple( - reversed(list( - itertools.dropwhile( - lambda x: x == 0, - reversed(release), - ) - )) + reversed(list(itertools.dropwhile(lambda x: x == 0, reversed(release)))) ) # We need to "trick" the sorting algorithm to put 1.0.dev0 before 1.0a0. @@ -433,9 +415,6 @@ def _cmpkey(epoch, release, pre, post, dev, local): # - Numeric segments sort numerically # - Shorter versions sort before longer versions when the prefixes # match exactly - local = tuple( - (i, "") if isinstance(i, int) else (-Infinity, i) - for i in local - ) + local = tuple((i, "") if isinstance(i, int) else (-Infinity, i) for i in local) return epoch, release, pre, post, dev, local diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pep517/__init__.py b/env/lib/python3.7/site-packages/pip/_vendor/pep517/__init__.py index 8beedea..9c1a098 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/pep517/__init__.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/pep517/__init__.py @@ -1,4 +1,4 @@ """Wrappers to build Python packages using PEP 517 hooks """ -__version__ = '0.2' +__version__ = '0.5.0' diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/__init__.cpython-37.pyc index cd73fb1..8318882 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/_in_process.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/_in_process.cpython-37.pyc index 123da33..78d7abb 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/_in_process.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/_in_process.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/check.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/check.cpython-37.pyc index f4fa36f..4bdd71a 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/check.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/check.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/colorlog.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/colorlog.cpython-37.pyc index f973471..4d836f4 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/colorlog.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/colorlog.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/compat.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/compat.cpython-37.pyc index 1d665ba..0dfd8ab 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/compat.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/compat.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/envbuild.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/envbuild.cpython-37.pyc index fd358d3..737a5dd 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/envbuild.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/envbuild.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/wrappers.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/wrappers.cpython-37.pyc index eb60294..43ad030 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/wrappers.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/pep517/__pycache__/wrappers.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py b/env/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py index baa14d3..d6524b6 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py @@ -21,19 +21,28 @@ import sys # This is run as a script, not a module, so it can't do a relative import import compat + +class BackendUnavailable(Exception): + """Raised if we cannot import the backend""" + + def _build_backend(): """Find and load the build backend""" ep = os.environ['PEP517_BUILD_BACKEND'] mod_path, _, obj_path = ep.partition(':') - obj = import_module(mod_path) + try: + obj = import_module(mod_path) + except ImportError: + raise BackendUnavailable if obj_path: for path_part in obj_path.split('.'): obj = getattr(obj, path_part) return obj + def get_requires_for_build_wheel(config_settings): """Invoke the optional get_requires_for_build_wheel hook - + Returns [] if the hook is not defined. """ backend = _build_backend() @@ -44,9 +53,10 @@ def get_requires_for_build_wheel(config_settings): else: return hook(config_settings) + def prepare_metadata_for_build_wheel(metadata_directory, config_settings): """Invoke optional prepare_metadata_for_build_wheel - + Implements a fallback by building a wheel if the hook isn't defined. """ backend = _build_backend() @@ -58,8 +68,10 @@ def prepare_metadata_for_build_wheel(metadata_directory, config_settings): else: return hook(metadata_directory, config_settings) + WHEEL_BUILT_MARKER = 'PEP517_ALREADY_BUILT_WHEEL' + def _dist_info_files(whl_zip): """Identify the .dist-info folder inside a wheel ZipFile.""" res = [] @@ -71,11 +83,13 @@ def _dist_info_files(whl_zip): return res raise Exception("No .dist-info folder found in wheel") -def _get_wheel_metadata_from_wheel(backend, metadata_directory, config_settings): + +def _get_wheel_metadata_from_wheel( + backend, metadata_directory, config_settings): """Build a wheel and extract the metadata from it. - - Fallback for when the build backend does not define the 'get_wheel_metadata' - hook. + + Fallback for when the build backend does not + define the 'get_wheel_metadata' hook. """ from zipfile import ZipFile whl_basename = backend.build_wheel(metadata_directory, config_settings) @@ -88,6 +102,7 @@ def _get_wheel_metadata_from_wheel(backend, metadata_directory, config_settings) zipf.extractall(path=metadata_directory, members=dist_info) return dist_info[0].split('/')[0] + def _find_already_built_wheel(metadata_directory): """Check for a wheel already built during the get_wheel_metadata hook. """ @@ -105,14 +120,16 @@ def _find_already_built_wheel(metadata_directory): print('Found multiple .whl files; unspecified behaviour. ' 'Will call build_wheel.') return None - + # Exactly one .whl file return whl_files[0] + def build_wheel(wheel_directory, config_settings, metadata_directory=None): """Invoke the mandatory build_wheel hook. - - If a wheel was already built in the prepare_metadata_for_build_wheel fallback, this + + If a wheel was already built in the + prepare_metadata_for_build_wheel fallback, this will copy it rather than rebuilding the wheel. """ prebuilt_whl = _find_already_built_wheel(metadata_directory) @@ -137,12 +154,15 @@ def get_requires_for_build_sdist(config_settings): else: return hook(config_settings) + class _DummyException(Exception): """Nothing should ever raise this exception""" + class GotUnsupportedOperation(Exception): """For internal use when backend raises UnsupportedOperation""" + def build_sdist(sdist_directory, config_settings): """Invoke the mandatory build_sdist hook.""" backend = _build_backend() @@ -151,6 +171,7 @@ def build_sdist(sdist_directory, config_settings): except getattr(backend, 'UnsupportedOperation', _DummyException): raise GotUnsupportedOperation + HOOK_NAMES = { 'get_requires_for_build_wheel', 'prepare_metadata_for_build_wheel', @@ -159,6 +180,7 @@ HOOK_NAMES = { 'build_sdist', } + def main(): if len(sys.argv) < 3: sys.exit("Needs args: hook_name, control_dir") @@ -173,10 +195,13 @@ def main(): json_out = {'unsupported': False, 'return_val': None} try: json_out['return_val'] = hook(**hook_input['kwargs']) + except BackendUnavailable: + json_out['no_backend'] = True except GotUnsupportedOperation: json_out['unsupported'] = True - + compat.write_json(json_out, pjoin(control_dir, 'output.json'), indent=2) + if __name__ == '__main__': main() diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pep517/check.py b/env/lib/python3.7/site-packages/pip/_vendor/pep517/check.py index c65d51c..f4cdc6b 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/pep517/check.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/pep517/check.py @@ -18,10 +18,11 @@ from .wrappers import Pep517HookCaller log = logging.getLogger(__name__) -def check_build_sdist(hooks): + +def check_build_sdist(hooks, build_sys_requires): with BuildEnvironment() as env: try: - env.pip_install(hooks.build_sys_requires) + env.pip_install(build_sys_requires) log.info('Installed static build dependencies') except CalledProcessError: log.error('Failed to install static build dependencies') @@ -30,7 +31,7 @@ def check_build_sdist(hooks): try: reqs = hooks.get_requires_for_build_sdist({}) log.info('Got build requires: %s', reqs) - except: + except Exception: log.error('Failure in get_requires_for_build_sdist', exc_info=True) return False @@ -47,12 +48,13 @@ def check_build_sdist(hooks): try: filename = hooks.build_sdist(td, {}) log.info('build_sdist returned %r', filename) - except: + except Exception: log.info('Failure in build_sdist', exc_info=True) return False if not filename.endswith('.tar.gz'): - log.error("Filename %s doesn't have .tar.gz extension", filename) + log.error( + "Filename %s doesn't have .tar.gz extension", filename) return False path = pjoin(td, filename) @@ -73,10 +75,11 @@ def check_build_sdist(hooks): return True -def check_build_wheel(hooks): + +def check_build_wheel(hooks, build_sys_requires): with BuildEnvironment() as env: try: - env.pip_install(hooks.build_sys_requires) + env.pip_install(build_sys_requires) log.info('Installed static build dependencies') except CalledProcessError: log.error('Failed to install static build dependencies') @@ -85,7 +88,7 @@ def check_build_wheel(hooks): try: reqs = hooks.get_requires_for_build_wheel({}) log.info('Got build requires: %s', reqs) - except: + except Exception: log.error('Failure in get_requires_for_build_sdist', exc_info=True) return False @@ -102,7 +105,7 @@ def check_build_wheel(hooks): try: filename = hooks.build_wheel(td, {}) log.info('build_wheel returned %r', filename) - except: + except Exception: log.info('Failure in build_wheel', exc_info=True) return False @@ -151,8 +154,8 @@ def check(source_dir): hooks = Pep517HookCaller(source_dir, backend) - sdist_ok = check_build_sdist(hooks) - wheel_ok = check_build_wheel(hooks) + sdist_ok = check_build_sdist(hooks, requires) + wheel_ok = check_build_wheel(hooks, requires) if not sdist_ok: log.warning('Sdist checks failed; scroll up to see') @@ -164,7 +167,8 @@ def check(source_dir): def main(argv=None): ap = argparse.ArgumentParser() - ap.add_argument('source_dir', + ap.add_argument( + 'source_dir', help="A directory containing pyproject.toml") args = ap.parse_args(argv) @@ -178,17 +182,21 @@ def main(argv=None): print(ansi('Checks failed', 'red')) sys.exit(1) + ansi_codes = { 'reset': '\x1b[0m', 'bold': '\x1b[1m', 'red': '\x1b[31m', 'green': '\x1b[32m', } + + def ansi(s, attr): if os.name != 'nt' and sys.stdout.isatty(): return ansi_codes[attr] + str(s) + ansi_codes['reset'] else: return str(s) + if __name__ == '__main__': main() diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pep517/colorlog.py b/env/lib/python3.7/site-packages/pip/_vendor/pep517/colorlog.py index 26cf748..69c8a59 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/pep517/colorlog.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/pep517/colorlog.py @@ -24,6 +24,7 @@ try: except ImportError: curses = None + def _stderr_supports_color(): color = False if curses and hasattr(sys.stderr, 'isatty') and sys.stderr.isatty(): @@ -35,13 +36,14 @@ def _stderr_supports_color(): pass return color + class LogFormatter(logging.Formatter): """Log formatter with colour support """ DEFAULT_COLORS = { - logging.INFO: 2, # Green - logging.WARNING: 3, # Yellow - logging.ERROR: 1, # Red + logging.INFO: 2, # Green + logging.WARNING: 3, # Yellow + logging.ERROR: 1, # Red logging.CRITICAL: 1, } @@ -75,7 +77,8 @@ class LogFormatter(logging.Formatter): fg_color = str(fg_color, "ascii") for levelno, code in self.DEFAULT_COLORS.items(): - self._colors[levelno] = str(curses.tparm(fg_color, code), "ascii") + self._colors[levelno] = str( + curses.tparm(fg_color, code), "ascii") self._normal = str(curses.tigetstr("sgr0"), "ascii") scr = curses.initscr() @@ -83,15 +86,16 @@ class LogFormatter(logging.Formatter): curses.endwin() else: self._normal = '' - # Default width is usually 80, but too wide is worse than too narrow + # Default width is usually 80, but too wide is + # worse than too narrow self.termwidth = 70 def formatMessage(self, record): - l = len(record.message) + mlen = len(record.message) right_text = '{initial}-{name}'.format(initial=record.levelname[0], name=record.name) - if l + len(right_text) < self.termwidth: - space = ' ' * (self.termwidth - (l + len(right_text))) + if mlen + len(right_text) < self.termwidth: + space = ' ' * (self.termwidth - (mlen + len(right_text))) else: space = ' ' @@ -103,6 +107,7 @@ class LogFormatter(logging.Formatter): return record.message + space + start_color + right_text + end_color + def enable_colourful_output(level=logging.INFO): handler = logging.StreamHandler() handler.setFormatter(LogFormatter()) diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pep517/envbuild.py b/env/lib/python3.7/site-packages/pip/_vendor/pep517/envbuild.py index c264f46..f7ac5f4 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/pep517/envbuild.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/pep517/envbuild.py @@ -14,6 +14,7 @@ from .wrappers import Pep517HookCaller log = logging.getLogger(__name__) + def _load_pyproject(source_dir): with open(os.path.join(source_dir, 'pyproject.toml')) as f: pyproject_data = pytoml.load(f) @@ -89,11 +90,17 @@ class BuildEnvironment(object): if not reqs: return log.info('Calling pip to install %s', reqs) - check_call([sys.executable, '-m', 'pip', 'install', '--ignore-installed', - '--prefix', self.path] + list(reqs)) + check_call([ + sys.executable, '-m', 'pip', 'install', '--ignore-installed', + '--prefix', self.path] + list(reqs)) def __exit__(self, exc_type, exc_val, exc_tb): - if self._cleanup and (self.path is not None) and os.path.isdir(self.path): + needs_cleanup = ( + self._cleanup and + self.path is not None and + os.path.isdir(self.path) + ) + if needs_cleanup: shutil.rmtree(self.path) if self.save_path is None: @@ -106,6 +113,7 @@ class BuildEnvironment(object): else: os.environ['PYTHONPATH'] = self.save_pythonpath + def build_wheel(source_dir, wheel_dir, config_settings=None): """Build a wheel from a source directory using PEP 517 hooks. diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pep517/wrappers.py b/env/lib/python3.7/site-packages/pip/_vendor/pep517/wrappers.py index 28260f3..b14b899 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/pep517/wrappers.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/pep517/wrappers.py @@ -10,6 +10,7 @@ from . import compat _in_proc_script = pjoin(dirname(abspath(__file__)), '_in_process.py') + @contextmanager def tempdir(): td = mkdtemp() @@ -18,9 +19,24 @@ def tempdir(): finally: shutil.rmtree(td) + +class BackendUnavailable(Exception): + """Will be raised if the backend cannot be imported in the hook process.""" + + class UnsupportedOperation(Exception): """May be raised by build_sdist if the backend indicates that it can't.""" + +def default_subprocess_runner(cmd, cwd=None, extra_environ=None): + """The default method of calling the wrapper subprocess.""" + env = os.environ.copy() + if extra_environ: + env.update(extra_environ) + + check_call(cmd, cwd=cwd, env=env) + + class Pep517HookCaller(object): """A wrapper around a source directory to be built with a PEP 517 backend. @@ -30,6 +46,16 @@ class Pep517HookCaller(object): def __init__(self, source_dir, build_backend): self.source_dir = abspath(source_dir) self.build_backend = build_backend + self._subprocess_runner = default_subprocess_runner + + # TODO: Is this over-engineered? Maybe frontends only need to + # set this when creating the wrapper, not on every call. + @contextmanager + def subprocess_runner(self, runner): + prev = self._subprocess_runner + self._subprocess_runner = runner + yield + self._subprocess_runner = prev def get_requires_for_build_wheel(self, config_settings=None): """Identify packages required for building a wheel @@ -45,7 +71,8 @@ class Pep517HookCaller(object): 'config_settings': config_settings }) - def prepare_metadata_for_build_wheel(self, metadata_directory, config_settings=None): + def prepare_metadata_for_build_wheel( + self, metadata_directory, config_settings=None): """Prepare a *.dist-info folder with metadata for this project. Returns the name of the newly created folder. @@ -59,7 +86,9 @@ class Pep517HookCaller(object): 'config_settings': config_settings, }) - def build_wheel(self, wheel_directory, config_settings=None, metadata_directory=None): + def build_wheel( + self, wheel_directory, config_settings=None, + metadata_directory=None): """Build a wheel from this project. Returns the name of the newly created file. @@ -103,10 +132,7 @@ class Pep517HookCaller(object): 'config_settings': config_settings, }) - def _call_hook(self, hook_name, kwargs): - env = os.environ.copy() - # On Python 2, pytoml returns Unicode values (which is correct) but the # environment passed to check_call needs to contain string values. We # convert here by encoding using ASCII (the backend can only contain @@ -118,17 +144,20 @@ class Pep517HookCaller(object): else: build_backend = self.build_backend - env['PEP517_BUILD_BACKEND'] = build_backend with tempdir() as td: compat.write_json({'kwargs': kwargs}, pjoin(td, 'input.json'), indent=2) # Run the hook in a subprocess - check_call([sys.executable, _in_proc_script, hook_name, td], - cwd=self.source_dir, env=env) + self._subprocess_runner( + [sys.executable, _in_proc_script, hook_name, td], + cwd=self.source_dir, + extra_environ={'PEP517_BUILD_BACKEND': build_backend} + ) data = compat.read_json(pjoin(td, 'output.json')) if data.get('unsupported'): raise UnsupportedOperation + if data.get('no_backend'): + raise BackendUnavailable return data['return_val'] - diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py b/env/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py index 0b432f6..fdd40de 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py @@ -39,6 +39,8 @@ import tempfile import textwrap import itertools import inspect +import ntpath +import posixpath from pkgutil import get_importer try: @@ -238,6 +240,9 @@ __all__ = [ 'register_finder', 'register_namespace_handler', 'register_loader_type', 'fixup_namespace_packages', 'get_importer', + # Warnings + 'PkgResourcesDeprecationWarning', + # Deprecated/backward compatibility only 'run_main', 'AvailableDistributions', ] @@ -1398,8 +1403,15 @@ class NullProvider: def has_resource(self, resource_name): return self._has(self._fn(self.module_path, resource_name)) + def _get_metadata_path(self, name): + return self._fn(self.egg_info, name) + def has_metadata(self, name): - return self.egg_info and self._has(self._fn(self.egg_info, name)) + if not self.egg_info: + return self.egg_info + + path = self._get_metadata_path(name) + return self._has(path) def get_metadata(self, name): if not self.egg_info: @@ -1463,10 +1475,86 @@ class NullProvider: ) def _fn(self, base, resource_name): + self._validate_resource_path(resource_name) if resource_name: return os.path.join(base, *resource_name.split('/')) return base + @staticmethod + def _validate_resource_path(path): + """ + Validate the resource paths according to the docs. + https://setuptools.readthedocs.io/en/latest/pkg_resources.html#basic-resource-access + + >>> warned = getfixture('recwarn') + >>> warnings.simplefilter('always') + >>> vrp = NullProvider._validate_resource_path + >>> vrp('foo/bar.txt') + >>> bool(warned) + False + >>> vrp('../foo/bar.txt') + >>> bool(warned) + True + >>> warned.clear() + >>> vrp('/foo/bar.txt') + >>> bool(warned) + True + >>> vrp('foo/../../bar.txt') + >>> bool(warned) + True + >>> warned.clear() + >>> vrp('foo/f../bar.txt') + >>> bool(warned) + False + + Windows path separators are straight-up disallowed. + >>> vrp(r'\\foo/bar.txt') + Traceback (most recent call last): + ... + ValueError: Use of .. or absolute path in a resource path \ +is not allowed. + + >>> vrp(r'C:\\foo/bar.txt') + Traceback (most recent call last): + ... + ValueError: Use of .. or absolute path in a resource path \ +is not allowed. + + Blank values are allowed + + >>> vrp('') + >>> bool(warned) + False + + Non-string values are not. + + >>> vrp(None) + Traceback (most recent call last): + ... + AttributeError: ... + """ + invalid = ( + os.path.pardir in path.split(posixpath.sep) or + posixpath.isabs(path) or + ntpath.isabs(path) + ) + if not invalid: + return + + msg = "Use of .. or absolute path in a resource path is not allowed." + + # Aggressively disallow Windows absolute paths + if ntpath.isabs(path) and not posixpath.isabs(path): + raise ValueError(msg) + + # for compatibility, warn; in future + # raise ValueError(msg) + warnings.warn( + msg[:-1] + " and will raise exceptions in a future release.", + DeprecationWarning, + stacklevel=4, + ) + def _get(self, path): if hasattr(self.loader, 'get_data'): return self.loader.get_data(path) @@ -1787,6 +1875,9 @@ class FileMetadata(EmptyProvider): def __init__(self, path): self.path = path + def _get_metadata_path(self, name): + return self.path + def has_metadata(self, name): return name == 'PKG-INFO' and os.path.isfile(self.path) @@ -1885,7 +1976,7 @@ def find_eggs_in_zip(importer, path_item, only=False): if only: # don't yield nested distros return - for subitem in metadata.resource_listdir('/'): + for subitem in metadata.resource_listdir(''): if _is_egg_path(subitem): subpath = os.path.join(path_item, subitem) dists = find_eggs_in_zip(zipimport.zipimporter(subpath), subpath) @@ -2228,7 +2319,18 @@ register_namespace_handler(object, null_ns_handler) def normalize_path(filename): """Normalize a file/dir name for comparison purposes""" - return os.path.normcase(os.path.realpath(filename)) + return os.path.normcase(os.path.realpath(os.path.normpath(_cygwin_patch(filename)))) + + +def _cygwin_patch(filename): # pragma: nocover + """ + Contrary to POSIX 2008, on Cygwin, getcwd (3) contains + symlink components. Using + os.path.abspath() works around this limitation. A fix in os.getcwd() + would probably better, in Cygwin even more so, except + that this seems to be by design... + """ + return os.path.abspath(filename) if sys.platform == 'cygwin' else filename def _normalize_cached(filename, _cache={}): @@ -2324,7 +2426,7 @@ class EntryPoint: warnings.warn( "Parameters to load are deprecated. Call .resolve and " ".require separately.", - DeprecationWarning, + PkgResourcesDeprecationWarning, stacklevel=2, ) if require: @@ -2569,10 +2671,14 @@ class Distribution: try: return self._version except AttributeError: - version = _version_from_file(self._get_metadata(self.PKG_INFO)) + version = self._get_version() if version is None: - tmpl = "Missing 'Version:' header and/or %s file" - raise ValueError(tmpl % self.PKG_INFO, self) + path = self._get_metadata_path_for_display(self.PKG_INFO) + msg = ( + "Missing 'Version:' header and/or {} file at path: {}" + ).format(self.PKG_INFO, path) + raise ValueError(msg, self) + return version @property @@ -2630,11 +2736,34 @@ class Distribution: ) return deps + def _get_metadata_path_for_display(self, name): + """ + Return the path to the given metadata file, if available. + """ + try: + # We need to access _get_metadata_path() on the provider object + # directly rather than through this class's __getattr__() + # since _get_metadata_path() is marked private. + path = self._provider._get_metadata_path(name) + + # Handle exceptions e.g. in case the distribution's metadata + # provider doesn't support _get_metadata_path(). + except Exception: + return '[could not detect]' + + return path + def _get_metadata(self, name): if self.has_metadata(name): for line in self.get_metadata_lines(name): yield line + def _get_version(self): + lines = self._get_metadata(self.PKG_INFO) + version = _version_from_file(lines) + + return version + def activate(self, path=None, replace=False): """Ensure distribution is importable on `path` (default=sys.path)""" if path is None: @@ -2853,7 +2982,7 @@ class EggInfoDistribution(Distribution): take an extra step and try to get the version number from the metadata file itself instead of the filename. """ - md_version = _version_from_file(self._get_metadata(self.PKG_INFO)) + md_version = self._get_version() if md_version: self._version = md_version return self @@ -3147,3 +3276,11 @@ def _initialize_master_working_set(): # match order list(map(working_set.add_entry, sys.path)) globals().update(locals()) + +class PkgResourcesDeprecationWarning(Warning): + """ + Base class for warning about deprecations in ``pkg_resources`` + + This class is not derived from ``DeprecationWarning``, and as such is + visible by default. + """ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-37.pyc index b6c7d21..9f2c479 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__pycache__/py31compat.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__pycache__/py31compat.cpython-37.pyc index ca0dca3..8fad861 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__pycache__/py31compat.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__pycache__/py31compat.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/progress/__init__.py b/env/lib/python3.7/site-packages/pip/_vendor/progress/__init__.py index a41f65d..e434c25 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/progress/__init__.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/progress/__init__.py @@ -12,31 +12,49 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -from __future__ import division +from __future__ import division, print_function from collections import deque from datetime import timedelta from math import ceil from sys import stderr -from time import time +try: + from time import monotonic +except ImportError: + from time import time as monotonic -__version__ = '1.4' +__version__ = '1.5' + +HIDE_CURSOR = '\x1b[?25l' +SHOW_CURSOR = '\x1b[?25h' class Infinite(object): file = stderr sma_window = 10 # Simple Moving Average window + check_tty = True + hide_cursor = True - def __init__(self, *args, **kwargs): + def __init__(self, message='', **kwargs): self.index = 0 - self.start_ts = time() + self.start_ts = monotonic() self.avg = 0 + self._avg_update_ts = self.start_ts self._ts = self.start_ts self._xput = deque(maxlen=self.sma_window) for key, val in kwargs.items(): setattr(self, key, val) + self._width = 0 + self.message = message + + if self.file and self.is_tty(): + if self.hide_cursor: + print(HIDE_CURSOR, end='', file=self.file) + print(self.message, end='', file=self.file) + self.file.flush() + def __getitem__(self, key): if key.startswith('_'): return None @@ -44,7 +62,7 @@ class Infinite(object): @property def elapsed(self): - return int(time() - self.start_ts) + return int(monotonic() - self.start_ts) @property def elapsed_td(self): @@ -52,8 +70,14 @@ class Infinite(object): def update_avg(self, n, dt): if n > 0: + xput_len = len(self._xput) self._xput.append(dt / n) - self.avg = sum(self._xput) / len(self._xput) + now = monotonic() + # update when we're still filling _xput, then after every second + if (xput_len < self.sma_window or + now - self._avg_update_ts > 1): + self.avg = sum(self._xput) / len(self._xput) + self._avg_update_ts = now def update(self): pass @@ -61,11 +85,34 @@ class Infinite(object): def start(self): pass + def clearln(self): + if self.file and self.is_tty(): + print('\r\x1b[K', end='', file=self.file) + + def write(self, s): + if self.file and self.is_tty(): + line = self.message + s.ljust(self._width) + print('\r' + line, end='', file=self.file) + self._width = max(self._width, len(s)) + self.file.flush() + + def writeln(self, line): + if self.file and self.is_tty(): + self.clearln() + print(line, end='', file=self.file) + self.file.flush() + def finish(self): - pass + if self.file and self.is_tty(): + print(file=self.file) + if self.hide_cursor: + print(SHOW_CURSOR, end='', file=self.file) + + def is_tty(self): + return self.file.isatty() if self.check_tty else True def next(self, n=1): - now = time() + now = monotonic() dt = now - self._ts self.update_avg(n, dt) self._ts = now @@ -73,12 +120,17 @@ class Infinite(object): self.update() def iter(self, it): - try: + with self: for x in it: yield x self.next() - finally: - self.finish() + + def __enter__(self): + self.start() + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self.finish() class Progress(Infinite): @@ -119,9 +171,7 @@ class Progress(Infinite): except TypeError: pass - try: + with self: for x in it: yield x self.next() - finally: - self.finish() diff --git a/env/lib/python3.7/site-packages/pip/_vendor/progress/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/progress/__pycache__/__init__.cpython-37.pyc index 6492871..661ee84 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/progress/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/progress/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/progress/__pycache__/bar.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/progress/__pycache__/bar.cpython-37.pyc index d9cf8e0..d63f551 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/progress/__pycache__/bar.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/progress/__pycache__/bar.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/progress/__pycache__/counter.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/progress/__pycache__/counter.cpython-37.pyc index 7cfde8c..9bdc438 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/progress/__pycache__/counter.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/progress/__pycache__/counter.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/progress/__pycache__/helpers.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/progress/__pycache__/helpers.cpython-37.pyc deleted file mode 100644 index 18ab229..0000000 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/progress/__pycache__/helpers.cpython-37.pyc and /dev/null differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/progress/__pycache__/spinner.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/progress/__pycache__/spinner.cpython-37.pyc index cd8f9e8..e895c4e 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/progress/__pycache__/spinner.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/progress/__pycache__/spinner.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/progress/bar.py b/env/lib/python3.7/site-packages/pip/_vendor/progress/bar.py index 025e61c..8819efd 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/progress/bar.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/progress/bar.py @@ -19,18 +19,15 @@ from __future__ import unicode_literals import sys from . import Progress -from .helpers import WritelnMixin -class Bar(WritelnMixin, Progress): +class Bar(Progress): width = 32 - message = '' suffix = '%(index)d/%(max)d' bar_prefix = ' |' bar_suffix = '| ' empty_fill = ' ' fill = '#' - hide_cursor = True def update(self): filled_length = int(self.width * self.progress) diff --git a/env/lib/python3.7/site-packages/pip/_vendor/progress/counter.py b/env/lib/python3.7/site-packages/pip/_vendor/progress/counter.py index 6b45a1e..d955ca4 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/progress/counter.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/progress/counter.py @@ -16,27 +16,20 @@ from __future__ import unicode_literals from . import Infinite, Progress -from .helpers import WriteMixin -class Counter(WriteMixin, Infinite): - message = '' - hide_cursor = True - +class Counter(Infinite): def update(self): self.write(str(self.index)) -class Countdown(WriteMixin, Progress): - hide_cursor = True - +class Countdown(Progress): def update(self): self.write(str(self.remaining)) -class Stack(WriteMixin, Progress): +class Stack(Progress): phases = (' ', '▁', '▂', '▃', '▄', '▅', '▆', '▇', '█') - hide_cursor = True def update(self): nphases = len(self.phases) diff --git a/env/lib/python3.7/site-packages/pip/_vendor/progress/helpers.py b/env/lib/python3.7/site-packages/pip/_vendor/progress/helpers.py deleted file mode 100644 index 0cde44e..0000000 --- a/env/lib/python3.7/site-packages/pip/_vendor/progress/helpers.py +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright (c) 2012 Giorgos Verigakis -# -# Permission to use, copy, modify, and distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -from __future__ import print_function - - -HIDE_CURSOR = '\x1b[?25l' -SHOW_CURSOR = '\x1b[?25h' - - -class WriteMixin(object): - hide_cursor = False - - def __init__(self, message=None, **kwargs): - super(WriteMixin, self).__init__(**kwargs) - self._width = 0 - if message: - self.message = message - - if self.file and self.file.isatty(): - if self.hide_cursor: - print(HIDE_CURSOR, end='', file=self.file) - print(self.message, end='', file=self.file) - self.file.flush() - - def write(self, s): - if self.file and self.file.isatty(): - b = '\b' * self._width - c = s.ljust(self._width) - print(b + c, end='', file=self.file) - self._width = max(self._width, len(s)) - self.file.flush() - - def finish(self): - if self.file and self.file.isatty() and self.hide_cursor: - print(SHOW_CURSOR, end='', file=self.file) - - -class WritelnMixin(object): - hide_cursor = False - - def __init__(self, message=None, **kwargs): - super(WritelnMixin, self).__init__(**kwargs) - if message: - self.message = message - - if self.file and self.file.isatty() and self.hide_cursor: - print(HIDE_CURSOR, end='', file=self.file) - - def clearln(self): - if self.file and self.file.isatty(): - print('\r\x1b[K', end='', file=self.file) - - def writeln(self, line): - if self.file and self.file.isatty(): - self.clearln() - print(line, end='', file=self.file) - self.file.flush() - - def finish(self): - if self.file and self.file.isatty(): - print(file=self.file) - if self.hide_cursor: - print(SHOW_CURSOR, end='', file=self.file) - - -from signal import signal, SIGINT -from sys import exit - - -class SigIntMixin(object): - """Registers a signal handler that calls finish on SIGINT""" - - def __init__(self, *args, **kwargs): - super(SigIntMixin, self).__init__(*args, **kwargs) - signal(SIGINT, self._sigint_handler) - - def _sigint_handler(self, signum, frame): - self.finish() - exit(0) diff --git a/env/lib/python3.7/site-packages/pip/_vendor/progress/spinner.py b/env/lib/python3.7/site-packages/pip/_vendor/progress/spinner.py index 464c7b2..4e100ca 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/progress/spinner.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/progress/spinner.py @@ -16,11 +16,9 @@ from __future__ import unicode_literals from . import Infinite -from .helpers import WriteMixin -class Spinner(WriteMixin, Infinite): - message = '' +class Spinner(Infinite): phases = ('-', '\\', '|', '/') hide_cursor = True @@ -40,5 +38,6 @@ class MoonSpinner(Spinner): class LineSpinner(Spinner): phases = ['⎺', '⎻', '⎼', '⎽', '⎼', '⎻'] + class PixelSpinner(Spinner): - phases = ['⣾','⣷', '⣯', '⣟', '⡿', '⢿', '⣻', '⣽'] + phases = ['⣾', '⣷', '⣯', '⣟', '⡿', '⢿', '⣻', '⣽'] diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pyparsing.py b/env/lib/python3.7/site-packages/pip/_vendor/pyparsing.py index 865152d..9d6a01d 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/pyparsing.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/pyparsing.py @@ -1,6 +1,7 @@ +#-*- coding: utf-8 -*- # module pyparsing.py # -# Copyright (c) 2003-2018 Paul T. McGuire +# Copyright (c) 2003-2019 Paul T. McGuire # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -27,15 +28,18 @@ __doc__ = \ pyparsing module - Classes and methods to define and execute parsing grammars ============================================================================= -The pyparsing module is an alternative approach to creating and executing simple grammars, -vs. the traditional lex/yacc approach, or the use of regular expressions. With pyparsing, you -don't need to learn a new syntax for defining grammars or matching expressions - the parsing module -provides a library of classes that you use to construct the grammar directly in Python. +The pyparsing module is an alternative approach to creating and +executing simple grammars, vs. the traditional lex/yacc approach, or the +use of regular expressions. With pyparsing, you don't need to learn +a new syntax for defining grammars or matching expressions - the parsing +module provides a library of classes that you use to construct the +grammar directly in Python. -Here is a program to parse "Hello, World!" (or any greeting of the form -C{", !"}), built up using L{Word}, L{Literal}, and L{And} elements -(L{'+'} operator gives L{And} expressions, strings are auto-converted to -L{Literal} expressions):: +Here is a program to parse "Hello, World!" (or any greeting of the form +``", !"``), built up using :class:`Word`, +:class:`Literal`, and :class:`And` elements +(the :class:`'+'` operators create :class:`And` expressions, +and the strings are auto-converted to :class:`Literal` expressions):: from pip._vendor.pyparsing import Word, alphas @@ -49,33 +53,48 @@ The program outputs the following:: Hello, World! -> ['Hello', ',', 'World', '!'] -The Python representation of the grammar is quite readable, owing to the self-explanatory -class names, and the use of '+', '|' and '^' operators. +The Python representation of the grammar is quite readable, owing to the +self-explanatory class names, and the use of '+', '|' and '^' operators. -The L{ParseResults} object returned from L{ParserElement.parseString} can be accessed as a nested list, a dictionary, or an -object with named attributes. +The :class:`ParseResults` object returned from +:class:`ParserElement.parseString` can be +accessed as a nested list, a dictionary, or an object with named +attributes. -The pyparsing module handles some of the problems that are typically vexing when writing text parsers: - - extra or missing whitespace (the above program will also handle "Hello,World!", "Hello , World !", etc.) - - quoted strings - - embedded comments +The pyparsing module handles some of the problems that are typically +vexing when writing text parsers: + + - extra or missing whitespace (the above program will also handle + "Hello,World!", "Hello , World !", etc.) + - quoted strings + - embedded comments Getting Started - ----------------- -Visit the classes L{ParserElement} and L{ParseResults} to see the base classes that most other pyparsing +Visit the classes :class:`ParserElement` and :class:`ParseResults` to +see the base classes that most other pyparsing classes inherit from. Use the docstrings for examples of how to: - - construct literal match expressions from L{Literal} and L{CaselessLiteral} classes - - construct character word-group expressions using the L{Word} class - - see how to create repetitive expressions using L{ZeroOrMore} and L{OneOrMore} classes - - use L{'+'}, L{'|'}, L{'^'}, and L{'&'} operators to combine simple expressions into more complex ones - - associate names with your parsed results using L{ParserElement.setResultsName} - - find some helpful expression short-cuts like L{delimitedList} and L{oneOf} - - find more useful common expressions in the L{pyparsing_common} namespace class + + - construct literal match expressions from :class:`Literal` and + :class:`CaselessLiteral` classes + - construct character word-group expressions using the :class:`Word` + class + - see how to create repetitive expressions using :class:`ZeroOrMore` + and :class:`OneOrMore` classes + - use :class:`'+'`, :class:`'|'`, :class:`'^'`, + and :class:`'&'` operators to combine simple expressions into + more complex ones + - associate names with your parsed results using + :class:`ParserElement.setResultsName` + - find some helpful expression short-cuts like :class:`delimitedList` + and :class:`oneOf` + - find more useful common expressions in the :class:`pyparsing_common` + namespace class """ -__version__ = "2.2.1" -__versionTime__ = "18 Sep 2018 00:49 UTC" +__version__ = "2.4.0" +__versionTime__ = "07 Apr 2019 18:28 UTC" __author__ = "Paul McGuire " import string @@ -91,6 +110,12 @@ import traceback import types from datetime import datetime +try: + # Python 3 + from itertools import filterfalse +except ImportError: + from itertools import ifilterfalse as filterfalse + try: from _thread import RLock except ImportError: @@ -113,27 +138,47 @@ except ImportError: except ImportError: _OrderedDict = None +try: + from types import SimpleNamespace +except ImportError: + class SimpleNamespace: pass + +# version compatibility configuration +__compat__ = SimpleNamespace() +__compat__.__doc__ = """ + A cross-version compatibility configuration for pyparsing features that will be + released in a future version. By setting values in this configuration to True, + those features can be enabled in prior versions for compatibility development + and testing. + + - collect_all_And_tokens - flag to enable fix for Issue #63 that fixes erroneous grouping + of results names when an And expression is nested within an Or or MatchFirst; set to + True to enable bugfix to be released in pyparsing 2.4 +""" +__compat__.collect_all_And_tokens = True + + #~ sys.stderr.write( "testing pyparsing module, version %s, %s\n" % (__version__,__versionTime__ ) ) -__all__ = [ +__all__ = [ '__version__', '__versionTime__', '__author__', '__compat__', 'And', 'CaselessKeyword', 'CaselessLiteral', 'CharsNotIn', 'Combine', 'Dict', 'Each', 'Empty', 'FollowedBy', 'Forward', 'GoToColumn', 'Group', 'Keyword', 'LineEnd', 'LineStart', 'Literal', -'MatchFirst', 'NoMatch', 'NotAny', 'OneOrMore', 'OnlyOnce', 'Optional', 'Or', +'PrecededBy', 'MatchFirst', 'NoMatch', 'NotAny', 'OneOrMore', 'OnlyOnce', 'Optional', 'Or', 'ParseBaseException', 'ParseElementEnhance', 'ParseException', 'ParseExpression', 'ParseFatalException', 'ParseResults', 'ParseSyntaxException', 'ParserElement', 'QuotedString', 'RecursiveGrammarException', -'Regex', 'SkipTo', 'StringEnd', 'StringStart', 'Suppress', 'Token', 'TokenConverter', -'White', 'Word', 'WordEnd', 'WordStart', 'ZeroOrMore', +'Regex', 'SkipTo', 'StringEnd', 'StringStart', 'Suppress', 'Token', 'TokenConverter', +'White', 'Word', 'WordEnd', 'WordStart', 'ZeroOrMore', 'Char', 'alphanums', 'alphas', 'alphas8bit', 'anyCloseTag', 'anyOpenTag', 'cStyleComment', 'col', 'commaSeparatedList', 'commonHTMLEntity', 'countedArray', 'cppStyleComment', 'dblQuotedString', 'dblSlashComment', 'delimitedList', 'dictOf', 'downcaseTokens', 'empty', 'hexnums', 'htmlComment', 'javaStyleComment', 'line', 'lineEnd', 'lineStart', 'lineno', 'makeHTMLTags', 'makeXMLTags', 'matchOnlyAtCol', 'matchPreviousExpr', 'matchPreviousLiteral', 'nestedExpr', 'nullDebugAction', 'nums', 'oneOf', 'opAssoc', 'operatorPrecedence', 'printables', -'punc8bit', 'pythonStyleComment', 'quotedString', 'removeQuotes', 'replaceHTMLEntity', +'punc8bit', 'pythonStyleComment', 'quotedString', 'removeQuotes', 'replaceHTMLEntity', 'replaceWith', 'restOfLine', 'sglQuotedString', 'srange', 'stringEnd', 'stringStart', 'traceParseAction', 'unicodeString', 'upcaseTokens', 'withAttribute', 'indentedBlock', 'originalTextFor', 'ungroup', 'infixNotation','locatedExpr', 'withClass', -'CloseMatch', 'tokenMap', 'pyparsing_common', +'CloseMatch', 'tokenMap', 'pyparsing_common', 'pyparsing_unicode', 'unicode_set', ] system_version = tuple(sys.version_info)[:3] @@ -142,6 +187,7 @@ if PY_3: _MAX_INT = sys.maxsize basestring = str unichr = chr + unicode = str _ustr = str # build list of single arg builtins, that can be used as parse actions @@ -152,9 +198,11 @@ else: range = xrange def _ustr(obj): - """Drop-in replacement for str(obj) that tries to be Unicode friendly. It first tries - str(obj). If that fails with a UnicodeEncodeError, then it tries unicode(obj). It - then < returns the unicode object | encodes it with the default encoding | ... >. + """Drop-in replacement for str(obj) that tries to be Unicode + friendly. It first tries str(obj). If that fails with + a UnicodeEncodeError, then it tries unicode(obj). It then + < returns the unicode object | encodes it with the default + encoding | ... >. """ if isinstance(obj,unicode): return obj @@ -179,9 +227,9 @@ else: singleArgBuiltins.append(getattr(__builtin__,fname)) except AttributeError: continue - + _generatorType = type((y for y in range(1))) - + def _xml_escape(data): """Escape &, <, >, ", ', etc. in a string of data.""" @@ -192,9 +240,6 @@ def _xml_escape(data): data = data.replace(from_, to_) return data -class _Constants(object): - pass - alphas = string.ascii_uppercase + string.ascii_lowercase nums = "0123456789" hexnums = nums + "ABCDEFabcdef" @@ -220,16 +265,16 @@ class ParseBaseException(Exception): @classmethod def _from_exception(cls, pe): """ - internal factory method to simplify creating one type of ParseException + internal factory method to simplify creating one type of ParseException from another - avoids having __init__ signature conflicts among subclasses """ return cls(pe.pstr, pe.loc, pe.msg, pe.parserElement) def __getattr__( self, aname ): """supported attributes by name are: - - lineno - returns the line number of the exception text - - col - returns the column number of the exception text - - line - returns the line containing the exception text + - lineno - returns the line number of the exception text + - col - returns the column number of the exception text + - line - returns the line containing the exception text """ if( aname == "lineno" ): return lineno( self.loc, self.pstr ) @@ -262,22 +307,94 @@ class ParseException(ParseBaseException): """ Exception thrown when parse expressions don't match class; supported attributes by name are: - - lineno - returns the line number of the exception text - - col - returns the column number of the exception text - - line - returns the line containing the exception text - + - lineno - returns the line number of the exception text + - col - returns the column number of the exception text + - line - returns the line containing the exception text + Example:: + try: Word(nums).setName("integer").parseString("ABC") except ParseException as pe: print(pe) print("column: {}".format(pe.col)) - + prints:: + Expected integer (at char 0), (line:1, col:1) column: 1 + """ - pass + + @staticmethod + def explain(exc, depth=16): + """ + Method to take an exception and translate the Python internal traceback into a list + of the pyparsing expressions that caused the exception to be raised. + + Parameters: + + - exc - exception raised during parsing (need not be a ParseException, in support + of Python exceptions that might be raised in a parse action) + - depth (default=16) - number of levels back in the stack trace to list expression + and function names; if None, the full stack trace names will be listed; if 0, only + the failing input line, marker, and exception string will be shown + + Returns a multi-line string listing the ParserElements and/or function names in the + exception's stack trace. + + Note: the diagnostic output will include string representations of the expressions + that failed to parse. These representations will be more helpful if you use `setName` to + give identifiable names to your expressions. Otherwise they will use the default string + forms, which may be cryptic to read. + + explain() is only supported under Python 3. + """ + import inspect + + if depth is None: + depth = sys.getrecursionlimit() + ret = [] + if isinstance(exc, ParseBaseException): + ret.append(exc.line) + ret.append(' ' * (exc.col - 1) + '^') + ret.append("{0}: {1}".format(type(exc).__name__, exc)) + + if depth > 0: + callers = inspect.getinnerframes(exc.__traceback__, context=depth) + seen = set() + for i, ff in enumerate(callers[-depth:]): + frm = ff[0] + + f_self = frm.f_locals.get('self', None) + if isinstance(f_self, ParserElement): + if frm.f_code.co_name not in ('parseImpl', '_parseNoCache'): + continue + if f_self in seen: + continue + seen.add(f_self) + + self_type = type(f_self) + ret.append("{0}.{1} - {2}".format(self_type.__module__, + self_type.__name__, + f_self)) + elif f_self is not None: + self_type = type(f_self) + ret.append("{0}.{1}".format(self_type.__module__, + self_type.__name__)) + else: + code = frm.f_code + if code.co_name in ('wrapper', ''): + continue + + ret.append("{0}".format(code.co_name)) + + depth -= 1 + if not depth: + break + + return '\n'.join(ret) + class ParseFatalException(ParseBaseException): """user-throwable exception thrown when inconsistent parse content @@ -285,9 +402,11 @@ class ParseFatalException(ParseBaseException): pass class ParseSyntaxException(ParseFatalException): - """just like L{ParseFatalException}, but thrown internally when an - L{ErrorStop} ('-' operator) indicates that parsing is to stop - immediately because an unbacktrackable syntax error has been found""" + """just like :class:`ParseFatalException`, but thrown internally + when an :class:`ErrorStop` ('-' operator) indicates + that parsing is to stop immediately because an unbacktrackable + syntax error has been found. + """ pass #~ class ReparseException(ParseBaseException): @@ -304,7 +423,9 @@ class ParseSyntaxException(ParseFatalException): #~ self.reparseLoc = restartLoc class RecursiveGrammarException(Exception): - """exception thrown by L{ParserElement.validate} if the grammar could be improperly recursive""" + """exception thrown by :class:`ParserElement.validate` if the + grammar could be improperly recursive + """ def __init__( self, parseElementList ): self.parseElementTrace = parseElementList @@ -322,16 +443,18 @@ class _ParseResultsWithOffset(object): self.tup = (self.tup[0],i) class ParseResults(object): - """ - Structured parse results, to provide multiple means of access to the parsed data: - - as a list (C{len(results)}) - - by list index (C{results[0], results[1]}, etc.) - - by attribute (C{results.} - see L{ParserElement.setResultsName}) + """Structured parse results, to provide multiple means of access to + the parsed data: + + - as a list (``len(results)``) + - by list index (``results[0], results[1]``, etc.) + - by attribute (``results.`` - see :class:`ParserElement.setResultsName`) Example:: + integer = Word(nums) - date_str = (integer.setResultsName("year") + '/' - + integer.setResultsName("month") + '/' + date_str = (integer.setResultsName("year") + '/' + + integer.setResultsName("month") + '/' + integer.setResultsName("day")) # equivalent form: # date_str = integer("year") + '/' + integer("month") + '/' + integer("day") @@ -348,7 +471,9 @@ class ParseResults(object): test("'month' in result") test("'minutes' in result") test("result.dump()", str) + prints:: + list(result) -> ['1999', '/', '12', '/', '31'] result[0] -> '1999' result['month'] -> '12' @@ -398,7 +523,7 @@ class ParseResults(object): toklist = [ toklist ] if asList: if isinstance(toklist,ParseResults): - self[name] = _ParseResultsWithOffset(toklist.copy(),0) + self[name] = _ParseResultsWithOffset(ParseResults(toklist.__toklist), 0) else: self[name] = _ParseResultsWithOffset(ParseResults(toklist[0]),0) self[name].__name = name @@ -467,19 +592,19 @@ class ParseResults(object): def _itervalues( self ): return (self[k] for k in self._iterkeys()) - + def _iteritems( self ): return ((k, self[k]) for k in self._iterkeys()) if PY_3: - keys = _iterkeys - """Returns an iterator of all named result keys (Python 3.x only).""" + keys = _iterkeys + """Returns an iterator of all named result keys.""" values = _itervalues - """Returns an iterator of all named result values (Python 3.x only).""" + """Returns an iterator of all named result values.""" items = _iteritems - """Returns an iterator of all named result key-value tuples (Python 3.x only).""" + """Returns an iterator of all named result key-value tuples.""" else: iterkeys = _iterkeys @@ -498,7 +623,7 @@ class ParseResults(object): def values( self ): """Returns all named result values (as a list in Python 2.x, as an iterator in Python 3.x).""" return list(self.itervalues()) - + def items( self ): """Returns all named result key-values (as a list of tuples in Python 2.x, as an iterator in Python 3.x).""" return list(self.iteritems()) @@ -507,19 +632,20 @@ class ParseResults(object): """Since keys() returns an iterator, this method is helpful in bypassing code that looks for the existence of any defined results names.""" return bool(self.__tokdict) - + def pop( self, *args, **kwargs): """ - Removes and returns item at specified index (default=C{last}). - Supports both C{list} and C{dict} semantics for C{pop()}. If passed no - argument or an integer argument, it will use C{list} semantics - and pop tokens from the list of parsed tokens. If passed a - non-integer argument (most likely a string), it will use C{dict} - semantics and pop the corresponding value from any defined - results names. A second default return value argument is - supported, just as in C{dict.pop()}. + Removes and returns item at specified index (default= ``last``). + Supports both ``list`` and ``dict`` semantics for ``pop()``. If + passed no argument or an integer argument, it will use ``list`` + semantics and pop tokens from the list of parsed tokens. If passed + a non-integer argument (most likely a string), it will use ``dict`` + semantics and pop the corresponding value from any defined results + names. A second default return value argument is supported, just as in + ``dict.pop()``. Example:: + def remove_first(tokens): tokens.pop(0) print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] @@ -536,7 +662,9 @@ class ParseResults(object): return tokens patt.addParseAction(remove_LABEL) print(patt.parseString("AAB 123 321").dump()) + prints:: + ['AAB', '123', '321'] - LABEL: AAB @@ -549,8 +677,8 @@ class ParseResults(object): args = (args[0], v) else: raise TypeError("pop() got an unexpected keyword argument '%s'" % k) - if (isinstance(args[0], int) or - len(args) == 1 or + if (isinstance(args[0], int) or + len(args) == 1 or args[0] in self): index = args[0] ret = self[index] @@ -563,14 +691,15 @@ class ParseResults(object): def get(self, key, defaultValue=None): """ Returns named result matching the given key, or if there is no - such name, then returns the given C{defaultValue} or C{None} if no - C{defaultValue} is specified. + such name, then returns the given ``defaultValue`` or ``None`` if no + ``defaultValue`` is specified. + + Similar to ``dict.get()``. - Similar to C{dict.get()}. - Example:: + integer = Word(nums) - date_str = integer("year") + '/' + integer("month") + '/' + integer("day") + date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parseString("1999/12/31") print(result.get("year")) # -> '1999' @@ -585,10 +714,11 @@ class ParseResults(object): def insert( self, index, insStr ): """ Inserts new element at location index in the list of parsed tokens. - - Similar to C{list.insert()}. + + Similar to ``list.insert()``. Example:: + print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] # use a parse action to insert the parse location in the front of the parsed results @@ -607,8 +737,9 @@ class ParseResults(object): Add single element to end of ParseResults list of elements. Example:: + print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] - + # use a parse action to compute the sum of the parsed integers, and add it to the end def append_sum(tokens): tokens.append(sum(map(int, tokens))) @@ -621,8 +752,9 @@ class ParseResults(object): Add sequence of elements to end of ParseResults list of elements. Example:: + patt = OneOrMore(Word(alphas)) - + # use a parse action to append the reverse of the matched strings, to make a palindrome def make_palindrome(tokens): tokens.extend(reversed([t[::-1] for t in tokens])) @@ -630,7 +762,7 @@ class ParseResults(object): print(patt.addParseAction(make_palindrome).parseString("lskdj sdlkjf lksd")) # -> 'lskdjsdlkjflksddsklfjkldsjdksl' """ if isinstance(itemseq, ParseResults): - self += itemseq + self.__iadd__(itemseq) else: self.__toklist.extend(itemseq) @@ -646,7 +778,7 @@ class ParseResults(object): return self[name] except KeyError: return "" - + if name in self.__tokdict: if name not in self.__accumNames: return self.__tokdict[name][-1][0] @@ -671,7 +803,7 @@ class ParseResults(object): self[k] = v if isinstance(v[0],ParseResults): v[0].__parent = wkref(self) - + self.__toklist += other.__toklist self.__accumNames.update( other.__accumNames ) return self @@ -683,7 +815,7 @@ class ParseResults(object): else: # this may raise a TypeError - so be it return other + self - + def __repr__( self ): return "(%s, %s)" % ( repr( self.__toklist ), repr( self.__tokdict ) ) @@ -706,11 +838,12 @@ class ParseResults(object): Returns the parse results as a nested list of matching tokens, all converted to strings. Example:: + patt = OneOrMore(Word(alphas)) result = patt.parseString("sldkj lsdkj sldkj") # even though the result prints in string-like form, it is actually a pyparsing ParseResults print(type(result), result) # -> ['sldkj', 'lsdkj', 'sldkj'] - + # Use asList() to create an actual list result_list = result.asList() print(type(result_list), result_list) # -> ['sldkj', 'lsdkj', 'sldkj'] @@ -722,12 +855,13 @@ class ParseResults(object): Returns the named parse results as a nested dictionary. Example:: + integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") - + result = date_str.parseString('12/31/1999') print(type(result), repr(result)) # -> (['12', '/', '31', '/', '1999'], {'day': [('1999', 4)], 'year': [('12', 0)], 'month': [('31', 2)]}) - + result_dict = result.asDict() print(type(result_dict), repr(result_dict)) # -> {'day': '1999', 'year': '12', 'month': '31'} @@ -740,7 +874,7 @@ class ParseResults(object): item_fn = self.items else: item_fn = self.iteritems - + def toItem(obj): if isinstance(obj, ParseResults): if obj.haskeys(): @@ -749,15 +883,15 @@ class ParseResults(object): return [toItem(v) for v in obj] else: return obj - + return dict((k,toItem(v)) for k,v in item_fn()) def copy( self ): """ - Returns a new copy of a C{ParseResults} object. + Returns a new copy of a :class:`ParseResults` object. """ ret = ParseResults( self.__toklist ) - ret.__tokdict = self.__tokdict.copy() + ret.__tokdict = dict(self.__tokdict.items()) ret.__parent = self.__parent ret.__accumNames.update( self.__accumNames ) ret.__name = self.__name @@ -833,22 +967,25 @@ class ParseResults(object): def getName(self): r""" - Returns the results name for this token expression. Useful when several + Returns the results name for this token expression. Useful when several different expressions might match at a particular location. Example:: + integer = Word(nums) ssn_expr = Regex(r"\d\d\d-\d\d-\d\d\d\d") house_number_expr = Suppress('#') + Word(nums, alphanums) - user_data = (Group(house_number_expr)("house_number") + user_data = (Group(house_number_expr)("house_number") | Group(ssn_expr)("ssn") | Group(integer)("age")) user_info = OneOrMore(user_data) - + result = user_info.parseString("22 111-22-3333 #221B") for item in result: print(item.getName(), ':', item[0]) + prints:: + age : 22 ssn : 111-22-3333 house_number : 221B @@ -870,17 +1007,20 @@ class ParseResults(object): def dump(self, indent='', depth=0, full=True): """ - Diagnostic method for listing out the contents of a C{ParseResults}. - Accepts an optional C{indent} argument so that this string can be embedded - in a nested display of other data. + Diagnostic method for listing out the contents of + a :class:`ParseResults`. Accepts an optional ``indent`` argument so + that this string can be embedded in a nested display of other data. Example:: + integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") - + result = date_str.parseString('12/31/1999') print(result.dump()) + prints:: + ['12', '/', '31', '/', '1999'] - day: 1999 - month: 31 @@ -910,16 +1050,18 @@ class ParseResults(object): out.append("\n%s%s[%d]:\n%s%s%s" % (indent,(' '*(depth)),i,indent,(' '*(depth+1)),vv.dump(indent,depth+1) )) else: out.append("\n%s%s[%d]:\n%s%s%s" % (indent,(' '*(depth)),i,indent,(' '*(depth+1)),_ustr(vv))) - + return "".join(out) def pprint(self, *args, **kwargs): """ - Pretty-printer for parsed results as a list, using the C{pprint} module. - Accepts additional positional or keyword args as defined for the - C{pprint.pprint} method. (U{http://docs.python.org/3/library/pprint.html#pprint.pprint}) + Pretty-printer for parsed results as a list, using the + `pprint `_ module. + Accepts additional positional or keyword args as defined for + `pprint.pprint `_ . Example:: + ident = Word(alphas, alphanums) num = Word(nums) func = Forward() @@ -927,7 +1069,9 @@ class ParseResults(object): func <<= ident + Group(Optional(delimitedList(term))) result = func.parseString("fna a,b,(fnb c,d,200),100") result.pprint(width=40) + prints:: + ['fna', ['a', 'b', @@ -970,24 +1114,25 @@ def col (loc,strg): The first column is number 1. Note: the default parsing behavior is to expand tabs in the input string - before starting the parsing process. See L{I{ParserElement.parseString}} for more information - on parsing strings containing C{}s, and suggested methods to maintain a - consistent view of the parsed string, the parse location, and line and column - positions within the parsed string. + before starting the parsing process. See + :class:`ParserElement.parseString` for more + information on parsing strings containing ```` s, and suggested + methods to maintain a consistent view of the parsed string, the parse + location, and line and column positions within the parsed string. """ s = strg return 1 if 0} for more information - on parsing strings containing C{}s, and suggested methods to maintain a - consistent view of the parsed string, the parse location, and line and column - positions within the parsed string. - """ + Note - the default parsing behavior is to expand tabs in the input string + before starting the parsing process. See :class:`ParserElement.parseString` + for more information on parsing strings containing ```` s, and + suggested methods to maintain a consistent view of the parsed string, the + parse location, and line and column positions within the parsed string. + """ return strg.count("\n",0,loc) + 1 def line( loc, strg ): @@ -1041,7 +1186,7 @@ def _trim_arity(func, maxargs=2): return lambda s,l,t: func(t) limit = [0] foundArity = [False] - + # traceback return data structure changed in Py3.5 - normalize back to plain tuples if system_version[:2] >= (3,5): def extract_stack(limit=0): @@ -1056,12 +1201,12 @@ def _trim_arity(func, maxargs=2): else: extract_stack = traceback.extract_stack extract_tb = traceback.extract_tb - - # synthesize what would be returned by traceback.extract_stack at the call to + + # synthesize what would be returned by traceback.extract_stack at the call to # user's parse action 'func', so that we don't incur call penalty at parse time - + LINE_DIFF = 6 - # IF ANY CODE CHANGES, EVEN JUST COMMENTS OR BLANK LINES, BETWEEN THE NEXT LINE AND + # IF ANY CODE CHANGES, EVEN JUST COMMENTS OR BLANK LINES, BETWEEN THE NEXT LINE AND # THE CALL TO FUNC INSIDE WRAPPER, LINE_DIFF MUST BE MODIFIED!!!! this_line = extract_stack(limit=2)[-1] pa_call_line_synth = (this_line[0], this_line[1]+LINE_DIFF) @@ -1092,7 +1237,7 @@ def _trim_arity(func, maxargs=2): # copy func name to wrapper for sensible debug output func_name = "" try: - func_name = getattr(func, '__name__', + func_name = getattr(func, '__name__', getattr(func, '__class__').__name__) except Exception: func_name = str(func) @@ -1111,9 +1256,10 @@ class ParserElement(object): Overrides the default whitespace chars Example:: + # default whitespace chars are space, and newline OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def', 'ghi', 'jkl'] - + # change to just treat newline as significant ParserElement.setDefaultWhitespaceChars(" \t") OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def'] @@ -1124,18 +1270,19 @@ class ParserElement(object): def inlineLiteralsUsing(cls): """ Set class to be used for inclusion of string literals into a parser. - + Example:: + # default literal class used is Literal integer = Word(nums) - date_str = integer("year") + '/' + integer("month") + '/' + integer("day") + date_str = integer("year") + '/' + integer("month") + '/' + integer("day") date_str.parseString("1999/12/31") # -> ['1999', '/', '12', '/', '31'] # change to Suppress ParserElement.inlineLiteralsUsing(Suppress) - date_str = integer("year") + '/' + integer("month") + '/' + integer("day") + date_str = integer("year") + '/' + integer("month") + '/' + integer("day") date_str.parseString("1999/12/31") # -> ['1999', '12', '31'] """ @@ -1149,7 +1296,7 @@ class ParserElement(object): self.resultsName = None self.saveAsList = savelist self.skipWhitespace = True - self.whiteChars = ParserElement.DEFAULT_WHITE_CHARS + self.whiteChars = set(ParserElement.DEFAULT_WHITE_CHARS) self.copyDefaultWhiteChars = True self.mayReturnEmpty = False # used when checking for left-recursion self.keepTabs = False @@ -1166,18 +1313,24 @@ class ParserElement(object): def copy( self ): """ - Make a copy of this C{ParserElement}. Useful for defining different parse actions - for the same parsing pattern, using copies of the original parse element. - + Make a copy of this :class:`ParserElement`. Useful for defining + different parse actions for the same parsing pattern, using copies of + the original parse element. + Example:: + integer = Word(nums).setParseAction(lambda toks: int(toks[0])) integerK = integer.copy().addParseAction(lambda toks: toks[0]*1024) + Suppress("K") integerM = integer.copy().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M") - + print(OneOrMore(integerK | integerM | integer).parseString("5K 100 640K 256M")) + prints:: + [5120, 100, 655360, 268435456] - Equivalent form of C{expr.copy()} is just C{expr()}:: + + Equivalent form of ``expr.copy()`` is just ``expr()``:: + integerM = integer().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M") """ cpy = copy.copy( self ) @@ -1190,8 +1343,9 @@ class ParserElement(object): def setName( self, name ): """ Define name for this expression, makes debugging and exception messages clearer. - + Example:: + Word(nums).parseString("ABC") # -> Exception: Expected W:(0123...) (at char 0), (line:1, col:1) Word(nums).setName("integer").parseString("ABC") # -> Exception: Expected integer (at char 0), (line:1, col:1) """ @@ -1205,17 +1359,18 @@ class ParserElement(object): """ Define name for referencing matching tokens as a nested attribute of the returned parse results. - NOTE: this returns a *copy* of the original C{ParserElement} object; + NOTE: this returns a *copy* of the original :class:`ParserElement` object; this is so that the client can define a basic element, such as an integer, and reference it in multiple places with different names. You can also set results names using the abbreviated syntax, - C{expr("name")} in place of C{expr.setResultsName("name")} - - see L{I{__call__}<__call__>}. + ``expr("name")`` in place of ``expr.setResultsName("name")`` + - see :class:`__call__`. Example:: - date_str = (integer.setResultsName("year") + '/' - + integer.setResultsName("month") + '/' + + date_str = (integer.setResultsName("year") + '/' + + integer.setResultsName("month") + '/' + integer.setResultsName("day")) # equivalent form: @@ -1231,7 +1386,7 @@ class ParserElement(object): def setBreak(self,breakFlag = True): """Method to invoke the Python pdb debugger when this element is - about to be parsed. Set C{breakFlag} to True to enable, False to + about to be parsed. Set ``breakFlag`` to True to enable, False to disable. """ if breakFlag: @@ -1250,25 +1405,28 @@ class ParserElement(object): def setParseAction( self, *fns, **kwargs ): """ Define one or more actions to perform when successfully matching parse element definition. - Parse action fn is a callable method with 0-3 arguments, called as C{fn(s,loc,toks)}, - C{fn(loc,toks)}, C{fn(toks)}, or just C{fn()}, where: - - s = the original string being parsed (see note below) - - loc = the location of the matching substring - - toks = a list of the matched tokens, packaged as a C{L{ParseResults}} object + Parse action fn is a callable method with 0-3 arguments, called as ``fn(s,loc,toks)`` , + ``fn(loc,toks)`` , ``fn(toks)`` , or just ``fn()`` , where: + + - s = the original string being parsed (see note below) + - loc = the location of the matching substring + - toks = a list of the matched tokens, packaged as a :class:`ParseResults` object + If the functions in fns modify the tokens, they can return them as the return value from fn, and the modified list of tokens will replace the original. Otherwise, fn does not need to return any value. Optional keyword arguments: - - callDuringTry = (default=C{False}) indicate if parse action should be run during lookaheads and alternate testing + - callDuringTry = (default= ``False`` ) indicate if parse action should be run during lookaheads and alternate testing Note: the default parsing behavior is to expand tabs in the input string - before starting the parsing process. See L{I{parseString}} for more information - on parsing strings containing C{}s, and suggested methods to maintain a - consistent view of the parsed string, the parse location, and line and column - positions within the parsed string. - + before starting the parsing process. See :class:`parseString for more + information on parsing strings containing ```` s, and suggested + methods to maintain a consistent view of the parsed string, the parse + location, and line and column positions within the parsed string. + Example:: + integer = Word(nums) date_str = integer + '/' + integer + '/' + integer @@ -1287,24 +1445,25 @@ class ParserElement(object): def addParseAction( self, *fns, **kwargs ): """ - Add one or more parse actions to expression's list of parse actions. See L{I{setParseAction}}. - - See examples in L{I{copy}}. + Add one or more parse actions to expression's list of parse actions. See :class:`setParseAction`. + + See examples in :class:`copy`. """ self.parseAction += list(map(_trim_arity, list(fns))) self.callDuringTry = self.callDuringTry or kwargs.get("callDuringTry", False) return self def addCondition(self, *fns, **kwargs): - """Add a boolean predicate function to expression's list of parse actions. See - L{I{setParseAction}} for function call signatures. Unlike C{setParseAction}, - functions passed to C{addCondition} need to return boolean success/fail of the condition. + """Add a boolean predicate function to expression's list of parse actions. See + :class:`setParseAction` for function call signatures. Unlike ``setParseAction``, + functions passed to ``addCondition`` need to return boolean success/fail of the condition. Optional keyword arguments: - - message = define a custom message to be used in the raised exception - - fatal = if True, will raise ParseFatalException to stop parsing immediately; otherwise will raise ParseException - + - message = define a custom message to be used in the raised exception + - fatal = if True, will raise ParseFatalException to stop parsing immediately; otherwise will raise ParseException + Example:: + integer = Word(nums).setParseAction(lambda toks: int(toks[0])) year_int = integer.copy() year_int.addCondition(lambda toks: toks[0] >= 2000, message="Only support years 2000 and later") @@ -1315,8 +1474,9 @@ class ParserElement(object): msg = kwargs.get("message", "failed user-defined condition") exc_type = ParseFatalException if kwargs.get("fatal", False) else ParseException for fn in fns: + fn = _trim_arity(fn) def pa(s,l,t): - if not bool(_trim_arity(fn)(s,l,t)): + if not bool(fn(s,l,t)): raise exc_type(s,l,msg) self.parseAction.append(pa) self.callDuringTry = self.callDuringTry or kwargs.get("callDuringTry", False) @@ -1325,12 +1485,12 @@ class ParserElement(object): def setFailAction( self, fn ): """Define action to perform if parsing fails at this expression. Fail acton fn is a callable function that takes the arguments - C{fn(s,loc,expr,err)} where: - - s = string being parsed - - loc = location where expression match was attempted and failed - - expr = the parse expression that failed - - err = the exception thrown - The function returns no value. It may throw C{L{ParseFatalException}} + ``fn(s,loc,expr,err)`` where: + - s = string being parsed + - loc = location where expression match was attempted and failed + - expr = the parse expression that failed + - err = the exception thrown + The function returns no value. It may throw :class:`ParseFatalException` if it is desired to stop parsing immediately.""" self.failAction = fn return self @@ -1412,8 +1572,14 @@ class ParserElement(object): if debugging: try: for fn in self.parseAction: - tokens = fn( instring, tokensStart, retTokens ) - if tokens is not None: + try: + tokens = fn( instring, tokensStart, retTokens ) + except IndexError as parse_action_exc: + exc = ParseException("exception raised in parse action") + exc.__cause__ = parse_action_exc + raise exc + + if tokens is not None and tokens is not retTokens: retTokens = ParseResults( tokens, self.resultsName, asList=self.saveAsList and isinstance(tokens,(ParseResults,list)), @@ -1425,8 +1591,14 @@ class ParserElement(object): raise else: for fn in self.parseAction: - tokens = fn( instring, tokensStart, retTokens ) - if tokens is not None: + try: + tokens = fn( instring, tokensStart, retTokens ) + except IndexError as parse_action_exc: + exc = ParseException("exception raised in parse action") + exc.__cause__ = parse_action_exc + raise exc + + if tokens is not None and tokens is not retTokens: retTokens = ParseResults( tokens, self.resultsName, asList=self.saveAsList and isinstance(tokens,(ParseResults,list)), @@ -1443,7 +1615,7 @@ class ParserElement(object): return self._parse( instring, loc, doActions=False )[0] except ParseFatalException: raise ParseException( instring, loc, self.errmsg, self) - + def canParseNext(self, instring, loc): try: self.tryParse(instring, loc) @@ -1465,7 +1637,7 @@ class ParserElement(object): def clear(self): cache.clear() - + def cache_len(self): return len(cache) @@ -1577,23 +1749,23 @@ class ParserElement(object): often in many complex grammars) can immediately return a cached value, instead of re-executing parsing/validating code. Memoizing is done of both valid results and parsing exceptions. - + Parameters: - - cache_size_limit - (default=C{128}) - if an integer value is provided - will limit the size of the packrat cache; if None is passed, then - the cache size will be unbounded; if 0 is passed, the cache will - be effectively disabled. - + + - cache_size_limit - (default= ``128``) - if an integer value is provided + will limit the size of the packrat cache; if None is passed, then + the cache size will be unbounded; if 0 is passed, the cache will + be effectively disabled. + This speedup may break existing programs that use parse actions that have side-effects. For this reason, packrat parsing is disabled when you first import pyparsing. To activate the packrat feature, your - program must call the class method C{ParserElement.enablePackrat()}. If - your program uses C{psyco} to "compile as you go", you must call - C{enablePackrat} before calling C{psyco.full()}. If you do not do this, - Python will crash. For best results, call C{enablePackrat()} immediately - after importing pyparsing. - + program must call the class method :class:`ParserElement.enablePackrat`. + For best results, call ``enablePackrat()`` immediately after + importing pyparsing. + Example:: + from pip._vendor import pyparsing pyparsing.ParserElement.enablePackrat() """ @@ -1612,23 +1784,25 @@ class ParserElement(object): expression has been built. If you want the grammar to require that the entire input string be - successfully parsed, then set C{parseAll} to True (equivalent to ending - the grammar with C{L{StringEnd()}}). + successfully parsed, then set ``parseAll`` to True (equivalent to ending + the grammar with ``StringEnd()``). - Note: C{parseString} implicitly calls C{expandtabs()} on the input string, + Note: ``parseString`` implicitly calls ``expandtabs()`` on the input string, in order to report proper column numbers in parse actions. If the input string contains tabs and - the grammar uses parse actions that use the C{loc} argument to index into the + the grammar uses parse actions that use the ``loc`` argument to index into the string being parsed, you can ensure you have a consistent view of the input string by: - - calling C{parseWithTabs} on your grammar before calling C{parseString} - (see L{I{parseWithTabs}}) - - define your parse action using the full C{(s,loc,toks)} signature, and - reference the input string using the parse action's C{s} argument - - explictly expand the tabs in your input string before calling - C{parseString} - + + - calling ``parseWithTabs`` on your grammar before calling ``parseString`` + (see :class:`parseWithTabs`) + - define your parse action using the full ``(s,loc,toks)`` signature, and + reference the input string using the parse action's ``s`` argument + - explictly expand the tabs in your input string before calling + ``parseString`` + Example:: + Word('a').parseString('aaaaabaaa') # -> ['aaaaa'] Word('a').parseString('aaaaabaaa', parseAll=True) # -> Exception: Expected end of text """ @@ -1659,22 +1833,23 @@ class ParserElement(object): """ Scan the input string for expression matches. Each match will return the matching tokens, start location, and end location. May be called with optional - C{maxMatches} argument, to clip scanning after 'n' matches are found. If - C{overlap} is specified, then overlapping matches will be reported. + ``maxMatches`` argument, to clip scanning after 'n' matches are found. If + ``overlap`` is specified, then overlapping matches will be reported. Note that the start and end locations are reported relative to the string - being parsed. See L{I{parseString}} for more information on parsing + being parsed. See :class:`parseString` for more information on parsing strings with embedded tabs. Example:: + source = "sldjf123lsdjjkf345sldkjf879lkjsfd987" print(source) for tokens,start,end in Word(alphas).scanString(source): print(' '*start + '^'*(end-start)) print(' '*start + tokens[0]) - + prints:: - + sldjf123lsdjjkf345sldkjf879lkjsfd987 ^^^^^ sldjf @@ -1728,19 +1903,22 @@ class ParserElement(object): def transformString( self, instring ): """ - Extension to C{L{scanString}}, to modify matching text with modified tokens that may - be returned from a parse action. To use C{transformString}, define a grammar and + Extension to :class:`scanString`, to modify matching text with modified tokens that may + be returned from a parse action. To use ``transformString``, define a grammar and attach a parse action to it that modifies the returned token list. - Invoking C{transformString()} on a target string will then scan for matches, + Invoking ``transformString()`` on a target string will then scan for matches, and replace the matched text patterns according to the logic in the parse - action. C{transformString()} returns the resulting transformed string. - + action. ``transformString()`` returns the resulting transformed string. + Example:: + wd = Word(alphas) wd.setParseAction(lambda toks: toks[0].title()) - + print(wd.transformString("now is the winter of our discontent made glorious summer by this sun of york.")) - Prints:: + + prints:: + Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York. """ out = [] @@ -1771,19 +1949,22 @@ class ParserElement(object): def searchString( self, instring, maxMatches=_MAX_INT ): """ - Another extension to C{L{scanString}}, simplifying the access to the tokens found + Another extension to :class:`scanString`, simplifying the access to the tokens found to match the given parse expression. May be called with optional - C{maxMatches} argument, to clip searching after 'n' matches are found. - + ``maxMatches`` argument, to clip searching after 'n' matches are found. + Example:: + # a capitalized word starts with an uppercase letter, followed by zero or more lowercase letters cap_word = Word(alphas.upper(), alphas.lower()) - + print(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity")) # the sum() builtin can be used to merge results into a single ParseResults object print(sum(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity"))) + prints:: + [['More'], ['Iron'], ['Lead'], ['Gold'], ['I'], ['Electricity']] ['More', 'Iron', 'Lead', 'Gold', 'I', 'Electricity'] """ @@ -1799,14 +1980,17 @@ class ParserElement(object): def split(self, instring, maxsplit=_MAX_INT, includeSeparators=False): """ Generator method to split a string using the given expression as a separator. - May be called with optional C{maxsplit} argument, to limit the number of splits; - and the optional C{includeSeparators} argument (default=C{False}), if the separating + May be called with optional ``maxsplit`` argument, to limit the number of splits; + and the optional ``includeSeparators`` argument (default= ``False``), if the separating matching text should be included in the split results. - - Example:: + + Example:: + punc = oneOf(list(".,;:/-!?")) print(list(punc.split("This, this?, this sentence, is badly punctuated!"))) + prints:: + ['This', ' this', '', ' this sentence', ' is badly punctuated', ''] """ splits = 0 @@ -1820,14 +2004,17 @@ class ParserElement(object): def __add__(self, other ): """ - Implementation of + operator - returns C{L{And}}. Adding strings to a ParserElement - converts them to L{Literal}s by default. - + Implementation of + operator - returns :class:`And`. Adding strings to a ParserElement + converts them to :class:`Literal`s by default. + Example:: + greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print (hello, "->", greet.parseString(hello)) - Prints:: + + prints:: + Hello, World! -> ['Hello', ',', 'World', '!'] """ if isinstance( other, basestring ): @@ -1840,7 +2027,7 @@ class ParserElement(object): def __radd__(self, other ): """ - Implementation of + operator when left operand is not a C{L{ParserElement}} + Implementation of + operator when left operand is not a :class:`ParserElement` """ if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) @@ -1852,7 +2039,7 @@ class ParserElement(object): def __sub__(self, other): """ - Implementation of - operator, returns C{L{And}} with error stop + Implementation of - operator, returns :class:`And` with error stop """ if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) @@ -1864,7 +2051,7 @@ class ParserElement(object): def __rsub__(self, other ): """ - Implementation of - operator when left operand is not a C{L{ParserElement}} + Implementation of - operator when left operand is not a :class:`ParserElement` """ if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) @@ -1876,23 +2063,23 @@ class ParserElement(object): def __mul__(self,other): """ - Implementation of * operator, allows use of C{expr * 3} in place of - C{expr + expr + expr}. Expressions may also me multiplied by a 2-integer - tuple, similar to C{{min,max}} multipliers in regular expressions. Tuples - may also include C{None} as in: - - C{expr*(n,None)} or C{expr*(n,)} is equivalent - to C{expr*n + L{ZeroOrMore}(expr)} - (read as "at least n instances of C{expr}") - - C{expr*(None,n)} is equivalent to C{expr*(0,n)} - (read as "0 to n instances of C{expr}") - - C{expr*(None,None)} is equivalent to C{L{ZeroOrMore}(expr)} - - C{expr*(1,None)} is equivalent to C{L{OneOrMore}(expr)} + Implementation of * operator, allows use of ``expr * 3`` in place of + ``expr + expr + expr``. Expressions may also me multiplied by a 2-integer + tuple, similar to ``{min,max}`` multipliers in regular expressions. Tuples + may also include ``None`` as in: + - ``expr*(n,None)`` or ``expr*(n,)`` is equivalent + to ``expr*n + ZeroOrMore(expr)`` + (read as "at least n instances of ``expr``") + - ``expr*(None,n)`` is equivalent to ``expr*(0,n)`` + (read as "0 to n instances of ``expr``") + - ``expr*(None,None)`` is equivalent to ``ZeroOrMore(expr)`` + - ``expr*(1,None)`` is equivalent to ``OneOrMore(expr)`` - Note that C{expr*(None,n)} does not raise an exception if + Note that ``expr*(None,n)`` does not raise an exception if more than n exprs exist in the input stream; that is, - C{expr*(None,n)} does not enforce a maximum number of expr + ``expr*(None,n)`` does not enforce a maximum number of expr occurrences. If this behavior is desired, then write - C{expr*(None,n) + ~expr} + ``expr*(None,n) + ~expr`` """ if isinstance(other,int): minElements, optElements = other,0 @@ -1947,7 +2134,7 @@ class ParserElement(object): def __or__(self, other ): """ - Implementation of | operator - returns C{L{MatchFirst}} + Implementation of | operator - returns :class:`MatchFirst` """ if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) @@ -1959,7 +2146,7 @@ class ParserElement(object): def __ror__(self, other ): """ - Implementation of | operator when left operand is not a C{L{ParserElement}} + Implementation of | operator when left operand is not a :class:`ParserElement` """ if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) @@ -1971,7 +2158,7 @@ class ParserElement(object): def __xor__(self, other ): """ - Implementation of ^ operator - returns C{L{Or}} + Implementation of ^ operator - returns :class:`Or` """ if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) @@ -1983,7 +2170,7 @@ class ParserElement(object): def __rxor__(self, other ): """ - Implementation of ^ operator when left operand is not a C{L{ParserElement}} + Implementation of ^ operator when left operand is not a :class:`ParserElement` """ if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) @@ -1995,7 +2182,7 @@ class ParserElement(object): def __and__(self, other ): """ - Implementation of & operator - returns C{L{Each}} + Implementation of & operator - returns :class:`Each` """ if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) @@ -2007,7 +2194,7 @@ class ParserElement(object): def __rand__(self, other ): """ - Implementation of & operator when left operand is not a C{L{ParserElement}} + Implementation of & operator when left operand is not a :class:`ParserElement` """ if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) @@ -2019,23 +2206,24 @@ class ParserElement(object): def __invert__( self ): """ - Implementation of ~ operator - returns C{L{NotAny}} + Implementation of ~ operator - returns :class:`NotAny` """ return NotAny( self ) def __call__(self, name=None): """ - Shortcut for C{L{setResultsName}}, with C{listAllMatches=False}. - - If C{name} is given with a trailing C{'*'} character, then C{listAllMatches} will be - passed as C{True}. - - If C{name} is omitted, same as calling C{L{copy}}. + Shortcut for :class:`setResultsName`, with ``listAllMatches=False``. + + If ``name`` is given with a trailing ``'*'`` character, then ``listAllMatches`` will be + passed as ``True``. + + If ``name` is omitted, same as calling :class:`copy`. Example:: + # these are equivalent userdata = Word(alphas).setResultsName("name") + Word(nums+"-").setResultsName("socsecno") - userdata = Word(alphas)("name") + Word(nums+"-")("socsecno") + userdata = Word(alphas)("name") + Word(nums+"-")("socsecno") """ if name is not None: return self.setResultsName(name) @@ -2044,7 +2232,7 @@ class ParserElement(object): def suppress( self ): """ - Suppresses the output of this C{ParserElement}; useful to keep punctuation from + Suppresses the output of this :class:`ParserElement`; useful to keep punctuation from cluttering up returned output. """ return Suppress( self ) @@ -2052,7 +2240,7 @@ class ParserElement(object): def leaveWhitespace( self ): """ Disables the skipping of whitespace before matching the characters in the - C{ParserElement}'s defined pattern. This is normally only used internally by + :class:`ParserElement`'s defined pattern. This is normally only used internally by the pyparsing module, but may be needed in some whitespace-sensitive grammars. """ self.skipWhitespace = False @@ -2069,9 +2257,9 @@ class ParserElement(object): def parseWithTabs( self ): """ - Overrides default behavior to expand C{}s to spaces before parsing the input string. - Must be called before C{parseString} when the input grammar contains elements that - match C{} characters. + Overrides default behavior to expand ````s to spaces before parsing the input string. + Must be called before ``parseString`` when the input grammar contains elements that + match ```` characters. """ self.keepTabs = True return self @@ -2081,11 +2269,12 @@ class ParserElement(object): Define expression to be ignored (e.g., comments) while doing pattern matching; may be called repeatedly, to define multiple comment or other ignorable patterns. - + Example:: + patt = OneOrMore(Word(alphas)) patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj'] - + patt.ignore(cStyleComment) patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj', 'lskjd'] """ @@ -2112,19 +2301,21 @@ class ParserElement(object): def setDebug( self, flag=True ): """ Enable display of debugging messages while doing pattern matching. - Set C{flag} to True to enable, False to disable. + Set ``flag`` to True to enable, False to disable. Example:: + wd = Word(alphas).setName("alphaword") integer = Word(nums).setName("numword") term = wd | integer - + # turn on debugging for wd wd.setDebug() OneOrMore(term).parseString("abc 123 xyz 890") - + prints:: + Match alphaword at loc 0(1,1) Matched alphaword -> ['abc'] Match alphaword at loc 3(1,4) @@ -2137,12 +2328,12 @@ class ParserElement(object): Exception raised:Expected alphaword (at char 15), (line:1, col:16) The output shown is that produced by the default debug actions - custom debug actions can be - specified using L{setDebugActions}. Prior to attempting - to match the C{wd} expression, the debugging message C{"Match at loc (,)"} - is shown. Then if the parse succeeds, a C{"Matched"} message is shown, or an C{"Exception raised"} - message is shown. Also note the use of L{setName} to assign a human-readable name to the expression, + specified using :class:`setDebugActions`. Prior to attempting + to match the ``wd`` expression, the debugging message ``"Match at loc (,)"`` + is shown. Then if the parse succeeds, a ``"Matched"`` message is shown, or an ``"Exception raised"`` + message is shown. Also note the use of :class:`setName` to assign a human-readable name to the expression, which makes debugging and exception messages easier to understand - for instance, the default - name created for the C{Word} expression without calling C{setName} is C{"W:(ABCD...)"}. + name created for the :class:`Word` expression without calling ``setName`` is ``"W:(ABCD...)"``. """ if flag: self.setDebugActions( _defaultStartDebugAction, _defaultSuccessDebugAction, _defaultExceptionDebugAction ) @@ -2212,14 +2403,15 @@ class ParserElement(object): def matches(self, testString, parseAll=True): """ - Method for quick testing of a parser against a test string. Good for simple + Method for quick testing of a parser against a test string. Good for simple inline microtests of sub expressions while building up larger parser. - + Parameters: - testString - to test against this expression for a match - - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests - + - parseAll - (default= ``True``) - flag to pass to :class:`parseString` when running tests + Example:: + expr = Word(nums) assert expr.matches("100") """ @@ -2228,28 +2420,32 @@ class ParserElement(object): return True except ParseBaseException: return False - - def runTests(self, tests, parseAll=True, comment='#', fullDump=True, printResults=True, failureTests=False): + + def runTests(self, tests, parseAll=True, comment='#', + fullDump=True, printResults=True, failureTests=False, postParse=None): """ Execute the parse expression on a series of test strings, showing each test, the parsed results or where the parse failed. Quick and easy way to run a parse expression against a list of sample strings. - + Parameters: - tests - a list of separate test strings, or a multiline string of test strings - - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests - - comment - (default=C{'#'}) - expression for indicating embedded comments in the test + - parseAll - (default= ``True``) - flag to pass to :class:`parseString` when running tests + - comment - (default= ``'#'``) - expression for indicating embedded comments in the test string; pass None to disable comment filtering - - fullDump - (default=C{True}) - dump results as list followed by results names in nested outline; + - fullDump - (default= ``True``) - dump results as list followed by results names in nested outline; if False, only dump nested list - - printResults - (default=C{True}) prints test output to stdout - - failureTests - (default=C{False}) indicates if these tests are expected to fail parsing + - printResults - (default= ``True``) prints test output to stdout + - failureTests - (default= ``False``) indicates if these tests are expected to fail parsing + - postParse - (default= ``None``) optional callback for successful parse results; called as + `fn(test_string, parse_results)` and returns a string to be added to the test output Returns: a (success, results) tuple, where success indicates that all tests succeeded - (or failed if C{failureTests} is True), and the results contain a list of lines of each + (or failed if ``failureTests`` is True), and the results contain a list of lines of each test's output - + Example:: + number_expr = pyparsing_common.number.copy() result = number_expr.runTests(''' @@ -2273,7 +2469,9 @@ class ParserElement(object): 3.14.159 ''', failureTests=True) print("Success" if result[0] else "Failed!") + prints:: + # unsigned integer 100 [100] @@ -2291,7 +2489,7 @@ class ParserElement(object): [1e-12] Success - + # stray character 100Z ^ @@ -2313,7 +2511,7 @@ class ParserElement(object): lines, create a test like this:: expr.runTest(r"this is a test\\n of strings that spans \\n 3 lines") - + (Note that this is a raw string literal, you must include the leading 'r'.) """ if isinstance(tests, basestring): @@ -2332,10 +2530,20 @@ class ParserElement(object): out = ['\n'.join(comments), t] comments = [] try: - t = t.replace(r'\n','\n') + # convert newline marks to actual newlines, and strip leading BOM if present + NL = Literal(r'\n').addParseAction(replaceWith('\n')).ignore(quotedString) + BOM = '\ufeff' + t = NL.transformString(t.lstrip(BOM)) result = self.parseString(t, parseAll=parseAll) out.append(result.dump(full=fullDump)) success = success and not failureTests + if postParse is not None: + try: + pp_value = postParse(t, result) + if pp_value is not None: + out.append(str(pp_value)) + except Exception as e: + out.append("{0} failed: {1}: {2}".format(postParse.__name__, type(e).__name__, e)) except ParseBaseException as pe: fatal = "(FATAL)" if isinstance(pe, ParseFatalException) else "" if '\n' in t: @@ -2357,21 +2565,20 @@ class ParserElement(object): print('\n'.join(out)) allResults.append((t, result)) - + return success, allResults - + class Token(ParserElement): - """ - Abstract C{ParserElement} subclass, for defining atomic matching patterns. + """Abstract :class:`ParserElement` subclass, for defining atomic + matching patterns. """ def __init__( self ): super(Token,self).__init__( savelist=False ) class Empty(Token): - """ - An empty token, will always match. + """An empty token, will always match. """ def __init__( self ): super(Empty,self).__init__() @@ -2381,8 +2588,7 @@ class Empty(Token): class NoMatch(Token): - """ - A token that will never match. + """A token that will never match. """ def __init__( self ): super(NoMatch,self).__init__() @@ -2396,18 +2602,18 @@ class NoMatch(Token): class Literal(Token): - """ - Token to exactly match a specified string. - + """Token to exactly match a specified string. + Example:: + Literal('blah').parseString('blah') # -> ['blah'] Literal('blah').parseString('blahfooblah') # -> ['blah'] Literal('blah').parseString('bla') # -> Exception: Expected "blah" - - For case-insensitive matching, use L{CaselessLiteral}. - + + For case-insensitive matching, use :class:`CaselessLiteral`. + For keyword matching (force word break before and after the matched string), - use L{Keyword} or L{CaselessKeyword}. + use :class:`Keyword` or :class:`CaselessKeyword`. """ def __init__( self, matchString ): super(Literal,self).__init__() @@ -2437,21 +2643,29 @@ _L = Literal ParserElement._literalStringClass = Literal class Keyword(Token): - """ - Token to exactly match a specified string as a keyword, that is, it must be - immediately followed by a non-keyword character. Compare with C{L{Literal}}: - - C{Literal("if")} will match the leading C{'if'} in C{'ifAndOnlyIf'}. - - C{Keyword("if")} will not; it will only match the leading C{'if'} in C{'if x=1'}, or C{'if(y==2)'} - Accepts two optional constructor arguments in addition to the keyword string: - - C{identChars} is a string of characters that would be valid identifier characters, - defaulting to all alphanumerics + "_" and "$" - - C{caseless} allows case-insensitive matching, default is C{False}. - + """Token to exactly match a specified string as a keyword, that is, + it must be immediately followed by a non-keyword character. Compare + with :class:`Literal`: + + - ``Literal("if")`` will match the leading ``'if'`` in + ``'ifAndOnlyIf'``. + - ``Keyword("if")`` will not; it will only match the leading + ``'if'`` in ``'if x=1'``, or ``'if(y==2)'`` + + Accepts two optional constructor arguments in addition to the + keyword string: + + - ``identChars`` is a string of characters that would be valid + identifier characters, defaulting to all alphanumerics + "_" and + "$" + - ``caseless`` allows case-insensitive matching, default is ``False``. + Example:: + Keyword("start").parseString("start") # -> ['start'] Keyword("start").parseString("starting") # -> Exception - For case-insensitive matching, use L{CaselessKeyword}. + For case-insensitive matching, use :class:`CaselessKeyword`. """ DEFAULT_KEYWORD_CHARS = alphanums+"_$" @@ -2502,15 +2716,15 @@ class Keyword(Token): Keyword.DEFAULT_KEYWORD_CHARS = chars class CaselessLiteral(Literal): - """ - Token to match a specified string, ignoring case of letters. + """Token to match a specified string, ignoring case of letters. Note: the matched results will always be in the case of the given match string, NOT the case of the input text. Example:: + OneOrMore(CaselessLiteral("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD', 'CMD'] - - (Contrast with example for L{CaselessKeyword}.) + + (Contrast with example for :class:`CaselessKeyword`.) """ def __init__( self, matchString ): super(CaselessLiteral,self).__init__( matchString.upper() ) @@ -2526,36 +2740,39 @@ class CaselessLiteral(Literal): class CaselessKeyword(Keyword): """ - Caseless version of L{Keyword}. + Caseless version of :class:`Keyword`. Example:: + OneOrMore(CaselessKeyword("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD'] - - (Contrast with example for L{CaselessLiteral}.) + + (Contrast with example for :class:`CaselessLiteral`.) """ def __init__( self, matchString, identChars=None ): super(CaselessKeyword,self).__init__( matchString, identChars, caseless=True ) - def parseImpl( self, instring, loc, doActions=True ): - if ( (instring[ loc:loc+self.matchLen ].upper() == self.caselessmatch) and - (loc >= len(instring)-self.matchLen or instring[loc+self.matchLen].upper() not in self.identChars) ): - return loc+self.matchLen, self.match - raise ParseException(instring, loc, self.errmsg, self) - class CloseMatch(Token): - """ - A variation on L{Literal} which matches "close" matches, that is, - strings with at most 'n' mismatching characters. C{CloseMatch} takes parameters: - - C{match_string} - string to be matched - - C{maxMismatches} - (C{default=1}) maximum number of mismatches allowed to count as a match - - The results from a successful parse will contain the matched text from the input string and the following named results: - - C{mismatches} - a list of the positions within the match_string where mismatches were found - - C{original} - the original match_string used to compare against the input string - - If C{mismatches} is an empty list, then the match was an exact match. - + """A variation on :class:`Literal` which matches "close" matches, + that is, strings with at most 'n' mismatching characters. + :class:`CloseMatch` takes parameters: + + - ``match_string`` - string to be matched + - ``maxMismatches`` - (``default=1``) maximum number of + mismatches allowed to count as a match + + The results from a successful parse will contain the matched text + from the input string and the following named results: + + - ``mismatches`` - a list of the positions within the + match_string where mismatches were found + - ``original`` - the original match_string used to compare + against the input string + + If ``mismatches`` is an empty list, then the match was an exact + match. + Example:: + patt = CloseMatch("ATCATCGAATGGA") patt.parseString("ATCATCGAAXGGA") # -> (['ATCATCGAAXGGA'], {'mismatches': [[9]], 'original': ['ATCATCGAATGGA']}) patt.parseString("ATCAXCGAAXGGA") # -> Exception: Expected 'ATCATCGAATGGA' (with up to 1 mismatches) (at char 0), (line:1, col:1) @@ -2604,55 +2821,62 @@ class CloseMatch(Token): class Word(Token): - """ - Token for matching words composed of allowed character sets. - Defined with string containing all allowed initial characters, - an optional string containing allowed body characters (if omitted, + """Token for matching words composed of allowed character sets. + Defined with string containing all allowed initial characters, an + optional string containing allowed body characters (if omitted, defaults to the initial character set), and an optional minimum, - maximum, and/or exact length. The default value for C{min} is 1 (a - minimum value < 1 is not valid); the default values for C{max} and C{exact} - are 0, meaning no maximum or exact length restriction. An optional - C{excludeChars} parameter can list characters that might be found in - the input C{bodyChars} string; useful to define a word of all printables - except for one or two characters, for instance. - - L{srange} is useful for defining custom character set strings for defining - C{Word} expressions, using range notation from regular expression character sets. - - A common mistake is to use C{Word} to match a specific literal string, as in - C{Word("Address")}. Remember that C{Word} uses the string argument to define - I{sets} of matchable characters. This expression would match "Add", "AAA", - "dAred", or any other word made up of the characters 'A', 'd', 'r', 'e', and 's'. - To match an exact literal string, use L{Literal} or L{Keyword}. + maximum, and/or exact length. The default value for ``min`` is + 1 (a minimum value < 1 is not valid); the default values for + ``max`` and ``exact`` are 0, meaning no maximum or exact + length restriction. An optional ``excludeChars`` parameter can + list characters that might be found in the input ``bodyChars`` + string; useful to define a word of all printables except for one or + two characters, for instance. + + :class:`srange` is useful for defining custom character set strings + for defining ``Word`` expressions, using range notation from + regular expression character sets. + + A common mistake is to use :class:`Word` to match a specific literal + string, as in ``Word("Address")``. Remember that :class:`Word` + uses the string argument to define *sets* of matchable characters. + This expression would match "Add", "AAA", "dAred", or any other word + made up of the characters 'A', 'd', 'r', 'e', and 's'. To match an + exact literal string, use :class:`Literal` or :class:`Keyword`. pyparsing includes helper strings for building Words: - - L{alphas} - - L{nums} - - L{alphanums} - - L{hexnums} - - L{alphas8bit} (alphabetic characters in ASCII range 128-255 - accented, tilded, umlauted, etc.) - - L{punc8bit} (non-alphabetic characters in ASCII range 128-255 - currency, symbols, superscripts, diacriticals, etc.) - - L{printables} (any non-whitespace character) + + - :class:`alphas` + - :class:`nums` + - :class:`alphanums` + - :class:`hexnums` + - :class:`alphas8bit` (alphabetic characters in ASCII range 128-255 + - accented, tilded, umlauted, etc.) + - :class:`punc8bit` (non-alphabetic characters in ASCII range + 128-255 - currency, symbols, superscripts, diacriticals, etc.) + - :class:`printables` (any non-whitespace character) Example:: + # a word composed of digits integer = Word(nums) # equivalent to Word("0123456789") or Word(srange("0-9")) - + # a word with a leading capital, and zero or more lowercase capital_word = Word(alphas.upper(), alphas.lower()) # hostnames are alphanumeric, with leading alpha, and '-' hostname = Word(alphas, alphanums+'-') - + # roman numeral (not a strict parser, accepts invalid mix of characters) roman = Word("IVXLCDM") - + # any string of non-whitespace characters, except for ',' csv_value = Word(printables, excludeChars=",") """ def __init__( self, initChars, bodyChars=None, min=1, max=0, exact=0, asKeyword=False, excludeChars=None ): super(Word,self).__init__() if excludeChars: + excludeChars = set(excludeChars) initChars = ''.join(c for c in initChars if c not in excludeChars) if bodyChars: bodyChars = ''.join(c for c in bodyChars if c not in excludeChars) @@ -2713,7 +2937,7 @@ class Word(Token): loc = result.end() return loc, result.group() - if not(instring[ loc ] in self.initChars): + if instring[loc] not in self.initChars: raise ParseException(instring, loc, self.errmsg, self) start = loc @@ -2728,9 +2952,9 @@ class Word(Token): throwException = False if loc - start < self.minLen: throwException = True - if self.maxSpecified and loc < instrlen and instring[loc] in bodychars: + elif self.maxSpecified and loc < instrlen and instring[loc] in bodychars: throwException = True - if self.asKeyword: + elif self.asKeyword: if (start>0 and instring[start-1] in bodychars) or (loc...)}), these will be preserved as - named parse results. + r"""Token for matching strings that match a given regular + expression. Defined with string specifying the regular expression in + a form recognized by the stdlib Python `re module `_. + If the given regex contains named groups (defined using ``(?P...)``), + these will be preserved as named parse results. Example:: + realnum = Regex(r"[+-]?\d+\.\d*") date = Regex(r'(?P\d{4})-(?P\d\d?)-(?P\d\d?)') - # ref: http://stackoverflow.com/questions/267399/how-do-you-match-only-valid-roman-numerals-with-a-regular-expression - roman = Regex(r"M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})") + # ref: https://stackoverflow.com/questions/267399/how-do-you-match-only-valid-roman-numerals-with-a-regular-expression + roman = Regex(r"M{0,4}(CM|CD|D?{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})") """ compiledREtype = type(re.compile("[A-Z]")) - def __init__( self, pattern, flags=0): - """The parameters C{pattern} and C{flags} are passed to the C{re.compile()} function as-is. See the Python C{re} module for an explanation of the acceptable patterns and flags.""" + def __init__( self, pattern, flags=0, asGroupList=False, asMatch=False): + """The parameters ``pattern`` and ``flags`` are passed + to the ``re.compile()`` function as-is. See the Python + `re module `_ module for an + explanation of the acceptable patterns and flags. + """ super(Regex,self).__init__() if isinstance(pattern, basestring): @@ -2801,7 +3041,7 @@ class Regex(Token): self.pattern = \ self.reString = str(pattern) self.flags = flags - + else: raise ValueError("Regex may only be constructed with a string or a compiled RE object") @@ -2809,19 +3049,43 @@ class Regex(Token): self.errmsg = "Expected " + self.name self.mayIndexError = False self.mayReturnEmpty = True + self.asGroupList = asGroupList + self.asMatch = asMatch + if self.asGroupList: + self.parseImpl = self.parseImplAsGroupList + if self.asMatch: + self.parseImpl = self.parseImplAsMatch - def parseImpl( self, instring, loc, doActions=True ): + def parseImpl(self, instring, loc, doActions=True): result = self.re.match(instring,loc) if not result: raise ParseException(instring, loc, self.errmsg, self) loc = result.end() - d = result.groupdict() ret = ParseResults(result.group()) + d = result.groupdict() if d: - for k in d: - ret[k] = d[k] - return loc,ret + for k, v in d.items(): + ret[k] = v + return loc, ret + + def parseImplAsGroupList(self, instring, loc, doActions=True): + result = self.re.match(instring,loc) + if not result: + raise ParseException(instring, loc, self.errmsg, self) + + loc = result.end() + ret = result.groups() + return loc, ret + + def parseImplAsMatch(self, instring, loc, doActions=True): + result = self.re.match(instring,loc) + if not result: + raise ParseException(instring, loc, self.errmsg, self) + + loc = result.end() + ret = result + return loc, ret def __str__( self ): try: @@ -2834,28 +3098,70 @@ class Regex(Token): return self.strRepr + def sub(self, repl): + r""" + Return Regex with an attached parse action to transform the parsed + result as if called using `re.sub(expr, repl, string) `_. + + Example:: + + make_html = Regex(r"(\w+):(.*?):").sub(r"<\1>\2") + print(make_html.transformString("h1:main title:")) + # prints "

main title

" + """ + if self.asGroupList: + warnings.warn("cannot use sub() with Regex(asGroupList=True)", + SyntaxWarning, stacklevel=2) + raise SyntaxError() + + if self.asMatch and callable(repl): + warnings.warn("cannot use sub() with a callable with Regex(asMatch=True)", + SyntaxWarning, stacklevel=2) + raise SyntaxError() + + if self.asMatch: + def pa(tokens): + return tokens[0].expand(repl) + else: + def pa(tokens): + return self.re.sub(repl, tokens[0]) + return self.addParseAction(pa) class QuotedString(Token): r""" Token for matching strings that are delimited by quoting characters. - + Defined with the following parameters: - - quoteChar - string of one or more characters defining the quote delimiting string - - escChar - character to escape quotes, typically backslash (default=C{None}) - - escQuote - special quote sequence to escape an embedded quote string (such as SQL's "" to escape an embedded ") (default=C{None}) - - multiline - boolean indicating whether quotes can span multiple lines (default=C{False}) - - unquoteResults - boolean indicating whether the matched text should be unquoted (default=C{True}) - - endQuoteChar - string of one or more characters defining the end of the quote delimited string (default=C{None} => same as quoteChar) - - convertWhitespaceEscapes - convert escaped whitespace (C{'\t'}, C{'\n'}, etc.) to actual whitespace (default=C{True}) + + - quoteChar - string of one or more characters defining the + quote delimiting string + - escChar - character to escape quotes, typically backslash + (default= ``None`` ) + - escQuote - special quote sequence to escape an embedded quote + string (such as SQL's ``""`` to escape an embedded ``"``) + (default= ``None`` ) + - multiline - boolean indicating whether quotes can span + multiple lines (default= ``False`` ) + - unquoteResults - boolean indicating whether the matched text + should be unquoted (default= ``True`` ) + - endQuoteChar - string of one or more characters defining the + end of the quote delimited string (default= ``None`` => same as + quoteChar) + - convertWhitespaceEscapes - convert escaped whitespace + (``'\t'``, ``'\n'``, etc.) to actual whitespace + (default= ``True`` ) Example:: + qs = QuotedString('"') print(qs.searchString('lsjdf "This is the quote" sldjf')) complex_qs = QuotedString('{{', endQuoteChar='}}') print(complex_qs.searchString('lsjdf {{This is the "quote"}} sldjf')) sql_qs = QuotedString('"', escQuote='""') print(sql_qs.searchString('lsjdf "This is the quote with ""embedded"" quotes" sldjf')) + prints:: + [['This is the quote']] [['This is the "quote"']] [['This is the quote with "embedded" quotes']] @@ -2973,19 +3279,23 @@ class QuotedString(Token): class CharsNotIn(Token): - """ - Token for matching words composed of characters I{not} in a given set (will - include whitespace in matched characters if not listed in the provided exclusion set - see example). - Defined with string containing all disallowed characters, and an optional - minimum, maximum, and/or exact length. The default value for C{min} is 1 (a - minimum value < 1 is not valid); the default values for C{max} and C{exact} - are 0, meaning no maximum or exact length restriction. + """Token for matching words composed of characters *not* in a given + set (will include whitespace in matched characters if not listed in + the provided exclusion set - see example). Defined with string + containing all disallowed characters, and an optional minimum, + maximum, and/or exact length. The default value for ``min`` is + 1 (a minimum value < 1 is not valid); the default values for + ``max`` and ``exact`` are 0, meaning no maximum or exact + length restriction. Example:: + # define a comma-separated-value as anything that is not a ',' csv_value = CharsNotIn(',') print(delimitedList(csv_value).parseString("dkls,lsdkjf,s12 34,@!#,213")) + prints:: + ['dkls', 'lsdkjf', 's12 34', '@!#', '213'] """ def __init__( self, notChars, min=1, max=0, exact=0 ): @@ -2994,7 +3304,9 @@ class CharsNotIn(Token): self.notChars = notChars if min < 1: - raise ValueError("cannot specify a minimum length < 1; use Optional(CharsNotIn()) if zero-length char group is permitted") + raise ValueError( + "cannot specify a minimum length < 1; use " + + "Optional(CharsNotIn()) if zero-length char group is permitted") self.minLen = min @@ -3044,19 +3356,38 @@ class CharsNotIn(Token): return self.strRepr class White(Token): - """ - Special matching class for matching whitespace. Normally, whitespace is ignored - by pyparsing grammars. This class is included when some whitespace structures - are significant. Define with a string containing the whitespace characters to be - matched; default is C{" \\t\\r\\n"}. Also takes optional C{min}, C{max}, and C{exact} arguments, - as defined for the C{L{Word}} class. + """Special matching class for matching whitespace. Normally, + whitespace is ignored by pyparsing grammars. This class is included + when some whitespace structures are significant. Define with + a string containing the whitespace characters to be matched; default + is ``" \\t\\r\\n"``. Also takes optional ``min``, + ``max``, and ``exact`` arguments, as defined for the + :class:`Word` class. """ whiteStrs = { - " " : "", - "\t": "", - "\n": "", - "\r": "", - "\f": "", + ' ' : '', + '\t': '', + '\n': '', + '\r': '', + '\f': '', + 'u\00A0': '', + 'u\1680': '', + 'u\180E': '', + 'u\2000': '', + 'u\2001': '', + 'u\2002': '', + 'u\2003': '', + 'u\2004': '', + 'u\2005': '', + 'u\2006': '', + 'u\2007': '', + 'u\2008': '', + 'u\2009': '', + 'u\200A': '', + 'u\200B': '', + 'u\202F': '', + 'u\205F': '', + 'u\3000': '', } def __init__(self, ws=" \t\r\n", min=1, max=0, exact=0): super(White,self).__init__() @@ -3079,7 +3410,7 @@ class White(Token): self.minLen = exact def parseImpl( self, instring, loc, doActions=True ): - if not(instring[ loc ] in self.matchWhite): + if instring[loc] not in self.matchWhite: raise ParseException(instring, loc, self.errmsg, self) start = loc loc += 1 @@ -3102,8 +3433,8 @@ class _PositionToken(Token): self.mayIndexError = False class GoToColumn(_PositionToken): - """ - Token to advance to a specific column of input text; useful for tabular report scraping. + """Token to advance to a specific column of input text; useful for + tabular report scraping. """ def __init__( self, colno ): super(GoToColumn,self).__init__() @@ -3128,11 +3459,11 @@ class GoToColumn(_PositionToken): class LineStart(_PositionToken): - """ - Matches if current position is at the beginning of a line within the parse string - + r"""Matches if current position is at the beginning of a line within + the parse string + Example:: - + test = '''\ AAA this line AAA and this line @@ -3142,10 +3473,11 @@ class LineStart(_PositionToken): for t in (LineStart() + 'AAA' + restOfLine).searchString(test): print(t) - - Prints:: + + prints:: + ['AAA', ' this line'] - ['AAA', ' and this line'] + ['AAA', ' and this line'] """ def __init__( self ): @@ -3158,8 +3490,8 @@ class LineStart(_PositionToken): raise ParseException(instring, loc, self.errmsg, self) class LineEnd(_PositionToken): - """ - Matches if current position is at the end of a line within the parse string + """Matches if current position is at the end of a line within the + parse string """ def __init__( self ): super(LineEnd,self).__init__() @@ -3178,8 +3510,8 @@ class LineEnd(_PositionToken): raise ParseException(instring, loc, self.errmsg, self) class StringStart(_PositionToken): - """ - Matches if current position is at the beginning of the parse string + """Matches if current position is at the beginning of the parse + string """ def __init__( self ): super(StringStart,self).__init__() @@ -3193,8 +3525,7 @@ class StringStart(_PositionToken): return loc, [] class StringEnd(_PositionToken): - """ - Matches if current position is at the end of the parse string + """Matches if current position is at the end of the parse string """ def __init__( self ): super(StringEnd,self).__init__() @@ -3211,12 +3542,13 @@ class StringEnd(_PositionToken): raise ParseException(instring, loc, self.errmsg, self) class WordStart(_PositionToken): - """ - Matches if the current position is at the beginning of a Word, and - is not preceded by any character in a given set of C{wordChars} - (default=C{printables}). To emulate the C{\b} behavior of regular expressions, - use C{WordStart(alphanums)}. C{WordStart} will also match at the beginning of - the string being parsed, or at the beginning of a line. + """Matches if the current position is at the beginning of a Word, + and is not preceded by any character in a given set of + ``wordChars`` (default= ``printables``). To emulate the + ``\b`` behavior of regular expressions, use + ``WordStart(alphanums)``. ``WordStart`` will also match at + the beginning of the string being parsed, or at the beginning of + a line. """ def __init__(self, wordChars = printables): super(WordStart,self).__init__() @@ -3231,12 +3563,12 @@ class WordStart(_PositionToken): return loc, [] class WordEnd(_PositionToken): - """ - Matches if the current position is at the end of a Word, and - is not followed by any character in a given set of C{wordChars} - (default=C{printables}). To emulate the C{\b} behavior of regular expressions, - use C{WordEnd(alphanums)}. C{WordEnd} will also match at the end of - the string being parsed, or at the end of a line. + """Matches if the current position is at the end of a Word, and is + not followed by any character in a given set of ``wordChars`` + (default= ``printables``). To emulate the ``\b`` behavior of + regular expressions, use ``WordEnd(alphanums)``. ``WordEnd`` + will also match at the end of the string being parsed, or at the end + of a line. """ def __init__(self, wordChars = printables): super(WordEnd,self).__init__() @@ -3254,8 +3586,8 @@ class WordEnd(_PositionToken): class ParseExpression(ParserElement): - """ - Abstract subclass of ParserElement, for combining and post-processing parsed tokens. + """Abstract subclass of ParserElement, for combining and + post-processing parsed tokens. """ def __init__( self, exprs, savelist = False ): super(ParseExpression,self).__init__(savelist) @@ -3286,7 +3618,7 @@ class ParseExpression(ParserElement): return self def leaveWhitespace( self ): - """Extends C{leaveWhitespace} defined in base class, and also invokes C{leaveWhitespace} on + """Extends ``leaveWhitespace`` defined in base class, and also invokes ``leaveWhitespace`` on all contained expressions.""" self.skipWhitespace = False self.exprs = [ e.copy() for e in self.exprs ] @@ -3347,19 +3679,15 @@ class ParseExpression(ParserElement): self.mayIndexError |= other.mayIndexError self.errmsg = "Expected " + _ustr(self) - - return self - def setResultsName( self, name, listAllMatches=False ): - ret = super(ParseExpression,self).setResultsName(name,listAllMatches) - return ret + return self def validate( self, validateTrace=[] ): tmp = validateTrace[:]+[self] for e in self.exprs: e.validate(tmp) self.checkRecursion( [] ) - + def copy(self): ret = super(ParseExpression,self).copy() ret.exprs = [e.copy() for e in self.exprs] @@ -3367,12 +3695,14 @@ class ParseExpression(ParserElement): class And(ParseExpression): """ - Requires all given C{ParseExpression}s to be found in the given order. + Requires all given :class:`ParseExpression` s to be found in the given order. Expressions may be separated by whitespace. - May be constructed using the C{'+'} operator. - May also be constructed using the C{'-'} operator, which will suppress backtracking. + May be constructed using the ``'+'`` operator. + May also be constructed using the ``'-'`` operator, which will + suppress backtracking. Example:: + integer = Word(nums) name_expr = OneOrMore(Word(alphas)) @@ -3394,6 +3724,11 @@ class And(ParseExpression): self.skipWhitespace = self.exprs[0].skipWhitespace self.callPreparse = True + def streamline(self): + super(And, self).streamline() + self.mayReturnEmpty = all(e.mayReturnEmpty for e in self.exprs) + return self + def parseImpl( self, instring, loc, doActions=True ): # pass False as last arg to _parse for first element, since we already # pre-parsed the string as part of our And pre-parsing @@ -3442,17 +3777,20 @@ class And(ParseExpression): class Or(ParseExpression): - """ - Requires that at least one C{ParseExpression} is found. - If two expressions match, the expression that matches the longest string will be used. - May be constructed using the C{'^'} operator. + """Requires that at least one :class:`ParseExpression` is found. If + two expressions match, the expression that matches the longest + string will be used. May be constructed using the ``'^'`` + operator. Example:: + # construct Or using '^' operator - + number = Word(nums) ^ Combine(Word(nums) + '.' + Word(nums)) print(number.searchString("123 3.1416 789")) + prints:: + [['123'], ['3.1416'], ['789']] """ def __init__( self, exprs, savelist = False ): @@ -3462,6 +3800,12 @@ class Or(ParseExpression): else: self.mayReturnEmpty = True + def streamline(self): + super(Or, self).streamline() + if __compat__.collect_all_And_tokens: + self.saveAsList = any(e.saveAsList for e in self.exprs) + return self + def parseImpl( self, instring, loc, doActions=True ): maxExcLoc = -1 maxException = None @@ -3521,14 +3865,14 @@ class Or(ParseExpression): class MatchFirst(ParseExpression): - """ - Requires that at least one C{ParseExpression} is found. - If two expressions match, the first one listed is the one that will match. - May be constructed using the C{'|'} operator. + """Requires that at least one :class:`ParseExpression` is found. If + two expressions match, the first one listed is the one that will + match. May be constructed using the ``'|'`` operator. Example:: + # construct MatchFirst using '|' operator - + # watch the order of expressions to match number = Word(nums) | Combine(Word(nums) + '.' + Word(nums)) print(number.searchString("123 3.1416 789")) # Fail! -> [['123'], ['3'], ['1416'], ['789']] @@ -3544,6 +3888,12 @@ class MatchFirst(ParseExpression): else: self.mayReturnEmpty = True + def streamline(self): + super(MatchFirst, self).streamline() + if __compat__.collect_all_And_tokens: + self.saveAsList = any(e.saveAsList for e in self.exprs) + return self + def parseImpl( self, instring, loc, doActions=True ): maxExcLoc = -1 maxException = None @@ -3589,12 +3939,13 @@ class MatchFirst(ParseExpression): class Each(ParseExpression): - """ - Requires all given C{ParseExpression}s to be found, but in any order. - Expressions may be separated by whitespace. - May be constructed using the C{'&'} operator. + """Requires all given :class:`ParseExpression` s to be found, but in + any order. Expressions may be separated by whitespace. + + May be constructed using the ``'&'`` operator. Example:: + color = oneOf("RED ORANGE YELLOW GREEN BLUE PURPLE BLACK WHITE BROWN") shape_type = oneOf("SQUARE CIRCLE TRIANGLE STAR HEXAGON OCTAGON") integer = Word(nums) @@ -3603,7 +3954,7 @@ class Each(ParseExpression): color_attr = "color:" + color("color") size_attr = "size:" + integer("size") - # use Each (using operator '&') to accept attributes in any order + # use Each (using operator '&') to accept attributes in any order # (shape and posn are required, color and size are optional) shape_spec = shape_attr & posn_attr & Optional(color_attr) & Optional(size_attr) @@ -3613,7 +3964,9 @@ class Each(ParseExpression): color:GREEN size:20 shape:TRIANGLE posn:20,40 ''' ) + prints:: + shape: SQUARE color: BLACK posn: 100, 120 ['shape:', 'SQUARE', 'color:', 'BLACK', 'posn:', ['100', ',', '120']] - color: BLACK @@ -3647,6 +4000,12 @@ class Each(ParseExpression): self.mayReturnEmpty = all(e.mayReturnEmpty for e in self.exprs) self.skipWhitespace = True self.initExprGroups = True + self.saveAsList = True + + def streamline(self): + super(Each, self).streamline() + self.mayReturnEmpty = all(e.mayReturnEmpty for e in self.exprs) + return self def parseImpl( self, instring, loc, doActions=True ): if self.initExprGroups: @@ -3713,8 +4072,8 @@ class Each(ParseExpression): class ParseElementEnhance(ParserElement): - """ - Abstract subclass of C{ParserElement}, for combining and post-processing parsed tokens. + """Abstract subclass of :class:`ParserElement`, for combining and + post-processing parsed tokens. """ def __init__( self, expr, savelist=False ): super(ParseElementEnhance,self).__init__(savelist) @@ -3790,20 +4149,25 @@ class ParseElementEnhance(ParserElement): class FollowedBy(ParseElementEnhance): - """ - Lookahead matching of the given parse expression. C{FollowedBy} - does I{not} advance the parsing position within the input string, it only - verifies that the specified parse expression matches at the current - position. C{FollowedBy} always returns a null token list. + """Lookahead matching of the given parse expression. + ``FollowedBy`` does *not* advance the parsing position within + the input string, it only verifies that the specified parse + expression matches at the current position. ``FollowedBy`` + always returns a null token list. If any results names are defined + in the lookahead expression, those *will* be returned for access by + name. Example:: + # use FollowedBy to match a label only if it is followed by a ':' data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) - + OneOrMore(attr_expr).parseString("shape: SQUARE color: BLACK posn: upper left").pprint() + prints:: + [['shape', 'SQUARE'], ['color', 'BLACK'], ['posn', 'upper left']] """ def __init__( self, expr ): @@ -3811,20 +4175,108 @@ class FollowedBy(ParseElementEnhance): self.mayReturnEmpty = True def parseImpl( self, instring, loc, doActions=True ): - self.expr.tryParse( instring, loc ) - return loc, [] + _, ret = self.expr._parse(instring, loc, doActions=doActions) + del ret[:] + return loc, ret + + +class PrecededBy(ParseElementEnhance): + """Lookbehind matching of the given parse expression. + ``PrecededBy`` does not advance the parsing position within the + input string, it only verifies that the specified parse expression + matches prior to the current position. ``PrecededBy`` always + returns a null token list, but if a results name is defined on the + given expression, it is returned. + + Parameters: + + - expr - expression that must match prior to the current parse + location + - retreat - (default= ``None``) - (int) maximum number of characters + to lookbehind prior to the current parse location + + If the lookbehind expression is a string, Literal, Keyword, or + a Word or CharsNotIn with a specified exact or maximum length, then + the retreat parameter is not required. Otherwise, retreat must be + specified to give a maximum number of characters to look back from + the current parse position for a lookbehind match. + + Example:: + + # VB-style variable names with type prefixes + int_var = PrecededBy("#") + pyparsing_common.identifier + str_var = PrecededBy("$") + pyparsing_common.identifier + + """ + def __init__(self, expr, retreat=None): + super(PrecededBy, self).__init__(expr) + self.expr = self.expr().leaveWhitespace() + self.mayReturnEmpty = True + self.mayIndexError = False + self.exact = False + if isinstance(expr, str): + retreat = len(expr) + self.exact = True + elif isinstance(expr, (Literal, Keyword)): + retreat = expr.matchLen + self.exact = True + elif isinstance(expr, (Word, CharsNotIn)) and expr.maxLen != _MAX_INT: + retreat = expr.maxLen + self.exact = True + elif isinstance(expr, _PositionToken): + retreat = 0 + self.exact = True + self.retreat = retreat + self.errmsg = "not preceded by " + str(expr) + self.skipWhitespace = False + + def parseImpl(self, instring, loc=0, doActions=True): + if self.exact: + if loc < self.retreat: + raise ParseException(instring, loc, self.errmsg) + start = loc - self.retreat + _, ret = self.expr._parse(instring, start) + else: + # retreat specified a maximum lookbehind window, iterate + test_expr = self.expr + StringEnd() + instring_slice = instring[:loc] + last_expr = ParseException(instring, loc, self.errmsg) + for offset in range(1, min(loc, self.retreat+1)): + try: + _, ret = test_expr._parse(instring_slice, loc-offset) + except ParseBaseException as pbe: + last_expr = pbe + else: + break + else: + raise last_expr + # return empty list of tokens, but preserve any defined results names + del ret[:] + return loc, ret class NotAny(ParseElementEnhance): - """ - Lookahead to disallow matching with the given parse expression. C{NotAny} - does I{not} advance the parsing position within the input string, it only - verifies that the specified parse expression does I{not} match at the current - position. Also, C{NotAny} does I{not} skip over leading whitespace. C{NotAny} - always returns a null token list. May be constructed using the '~' operator. + """Lookahead to disallow matching with the given parse expression. + ``NotAny`` does *not* advance the parsing position within the + input string, it only verifies that the specified parse expression + does *not* match at the current position. Also, ``NotAny`` does + *not* skip over leading whitespace. ``NotAny`` always returns + a null token list. May be constructed using the '~' operator. Example:: - + + AND, OR, NOT = map(CaselessKeyword, "AND OR NOT".split()) + + # take care not to mistake keywords for identifiers + ident = ~(AND | OR | NOT) + Word(alphas) + boolean_term = Optional(NOT) + ident + + # very crude boolean expression - to support parenthesis groups and + # operation hierarchy, use infixNotation + boolean_expr = boolean_term + ZeroOrMore((AND | OR) + boolean_term) + + # integers that are followed by "." are actually floats + integer = Word(nums) + ~Char(".") """ def __init__( self, expr ): super(NotAny,self).__init__(expr) @@ -3862,7 +4314,7 @@ class _MultipleMatch(ParseElementEnhance): check_ender = self.not_ender is not None if check_ender: try_not_ender = self.not_ender.tryParse - + # must be at least one (but first see if we are the stopOn sentinel; # if so, fail) if check_ender: @@ -3884,18 +4336,18 @@ class _MultipleMatch(ParseElementEnhance): pass return loc, tokens - + class OneOrMore(_MultipleMatch): - """ - Repetition of one or more of the given expression. - + """Repetition of one or more of the given expression. + Parameters: - expr - expression that must match one or more times - - stopOn - (default=C{None}) - expression for a terminating sentinel - (only required if the sentinel would ordinarily match the repetition - expression) + - stopOn - (default= ``None``) - expression for a terminating sentinel + (only required if the sentinel would ordinarily match the repetition + expression) Example:: + data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join)) @@ -3906,7 +4358,7 @@ class OneOrMore(_MultipleMatch): # use stopOn attribute for OneOrMore to avoid reading label string as part of the data attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) OneOrMore(attr_expr).parseString(text).pprint() # Better -> [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'BLACK']] - + # could also be written as (attr_expr * (1,)).parseString(text).pprint() """ @@ -3921,21 +4373,20 @@ class OneOrMore(_MultipleMatch): return self.strRepr class ZeroOrMore(_MultipleMatch): - """ - Optional repetition of zero or more of the given expression. - + """Optional repetition of zero or more of the given expression. + Parameters: - expr - expression that must match zero or more times - - stopOn - (default=C{None}) - expression for a terminating sentinel - (only required if the sentinel would ordinarily match the repetition - expression) + - stopOn - (default= ``None``) - expression for a terminating sentinel + (only required if the sentinel would ordinarily match the repetition + expression) - Example: similar to L{OneOrMore} + Example: similar to :class:`OneOrMore` """ def __init__( self, expr, stopOn=None): super(ZeroOrMore,self).__init__(expr, stopOn=stopOn) self.mayReturnEmpty = True - + def parseImpl( self, instring, loc, doActions=True ): try: return super(ZeroOrMore, self).parseImpl(instring, loc, doActions) @@ -3960,27 +4411,29 @@ class _NullToken(object): _optionalNotMatched = _NullToken() class Optional(ParseElementEnhance): - """ - Optional matching of the given expression. + """Optional matching of the given expression. Parameters: - expr - expression that must match zero or more times - default (optional) - value to be returned if the optional expression is not found. Example:: + # US postal code can be a 5-digit zip, plus optional 4-digit qualifier zip = Combine(Word(nums, exact=5) + Optional('-' + Word(nums, exact=4))) zip.runTests(''' # traditional ZIP code 12345 - + # ZIP+4 form 12101-0001 - + # invalid ZIP 98765- ''') + prints:: + # traditional ZIP code 12345 ['12345'] @@ -4024,20 +4477,21 @@ class Optional(ParseElementEnhance): return self.strRepr class SkipTo(ParseElementEnhance): - """ - Token for skipping over all undefined text until the matched expression is found. + """Token for skipping over all undefined text until the matched + expression is found. Parameters: - expr - target expression marking the end of the data to be skipped - - include - (default=C{False}) if True, the target expression is also parsed + - include - (default= ``False``) if True, the target expression is also parsed (the skipped text and target expression are returned as a 2-element list). - - ignore - (default=C{None}) used to define grammars (typically quoted strings and + - ignore - (default= ``None``) used to define grammars (typically quoted strings and comments) that might contain false matches to the target expression - - failOn - (default=C{None}) define expressions that are not allowed to be - included in the skipped test; if found before the target expression is found, + - failOn - (default= ``None``) define expressions that are not allowed to be + included in the skipped test; if found before the target expression is found, the SkipTo is not a match Example:: + report = ''' Outstanding Issues Report - 1 Jan 2000 @@ -4054,14 +4508,16 @@ class SkipTo(ParseElementEnhance): # - parse action will call token.strip() for each matched token, i.e., the description body string_data = SkipTo(SEP, ignore=quotedString) string_data.setParseAction(tokenMap(str.strip)) - ticket_expr = (integer("issue_num") + SEP - + string_data("sev") + SEP - + string_data("desc") + SEP + ticket_expr = (integer("issue_num") + SEP + + string_data("sev") + SEP + + string_data("desc") + SEP + integer("days_open")) - + for tkt in ticket_expr.searchString(report): print tkt.dump() + prints:: + ['101', 'Critical', 'Intermittent system crash', '6'] - days_open: 6 - desc: Intermittent system crash @@ -4084,7 +4540,7 @@ class SkipTo(ParseElementEnhance): self.mayReturnEmpty = True self.mayIndexError = False self.includeMatch = include - self.asList = False + self.saveAsList = False if isinstance(failOn, basestring): self.failOn = ParserElement._literalStringClass(failOn) else: @@ -4098,14 +4554,14 @@ class SkipTo(ParseElementEnhance): expr_parse = self.expr._parse self_failOn_canParseNext = self.failOn.canParseNext if self.failOn is not None else None self_ignoreExpr_tryParse = self.ignoreExpr.tryParse if self.ignoreExpr is not None else None - + tmploc = loc while tmploc <= instrlen: if self_failOn_canParseNext is not None: # break if failOn expression matches if self_failOn_canParseNext(instring, tmploc): break - + if self_ignoreExpr_tryParse is not None: # advance past ignore expressions while 1: @@ -4113,7 +4569,7 @@ class SkipTo(ParseElementEnhance): tmploc = self_ignoreExpr_tryParse(instring, tmploc) except ParseBaseException: break - + try: expr_parse(instring, tmploc, doActions=False, callPreParse=False) except (ParseException, IndexError): @@ -4131,7 +4587,7 @@ class SkipTo(ParseElementEnhance): loc = tmploc skiptext = instring[startloc:loc] skipresult = ParseResults(skiptext) - + if self.includeMatch: loc, mat = expr_parse(instring,loc,doActions,callPreParse=False) skipresult += mat @@ -4139,23 +4595,31 @@ class SkipTo(ParseElementEnhance): return loc, skipresult class Forward(ParseElementEnhance): - """ - Forward declaration of an expression to be defined later - + """Forward declaration of an expression to be defined later - used for recursive grammars, such as algebraic infix notation. - When the expression is known, it is assigned to the C{Forward} variable using the '<<' operator. + When the expression is known, it is assigned to the ``Forward`` + variable using the '<<' operator. + + Note: take care when assigning to ``Forward`` not to overlook + precedence of operators. - Note: take care when assigning to C{Forward} not to overlook precedence of operators. Specifically, '|' has a lower precedence than '<<', so that:: + fwdExpr << a | b | c + will actually be evaluated as:: + (fwdExpr << a) | b | c + thereby leaving b and c out as parseable alternatives. It is recommended that you - explicitly group the values inserted into the C{Forward}:: + explicitly group the values inserted into the ``Forward``:: + fwdExpr << (a | b | c) + Converting to use the '<<=' operator instead will avoid this problem. - See L{ParseResults.pprint} for an example of a recursive parser created using - C{Forward}. + See :class:`ParseResults.pprint` for an example of a recursive + parser created using ``Forward``. """ def __init__( self, other=None ): super(Forward,self).__init__( other, savelist=False ) @@ -4172,10 +4636,10 @@ class Forward(ParseElementEnhance): self.saveAsList = self.expr.saveAsList self.ignoreExprs.extend(self.expr.ignoreExprs) return self - + def __ilshift__(self, other): return self << other - + def leaveWhitespace( self ): self.skipWhitespace = False return self @@ -4197,18 +4661,18 @@ class Forward(ParseElementEnhance): def __str__( self ): if hasattr(self,"name"): return self.name - return self.__class__.__name__ + ": ..." - # stubbed out for now - creates awful memory and perf issues - self._revertClass = self.__class__ - self.__class__ = _ForwardNoRecurse + # Avoid infinite recursion by setting a temporary name + self.name = self.__class__.__name__ + ": ..." + + # Use the string representation of main expression. try: if self.expr is not None: retString = _ustr(self.expr) else: retString = "None" finally: - self.__class__ = self._revertClass + del self.name return self.__class__.__name__ + ": " + retString def copy(self): @@ -4219,25 +4683,22 @@ class Forward(ParseElementEnhance): ret <<= self return ret -class _ForwardNoRecurse(Forward): - def __str__( self ): - return "..." - class TokenConverter(ParseElementEnhance): """ - Abstract subclass of C{ParseExpression}, for converting parsed results. + Abstract subclass of :class:`ParseExpression`, for converting parsed results. """ def __init__( self, expr, savelist=False ): super(TokenConverter,self).__init__( expr )#, savelist ) self.saveAsList = False class Combine(TokenConverter): - """ - Converter to concatenate all matching tokens to a single string. - By default, the matching patterns must also be contiguous in the input string; - this can be disabled by specifying C{'adjacent=False'} in the constructor. + """Converter to concatenate all matching tokens to a single string. + By default, the matching patterns must also be contiguous in the + input string; this can be disabled by specifying + ``'adjacent=False'`` in the constructor. Example:: + real = Word(nums) + '.' + Word(nums) print(real.parseString('3.1416')) # -> ['3', '.', '1416'] # will also erroneously match the following @@ -4276,10 +4737,11 @@ class Combine(TokenConverter): return retToks class Group(TokenConverter): - """ - Converter to return the matched tokens as a list - useful for returning tokens of C{L{ZeroOrMore}} and C{L{OneOrMore}} expressions. + """Converter to return the matched tokens as a list - useful for + returning tokens of :class:`ZeroOrMore` and :class:`OneOrMore` expressions. Example:: + ident = Word(alphas) num = Word(nums) term = ident | num @@ -4297,32 +4759,34 @@ class Group(TokenConverter): return [ tokenlist ] class Dict(TokenConverter): - """ - Converter to return a repetitive expression as a list, but also as a dictionary. - Each element can also be referenced using the first token in the expression as its key. - Useful for tabular report scraping when the first column can be used as a item key. + """Converter to return a repetitive expression as a list, but also + as a dictionary. Each element can also be referenced using the first + token in the expression as its key. Useful for tabular report + scraping when the first column can be used as a item key. Example:: + data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join)) text = "shape: SQUARE posn: upper left color: light blue texture: burlap" attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) - + # print attributes as plain groups print(OneOrMore(attr_expr).parseString(text).dump()) - + # instead of OneOrMore(expr), parse using Dict(OneOrMore(Group(expr))) - Dict will auto-assign names result = Dict(OneOrMore(Group(attr_expr))).parseString(text) print(result.dump()) - - # access named fields as dict entries, or output as dict - print(result['shape']) - print(result.asDict()) - prints:: - ['shape', 'SQUARE', 'posn', 'upper left', 'color', 'light blue', 'texture', 'burlap'] + # access named fields as dict entries, or output as dict + print(result['shape']) + print(result.asDict()) + + prints:: + + ['shape', 'SQUARE', 'posn', 'upper left', 'color', 'light blue', 'texture', 'burlap'] [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']] - color: light blue - posn: upper left @@ -4330,7 +4794,8 @@ class Dict(TokenConverter): - texture: burlap SQUARE {'color': 'light blue', 'posn': 'upper left', 'texture': 'burlap', 'shape': 'SQUARE'} - See more examples at L{ParseResults} of accessing fields by results name. + + See more examples at :class:`ParseResults` of accessing fields by results name. """ def __init__( self, expr ): super(Dict,self).__init__( expr ) @@ -4362,10 +4827,10 @@ class Dict(TokenConverter): class Suppress(TokenConverter): - """ - Converter for ignoring the results of a parsed expression. + """Converter for ignoring the results of a parsed expression. Example:: + source = "a, b, c,d" wd = Word(alphas) wd_list1 = wd + ZeroOrMore(',' + wd) @@ -4375,10 +4840,13 @@ class Suppress(TokenConverter): # way afterward - use Suppress to keep them out of the parsed output wd_list2 = wd + ZeroOrMore(Suppress(',') + wd) print(wd_list2.parseString(source)) + prints:: + ['a', ',', 'b', ',', 'c', ',', 'd'] ['a', 'b', 'c', 'd'] - (See also L{delimitedList}.) + + (See also :class:`delimitedList`.) """ def postParse( self, instring, loc, tokenlist ): return [] @@ -4388,8 +4856,7 @@ class Suppress(TokenConverter): class OnlyOnce(object): - """ - Wrapper for parse actions, to ensure they are only called once. + """Wrapper for parse actions, to ensure they are only called once. """ def __init__(self, methodCall): self.callable = _trim_arity(methodCall) @@ -4404,13 +4871,15 @@ class OnlyOnce(object): self.called = False def traceParseAction(f): - """ - Decorator for debugging parse actions. - - When the parse action is called, this decorator will print C{">> entering I{method-name}(line:I{current_source_line}, I{parse_location}, I{matched_tokens})".} - When the parse action completes, the decorator will print C{"<<"} followed by the returned value, or any exception that the parse action raised. + """Decorator for debugging parse actions. + + When the parse action is called, this decorator will print + ``">> entering method-name(line:, , )"``. + When the parse action completes, the decorator will print + ``"<<"`` followed by the returned value, or any exception that the parse action raised. Example:: + wd = Word(alphas) @traceParseAction @@ -4419,7 +4888,9 @@ def traceParseAction(f): wds = OneOrMore(wd).setParseAction(remove_duplicate_chars) print(wds.parseString("slkdjs sld sldd sdlf sdljf")) + prints:: + >>entering remove_duplicate_chars(line: 'slkdjs sld sldd sdlf sdljf', 0, (['slkdjs', 'sld', 'sldd', 'sdlf', 'sdljf'], {})) < ['aa', 'bb', 'cc'] delimitedList(Word(hexnums), delim=':', combine=True).parseString("AA:BB:CC:DD:EE") # -> ['AA:BB:CC:DD:EE'] """ @@ -4467,16 +4940,21 @@ def delimitedList( expr, delim=",", combine=False ): return ( expr + ZeroOrMore( Suppress( delim ) + expr ) ).setName(dlName) def countedArray( expr, intExpr=None ): - """ - Helper to define a counted list of expressions. + """Helper to define a counted list of expressions. + This helper defines a pattern of the form:: + integer expr expr expr... + where the leading integer tells how many expr expressions follow. - The matched tokens returns the array of expr tokens as a list - the leading count token is suppressed. - - If C{intExpr} is specified, it should be a pyparsing expression that produces an integer value. + The matched tokens returns the array of expr tokens as a list - the + leading count token is suppressed. + + If ``intExpr`` is specified, it should be a pyparsing expression + that produces an integer value. Example:: + countedArray(Word(alphas)).parseString('2 ab cd ef') # -> ['ab', 'cd'] # in this parser, the leading integer value is given in binary, @@ -4507,17 +4985,19 @@ def _flatten(L): return ret def matchPreviousLiteral(expr): - """ - Helper to define an expression that is indirectly defined from - the tokens matched in a previous expression, that is, it looks - for a 'repeat' of a previous expression. For example:: + """Helper to define an expression that is indirectly defined from + the tokens matched in a previous expression, that is, it looks for + a 'repeat' of a previous expression. For example:: + first = Word(nums) second = matchPreviousLiteral(first) matchExpr = first + ":" + second - will match C{"1:1"}, but not C{"1:2"}. Because this matches a - previous literal, will also match the leading C{"1:1"} in C{"1:10"}. - If this is not desired, use C{matchPreviousExpr}. - Do I{not} use with packrat parsing enabled. + + will match ``"1:1"``, but not ``"1:2"``. Because this + matches a previous literal, will also match the leading + ``"1:1"`` in ``"1:10"``. If this is not desired, use + :class:`matchPreviousExpr`. Do *not* use with packrat parsing + enabled. """ rep = Forward() def copyTokenToRepeater(s,l,t): @@ -4535,18 +5015,19 @@ def matchPreviousLiteral(expr): return rep def matchPreviousExpr(expr): - """ - Helper to define an expression that is indirectly defined from - the tokens matched in a previous expression, that is, it looks - for a 'repeat' of a previous expression. For example:: + """Helper to define an expression that is indirectly defined from + the tokens matched in a previous expression, that is, it looks for + a 'repeat' of a previous expression. For example:: + first = Word(nums) second = matchPreviousExpr(first) matchExpr = first + ":" + second - will match C{"1:1"}, but not C{"1:2"}. Because this matches by - expressions, will I{not} match the leading C{"1:1"} in C{"1:10"}; - the expressions are evaluated first, and then compared, so - C{"1"} is compared with C{"10"}. - Do I{not} use with packrat parsing enabled. + + will match ``"1:1"``, but not ``"1:2"``. Because this + matches by expressions, will *not* match the leading ``"1:1"`` + in ``"1:10"``; the expressions are evaluated first, and then + compared, so ``"1"`` is compared with ``"10"``. Do *not* use + with packrat parsing enabled. """ rep = Forward() e2 = expr.copy() @@ -4571,26 +5052,33 @@ def _escapeRegexRangeChars(s): return _ustr(s) def oneOf( strs, caseless=False, useRegex=True ): - """ - Helper to quickly define a set of alternative Literals, and makes sure to do - longest-first testing when there is a conflict, regardless of the input order, - but returns a C{L{MatchFirst}} for best performance. + """Helper to quickly define a set of alternative Literals, and makes + sure to do longest-first testing when there is a conflict, + regardless of the input order, but returns + a :class:`MatchFirst` for best performance. Parameters: - - strs - a string of space-delimited literals, or a collection of string literals - - caseless - (default=C{False}) - treat all literals as caseless - - useRegex - (default=C{True}) - as an optimization, will generate a Regex - object; otherwise, will generate a C{MatchFirst} object (if C{caseless=True}, or - if creating a C{Regex} raises an exception) + + - strs - a string of space-delimited literals, or a collection of + string literals + - caseless - (default= ``False``) - treat all literals as + caseless + - useRegex - (default= ``True``) - as an optimization, will + generate a Regex object; otherwise, will generate + a :class:`MatchFirst` object (if ``caseless=True``, or if + creating a :class:`Regex` raises an exception) Example:: + comp_oper = oneOf("< = > <= >= !=") var = Word(alphas) number = Word(nums) term = var | number comparison_expr = term + comp_oper + term print(comparison_expr.searchString("B = 12 AA=23 B<=AA AA>12")) + prints:: + [['B', '=', '12'], ['AA', '=', '23'], ['B', '<=', 'AA'], ['AA', '>', '12']] """ if caseless: @@ -4644,19 +5132,21 @@ def oneOf( strs, caseless=False, useRegex=True ): return MatchFirst(parseElementClass(sym) for sym in symbols).setName(' | '.join(symbols)) def dictOf( key, value ): - """ - Helper to easily and clearly define a dictionary by specifying the respective patterns - for the key and value. Takes care of defining the C{L{Dict}}, C{L{ZeroOrMore}}, and C{L{Group}} tokens - in the proper order. The key pattern can include delimiting markers or punctuation, - as long as they are suppressed, thereby leaving the significant key text. The value - pattern can include named results, so that the C{Dict} results can include named token - fields. + """Helper to easily and clearly define a dictionary by specifying + the respective patterns for the key and value. Takes care of + defining the :class:`Dict`, :class:`ZeroOrMore`, and + :class:`Group` tokens in the proper order. The key pattern + can include delimiting markers or punctuation, as long as they are + suppressed, thereby leaving the significant key text. The value + pattern can include named results, so that the :class:`Dict` results + can include named token fields. Example:: + text = "shape: SQUARE posn: upper left color: light blue texture: burlap" attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) print(OneOrMore(attr_expr).parseString(text).dump()) - + attr_label = label attr_value = Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join) @@ -4666,7 +5156,9 @@ def dictOf( key, value ): print(result['shape']) print(result.shape) # object attribute access works too print(result.asDict()) + prints:: + [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']] - color: light blue - posn: upper left @@ -4676,29 +5168,34 @@ def dictOf( key, value ): SQUARE {'color': 'light blue', 'shape': 'SQUARE', 'posn': 'upper left', 'texture': 'burlap'} """ - return Dict( ZeroOrMore( Group ( key + value ) ) ) + return Dict(OneOrMore(Group(key + value))) def originalTextFor(expr, asString=True): - """ - Helper to return the original, untokenized text for a given expression. Useful to - restore the parsed fields of an HTML start tag into the raw tag text itself, or to - revert separate tokens with intervening whitespace back to the original matching - input text. By default, returns astring containing the original parsed text. - - If the optional C{asString} argument is passed as C{False}, then the return value is a - C{L{ParseResults}} containing any results names that were originally matched, and a - single token containing the original matched text from the input string. So if - the expression passed to C{L{originalTextFor}} contains expressions with defined - results names, you must set C{asString} to C{False} if you want to preserve those - results name values. + """Helper to return the original, untokenized text for a given + expression. Useful to restore the parsed fields of an HTML start + tag into the raw tag text itself, or to revert separate tokens with + intervening whitespace back to the original matching input text. By + default, returns astring containing the original parsed text. + + If the optional ``asString`` argument is passed as + ``False``, then the return value is + a :class:`ParseResults` containing any results names that + were originally matched, and a single token containing the original + matched text from the input string. So if the expression passed to + :class:`originalTextFor` contains expressions with defined + results names, you must set ``asString`` to ``False`` if you + want to preserve those results name values. Example:: + src = "this is test bold text normal text " for tag in ("b","i"): opener,closer = makeHTMLTags(tag) patt = originalTextFor(opener + SkipTo(closer) + closer) print(patt.searchString(src)[0]) + prints:: + [' bold text '] ['text'] """ @@ -4715,29 +5212,33 @@ def originalTextFor(expr, asString=True): matchExpr.ignoreExprs = expr.ignoreExprs return matchExpr -def ungroup(expr): +def ungroup(expr): + """Helper to undo pyparsing's default grouping of And expressions, + even if all but one are non-empty. """ - Helper to undo pyparsing's default grouping of And expressions, even - if all but one are non-empty. - """ - return TokenConverter(expr).setParseAction(lambda t:t[0]) + return TokenConverter(expr).addParseAction(lambda t:t[0]) def locatedExpr(expr): - """ - Helper to decorate a returned token with its starting and ending locations in the input string. + """Helper to decorate a returned token with its starting and ending + locations in the input string. + This helper adds the following results names: + - locn_start = location where matched expression begins - locn_end = location where matched expression ends - value = the actual parsed results - Be careful if the input text contains C{} characters, you may want to call - C{L{ParserElement.parseWithTabs}} + Be careful if the input text contains ```` characters, you + may want to call :class:`ParserElement.parseWithTabs` Example:: + wd = Word(alphas) for match in locatedExpr(wd).searchString("ljsdf123lksdjjf123lkkjj1222"): print(match) + prints:: + [[0, 'ljsdf', 5]] [[8, 'lksdjjf', 15]] [[18, 'lkkjj', 23]] @@ -4761,22 +5262,30 @@ _charRange = Group(_singleChar + Suppress("-") + _singleChar) _reBracketExpr = Literal("[") + Optional("^").setResultsName("negate") + Group( OneOrMore( _charRange | _singleChar ) ).setResultsName("body") + "]" def srange(s): - r""" - Helper to easily define string ranges for use in Word construction. Borrows - syntax from regexp '[]' string range definitions:: + r"""Helper to easily define string ranges for use in Word + construction. Borrows syntax from regexp '[]' string range + definitions:: + srange("[0-9]") -> "0123456789" srange("[a-z]") -> "abcdefghijklmnopqrstuvwxyz" srange("[a-z$_]") -> "abcdefghijklmnopqrstuvwxyz$_" - The input string must be enclosed in []'s, and the returned string is the expanded - character set joined into a single string. - The values enclosed in the []'s may be: + + The input string must be enclosed in []'s, and the returned string + is the expanded character set joined into a single string. The + values enclosed in the []'s may be: + - a single character - - an escaped character with a leading backslash (such as C{\-} or C{\]}) - - an escaped hex character with a leading C{'\x'} (C{\x21}, which is a C{'!'} character) - (C{\0x##} is also supported for backwards compatibility) - - an escaped octal character with a leading C{'\0'} (C{\041}, which is a C{'!'} character) - - a range of any of the above, separated by a dash (C{'a-z'}, etc.) - - any combination of the above (C{'aeiouy'}, C{'a-zA-Z0-9_$'}, etc.) + - an escaped character with a leading backslash (such as ``\-`` + or ``\]``) + - an escaped hex character with a leading ``'\x'`` + (``\x21``, which is a ``'!'`` character) (``\0x##`` + is also supported for backwards compatibility) + - an escaped octal character with a leading ``'\0'`` + (``\041``, which is a ``'!'`` character) + - a range of any of the above, separated by a dash (``'a-z'``, + etc.) + - any combination of the above (``'aeiouy'``, + ``'a-zA-Z0-9_$'``, etc.) """ _expanded = lambda p: p if not isinstance(p,ParseResults) else ''.join(unichr(c) for c in range(ord(p[0]),ord(p[1])+1)) try: @@ -4785,9 +5294,8 @@ def srange(s): return "" def matchOnlyAtCol(n): - """ - Helper method for defining parse actions that require matching at a specific - column in the input text. + """Helper method for defining parse actions that require matching at + a specific column in the input text. """ def verifyCol(strg,locn,toks): if col(locn,strg) != n: @@ -4795,24 +5303,26 @@ def matchOnlyAtCol(n): return verifyCol def replaceWith(replStr): - """ - Helper method for common parse actions that simply return a literal value. Especially - useful when used with C{L{transformString}()}. + """Helper method for common parse actions that simply return + a literal value. Especially useful when used with + :class:`transformString` (). Example:: + num = Word(nums).setParseAction(lambda toks: int(toks[0])) na = oneOf("N/A NA").setParseAction(replaceWith(math.nan)) term = na | num - + OneOrMore(term).parseString("324 234 N/A 234") # -> [324, 234, nan, 234] """ return lambda s,l,t: [replStr] def removeQuotes(s,l,t): - """ - Helper parse action for removing quotation marks from parsed quoted strings. + """Helper parse action for removing quotation marks from parsed + quoted strings. Example:: + # by default, quotation marks are included in parsed results quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["'Now is the Winter of our Discontent'"] @@ -4823,18 +5333,20 @@ def removeQuotes(s,l,t): return t[0][1:-1] def tokenMap(func, *args): - """ - Helper to define a parse action by mapping a function to all elements of a ParseResults list.If any additional - args are passed, they are forwarded to the given function as additional arguments after - the token, as in C{hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))}, which will convert the - parsed data to an integer using base 16. + """Helper to define a parse action by mapping a function to all + elements of a ParseResults list. If any additional args are passed, + they are forwarded to the given function as additional arguments + after the token, as in + ``hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))``, + which will convert the parsed data to an integer using base 16. + + Example (compare the last to example in :class:`ParserElement.transformString`:: - Example (compare the last to example in L{ParserElement.transformString}:: hex_ints = OneOrMore(Word(hexnums)).setParseAction(tokenMap(int, 16)) hex_ints.runTests(''' 00 11 22 aa FF 0a 0d 1a ''') - + upperword = Word(alphas).setParseAction(tokenMap(str.upper)) OneOrMore(upperword).runTests(''' my kingdom for a horse @@ -4844,7 +5356,9 @@ def tokenMap(func, *args): OneOrMore(wd).setParseAction(' '.join).runTests(''' now is the winter of our discontent made glorious summer by this sun of york ''') + prints:: + 00 11 22 aa FF 0a 0d 1a [0, 17, 34, 170, 255, 10, 13, 26] @@ -4858,7 +5372,7 @@ def tokenMap(func, *args): return [func(tokn, *args) for tokn in t] try: - func_name = getattr(func, '__name__', + func_name = getattr(func, '__name__', getattr(func, '__class__').__name__) except Exception: func_name = str(func) @@ -4867,12 +5381,16 @@ def tokenMap(func, *args): return pa upcaseTokens = tokenMap(lambda t: _ustr(t).upper()) -"""(Deprecated) Helper parse action to convert tokens to upper case. Deprecated in favor of L{pyparsing_common.upcaseTokens}""" +"""(Deprecated) Helper parse action to convert tokens to upper case. +Deprecated in favor of :class:`pyparsing_common.upcaseTokens`""" downcaseTokens = tokenMap(lambda t: _ustr(t).lower()) -"""(Deprecated) Helper parse action to convert tokens to lower case. Deprecated in favor of L{pyparsing_common.downcaseTokens}""" - -def _makeTags(tagStr, xml): +"""(Deprecated) Helper parse action to convert tokens to lower case. +Deprecated in favor of :class:`pyparsing_common.downcaseTokens`""" + +def _makeTags(tagStr, xml, + suppress_LT=Suppress("<"), + suppress_GT=Suppress(">")): """Internal helper to construct opening and closing tag expressions, given a tag name""" if isinstance(tagStr,basestring): resname = tagStr @@ -4883,74 +5401,88 @@ def _makeTags(tagStr, xml): tagAttrName = Word(alphas,alphanums+"_-:") if (xml): tagAttrValue = dblQuotedString.copy().setParseAction( removeQuotes ) - openTag = Suppress("<") + tagStr("tag") + \ - Dict(ZeroOrMore(Group( tagAttrName + Suppress("=") + tagAttrValue ))) + \ - Optional("/",default=[False]).setResultsName("empty").setParseAction(lambda s,l,t:t[0]=='/') + Suppress(">") + openTag = (suppress_LT + + tagStr("tag") + + Dict(ZeroOrMore(Group(tagAttrName + Suppress("=") + tagAttrValue ))) + + Optional("/", default=[False])("empty").setParseAction(lambda s,l,t:t[0]=='/') + + suppress_GT) else: - printablesLessRAbrack = "".join(c for c in printables if c not in ">") - tagAttrValue = quotedString.copy().setParseAction( removeQuotes ) | Word(printablesLessRAbrack) - openTag = Suppress("<") + tagStr("tag") + \ - Dict(ZeroOrMore(Group( tagAttrName.setParseAction(downcaseTokens) + \ - Optional( Suppress("=") + tagAttrValue ) ))) + \ - Optional("/",default=[False]).setResultsName("empty").setParseAction(lambda s,l,t:t[0]=='/') + Suppress(">") - closeTag = Combine(_L("") + tagAttrValue = quotedString.copy().setParseAction( removeQuotes ) | Word(printables, excludeChars=">") + openTag = (suppress_LT + + tagStr("tag") + + Dict(ZeroOrMore(Group(tagAttrName.setParseAction(downcaseTokens) + + Optional(Suppress("=") + tagAttrValue)))) + + Optional("/",default=[False])("empty").setParseAction(lambda s,l,t:t[0]=='/') + + suppress_GT) + closeTag = Combine(_L("", adjacent=False) - openTag = openTag.setResultsName("start"+"".join(resname.replace(":"," ").title().split())).setName("<%s>" % resname) - closeTag = closeTag.setResultsName("end"+"".join(resname.replace(":"," ").title().split())).setName("" % resname) + openTag.setName("<%s>" % resname) + # add start results name in parse action now that ungrouped names are not reported at two levels + openTag.addParseAction(lambda t: t.__setitem__("start"+"".join(resname.replace(":"," ").title().split()), t.copy())) + closeTag = closeTag("end"+"".join(resname.replace(":"," ").title().split())).setName("" % resname) openTag.tag = resname closeTag.tag = resname + openTag.tag_body = SkipTo(closeTag()) return openTag, closeTag def makeHTMLTags(tagStr): - """ - Helper to construct opening and closing tag expressions for HTML, given a tag name. Matches - tags in either upper or lower case, attributes with namespaces and with quoted or unquoted values. + """Helper to construct opening and closing tag expressions for HTML, + given a tag name. Matches tags in either upper or lower case, + attributes with namespaces and with quoted or unquoted values. Example:: - text = 'More info at the pyparsing wiki page' - # makeHTMLTags returns pyparsing expressions for the opening and closing tags as a 2-tuple + + text = 'More info at the pyparsing wiki page' + # makeHTMLTags returns pyparsing expressions for the opening and + # closing tags as a 2-tuple a,a_end = makeHTMLTags("A") link_expr = a + SkipTo(a_end)("link_text") + a_end - + for link in link_expr.searchString(text): - # attributes in the tag (like "href" shown here) are also accessible as named results + # attributes in the tag (like "href" shown here) are + # also accessible as named results print(link.link_text, '->', link.href) + prints:: - pyparsing -> http://pyparsing.wikispaces.com + + pyparsing -> https://github.com/pyparsing/pyparsing/wiki """ return _makeTags( tagStr, False ) def makeXMLTags(tagStr): - """ - Helper to construct opening and closing tag expressions for XML, given a tag name. Matches - tags only in the given upper/lower case. + """Helper to construct opening and closing tag expressions for XML, + given a tag name. Matches tags only in the given upper/lower case. - Example: similar to L{makeHTMLTags} + Example: similar to :class:`makeHTMLTags` """ return _makeTags( tagStr, True ) def withAttribute(*args,**attrDict): - """ - Helper to create a validating parse action to be used with start tags created - with C{L{makeXMLTags}} or C{L{makeHTMLTags}}. Use C{withAttribute} to qualify a starting tag - with a required attribute value, to avoid false matches on common tags such as - C{} or C{
}. + """Helper to create a validating parse action to be used with start + tags created with :class:`makeXMLTags` or + :class:`makeHTMLTags`. Use ``withAttribute`` to qualify + a starting tag with a required attribute value, to avoid false + matches on common tags such as ```` or ``
``. - Call C{withAttribute} with a series of attribute names and values. Specify the list - of filter attributes names and values as: - - keyword arguments, as in C{(align="right")}, or - - as an explicit dict with C{**} operator, when an attribute name is also a Python - reserved word, as in C{**{"class":"Customer", "align":"right"}} - - a list of name-value tuples, as in ( ("ns1:class", "Customer"), ("ns2:align","right") ) - For attribute names with a namespace prefix, you must use the second form. Attribute - names are matched insensitive to upper/lower case. - - If just testing for C{class} (with or without a namespace), use C{L{withClass}}. + Call ``withAttribute`` with a series of attribute names and + values. Specify the list of filter attributes names and values as: - To verify that the attribute exists, but without specifying a value, pass - C{withAttribute.ANY_VALUE} as the value. + - keyword arguments, as in ``(align="right")``, or + - as an explicit dict with ``**`` operator, when an attribute + name is also a Python reserved word, as in ``**{"class":"Customer", "align":"right"}`` + - a list of name-value tuples, as in ``(("ns1:class", "Customer"), ("ns2:align","right"))`` + + For attribute names with a namespace prefix, you must use the second + form. Attribute names are matched insensitive to upper/lower case. + + If just testing for ``class`` (with or without a namespace), use + :class:`withClass`. + + To verify that the attribute exists, but without specifying a value, + pass ``withAttribute.ANY_VALUE`` as the value. Example:: + html = '''
Some text @@ -4958,7 +5490,7 @@ def withAttribute(*args,**attrDict):
1,3 2,3 1,1
this has no type
- + ''' div,div_end = makeHTMLTags("div") @@ -4967,13 +5499,15 @@ def withAttribute(*args,**attrDict): grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) - + # construct a match with any div tag having a type attribute, regardless of the value div_any_type = div().setParseAction(withAttribute(type=withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) + prints:: + 1 4 0 1 0 1 4 0 1 0 @@ -4995,11 +5529,12 @@ def withAttribute(*args,**attrDict): withAttribute.ANY_VALUE = object() def withClass(classname, namespace=''): - """ - Simplified version of C{L{withAttribute}} when matching on a div class - made - difficult because C{class} is a reserved word in Python. + """Simplified version of :class:`withAttribute` when + matching on a div class - made difficult because ``class`` is + a reserved word in Python. Example:: + html = '''
Some text @@ -5007,84 +5542,96 @@ def withClass(classname, namespace=''):
1,3 2,3 1,1
this <div> has no class
- + ''' div,div_end = makeHTMLTags("div") div_grid = div().setParseAction(withClass("grid")) - + grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) - + div_any_type = div().setParseAction(withClass(withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) + prints:: + 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 """ classattr = "%s:class" % namespace if namespace else "class" - return withAttribute(**{classattr : classname}) + return withAttribute(**{classattr : classname}) -opAssoc = _Constants() +opAssoc = SimpleNamespace() opAssoc.LEFT = object() opAssoc.RIGHT = object() def infixNotation( baseExpr, opList, lpar=Suppress('('), rpar=Suppress(')') ): - """ - Helper method for constructing grammars of expressions made up of - operators working in a precedence hierarchy. Operators may be unary or - binary, left- or right-associative. Parse actions can also be attached - to operator expressions. The generated parser will also recognize the use - of parentheses to override operator precedences (see example below). - - Note: if you define a deep operator list, you may see performance issues - when using infixNotation. See L{ParserElement.enablePackrat} for a - mechanism to potentially improve your parser performance. + """Helper method for constructing grammars of expressions made up of + operators working in a precedence hierarchy. Operators may be unary + or binary, left- or right-associative. Parse actions can also be + attached to operator expressions. The generated parser will also + recognize the use of parentheses to override operator precedences + (see example below). + + Note: if you define a deep operator list, you may see performance + issues when using infixNotation. See + :class:`ParserElement.enablePackrat` for a mechanism to potentially + improve your parser performance. Parameters: - - baseExpr - expression representing the most basic element for the nested - - opList - list of tuples, one for each operator precedence level in the - expression grammar; each tuple is of the form - (opExpr, numTerms, rightLeftAssoc, parseAction), where: - - opExpr is the pyparsing expression for the operator; - may also be a string, which will be converted to a Literal; - if numTerms is 3, opExpr is a tuple of two expressions, for the - two operators separating the 3 terms - - numTerms is the number of terms for this operator (must - be 1, 2, or 3) - - rightLeftAssoc is the indicator whether the operator is - right or left associative, using the pyparsing-defined - constants C{opAssoc.RIGHT} and C{opAssoc.LEFT}. + - baseExpr - expression representing the most basic element for the + nested + - opList - list of tuples, one for each operator precedence level + in the expression grammar; each tuple is of the form ``(opExpr, + numTerms, rightLeftAssoc, parseAction)``, where: + + - opExpr is the pyparsing expression for the operator; may also + be a string, which will be converted to a Literal; if numTerms + is 3, opExpr is a tuple of two expressions, for the two + operators separating the 3 terms + - numTerms is the number of terms for this operator (must be 1, + 2, or 3) + - rightLeftAssoc is the indicator whether the operator is right + or left associative, using the pyparsing-defined constants + ``opAssoc.RIGHT`` and ``opAssoc.LEFT``. - parseAction is the parse action to be associated with - expressions matching this operator expression (the - parse action tuple member may be omitted); if the parse action - is passed a tuple or list of functions, this is equivalent to - calling C{setParseAction(*fn)} (L{ParserElement.setParseAction}) - - lpar - expression for matching left-parentheses (default=C{Suppress('(')}) - - rpar - expression for matching right-parentheses (default=C{Suppress(')')}) + expressions matching this operator expression (the parse action + tuple member may be omitted); if the parse action is passed + a tuple or list of functions, this is equivalent to calling + ``setParseAction(*fn)`` + (:class:`ParserElement.setParseAction`) + - lpar - expression for matching left-parentheses + (default= ``Suppress('(')``) + - rpar - expression for matching right-parentheses + (default= ``Suppress(')')``) Example:: - # simple example of four-function arithmetic with ints and variable names + + # simple example of four-function arithmetic with ints and + # variable names integer = pyparsing_common.signed_integer - varname = pyparsing_common.identifier - + varname = pyparsing_common.identifier + arith_expr = infixNotation(integer | varname, [ ('-', 1, opAssoc.RIGHT), (oneOf('* /'), 2, opAssoc.LEFT), (oneOf('+ -'), 2, opAssoc.LEFT), ]) - + arith_expr.runTests(''' 5+3*6 (5+3)*6 -2--11 ''', fullDump=False) + prints:: + 5+3*6 [[5, '+', [3, '*', 6]]] @@ -5094,6 +5641,12 @@ def infixNotation( baseExpr, opList, lpar=Suppress('('), rpar=Suppress(')') ): -2--11 [[['-', 2], '-', ['-', 11]]] """ + # captive version of FollowedBy that does not do parse actions or capture results names + class _FB(FollowedBy): + def parseImpl(self, instring, loc, doActions=True): + self.expr.tryParse(instring, loc) + return loc, [] + ret = Forward() lastExpr = baseExpr | ( lpar + ret + rpar ) for i,operDef in enumerate(opList): @@ -5101,19 +5654,20 @@ def infixNotation( baseExpr, opList, lpar=Suppress('('), rpar=Suppress(')') ): termName = "%s term" % opExpr if arity < 3 else "%s%s term" % opExpr if arity == 3: if opExpr is None or len(opExpr) != 2: - raise ValueError("if numterms=3, opExpr must be a tuple or list of two expressions") + raise ValueError( + "if numterms=3, opExpr must be a tuple or list of two expressions") opExpr1, opExpr2 = opExpr thisExpr = Forward().setName(termName) if rightLeftAssoc == opAssoc.LEFT: if arity == 1: - matchExpr = FollowedBy(lastExpr + opExpr) + Group( lastExpr + OneOrMore( opExpr ) ) + matchExpr = _FB(lastExpr + opExpr) + Group( lastExpr + OneOrMore( opExpr ) ) elif arity == 2: if opExpr is not None: - matchExpr = FollowedBy(lastExpr + opExpr + lastExpr) + Group( lastExpr + OneOrMore( opExpr + lastExpr ) ) + matchExpr = _FB(lastExpr + opExpr + lastExpr) + Group( lastExpr + OneOrMore( opExpr + lastExpr ) ) else: - matchExpr = FollowedBy(lastExpr+lastExpr) + Group( lastExpr + OneOrMore(lastExpr) ) + matchExpr = _FB(lastExpr+lastExpr) + Group( lastExpr + OneOrMore(lastExpr) ) elif arity == 3: - matchExpr = FollowedBy(lastExpr + opExpr1 + lastExpr + opExpr2 + lastExpr) + \ + matchExpr = _FB(lastExpr + opExpr1 + lastExpr + opExpr2 + lastExpr) + \ Group( lastExpr + opExpr1 + lastExpr + opExpr2 + lastExpr ) else: raise ValueError("operator must be unary (1), binary (2), or ternary (3)") @@ -5122,14 +5676,14 @@ def infixNotation( baseExpr, opList, lpar=Suppress('('), rpar=Suppress(')') ): # try to avoid LR with this extra test if not isinstance(opExpr, Optional): opExpr = Optional(opExpr) - matchExpr = FollowedBy(opExpr.expr + thisExpr) + Group( opExpr + thisExpr ) + matchExpr = _FB(opExpr.expr + thisExpr) + Group( opExpr + thisExpr ) elif arity == 2: if opExpr is not None: - matchExpr = FollowedBy(lastExpr + opExpr + thisExpr) + Group( lastExpr + OneOrMore( opExpr + thisExpr ) ) + matchExpr = _FB(lastExpr + opExpr + thisExpr) + Group( lastExpr + OneOrMore( opExpr + thisExpr ) ) else: - matchExpr = FollowedBy(lastExpr + thisExpr) + Group( lastExpr + OneOrMore( thisExpr ) ) + matchExpr = _FB(lastExpr + thisExpr) + Group( lastExpr + OneOrMore( thisExpr ) ) elif arity == 3: - matchExpr = FollowedBy(lastExpr + opExpr1 + thisExpr + opExpr2 + thisExpr) + \ + matchExpr = _FB(lastExpr + opExpr1 + thisExpr + opExpr2 + thisExpr) + \ Group( lastExpr + opExpr1 + thisExpr + opExpr2 + thisExpr ) else: raise ValueError("operator must be unary (1), binary (2), or ternary (3)") @@ -5146,7 +5700,8 @@ def infixNotation( baseExpr, opList, lpar=Suppress('('), rpar=Suppress(')') ): return ret operatorPrecedence = infixNotation -"""(Deprecated) Former name of C{L{infixNotation}}, will be dropped in a future release.""" +"""(Deprecated) Former name of :class:`infixNotation`, will be +dropped in a future release.""" dblQuotedString = Combine(Regex(r'"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*')+'"').setName("string enclosed in double quotes") sglQuotedString = Combine(Regex(r"'(?:[^'\n\r\\]|(?:'')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*")+"'").setName("string enclosed in single quotes") @@ -5155,28 +5710,33 @@ quotedString = Combine(Regex(r'"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+) unicodeString = Combine(_L('u') + quotedString.copy()).setName("unicode string literal") def nestedExpr(opener="(", closer=")", content=None, ignoreExpr=quotedString.copy()): - """ - Helper method for defining nested lists enclosed in opening and closing - delimiters ("(" and ")" are the default). + """Helper method for defining nested lists enclosed in opening and + closing delimiters ("(" and ")" are the default). Parameters: - - opener - opening character for a nested list (default=C{"("}); can also be a pyparsing expression - - closer - closing character for a nested list (default=C{")"}); can also be a pyparsing expression - - content - expression for items within the nested lists (default=C{None}) - - ignoreExpr - expression for ignoring opening and closing delimiters (default=C{quotedString}) + - opener - opening character for a nested list + (default= ``"("``); can also be a pyparsing expression + - closer - closing character for a nested list + (default= ``")"``); can also be a pyparsing expression + - content - expression for items within the nested lists + (default= ``None``) + - ignoreExpr - expression for ignoring opening and closing + delimiters (default= :class:`quotedString`) - If an expression is not provided for the content argument, the nested - expression will capture all whitespace-delimited content between delimiters - as a list of separate values. + If an expression is not provided for the content argument, the + nested expression will capture all whitespace-delimited content + between delimiters as a list of separate values. - Use the C{ignoreExpr} argument to define expressions that may contain - opening or closing characters that should not be treated as opening - or closing characters for nesting, such as quotedString or a comment - expression. Specify multiple expressions using an C{L{Or}} or C{L{MatchFirst}}. - The default is L{quotedString}, but if no expressions are to be ignored, - then pass C{None} for this argument. + Use the ``ignoreExpr`` argument to define expressions that may + contain opening or closing characters that should not be treated as + opening or closing characters for nesting, such as quotedString or + a comment expression. Specify multiple expressions using an + :class:`Or` or :class:`MatchFirst`. The default is + :class:`quotedString`, but if no expressions are to be ignored, then + pass ``None`` for this argument. Example:: + data_type = oneOf("void int short long char float double") decl_data_type = Combine(data_type + Optional(Word('*'))) ident = Word(alphas+'_', alphanums+'_') @@ -5186,29 +5746,31 @@ def nestedExpr(opener="(", closer=")", content=None, ignoreExpr=quotedString.cop code_body = nestedExpr('{', '}', ignoreExpr=(quotedString | cStyleComment)) - c_function = (decl_data_type("type") + c_function = (decl_data_type("type") + ident("name") - + LPAR + Optional(delimitedList(arg), [])("args") + RPAR + + LPAR + Optional(delimitedList(arg), [])("args") + RPAR + code_body("body")) c_function.ignore(cStyleComment) - + source_code = ''' - int is_odd(int x) { - return (x%2); + int is_odd(int x) { + return (x%2); } - - int dec_to_hex(char hchar) { - if (hchar >= '0' && hchar <= '9') { - return (ord(hchar)-ord('0')); - } else { + + int dec_to_hex(char hchar) { + if (hchar >= '0' && hchar <= '9') { + return (ord(hchar)-ord('0')); + } else { return (10+ord(hchar)-ord('A')); - } + } } ''' for func in c_function.searchString(source_code): print("%(name)s (%(type)s) args: %(args)s" % func) + prints:: + is_odd (int) args: [['int', 'x']] dec_to_hex (int) args: [['char', 'hchar']] """ @@ -5226,7 +5788,7 @@ def nestedExpr(opener="(", closer=")", content=None, ignoreExpr=quotedString.cop ).setParseAction(lambda t:t[0].strip())) else: if ignoreExpr is not None: - content = (Combine(OneOrMore(~ignoreExpr + + content = (Combine(OneOrMore(~ignoreExpr + ~Literal(opener) + ~Literal(closer) + CharsNotIn(ParserElement.DEFAULT_WHITE_CHARS,exact=1)) ).setParseAction(lambda t:t[0].strip())) @@ -5245,23 +5807,24 @@ def nestedExpr(opener="(", closer=")", content=None, ignoreExpr=quotedString.cop return ret def indentedBlock(blockStatementExpr, indentStack, indent=True): - """ - Helper method for defining space-delimited indentation blocks, such as - those used to define block statements in Python source code. + """Helper method for defining space-delimited indentation blocks, + such as those used to define block statements in Python source code. Parameters: - - blockStatementExpr - expression defining syntax of statement that - is repeated within the indented block - - indentStack - list created by caller to manage indentation stack - (multiple statementWithIndentedBlock expressions within a single grammar - should share a common indentStack) - - indent - boolean indicating whether block must be indented beyond the - the current level; set to False for block of left-most statements - (default=C{True}) - A valid block must contain at least one C{blockStatement}. + - blockStatementExpr - expression defining syntax of statement that + is repeated within the indented block + - indentStack - list created by caller to manage indentation stack + (multiple statementWithIndentedBlock expressions within a single + grammar should share a common indentStack) + - indent - boolean indicating whether block must be indented beyond + the the current level; set to False for block of left-most + statements (default= ``True``) + + A valid block must contain at least one ``blockStatement``. Example:: + data = ''' def A(z): A1 @@ -5302,7 +5865,9 @@ def indentedBlock(blockStatementExpr, indentStack, indent=True): parseTree = module_body.parseString(data) parseTree.pprint() + prints:: + [['def', 'A', ['(', 'z', ')'], @@ -5320,14 +5885,19 @@ def indentedBlock(blockStatementExpr, indentStack, indent=True): 'spam', ['(', 'x', 'y', ')'], ':', - [[['def', 'eggs', ['(', 'z', ')'], ':', [['pass']]]]]]] + [[['def', 'eggs', ['(', 'z', ')'], ':', [['pass']]]]]]] """ + backup_stack = indentStack[:] + + def reset_stack(): + indentStack[:] = backup_stack + def checkPeerIndent(s,l,t): if l >= len(s): return curCol = col(l,s) if curCol != indentStack[-1]: if curCol > indentStack[-1]: - raise ParseFatalException(s,l,"illegal nesting") + raise ParseException(s,l,"illegal nesting") raise ParseException(s,l,"not a peer entry") def checkSubIndent(s,l,t): @@ -5355,6 +5925,7 @@ def indentedBlock(blockStatementExpr, indentStack, indent=True): else: smExpr = Group( Optional(NL) + (OneOrMore( PEER + Group(blockStatementExpr) + Optional(NL) )) ) + smExpr.setFailAction(lambda a, b, c, d: reset_stack()) blockStatementExpr.ignore(_bslash + LineEnd()) return smExpr.setName('indented block') @@ -5370,51 +5941,61 @@ def replaceHTMLEntity(t): # it's easy to get these comment structures wrong - they're very common, so may as well make them available cStyleComment = Combine(Regex(r"/\*(?:[^*]|\*(?!/))*") + '*/').setName("C style comment") -"Comment of the form C{/* ... */}" +"Comment of the form ``/* ... */``" htmlComment = Regex(r"").setName("HTML comment") -"Comment of the form C{}" +"Comment of the form ````" restOfLine = Regex(r".*").leaveWhitespace().setName("rest of line") dblSlashComment = Regex(r"//(?:\\\n|[^\n])*").setName("// comment") -"Comment of the form C{// ... (to end of line)}" +"Comment of the form ``// ... (to end of line)``" cppStyleComment = Combine(Regex(r"/\*(?:[^*]|\*(?!/))*") + '*/'| dblSlashComment).setName("C++ style comment") -"Comment of either form C{L{cStyleComment}} or C{L{dblSlashComment}}" +"Comment of either form :class:`cStyleComment` or :class:`dblSlashComment`" javaStyleComment = cppStyleComment -"Same as C{L{cppStyleComment}}" +"Same as :class:`cppStyleComment`" pythonStyleComment = Regex(r"#.*").setName("Python style comment") -"Comment of the form C{# ... (to end of line)}" +"Comment of the form ``# ... (to end of line)``" _commasepitem = Combine(OneOrMore(Word(printables, excludeChars=',') + Optional( Word(" \t") + ~Literal(",") + ~LineEnd() ) ) ).streamline().setName("commaItem") commaSeparatedList = delimitedList( Optional( quotedString.copy() | _commasepitem, default="") ).setName("commaSeparatedList") -"""(Deprecated) Predefined expression of 1 or more printable words or quoted strings, separated by commas. - This expression is deprecated in favor of L{pyparsing_common.comma_separated_list}.""" +"""(Deprecated) Predefined expression of 1 or more printable words or +quoted strings, separated by commas. + +This expression is deprecated in favor of :class:`pyparsing_common.comma_separated_list`. +""" # some other useful expressions - using lower-case class name since we are really using this as a namespace class pyparsing_common: - """ - Here are some common low-level expressions that may be useful in jump-starting parser development: - - numeric forms (L{integers}, L{reals}, L{scientific notation}) - - common L{programming identifiers} - - network addresses (L{MAC}, L{IPv4}, L{IPv6}) - - ISO8601 L{dates} and L{datetime} - - L{UUID} - - L{comma-separated list} + """Here are some common low-level expressions that may be useful in + jump-starting parser development: + + - numeric forms (:class:`integers`, :class:`reals`, + :class:`scientific notation`) + - common :class:`programming identifiers` + - network addresses (:class:`MAC`, + :class:`IPv4`, :class:`IPv6`) + - ISO8601 :class:`dates` and + :class:`datetime` + - :class:`UUID` + - :class:`comma-separated list` + Parse actions: - - C{L{convertToInteger}} - - C{L{convertToFloat}} - - C{L{convertToDate}} - - C{L{convertToDatetime}} - - C{L{stripHTMLTags}} - - C{L{upcaseTokens}} - - C{L{downcaseTokens}} + + - :class:`convertToInteger` + - :class:`convertToFloat` + - :class:`convertToDate` + - :class:`convertToDatetime` + - :class:`stripHTMLTags` + - :class:`upcaseTokens` + - :class:`downcaseTokens` Example:: + pyparsing_common.number.runTests(''' # any int or real number, returned as the appropriate type 100 @@ -5461,7 +6042,9 @@ class pyparsing_common: # uuid 12345678-1234-5678-1234-567812345678 ''') + prints:: + # any int or real number, returned as the appropriate type 100 [100] @@ -5563,7 +6146,8 @@ class pyparsing_common: """expression that parses a floating point number and returns a float""" sci_real = Regex(r'[+-]?\d+([eE][+-]?\d+|\.\d*([eE][+-]?\d+)?)').setName("real number with scientific notation").setParseAction(convertToFloat) - """expression that parses a floating point number with optional scientific notation and returns a float""" + """expression that parses a floating point number with optional + scientific notation and returns a float""" # streamlining this expression makes the docs nicer-looking number = (sci_real | real | signed_integer).streamline() @@ -5571,12 +6155,12 @@ class pyparsing_common: fnumber = Regex(r'[+-]?\d+\.?\d*([eE][+-]?\d+)?').setName("fnumber").setParseAction(convertToFloat) """any int or real number, returned as float""" - + identifier = Word(alphas+'_', alphanums+'_').setName("identifier") """typical code identifier (leading alpha or '_', followed by 0 or more alphas, nums, or '_')""" - + ipv4_address = Regex(r'(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})){3}').setName("IPv4 address") - "IPv4 address (C{0.0.0.0 - 255.255.255.255})" + "IPv4 address (``0.0.0.0 - 255.255.255.255``)" _ipv6_part = Regex(r'[0-9a-fA-F]{1,4}').setName("hex_integer") _full_ipv6_address = (_ipv6_part + (':' + _ipv6_part)*7).setName("full IPv6 address") @@ -5585,7 +6169,7 @@ class pyparsing_common: _mixed_ipv6_address = ("::ffff:" + ipv4_address).setName("mixed IPv6 address") ipv6_address = Combine((_full_ipv6_address | _mixed_ipv6_address | _short_ipv6_address).setName("IPv6 address")).setName("IPv6 address") "IPv6 address (long, short, or mixed form)" - + mac_address = Regex(r'[0-9a-fA-F]{2}([:.-])[0-9a-fA-F]{2}(?:\1[0-9a-fA-F]{2}){4}').setName("MAC address") "MAC address xx:xx:xx:xx:xx (may also have '-' or '.' delimiters)" @@ -5595,13 +6179,16 @@ class pyparsing_common: Helper to create a parse action for converting parsed date string to Python datetime.date Params - - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%d"}) + - fmt - format to be passed to datetime.strptime (default= ``"%Y-%m-%d"``) Example:: + date_expr = pyparsing_common.iso8601_date.copy() date_expr.setParseAction(pyparsing_common.convertToDate()) print(date_expr.parseString("1999-12-31")) + prints:: + [datetime.date(1999, 12, 31)] """ def cvt_fn(s,l,t): @@ -5613,17 +6200,20 @@ class pyparsing_common: @staticmethod def convertToDatetime(fmt="%Y-%m-%dT%H:%M:%S.%f"): - """ - Helper to create a parse action for converting parsed datetime string to Python datetime.datetime + """Helper to create a parse action for converting parsed + datetime string to Python datetime.datetime Params - - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%dT%H:%M:%S.%f"}) + - fmt - format to be passed to datetime.strptime (default= ``"%Y-%m-%dT%H:%M:%S.%f"``) Example:: + dt_expr = pyparsing_common.iso8601_datetime.copy() dt_expr.setParseAction(pyparsing_common.convertToDatetime()) print(dt_expr.parseString("1999-12-31T23:59:59.999")) + prints:: + [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)] """ def cvt_fn(s,l,t): @@ -5634,31 +6224,34 @@ class pyparsing_common: return cvt_fn iso8601_date = Regex(r'(?P\d{4})(?:-(?P\d\d)(?:-(?P\d\d))?)?').setName("ISO8601 date") - "ISO8601 date (C{yyyy-mm-dd})" + "ISO8601 date (``yyyy-mm-dd``)" iso8601_datetime = Regex(r'(?P\d{4})-(?P\d\d)-(?P\d\d)[T ](?P\d\d):(?P\d\d)(:(?P\d\d(\.\d*)?)?)?(?PZ|[+-]\d\d:?\d\d)?').setName("ISO8601 datetime") - "ISO8601 datetime (C{yyyy-mm-ddThh:mm:ss.s(Z|+-00:00)}) - trailing seconds, milliseconds, and timezone optional; accepts separating C{'T'} or C{' '}" + "ISO8601 datetime (``yyyy-mm-ddThh:mm:ss.s(Z|+-00:00)``) - trailing seconds, milliseconds, and timezone optional; accepts separating ``'T'`` or ``' '``" uuid = Regex(r'[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}').setName("UUID") - "UUID (C{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx})" + "UUID (``xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx``)" _html_stripper = anyOpenTag.suppress() | anyCloseTag.suppress() @staticmethod def stripHTMLTags(s, l, tokens): - """ - Parse action to remove HTML tags from web page HTML source + """Parse action to remove HTML tags from web page HTML source Example:: - # strip HTML links from normal text - text = 'More info at the
pyparsing wiki page' + + # strip HTML links from normal text + text = 'More info at the pyparsing wiki page' td,td_end = makeHTMLTags("TD") table_text = td + SkipTo(td_end).setParseAction(pyparsing_common.stripHTMLTags)("body") + td_end - - print(table_text.parseString(text).body) # -> 'More info at the pyparsing wiki page' + print(table_text.parseString(text).body) + + Prints:: + + More info at the pyparsing wiki page """ return pyparsing_common._html_stripper.transformString(tokens[0]) - _commasepitem = Combine(OneOrMore(~Literal(",") + ~LineEnd() + Word(printables, excludeChars=',') + _commasepitem = Combine(OneOrMore(~Literal(",") + ~LineEnd() + Word(printables, excludeChars=',') + Optional( White(" \t") ) ) ).streamline().setName("commaItem") comma_separated_list = delimitedList( Optional( quotedString.copy() | _commasepitem, default="") ).setName("comma separated list") """Predefined expression of 1 or more printable words or quoted strings, separated by commas.""" @@ -5670,6 +6263,164 @@ class pyparsing_common: """Parse action to convert tokens to lower case.""" +class _lazyclassproperty(object): + def __init__(self, fn): + self.fn = fn + self.__doc__ = fn.__doc__ + self.__name__ = fn.__name__ + + def __get__(self, obj, cls): + if cls is None: + cls = type(obj) + if not hasattr(cls, '_intern') or any(cls._intern is getattr(superclass, '_intern', []) for superclass in cls.__mro__[1:]): + cls._intern = {} + attrname = self.fn.__name__ + if attrname not in cls._intern: + cls._intern[attrname] = self.fn(cls) + return cls._intern[attrname] + + +class unicode_set(object): + """ + A set of Unicode characters, for language-specific strings for + ``alphas``, ``nums``, ``alphanums``, and ``printables``. + A unicode_set is defined by a list of ranges in the Unicode character + set, in a class attribute ``_ranges``, such as:: + + _ranges = [(0x0020, 0x007e), (0x00a0, 0x00ff),] + + A unicode set can also be defined using multiple inheritance of other unicode sets:: + + class CJK(Chinese, Japanese, Korean): + pass + """ + _ranges = [] + + @classmethod + def _get_chars_for_ranges(cls): + ret = [] + for cc in cls.__mro__: + if cc is unicode_set: + break + for rr in cc._ranges: + ret.extend(range(rr[0], rr[-1]+1)) + return [unichr(c) for c in sorted(set(ret))] + + @_lazyclassproperty + def printables(cls): + "all non-whitespace characters in this range" + return u''.join(filterfalse(unicode.isspace, cls._get_chars_for_ranges())) + + @_lazyclassproperty + def alphas(cls): + "all alphabetic characters in this range" + return u''.join(filter(unicode.isalpha, cls._get_chars_for_ranges())) + + @_lazyclassproperty + def nums(cls): + "all numeric digit characters in this range" + return u''.join(filter(unicode.isdigit, cls._get_chars_for_ranges())) + + @_lazyclassproperty + def alphanums(cls): + "all alphanumeric characters in this range" + return cls.alphas + cls.nums + + +class pyparsing_unicode(unicode_set): + """ + A namespace class for defining common language unicode_sets. + """ + _ranges = [(32, sys.maxunicode)] + + class Latin1(unicode_set): + "Unicode set for Latin-1 Unicode Character Range" + _ranges = [(0x0020, 0x007e), (0x00a0, 0x00ff),] + + class LatinA(unicode_set): + "Unicode set for Latin-A Unicode Character Range" + _ranges = [(0x0100, 0x017f),] + + class LatinB(unicode_set): + "Unicode set for Latin-B Unicode Character Range" + _ranges = [(0x0180, 0x024f),] + + class Greek(unicode_set): + "Unicode set for Greek Unicode Character Ranges" + _ranges = [ + (0x0370, 0x03ff), (0x1f00, 0x1f15), (0x1f18, 0x1f1d), (0x1f20, 0x1f45), (0x1f48, 0x1f4d), + (0x1f50, 0x1f57), (0x1f59,), (0x1f5b,), (0x1f5d,), (0x1f5f, 0x1f7d), (0x1f80, 0x1fb4), (0x1fb6, 0x1fc4), + (0x1fc6, 0x1fd3), (0x1fd6, 0x1fdb), (0x1fdd, 0x1fef), (0x1ff2, 0x1ff4), (0x1ff6, 0x1ffe), + ] + + class Cyrillic(unicode_set): + "Unicode set for Cyrillic Unicode Character Range" + _ranges = [(0x0400, 0x04ff)] + + class Chinese(unicode_set): + "Unicode set for Chinese Unicode Character Range" + _ranges = [(0x4e00, 0x9fff), (0x3000, 0x303f), ] + + class Japanese(unicode_set): + "Unicode set for Japanese Unicode Character Range, combining Kanji, Hiragana, and Katakana ranges" + _ranges = [ ] + + class Kanji(unicode_set): + "Unicode set for Kanji Unicode Character Range" + _ranges = [(0x4E00, 0x9Fbf), (0x3000, 0x303f), ] + + class Hiragana(unicode_set): + "Unicode set for Hiragana Unicode Character Range" + _ranges = [(0x3040, 0x309f), ] + + class Katakana(unicode_set): + "Unicode set for Katakana Unicode Character Range" + _ranges = [(0x30a0, 0x30ff), ] + + class Korean(unicode_set): + "Unicode set for Korean Unicode Character Range" + _ranges = [(0xac00, 0xd7af), (0x1100, 0x11ff), (0x3130, 0x318f), (0xa960, 0xa97f), (0xd7b0, 0xd7ff), (0x3000, 0x303f), ] + + class CJK(Chinese, Japanese, Korean): + "Unicode set for combined Chinese, Japanese, and Korean (CJK) Unicode Character Range" + pass + + class Thai(unicode_set): + "Unicode set for Thai Unicode Character Range" + _ranges = [(0x0e01, 0x0e3a), (0x0e3f, 0x0e5b), ] + + class Arabic(unicode_set): + "Unicode set for Arabic Unicode Character Range" + _ranges = [(0x0600, 0x061b), (0x061e, 0x06ff), (0x0700, 0x077f), ] + + class Hebrew(unicode_set): + "Unicode set for Hebrew Unicode Character Range" + _ranges = [(0x0590, 0x05ff), ] + + class Devanagari(unicode_set): + "Unicode set for Devanagari Unicode Character Range" + _ranges = [(0x0900, 0x097f), (0xa8e0, 0xa8ff)] + +pyparsing_unicode.Japanese._ranges = (pyparsing_unicode.Japanese.Kanji._ranges + + pyparsing_unicode.Japanese.Hiragana._ranges + + pyparsing_unicode.Japanese.Katakana._ranges) + +# define ranges in language character sets +if PY_3: + setattr(pyparsing_unicode, "العربية", pyparsing_unicode.Arabic) + setattr(pyparsing_unicode, "中文", pyparsing_unicode.Chinese) + setattr(pyparsing_unicode, "кириллица", pyparsing_unicode.Cyrillic) + setattr(pyparsing_unicode, "Ελληνικά", pyparsing_unicode.Greek) + setattr(pyparsing_unicode, "עִברִית", pyparsing_unicode.Hebrew) + setattr(pyparsing_unicode, "日本語", pyparsing_unicode.Japanese) + setattr(pyparsing_unicode.Japanese, "漢字", pyparsing_unicode.Japanese.Kanji) + setattr(pyparsing_unicode.Japanese, "カタカナ", pyparsing_unicode.Japanese.Katakana) + setattr(pyparsing_unicode.Japanese, "ひらがな", pyparsing_unicode.Japanese.Hiragana) + setattr(pyparsing_unicode, "한국어", pyparsing_unicode.Korean) + setattr(pyparsing_unicode, "ไทย", pyparsing_unicode.Thai) + setattr(pyparsing_unicode, "देवनागरी", pyparsing_unicode.Devanagari) + + if __name__ == "__main__": selectToken = CaselessLiteral("select") @@ -5683,7 +6434,7 @@ if __name__ == "__main__": tableName = delimitedList(ident, ".", combine=True).setParseAction(upcaseTokens) tableNameList = Group(delimitedList(tableName)).setName("tables") - + simpleSQL = selectToken("command") + columnSpec("columns") + fromToken + tableNameList("tables") # demo runTests method, including embedded comments in test string diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pytoml/__init__.py b/env/lib/python3.7/site-packages/pip/_vendor/pytoml/__init__.py index 8dc7315..8ed060f 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/pytoml/__init__.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/pytoml/__init__.py @@ -1,3 +1,4 @@ from .core import TomlError from .parser import load, loads -from .writer import dump, dumps +from .test import translate_to_test +from .writer import dump, dumps \ No newline at end of file diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pytoml/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/pytoml/__pycache__/__init__.cpython-37.pyc index 1456bc4..f94683b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/pytoml/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/pytoml/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pytoml/__pycache__/core.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/pytoml/__pycache__/core.cpython-37.pyc index 9bbeae9..fb123aa 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/pytoml/__pycache__/core.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/pytoml/__pycache__/core.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pytoml/__pycache__/parser.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/pytoml/__pycache__/parser.cpython-37.pyc index ae6275a..834ed90 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/pytoml/__pycache__/parser.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/pytoml/__pycache__/parser.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pytoml/__pycache__/writer.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/pytoml/__pycache__/writer.cpython-37.pyc index 35a2630..e22a1d9 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/pytoml/__pycache__/writer.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/pytoml/__pycache__/writer.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pytoml/parser.py b/env/lib/python3.7/site-packages/pip/_vendor/pytoml/parser.py index 9f94e92..3493aa6 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/pytoml/parser.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/pytoml/parser.py @@ -1,5 +1,6 @@ import string, re, sys, datetime from .core import TomlError +from .utils import rfc3339_re, parse_rfc3339_re if sys.version_info[0] == 2: _chr = unichr @@ -179,13 +180,13 @@ _ws_re = re.compile(r'[ \t]*') def _p_ws(s): s.expect_re(_ws_re) -_escapes = { 'b': '\b', 'n': '\n', 'r': '\r', 't': '\t', '"': '"', '\'': '\'', - '\\': '\\', '/': '/', 'f': '\f' } +_escapes = { 'b': '\b', 'n': '\n', 'r': '\r', 't': '\t', '"': '"', + '\\': '\\', 'f': '\f' } _basicstr_re = re.compile(r'[^"\\\000-\037]*') _short_uni_re = re.compile(r'u([0-9a-fA-F]{4})') _long_uni_re = re.compile(r'U([0-9a-fA-F]{8})') -_escapes_re = re.compile('[bnrt"\'\\\\/f]') +_escapes_re = re.compile(r'[btnfr\"\\]') _newline_esc_re = re.compile('\n[ \t\n]*') def _p_basicstr_content(s, content=_basicstr_re): res = [] @@ -196,7 +197,10 @@ def _p_basicstr_content(s, content=_basicstr_re): if s.consume_re(_newline_esc_re): pass elif s.consume_re(_short_uni_re) or s.consume_re(_long_uni_re): - res.append(_chr(int(s.last().group(1), 16))) + v = int(s.last().group(1), 16) + if 0xd800 <= v < 0xe000: + s.fail() + res.append(_chr(v)) else: s.expect_re(_escapes_re) res.append(_escapes[s.last().group(0)]) @@ -220,9 +224,8 @@ def _p_key(s): return s.expect_re(_key_re).group(0) _float_re = re.compile(r'[+-]?(?:0|[1-9](?:_?\d)*)(?:\.\d(?:_?\d)*)?(?:[eE][+-]?(?:\d(?:_?\d)*))?') -_datetime_re = re.compile(r'(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d+)?(?:Z|([+-]\d{2}):(\d{2}))') -_basicstr_ml_re = re.compile(r'(?:(?:|"|"")[^"\\\000-\011\013-\037])*') +_basicstr_ml_re = re.compile(r'(?:""?(?!")|[^"\\\000-\011\013-\037])*') _litstr_re = re.compile(r"[^'\000\010\012-\037]*") _litstr_ml_re = re.compile(r"(?:(?:|'|'')(?:[^'\000-\010\013-\037]))*") def _p_value(s, object_pairs_hook): @@ -251,24 +254,9 @@ def _p_value(s, object_pairs_hook): s.expect('\'') return 'str', r, r, pos - if s.consume_re(_datetime_re): + if s.consume_re(rfc3339_re): m = s.last() - s0 = m.group(0) - r = map(int, m.groups()[:6]) - if m.group(7): - micro = float(m.group(7)) - else: - micro = 0 - - if m.group(8): - g = int(m.group(8), 10) * 60 + int(m.group(9), 10) - tz = _TimeZone(datetime.timedelta(0, g * 60)) - else: - tz = _TimeZone(datetime.timedelta(0, 0)) - - y, m, d, H, M, S = r - dt = datetime.datetime(y, m, d, H, M, S, int(micro * 1000000), tz) - return 'datetime', s0, dt, pos + return 'datetime', m.group(0), parse_rfc3339_re(m), pos if s.consume_re(_float_re): m = s.last().group(0) @@ -351,24 +339,3 @@ def _p_toml(s, object_pairs_hook): _p_ews(s) s.expect_eof() return stmts - -class _TimeZone(datetime.tzinfo): - def __init__(self, offset): - self._offset = offset - - def utcoffset(self, dt): - return self._offset - - def dst(self, dt): - return None - - def tzname(self, dt): - m = self._offset.total_seconds() // 60 - if m < 0: - res = '-' - m = -m - else: - res = '+' - h = m // 60 - m = m - h * 60 - return '{}{:.02}{:.02}'.format(res, h, m) diff --git a/env/lib/python3.7/site-packages/pip/_vendor/pytoml/writer.py b/env/lib/python3.7/site-packages/pip/_vendor/pytoml/writer.py index 6eaf5d7..73b5089 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/pytoml/writer.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/pytoml/writer.py @@ -1,5 +1,7 @@ from __future__ import unicode_literals -import io, datetime, math, sys +import io, datetime, math, string, sys + +from .utils import format_rfc3339 if sys.version_info[0] == 3: long = int @@ -39,22 +41,13 @@ def _escape_string(s): return '"' + ''.join(res) + '"' +_key_chars = string.digits + string.ascii_letters + '-_' def _escape_id(s): - if any(not c.isalnum() and c not in '-_' for c in s): + if any(c not in _key_chars for c in s): return _escape_string(s) return s -def _format_list(v): - return '[{0}]'.format(', '.join(_format_value(obj) for obj in v)) - -# Formula from: -# https://docs.python.org/2/library/datetime.html#datetime.timedelta.total_seconds -# Once support for py26 is dropped, this can be replaced by td.total_seconds() -def _total_seconds(td): - return ((td.microseconds - + (td.seconds + td.days * 24 * 3600) * 10**6) / 10.0**6) - def _format_value(v): if isinstance(v, bool): return 'true' if v else 'false' @@ -68,25 +61,11 @@ def _format_value(v): elif isinstance(v, unicode) or isinstance(v, bytes): return _escape_string(v) elif isinstance(v, datetime.datetime): - offs = v.utcoffset() - offs = _total_seconds(offs) // 60 if offs is not None else 0 - - if offs == 0: - suffix = 'Z' - else: - if offs > 0: - suffix = '+' - else: - suffix = '-' - offs = -offs - suffix = '{0}{1:.02}{2:.02}'.format(suffix, offs // 60, offs % 60) - - if v.microsecond: - return v.strftime('%Y-%m-%dT%H:%M:%S.%f') + suffix - else: - return v.strftime('%Y-%m-%dT%H:%M:%S') + suffix + return format_rfc3339(v) elif isinstance(v, list): - return _format_list(v) + return '[{0}]'.format(', '.join(_format_value(obj) for obj in v)) + elif isinstance(v, dict): + return '{{{0}}}'.format(', '.join('{} = {}'.format(_escape_id(k), _format_value(obj)) for k, obj in v.items())) else: raise RuntimeError(v) diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/__init__.py b/env/lib/python3.7/site-packages/pip/_vendor/requests/__init__.py index 3f3f4f2..80c4ce1 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/requests/__init__.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/requests/__init__.py @@ -22,7 +22,7 @@ usage: ... or POST: >>> payload = dict(key1='value1', key2='value2') - >>> r = requests.post('http://httpbin.org/post', data=payload) + >>> r = requests.post('https://httpbin.org/post', data=payload) >>> print(r.text) { ... @@ -57,10 +57,10 @@ def check_compatibility(urllib3_version, chardet_version): # Check urllib3 for compatibility. major, minor, patch = urllib3_version # noqa: F811 major, minor, patch = int(major), int(minor), int(patch) - # urllib3 >= 1.21.1, <= 1.23 + # urllib3 >= 1.21.1, <= 1.24 assert major == 1 assert minor >= 21 - assert minor <= 23 + assert minor <= 24 # Check chardet for compatibility. major, minor, patch = chardet_version.split('.')[:3] @@ -79,14 +79,14 @@ def _check_cryptography(cryptography_version): return if cryptography_version < [1, 3, 4]: - warning = 'Old version of cryptography ({0}) may cause slowdown.'.format(cryptography_version) + warning = 'Old version of cryptography ({}) may cause slowdown.'.format(cryptography_version) warnings.warn(warning, RequestsDependencyWarning) # Check imported dependencies for compatibility. try: check_compatibility(urllib3.__version__, chardet.__version__) except (AssertionError, ValueError): - warnings.warn("urllib3 ({0}) or chardet ({1}) doesn't match a supported " + warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported " "version!".format(urllib3.__version__, chardet.__version__), RequestsDependencyWarning) @@ -125,12 +125,7 @@ from .exceptions import ( # Set default logging handler to avoid "No handler found" warnings. import logging -try: # Python 2.7+ - from logging import NullHandler -except ImportError: - class NullHandler(logging.Handler): - def emit(self, record): - pass +from logging import NullHandler logging.getLogger(__name__).addHandler(NullHandler()) diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/__init__.cpython-37.pyc index db44191..9a03bfb 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/__version__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/__version__.cpython-37.pyc index 47aa3cb..bfd8d89 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/__version__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/__version__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/_internal_utils.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/_internal_utils.cpython-37.pyc index 2bc6da6..9daf03f 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/_internal_utils.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/_internal_utils.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/adapters.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/adapters.cpython-37.pyc index ba1d03e..73d100f 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/adapters.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/adapters.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/api.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/api.cpython-37.pyc index 1a6e3c5..03417d6 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/api.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/api.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/auth.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/auth.cpython-37.pyc index d1de425..3c13690 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/auth.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/auth.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/certs.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/certs.cpython-37.pyc index 4538915..9e09ed6 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/certs.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/certs.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/compat.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/compat.cpython-37.pyc index bf851ab..be7ffce 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/compat.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/compat.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/cookies.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/cookies.cpython-37.pyc index b636da9..ec71d31 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/cookies.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/cookies.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/exceptions.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/exceptions.cpython-37.pyc index bb1fd7e..09931aa 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/exceptions.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/exceptions.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/help.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/help.cpython-37.pyc index f732d9f..922b6ff 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/help.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/help.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/hooks.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/hooks.cpython-37.pyc index 1285400..82e25d5 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/hooks.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/hooks.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/models.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/models.cpython-37.pyc index 58645ed..64e33b4 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/models.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/models.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/packages.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/packages.cpython-37.pyc index 54b63e4..701ba2c 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/packages.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/packages.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/sessions.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/sessions.cpython-37.pyc index a9941b3..8c51a56 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/sessions.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/sessions.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/status_codes.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/status_codes.cpython-37.pyc index 887d5fa..1ab9b4f 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/status_codes.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/status_codes.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/structures.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/structures.cpython-37.pyc index 474c25f..5a23ace 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/structures.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/structures.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/utils.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/utils.cpython-37.pyc index 48c2044..07aa93d 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/utils.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/utils.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/__version__.py b/env/lib/python3.7/site-packages/pip/_vendor/requests/__version__.py index ef61ec0..f5b5d03 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/requests/__version__.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/requests/__version__.py @@ -5,8 +5,8 @@ __title__ = 'requests' __description__ = 'Python HTTP for Humans.' __url__ = 'http://python-requests.org' -__version__ = '2.19.1' -__build__ = 0x021901 +__version__ = '2.21.0' +__build__ = 0x022100 __author__ = 'Kenneth Reitz' __author_email__ = 'me@kennethreitz.org' __license__ = 'Apache 2.0' diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/adapters.py b/env/lib/python3.7/site-packages/pip/_vendor/requests/adapters.py index f6f3f99..c30e7c9 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/requests/adapters.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/requests/adapters.py @@ -26,6 +26,7 @@ from pip._vendor.urllib3.exceptions import ProtocolError from pip._vendor.urllib3.exceptions import ReadTimeoutError from pip._vendor.urllib3.exceptions import SSLError as _SSLError from pip._vendor.urllib3.exceptions import ResponseError +from pip._vendor.urllib3.exceptions import LocationValueError from .models import Response from .compat import urlparse, basestring @@ -35,7 +36,8 @@ from .utils import (DEFAULT_CA_BUNDLE_PATH, extract_zipped_paths, from .structures import CaseInsensitiveDict from .cookies import extract_cookies_to_jar from .exceptions import (ConnectionError, ConnectTimeout, ReadTimeout, SSLError, - ProxyError, RetryError, InvalidSchema, InvalidProxyURL) + ProxyError, RetryError, InvalidSchema, InvalidProxyURL, + InvalidURL) from .auth import _basic_auth_str try: @@ -127,8 +129,7 @@ class HTTPAdapter(BaseAdapter): self.init_poolmanager(pool_connections, pool_maxsize, block=pool_block) def __getstate__(self): - return dict((attr, getattr(self, attr, None)) for attr in - self.__attrs__) + return {attr: getattr(self, attr, None) for attr in self.__attrs__} def __setstate__(self, state): # Can't handle by adding 'proxy_manager' to self.__attrs__ because @@ -224,7 +225,7 @@ class HTTPAdapter(BaseAdapter): if not cert_loc or not os.path.exists(cert_loc): raise IOError("Could not find a suitable TLS CA certificate bundle, " - "invalid path: {0}".format(cert_loc)) + "invalid path: {}".format(cert_loc)) conn.cert_reqs = 'CERT_REQUIRED' @@ -246,10 +247,10 @@ class HTTPAdapter(BaseAdapter): conn.key_file = None if conn.cert_file and not os.path.exists(conn.cert_file): raise IOError("Could not find the TLS certificate file, " - "invalid path: {0}".format(conn.cert_file)) + "invalid path: {}".format(conn.cert_file)) if conn.key_file and not os.path.exists(conn.key_file): raise IOError("Could not find the TLS key file, " - "invalid path: {0}".format(conn.key_file)) + "invalid path: {}".format(conn.key_file)) def build_response(self, req, resp): """Builds a :class:`Response ` object from a urllib3 @@ -378,7 +379,7 @@ class HTTPAdapter(BaseAdapter): when subclassing the :class:`HTTPAdapter `. - :param proxies: The url of the proxy being used for this request. + :param proxy: The url of the proxy being used for this request. :rtype: dict """ headers = {} @@ -407,7 +408,10 @@ class HTTPAdapter(BaseAdapter): :rtype: requests.Response """ - conn = self.get_connection(request.url, proxies) + try: + conn = self.get_connection(request.url, proxies) + except LocationValueError as e: + raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) @@ -421,7 +425,7 @@ class HTTPAdapter(BaseAdapter): timeout = TimeoutSauce(connect=connect, read=read) except ValueError as e: # this may raise a string formatting error. - err = ("Invalid timeout {0}. Pass a (connect, read) " + err = ("Invalid timeout {}. Pass a (connect, read) " "timeout tuple, or a single float to set " "both timeouts to the same value".format(timeout)) raise ValueError(err) @@ -471,11 +475,10 @@ class HTTPAdapter(BaseAdapter): # Receive the response from the server try: - # For Python 2.7+ versions, use buffering of HTTP - # responses + # For Python 2.7, use buffering of HTTP responses r = low_conn.getresponse(buffering=True) except TypeError: - # For compatibility with Python 2.6 versions and back + # For compatibility with Python 3.3+ r = low_conn.getresponse() resp = HTTPResponse.from_httplib( diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/api.py b/env/lib/python3.7/site-packages/pip/_vendor/requests/api.py index a2cc84d..abada96 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/requests/api.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/requests/api.py @@ -18,8 +18,10 @@ def request(method, url, **kwargs): :param method: method for the new :class:`Request` object. :param url: URL for the new :class:`Request` object. - :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`. - :param data: (optional) Dictionary or list of tuples ``[(key, value)]`` (will be form-encoded), bytes, or file-like object to send in the body of the :class:`Request`. + :param params: (optional) Dictionary, list of tuples or bytes to send + in the body of the :class:`Request`. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`. :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`. :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`. @@ -47,7 +49,7 @@ def request(method, url, **kwargs): Usage:: >>> import requests - >>> req = requests.request('GET', 'http://httpbin.org/get') + >>> req = requests.request('GET', 'https://httpbin.org/get') """ @@ -62,7 +64,8 @@ def get(url, params=None, **kwargs): r"""Sends a GET request. :param url: URL for the new :class:`Request` object. - :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`. + :param params: (optional) Dictionary, list of tuples or bytes to send + in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object :rtype: requests.Response @@ -102,7 +105,8 @@ def post(url, data=None, json=None, **kwargs): r"""Sends a POST request. :param url: URL for the new :class:`Request` object. - :param data: (optional) Dictionary (will be form-encoded), bytes, or file-like object to send in the body of the :class:`Request`. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. :param json: (optional) json data to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object @@ -116,7 +120,8 @@ def put(url, data=None, **kwargs): r"""Sends a PUT request. :param url: URL for the new :class:`Request` object. - :param data: (optional) Dictionary (will be form-encoded), bytes, or file-like object to send in the body of the :class:`Request`. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. :param json: (optional) json data to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object @@ -130,7 +135,8 @@ def patch(url, data=None, **kwargs): r"""Sends a PATCH request. :param url: URL for the new :class:`Request` object. - :param data: (optional) Dictionary (will be form-encoded), bytes, or file-like object to send in the body of the :class:`Request`. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. :param json: (optional) json data to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response ` object diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/auth.py b/env/lib/python3.7/site-packages/pip/_vendor/requests/auth.py index 4ae4594..bdde51c 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/requests/auth.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/requests/auth.py @@ -38,7 +38,7 @@ def _basic_auth_str(username, password): if not isinstance(username, basestring): warnings.warn( "Non-string usernames will no longer be supported in Requests " - "3.0.0. Please convert the object you've passed in ({0!r}) to " + "3.0.0. Please convert the object you've passed in ({!r}) to " "a string or bytes object in the near future to avoid " "problems.".format(username), category=DeprecationWarning, @@ -48,7 +48,7 @@ def _basic_auth_str(username, password): if not isinstance(password, basestring): warnings.warn( "Non-string passwords will no longer be supported in Requests " - "3.0.0. Please convert the object you've passed in ({0!r}) to " + "3.0.0. Please convert the object you've passed in ({!r}) to " "a string or bytes object in the near future to avoid " "problems.".format(password), category=DeprecationWarning, diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/compat.py b/env/lib/python3.7/site-packages/pip/_vendor/requests/compat.py index ec5d305..6a86893 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/requests/compat.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/requests/compat.py @@ -47,9 +47,8 @@ if is_py2: import cookielib from Cookie import Morsel from StringIO import StringIO - from collections import Callable, Mapping, MutableMapping + from collections import Callable, Mapping, MutableMapping, OrderedDict - from pip._vendor.urllib3.packages.ordered_dict import OrderedDict builtin_str = str bytes = str diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/cookies.py b/env/lib/python3.7/site-packages/pip/_vendor/requests/cookies.py index 50883a8..56fccd9 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/requests/cookies.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/requests/cookies.py @@ -444,20 +444,21 @@ def create_cookie(name, value, **kwargs): By default, the pair of `name` and `value` will be set for the domain '' and sent on every request (this is sometimes called a "supercookie"). """ - result = dict( - version=0, - name=name, - value=value, - port=None, - domain='', - path='/', - secure=False, - expires=None, - discard=True, - comment=None, - comment_url=None, - rest={'HttpOnly': None}, - rfc2109=False,) + result = { + 'version': 0, + 'name': name, + 'value': value, + 'port': None, + 'domain': '', + 'path': '/', + 'secure': False, + 'expires': None, + 'discard': True, + 'comment': None, + 'comment_url': None, + 'rest': {'HttpOnly': None}, + 'rfc2109': False, + } badargs = set(kwargs) - set(result) if badargs: @@ -511,6 +512,7 @@ def cookiejar_from_dict(cookie_dict, cookiejar=None, overwrite=True): :param cookiejar: (optional) A cookiejar to add the cookies to. :param overwrite: (optional) If False, will not replace cookies already in the jar with new ones. + :rtype: CookieJar """ if cookiejar is None: cookiejar = RequestsCookieJar() @@ -529,6 +531,7 @@ def merge_cookies(cookiejar, cookies): :param cookiejar: CookieJar object to add the cookies to. :param cookies: Dictionary or CookieJar object to be added. + :rtype: CookieJar """ if not isinstance(cookiejar, cookielib.CookieJar): raise ValueError('You can only merge into CookieJar') diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/help.py b/env/lib/python3.7/site-packages/pip/_vendor/requests/help.py index df1b4eb..3c3072b 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/requests/help.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/requests/help.py @@ -89,8 +89,7 @@ def info(): 'version': getattr(idna, '__version__', ''), } - # OPENSSL_VERSION_NUMBER doesn't exist in the Python 2.6 ssl module. - system_ssl = getattr(ssl, 'OPENSSL_VERSION_NUMBER', None) + system_ssl = ssl.OPENSSL_VERSION_NUMBER system_ssl_info = { 'version': '%x' % system_ssl if system_ssl is not None else '' } diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/hooks.py b/env/lib/python3.7/site-packages/pip/_vendor/requests/hooks.py index 32b32de..7a51f21 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/requests/hooks.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/requests/hooks.py @@ -15,14 +15,14 @@ HOOKS = ['response'] def default_hooks(): - return dict((event, []) for event in HOOKS) + return {event: [] for event in HOOKS} # TODO: response is the only one def dispatch_hook(key, hooks, hook_data, **kwargs): """Dispatches a hook dictionary on a given piece of data.""" - hooks = hooks or dict() + hooks = hooks or {} hooks = hooks.get(key) if hooks: if hasattr(hooks, '__call__'): diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/models.py b/env/lib/python3.7/site-packages/pip/_vendor/requests/models.py index 4230535..0839957 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/requests/models.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/requests/models.py @@ -204,9 +204,13 @@ class Request(RequestHooksMixin): :param url: URL to send. :param headers: dictionary of headers to send. :param files: dictionary of {filename: fileobject} files to multipart upload. - :param data: the body to attach to the request. If a dictionary is provided, form-encoding will take place. + :param data: the body to attach to the request. If a dictionary or + list of tuples ``[(key, value)]`` is provided, form-encoding will + take place. :param json: json for the body to attach to the request (if files or data is not specified). - :param params: dictionary of URL parameters to append to the URL. + :param params: URL parameters to append to the URL. If a dictionary or + list of tuples ``[(key, value)]`` is provided, form-encoding will + take place. :param auth: Auth handler or (user, pass) tuple. :param cookies: dictionary or CookieJar of cookies to attach to this request. :param hooks: dictionary of callback hooks, for internal usage. @@ -214,7 +218,7 @@ class Request(RequestHooksMixin): Usage:: >>> import requests - >>> req = requests.Request('GET', 'http://httpbin.org/get') + >>> req = requests.Request('GET', 'https://httpbin.org/get') >>> req.prepare() """ @@ -274,7 +278,7 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): Usage:: >>> import requests - >>> req = requests.Request('GET', 'http://httpbin.org/get') + >>> req = requests.Request('GET', 'https://httpbin.org/get') >>> r = req.prepare() @@ -648,10 +652,7 @@ class Response(object): if not self._content_consumed: self.content - return dict( - (attr, getattr(self, attr, None)) - for attr in self.__attrs__ - ) + return {attr: getattr(self, attr, None) for attr in self.__attrs__} def __setstate__(self, state): for name, value in state.items(): @@ -780,7 +781,7 @@ class Response(object): return chunks - def iter_lines(self, chunk_size=ITER_CHUNK_SIZE, decode_unicode=None, delimiter=None): + def iter_lines(self, chunk_size=ITER_CHUNK_SIZE, decode_unicode=False, delimiter=None): """Iterates over the response data, one line at a time. When stream=True is set on the request, this avoids reading the content at once into memory for large responses. diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py b/env/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py index ba13526..d73d700 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py @@ -19,7 +19,7 @@ from .cookies import ( from .models import Request, PreparedRequest, DEFAULT_REDIRECT_LIMIT from .hooks import default_hooks, dispatch_hook from ._internal_utils import to_native_string -from .utils import to_key_val_list, default_headers +from .utils import to_key_val_list, default_headers, DEFAULT_PORTS from .exceptions import ( TooManyRedirects, InvalidSchema, ChunkedEncodingError, ContentDecodingError) @@ -115,6 +115,31 @@ class SessionRedirectMixin(object): return to_native_string(location, 'utf8') return None + def should_strip_auth(self, old_url, new_url): + """Decide whether Authorization header should be removed when redirecting""" + old_parsed = urlparse(old_url) + new_parsed = urlparse(new_url) + if old_parsed.hostname != new_parsed.hostname: + return True + # Special case: allow http -> https redirect when using the standard + # ports. This isn't specified by RFC 7235, but is kept to avoid + # breaking backwards compatibility with older versions of requests + # that allowed any redirects on the same host. + if (old_parsed.scheme == 'http' and old_parsed.port in (80, None) + and new_parsed.scheme == 'https' and new_parsed.port in (443, None)): + return False + + # Handle default port usage corresponding to scheme. + changed_port = old_parsed.port != new_parsed.port + changed_scheme = old_parsed.scheme != new_parsed.scheme + default_port = (DEFAULT_PORTS.get(old_parsed.scheme, None), None) + if (not changed_scheme and old_parsed.port in default_port + and new_parsed.port in default_port): + return False + + # Standard case: root URI must match + return changed_port or changed_scheme + def resolve_redirects(self, resp, req, stream=False, timeout=None, verify=True, cert=None, proxies=None, yield_requests=False, **adapter_kwargs): """Receives a Response. Returns a generator of Responses or Requests.""" @@ -236,14 +261,10 @@ class SessionRedirectMixin(object): headers = prepared_request.headers url = prepared_request.url - if 'Authorization' in headers: + if 'Authorization' in headers and self.should_strip_auth(response.request.url, url): # If we get redirected to a new host, we should strip out any # authentication headers. - original_parsed = urlparse(response.request.url) - redirect_parsed = urlparse(url) - - if (original_parsed.hostname != redirect_parsed.hostname): - del headers['Authorization'] + del headers['Authorization'] # .netrc might have more auth for us on our new host. new_auth = get_netrc_auth(url) if self.trust_env else None @@ -299,7 +320,7 @@ class SessionRedirectMixin(object): """ method = prepared_request.method - # http://tools.ietf.org/html/rfc7231#section-6.4.4 + # https://tools.ietf.org/html/rfc7231#section-6.4.4 if response.status_code == codes.see_other and method != 'HEAD': method = 'GET' @@ -325,13 +346,13 @@ class Session(SessionRedirectMixin): >>> import requests >>> s = requests.Session() - >>> s.get('http://httpbin.org/get') + >>> s.get('https://httpbin.org/get') Or as a context manager:: >>> with requests.Session() as s: - >>> s.get('http://httpbin.org/get') + >>> s.get('https://httpbin.org/get') """ @@ -453,8 +474,8 @@ class Session(SessionRedirectMixin): :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`. - :param data: (optional) Dictionary, bytes, or file-like object to send - in the body of the :class:`Request`. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. :param json: (optional) json to send in the body of the :class:`Request`. :param headers: (optional) Dictionary of HTTP Headers to send with the @@ -550,7 +571,8 @@ class Session(SessionRedirectMixin): r"""Sends a POST request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. - :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. :param json: (optional) json to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response @@ -562,7 +584,8 @@ class Session(SessionRedirectMixin): r"""Sends a PUT request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. - :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response """ @@ -573,7 +596,8 @@ class Session(SessionRedirectMixin): r"""Sends a PATCH request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. - :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`. + :param data: (optional) Dictionary, list of tuples, bytes, or file-like + object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response """ @@ -723,7 +747,7 @@ class Session(SessionRedirectMixin): self.adapters[key] = self.adapters.pop(key) def __getstate__(self): - state = dict((attr, getattr(self, attr, None)) for attr in self.__attrs__) + state = {attr: getattr(self, attr, None) for attr in self.__attrs__} return state def __setstate__(self, state): @@ -735,7 +759,12 @@ def session(): """ Returns a :class:`Session` for context-management. + .. deprecated:: 1.0.0 + + This method has been deprecated since version 1.0.0 and is only kept for + backwards compatibility. New code should use :class:`~requests.sessions.Session` + to create a session. This may be removed at a future date. + :rtype: Session """ - return Session() diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/status_codes.py b/env/lib/python3.7/site-packages/pip/_vendor/requests/status_codes.py index ff462c6..813e8c4 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/requests/status_codes.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/requests/status_codes.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -""" +r""" The ``codes`` object defines a mapping from common names for HTTP statuses to their numerical codes, accessible either as attributes or as dictionary items. diff --git a/env/lib/python3.7/site-packages/pip/_vendor/requests/utils.py b/env/lib/python3.7/site-packages/pip/_vendor/requests/utils.py index 431f6be..8170a8d 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/requests/utils.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/requests/utils.py @@ -38,6 +38,8 @@ NETRC_FILES = ('.netrc', '_netrc') DEFAULT_CA_BUNDLE_PATH = certs.where() +DEFAULT_PORTS = {'http': 80, 'https': 443} + if sys.platform == 'win32': # provide a proxy_bypass version on Windows without DNS lookups @@ -173,10 +175,10 @@ def get_netrc_auth(url, raise_errors=False): for f in NETRC_FILES: try: - loc = os.path.expanduser('~/{0}'.format(f)) + loc = os.path.expanduser('~/{}'.format(f)) except KeyError: # os.path.expanduser can fail when $HOME is undefined and - # getpwuid fails. See http://bugs.python.org/issue20164 & + # getpwuid fails. See https://bugs.python.org/issue20164 & # https://github.com/requests/requests/issues/1846 return @@ -264,7 +266,7 @@ def from_key_val_list(value): >>> from_key_val_list([('key', 'val')]) OrderedDict([('key', 'val')]) >>> from_key_val_list('string') - ValueError: need more than 1 value to unpack + ValueError: cannot encode objects that are not 2-tuples >>> from_key_val_list({'key': 'val'}) OrderedDict([('key', 'val')]) @@ -466,7 +468,7 @@ def _parse_content_type_header(header): if index_of_equals != -1: key = param[:index_of_equals].strip(items_to_strip) value = param[index_of_equals + 1:].strip(items_to_strip) - params_dict[key] = value + params_dict[key.lower()] = value return content_type, params_dict @@ -706,6 +708,10 @@ def should_bypass_proxies(url, no_proxy): no_proxy = get_proxy('no_proxy') parsed = urlparse(url) + if parsed.hostname is None: + # URLs don't always have hostnames, e.g. file:/// urls. + return True + if no_proxy: # We need to check whether we match here. We need to see if we match # the end of the hostname, both with and without the port. @@ -725,7 +731,7 @@ def should_bypass_proxies(url, no_proxy): else: host_with_port = parsed.hostname if parsed.port: - host_with_port += ':{0}'.format(parsed.port) + host_with_port += ':{}'.format(parsed.port) for host in no_proxy: if parsed.hostname.endswith(host) or host_with_port.endswith(host): @@ -733,13 +739,8 @@ def should_bypass_proxies(url, no_proxy): # to apply the proxies on this URL. return True - # If the system proxy settings indicate that this URL should be bypassed, - # don't proxy. - # The proxy_bypass function is incredibly buggy on OS X in early versions - # of Python 2.6, so allow this call to fail. Only catch the specific - # exceptions we've seen, though: this call failing in other ways can reveal - # legitimate problems. with set_environ('no_proxy', no_proxy_arg): + # parsed.hostname can be `None` in cases such as a file URI. try: bypass = proxy_bypass(parsed.hostname) except (TypeError, socket.gaierror): diff --git a/env/lib/python3.7/site-packages/pip/_vendor/six.py b/env/lib/python3.7/site-packages/pip/_vendor/six.py index 6bf4fd3..89b2188 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/six.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/six.py @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2017 Benjamin Peterson +# Copyright (c) 2010-2018 Benjamin Peterson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ import sys import types __author__ = "Benjamin Peterson " -__version__ = "1.11.0" +__version__ = "1.12.0" # Useful for very coarse version differentiation. @@ -844,10 +844,71 @@ def add_metaclass(metaclass): orig_vars.pop(slots_var) orig_vars.pop('__dict__', None) orig_vars.pop('__weakref__', None) + if hasattr(cls, '__qualname__'): + orig_vars['__qualname__'] = cls.__qualname__ return metaclass(cls.__name__, cls.__bases__, orig_vars) return wrapper +def ensure_binary(s, encoding='utf-8', errors='strict'): + """Coerce **s** to six.binary_type. + + For Python 2: + - `unicode` -> encoded to `str` + - `str` -> `str` + + For Python 3: + - `str` -> encoded to `bytes` + - `bytes` -> `bytes` + """ + if isinstance(s, text_type): + return s.encode(encoding, errors) + elif isinstance(s, binary_type): + return s + else: + raise TypeError("not expecting type '%s'" % type(s)) + + +def ensure_str(s, encoding='utf-8', errors='strict'): + """Coerce *s* to `str`. + + For Python 2: + - `unicode` -> encoded to `str` + - `str` -> `str` + + For Python 3: + - `str` -> `str` + - `bytes` -> decoded to `str` + """ + if not isinstance(s, (text_type, binary_type)): + raise TypeError("not expecting type '%s'" % type(s)) + if PY2 and isinstance(s, text_type): + s = s.encode(encoding, errors) + elif PY3 and isinstance(s, binary_type): + s = s.decode(encoding, errors) + return s + + +def ensure_text(s, encoding='utf-8', errors='strict'): + """Coerce *s* to six.text_type. + + For Python 2: + - `unicode` -> `unicode` + - `str` -> `unicode` + + For Python 3: + - `str` -> `str` + - `bytes` -> decoded to `str` + """ + if isinstance(s, binary_type): + return s.decode(encoding, errors) + elif isinstance(s, text_type): + return s + else: + raise TypeError("not expecting type '%s'" % type(s)) + + + def python_2_unicode_compatible(klass): """ A decorator that defines __unicode__ and __str__ methods under Python 2. diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__init__.py b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__init__.py index 4bd533b..148a9c3 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__init__.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__init__.py @@ -23,16 +23,11 @@ from .util.retry import Retry # Set default logging handler to avoid "No handler found" warnings. import logging -try: # Python 2.7+ - from logging import NullHandler -except ImportError: - class NullHandler(logging.Handler): - def emit(self, record): - pass +from logging import NullHandler __author__ = 'Andrey Petrov (andrey.petrov@shazow.net)' __license__ = 'MIT' -__version__ = '1.23' +__version__ = '1.24.1' __all__ = ( 'HTTPConnectionPool', diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/__init__.cpython-37.pyc index 9b6737a..6e81260 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/_collections.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/_collections.cpython-37.pyc index d4d54d0..751d323 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/_collections.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/_collections.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/connection.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/connection.cpython-37.pyc index 0d32310..385b299 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/connection.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/connection.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/connectionpool.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/connectionpool.cpython-37.pyc index 92640c1..0b1835b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/connectionpool.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/connectionpool.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/exceptions.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/exceptions.cpython-37.pyc index 3efb3a8..6bfa69f 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/exceptions.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/exceptions.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/fields.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/fields.cpython-37.pyc index 62f5a01..c77907b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/fields.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/fields.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/filepost.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/filepost.cpython-37.pyc index 6f281bb..b65eb00 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/filepost.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/filepost.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/poolmanager.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/poolmanager.cpython-37.pyc index 0670dc8..d2bb28b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/poolmanager.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/poolmanager.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/request.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/request.cpython-37.pyc index 8916a60..3a7766f 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/request.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/request.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/response.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/response.cpython-37.pyc index 4ea3e89..e0f1e05 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/response.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/__pycache__/response.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/_collections.py b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/_collections.py index 6e36b84..34f2381 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/_collections.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/_collections.py @@ -14,10 +14,7 @@ except ImportError: # Platform-specific: No threads available pass -try: # Python 2.7+ - from collections import OrderedDict -except ImportError: - from .packages.ordered_dict import OrderedDict +from collections import OrderedDict from .exceptions import InvalidHeader from .packages.six import iterkeys, itervalues, PY3 diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/connection.py b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/connection.py index a03b573..02b3665 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/connection.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/connection.py @@ -2,7 +2,6 @@ from __future__ import absolute_import import datetime import logging import os -import sys import socket from socket import error as SocketError, timeout as SocketTimeout import warnings @@ -78,9 +77,6 @@ class HTTPConnection(_HTTPConnection, object): - ``strict``: See the documentation on :class:`urllib3.connectionpool.HTTPConnectionPool` - ``source_address``: Set the source address for the current connection. - - .. note:: This is ignored for Python 2.6. It is only applied for 2.7 and 3.x - - ``socket_options``: Set specific options on the underlying socket. If not specified, then defaults are loaded from ``HTTPConnection.default_socket_options`` which includes disabling Nagle's algorithm (sets TCP_NODELAY to 1) unless the connection is behind a proxy. @@ -108,21 +104,13 @@ class HTTPConnection(_HTTPConnection, object): if six.PY3: # Python 3 kw.pop('strict', None) - # Pre-set source_address in case we have an older Python like 2.6. + # Pre-set source_address. self.source_address = kw.get('source_address') - if sys.version_info < (2, 7): # Python 2.6 - # _HTTPConnection on Python 2.6 will balk at this keyword arg, but - # not newer versions. We can still use it when creating a - # connection though, so we pop it *after* we have saved it as - # self.source_address. - kw.pop('source_address', None) - #: The socket options provided by the user. If no options are #: provided, we use the default options. self.socket_options = kw.pop('socket_options', self.default_socket_options) - # Superclass also sets self.source_address in Python 2.7+. _HTTPConnection.__init__(self, *args, **kw) @property @@ -183,10 +171,7 @@ class HTTPConnection(_HTTPConnection, object): def _prepare_conn(self, conn): self.sock = conn - # the _tunnel_host attribute was added in python 2.6.3 (via - # http://hg.python.org/cpython/rev/0f57b30a152f) so pythons 2.6(0-2) do - # not have them. - if getattr(self, '_tunnel_host', None): + if self._tunnel_host: # TODO: Fix tunnel so it doesn't depend on self.sock state. self._tunnel() # Mark this connection as not reusable @@ -217,13 +202,13 @@ class HTTPConnection(_HTTPConnection, object): self.endheaders() if body is not None: - stringish_types = six.string_types + (six.binary_type,) + stringish_types = six.string_types + (bytes,) if isinstance(body, stringish_types): body = (body,) for chunk in body: if not chunk: continue - if not isinstance(chunk, six.binary_type): + if not isinstance(chunk, bytes): chunk = chunk.encode('utf8') len_str = hex(len(chunk))[2:] self.send(len_str.encode('utf-8')) @@ -242,7 +227,7 @@ class HTTPSConnection(HTTPConnection): def __init__(self, host, port=None, key_file=None, cert_file=None, strict=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, - ssl_context=None, **kw): + ssl_context=None, server_hostname=None, **kw): HTTPConnection.__init__(self, host, port, strict=strict, timeout=timeout, **kw) @@ -250,6 +235,7 @@ class HTTPSConnection(HTTPConnection): self.key_file = key_file self.cert_file = cert_file self.ssl_context = ssl_context + self.server_hostname = server_hostname # Required property for Google AppEngine 1.9.0 which otherwise causes # HTTPS requests to go out as HTTP. (See Issue #356) @@ -270,6 +256,7 @@ class HTTPSConnection(HTTPConnection): keyfile=self.key_file, certfile=self.cert_file, ssl_context=self.ssl_context, + server_hostname=self.server_hostname ) @@ -312,12 +299,9 @@ class VerifiedHTTPSConnection(HTTPSConnection): def connect(self): # Add certificate verification conn = self._new_conn() - hostname = self.host - if getattr(self, '_tunnel_host', None): - # _tunnel_host was added in Python 2.6.3 - # (See: http://hg.python.org/cpython/rev/0f57b30a152f) + if self._tunnel_host: self.sock = conn # Calls self._set_hostport(), so self.host is # self._tunnel_host below. @@ -328,6 +312,10 @@ class VerifiedHTTPSConnection(HTTPSConnection): # Override the host with the one we're requesting data from. hostname = self._tunnel_host + server_hostname = hostname + if self.server_hostname is not None: + server_hostname = self.server_hostname + is_time_off = datetime.date.today() < RECENT_DATE if is_time_off: warnings.warn(( @@ -352,7 +340,7 @@ class VerifiedHTTPSConnection(HTTPSConnection): certfile=self.cert_file, ca_certs=self.ca_certs, ca_cert_dir=self.ca_cert_dir, - server_hostname=hostname, + server_hostname=server_hostname, ssl_context=context) if self.assert_fingerprint: @@ -373,7 +361,7 @@ class VerifiedHTTPSConnection(HTTPSConnection): 'for details.)'.format(hostname)), SubjectAltNameWarning ) - _match_hostname(cert, self.assert_hostname or hostname) + _match_hostname(cert, self.assert_hostname or server_hostname) self.is_verified = ( context.verify_mode == ssl.CERT_REQUIRED or diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/connectionpool.py b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/connectionpool.py index 8fcb0bc..f7a8f19 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/connectionpool.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/connectionpool.py @@ -89,7 +89,7 @@ class ConnectionPool(object): # This is taken from http://hg.python.org/cpython/file/7aaba721ebc0/Lib/socket.py#l252 -_blocking_errnos = set([errno.EAGAIN, errno.EWOULDBLOCK]) +_blocking_errnos = {errno.EAGAIN, errno.EWOULDBLOCK} class HTTPConnectionPool(ConnectionPool, RequestMethods): @@ -313,7 +313,7 @@ class HTTPConnectionPool(ConnectionPool, RequestMethods): # Catch possible read timeouts thrown as SSL errors. If not the # case, rethrow the original. We need to do this because of: # http://bugs.python.org/issue10272 - if 'timed out' in str(err) or 'did not complete (read)' in str(err): # Python 2.6 + if 'timed out' in str(err) or 'did not complete (read)' in str(err): # Python < 2.7.4 raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value) def _make_request(self, conn, method, url, timeout=_Default, chunked=False, @@ -375,7 +375,7 @@ class HTTPConnectionPool(ConnectionPool, RequestMethods): try: try: # Python 2.7, use buffering of HTTP responses httplib_response = conn.getresponse(buffering=True) - except TypeError: # Python 2.6 and older, Python 3 + except TypeError: # Python 3 try: httplib_response = conn.getresponse() except Exception as e: @@ -801,17 +801,7 @@ class HTTPSConnectionPool(HTTPConnectionPool): Establish tunnel connection early, because otherwise httplib would improperly set Host: header to proxy's IP:port. """ - # Python 2.7+ - try: - set_tunnel = conn.set_tunnel - except AttributeError: # Platform-specific: Python 2.6 - set_tunnel = conn._set_tunnel - - if sys.version_info <= (2, 6, 4) and not self.proxy_headers: # Python 2.6.4 and older - set_tunnel(self._proxy_host, self.port) - else: - set_tunnel(self._proxy_host, self.port, self.proxy_headers) - + conn.set_tunnel(self._proxy_host, self.port, self.proxy_headers) conn.connect() def _new_conn(self): diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/__init__.cpython-37.pyc index 37e36be..278aa27 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/appengine.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/appengine.cpython-37.pyc index 88abbbb..6a9731f 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/appengine.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/appengine.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/ntlmpool.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/ntlmpool.cpython-37.pyc index 0dbf249..434df5a 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/ntlmpool.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/ntlmpool.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/pyopenssl.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/pyopenssl.cpython-37.pyc index 9e2d459..2286917 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/pyopenssl.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/pyopenssl.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/securetransport.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/securetransport.cpython-37.pyc index 9ab9935..cf2355a 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/securetransport.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/securetransport.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/socks.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/socks.cpython-37.pyc index 930a350..881d9f5 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/socks.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__pycache__/socks.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__pycache__/__init__.cpython-37.pyc index 329bd6c..fff7713 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__pycache__/bindings.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__pycache__/bindings.cpython-37.pyc index 16c22be..2862f01 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__pycache__/bindings.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__pycache__/bindings.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__pycache__/low_level.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__pycache__/low_level.cpython-37.pyc index 8974672..eafeefe 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__pycache__/low_level.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__pycache__/low_level.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/appengine.py b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/appengine.py index 59f2a61..9b42952 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/appengine.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/appengine.py @@ -39,8 +39,8 @@ urllib3 on Google App Engine: """ from __future__ import absolute_import +import io import logging -import os import warnings from ..packages.six.moves.urllib.parse import urljoin @@ -53,11 +53,11 @@ from ..exceptions import ( SSLError ) -from ..packages.six import BytesIO from ..request import RequestMethods from ..response import HTTPResponse from ..util.timeout import Timeout from ..util.retry import Retry +from . import _appengine_environ try: from google.appengine.api import urlfetch @@ -239,7 +239,7 @@ class AppEngineManager(RequestMethods): original_response = HTTPResponse( # In order for decoding to work, we must present the content as # a file-like object. - body=BytesIO(urlfetch_resp.content), + body=io.BytesIO(urlfetch_resp.content), msg=urlfetch_resp.header_msg, headers=urlfetch_resp.headers, status=urlfetch_resp.status_code, @@ -247,7 +247,7 @@ class AppEngineManager(RequestMethods): ) return HTTPResponse( - body=BytesIO(urlfetch_resp.content), + body=io.BytesIO(urlfetch_resp.content), headers=urlfetch_resp.headers, status=urlfetch_resp.status_code, original_response=original_response, @@ -280,26 +280,10 @@ class AppEngineManager(RequestMethods): return retries -def is_appengine(): - return (is_local_appengine() or - is_prod_appengine() or - is_prod_appengine_mvms()) +# Alias methods from _appengine_environ to maintain public API interface. - -def is_appengine_sandbox(): - return is_appengine() and not is_prod_appengine_mvms() - - -def is_local_appengine(): - return ('APPENGINE_RUNTIME' in os.environ and - 'Development/' in os.environ['SERVER_SOFTWARE']) - - -def is_prod_appengine(): - return ('APPENGINE_RUNTIME' in os.environ and - 'Google App Engine/' in os.environ['SERVER_SOFTWARE'] and - not is_prod_appengine_mvms()) - - -def is_prod_appengine_mvms(): - return os.environ.get('GAE_VM', False) == 'true' +is_appengine = _appengine_environ.is_appengine +is_appengine_sandbox = _appengine_environ.is_appengine_sandbox +is_local_appengine = _appengine_environ.is_local_appengine +is_prod_appengine = _appengine_environ.is_prod_appengine +is_prod_appengine_mvms = _appengine_environ.is_prod_appengine_mvms diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py index 642e99e..8ea127c 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py @@ -43,8 +43,7 @@ class NTLMConnectionPool(HTTPSConnectionPool): log.debug('Starting NTLM HTTPS connection no. %d: https://%s%s', self.num_connections, self.host, self.authurl) - headers = {} - headers['Connection'] = 'Keep-Alive' + headers = {'Connection': 'Keep-Alive'} req_header = 'Authorization' resp_header = 'www-authenticate' diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py index 6dd3a01..363667c 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py @@ -163,6 +163,9 @@ def _dnsname_to_stdlib(name): from ASCII bytes. We need to idna-encode that string to get it back, and then on Python 3 we also need to convert to unicode via UTF-8 (the stdlib uses PyUnicode_FromStringAndSize on it, which decodes via UTF-8). + + If the name cannot be idna-encoded then we return None signalling that + the name given should be skipped. """ def idna_encode(name): """ @@ -172,14 +175,19 @@ def _dnsname_to_stdlib(name): """ from pip._vendor import idna - for prefix in [u'*.', u'.']: - if name.startswith(prefix): - name = name[len(prefix):] - return prefix.encode('ascii') + idna.encode(name) - return idna.encode(name) + try: + for prefix in [u'*.', u'.']: + if name.startswith(prefix): + name = name[len(prefix):] + return prefix.encode('ascii') + idna.encode(name) + return idna.encode(name) + except idna.core.IDNAError: + return None name = idna_encode(name) - if sys.version_info >= (3, 0): + if name is None: + return None + elif sys.version_info >= (3, 0): name = name.decode('utf-8') return name @@ -223,9 +231,10 @@ def get_subj_alt_name(peer_cert): # Sadly the DNS names need to be idna encoded and then, on Python 3, UTF-8 # decoded. This is pretty frustrating, but that's what the standard library # does with certificates, and so we need to attempt to do the same. + # We also want to skip over names which cannot be idna encoded. names = [ - ('DNS', _dnsname_to_stdlib(name)) - for name in ext.get_values_for_type(x509.DNSName) + ('DNS', name) for name in map(_dnsname_to_stdlib, ext.get_values_for_type(x509.DNSName)) + if name is not None ] names.extend( ('IP Address', str(name)) diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/__pycache__/__init__.cpython-37.pyc index c4fad72..b7b8576 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/__pycache__/ordered_dict.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/__pycache__/ordered_dict.cpython-37.pyc deleted file mode 100644 index 852d6d0..0000000 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/__pycache__/ordered_dict.cpython-37.pyc and /dev/null differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/__pycache__/six.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/__pycache__/six.cpython-37.pyc index fa7a7a7..bea2926 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/__pycache__/six.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/__pycache__/six.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/backports/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/backports/__pycache__/__init__.cpython-37.pyc index 258b7d0..8b2b24f 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/backports/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/backports/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/backports/__pycache__/makefile.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/backports/__pycache__/makefile.cpython-37.pyc index c34676c..cabc3b0 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/backports/__pycache__/makefile.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/backports/__pycache__/makefile.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py index 75b80dc..740db37 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py @@ -16,7 +16,7 @@ def backport_makefile(self, mode="r", buffering=None, encoding=None, """ Backport of ``socket.makefile`` from Python 3.5. """ - if not set(mode) <= set(["r", "w", "b"]): + if not set(mode) <= {"r", "w", "b"}: raise ValueError( "invalid mode %r (only r, w, b allowed)" % (mode,) ) diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/ordered_dict.py b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/ordered_dict.py deleted file mode 100644 index 4479363..0000000 --- a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/ordered_dict.py +++ /dev/null @@ -1,259 +0,0 @@ -# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. -# Passes Python2.7's test suite and incorporates all the latest updates. -# Copyright 2009 Raymond Hettinger, released under the MIT License. -# http://code.activestate.com/recipes/576693/ -try: - from thread import get_ident as _get_ident -except ImportError: - from dummy_thread import get_ident as _get_ident - -try: - from _abcoll import KeysView, ValuesView, ItemsView -except ImportError: - pass - - -class OrderedDict(dict): - 'Dictionary that remembers insertion order' - # An inherited dict maps keys to values. - # The inherited dict provides __getitem__, __len__, __contains__, and get. - # The remaining methods are order-aware. - # Big-O running times for all methods are the same as for regular dictionaries. - - # The internal self.__map dictionary maps keys to links in a doubly linked list. - # The circular doubly linked list starts and ends with a sentinel element. - # The sentinel element never gets deleted (this simplifies the algorithm). - # Each link is stored as a list of length three: [PREV, NEXT, KEY]. - - def __init__(self, *args, **kwds): - '''Initialize an ordered dictionary. Signature is the same as for - regular dictionaries, but keyword arguments are not recommended - because their insertion order is arbitrary. - - ''' - if len(args) > 1: - raise TypeError('expected at most 1 arguments, got %d' % len(args)) - try: - self.__root - except AttributeError: - self.__root = root = [] # sentinel node - root[:] = [root, root, None] - self.__map = {} - self.__update(*args, **kwds) - - def __setitem__(self, key, value, dict_setitem=dict.__setitem__): - 'od.__setitem__(i, y) <==> od[i]=y' - # Setting a new item creates a new link which goes at the end of the linked - # list, and the inherited dictionary is updated with the new key/value pair. - if key not in self: - root = self.__root - last = root[0] - last[1] = root[0] = self.__map[key] = [last, root, key] - dict_setitem(self, key, value) - - def __delitem__(self, key, dict_delitem=dict.__delitem__): - 'od.__delitem__(y) <==> del od[y]' - # Deleting an existing item uses self.__map to find the link which is - # then removed by updating the links in the predecessor and successor nodes. - dict_delitem(self, key) - link_prev, link_next, key = self.__map.pop(key) - link_prev[1] = link_next - link_next[0] = link_prev - - def __iter__(self): - 'od.__iter__() <==> iter(od)' - root = self.__root - curr = root[1] - while curr is not root: - yield curr[2] - curr = curr[1] - - def __reversed__(self): - 'od.__reversed__() <==> reversed(od)' - root = self.__root - curr = root[0] - while curr is not root: - yield curr[2] - curr = curr[0] - - def clear(self): - 'od.clear() -> None. Remove all items from od.' - try: - for node in self.__map.itervalues(): - del node[:] - root = self.__root - root[:] = [root, root, None] - self.__map.clear() - except AttributeError: - pass - dict.clear(self) - - def popitem(self, last=True): - '''od.popitem() -> (k, v), return and remove a (key, value) pair. - Pairs are returned in LIFO order if last is true or FIFO order if false. - - ''' - if not self: - raise KeyError('dictionary is empty') - root = self.__root - if last: - link = root[0] - link_prev = link[0] - link_prev[1] = root - root[0] = link_prev - else: - link = root[1] - link_next = link[1] - root[1] = link_next - link_next[0] = root - key = link[2] - del self.__map[key] - value = dict.pop(self, key) - return key, value - - # -- the following methods do not depend on the internal structure -- - - def keys(self): - 'od.keys() -> list of keys in od' - return list(self) - - def values(self): - 'od.values() -> list of values in od' - return [self[key] for key in self] - - def items(self): - 'od.items() -> list of (key, value) pairs in od' - return [(key, self[key]) for key in self] - - def iterkeys(self): - 'od.iterkeys() -> an iterator over the keys in od' - return iter(self) - - def itervalues(self): - 'od.itervalues -> an iterator over the values in od' - for k in self: - yield self[k] - - def iteritems(self): - 'od.iteritems -> an iterator over the (key, value) items in od' - for k in self: - yield (k, self[k]) - - def update(*args, **kwds): - '''od.update(E, **F) -> None. Update od from dict/iterable E and F. - - If E is a dict instance, does: for k in E: od[k] = E[k] - If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] - Or if E is an iterable of items, does: for k, v in E: od[k] = v - In either case, this is followed by: for k, v in F.items(): od[k] = v - - ''' - if len(args) > 2: - raise TypeError('update() takes at most 2 positional ' - 'arguments (%d given)' % (len(args),)) - elif not args: - raise TypeError('update() takes at least 1 argument (0 given)') - self = args[0] - # Make progressively weaker assumptions about "other" - other = () - if len(args) == 2: - other = args[1] - if isinstance(other, dict): - for key in other: - self[key] = other[key] - elif hasattr(other, 'keys'): - for key in other.keys(): - self[key] = other[key] - else: - for key, value in other: - self[key] = value - for key, value in kwds.items(): - self[key] = value - - __update = update # let subclasses override update without breaking __init__ - - __marker = object() - - def pop(self, key, default=__marker): - '''od.pop(k[,d]) -> v, remove specified key and return the corresponding value. - If key is not found, d is returned if given, otherwise KeyError is raised. - - ''' - if key in self: - result = self[key] - del self[key] - return result - if default is self.__marker: - raise KeyError(key) - return default - - def setdefault(self, key, default=None): - 'od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od' - if key in self: - return self[key] - self[key] = default - return default - - def __repr__(self, _repr_running={}): - 'od.__repr__() <==> repr(od)' - call_key = id(self), _get_ident() - if call_key in _repr_running: - return '...' - _repr_running[call_key] = 1 - try: - if not self: - return '%s()' % (self.__class__.__name__,) - return '%s(%r)' % (self.__class__.__name__, self.items()) - finally: - del _repr_running[call_key] - - def __reduce__(self): - 'Return state information for pickling' - items = [[k, self[k]] for k in self] - inst_dict = vars(self).copy() - for k in vars(OrderedDict()): - inst_dict.pop(k, None) - if inst_dict: - return (self.__class__, (items,), inst_dict) - return self.__class__, (items,) - - def copy(self): - 'od.copy() -> a shallow copy of od' - return self.__class__(self) - - @classmethod - def fromkeys(cls, iterable, value=None): - '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S - and values equal to v (which defaults to None). - - ''' - d = cls() - for key in iterable: - d[key] = value - return d - - def __eq__(self, other): - '''od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive - while comparison to a regular mapping is order-insensitive. - - ''' - if isinstance(other, OrderedDict): - return len(self)==len(other) and self.items() == other.items() - return dict.__eq__(self, other) - - def __ne__(self, other): - return not self == other - - # -- the following methods are only used in Python 2.7 -- - - def viewkeys(self): - "od.viewkeys() -> a set-like object providing a view on od's keys" - return KeysView(self) - - def viewvalues(self): - "od.viewvalues() -> an object providing a view on od's values" - return ValuesView(self) - - def viewitems(self): - "od.viewitems() -> a set-like object providing a view on od's items" - return ItemsView(self) diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/__pycache__/__init__.cpython-37.pyc index f061e45..23c3faf 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/__pycache__/_implementation.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/__pycache__/_implementation.cpython-37.pyc index a083eea..874224a 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/__pycache__/_implementation.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/__pycache__/_implementation.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/_implementation.py b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/_implementation.py index 92c9bc7..970cf65 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/_implementation.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/_implementation.py @@ -9,8 +9,7 @@ import sys # ipaddress has been backported to 2.6+ in pypi. If it is installed on the # system, use it to handle IPAddress ServerAltnames (this was added in # python-3.5) otherwise only do DNS matching. This allows -# backports.ssl_match_hostname to continue to be used all the way back to -# python-2.4. +# backports.ssl_match_hostname to continue to be used in Python 2.7. try: from pip._vendor import ipaddress except ImportError: diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/poolmanager.py b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/poolmanager.py index 506a3c9..fe5491c 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/poolmanager.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/poolmanager.py @@ -47,6 +47,7 @@ _key_fields = ( 'key__socks_options', # dict 'key_assert_hostname', # bool or string 'key_assert_fingerprint', # str + 'key_server_hostname', #str ) #: The namedtuple class used to construct keys for the connection pool. diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/request.py b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/request.py index 1be3334..8f2f44b 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/request.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/request.py @@ -36,7 +36,7 @@ class RequestMethods(object): explicitly. """ - _encode_url_methods = set(['DELETE', 'GET', 'HEAD', 'OPTIONS']) + _encode_url_methods = {'DELETE', 'GET', 'HEAD', 'OPTIONS'} def __init__(self, headers=None): self.headers = headers or {} diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py index 9873cb9..c112690 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py @@ -11,7 +11,7 @@ from .exceptions import ( BodyNotHttplibCompatible, ProtocolError, DecodeError, ReadTimeoutError, ResponseNotChunked, IncompleteRead, InvalidHeader ) -from .packages.six import string_types as basestring, binary_type, PY3 +from .packages.six import string_types as basestring, PY3 from .packages.six.moves import http_client as httplib from .connection import HTTPException, BaseSSLError from .util.response import is_fp_closed, is_response_to_head @@ -23,7 +23,7 @@ class DeflateDecoder(object): def __init__(self): self._first_try = True - self._data = binary_type() + self._data = b'' self._obj = zlib.decompressobj() def __getattr__(self, name): @@ -69,9 +69,9 @@ class GzipDecoder(object): return getattr(self._obj, name) def decompress(self, data): - ret = binary_type() + ret = bytearray() if self._state == GzipDecoderState.SWALLOW_DATA or not data: - return ret + return bytes(ret) while True: try: ret += self._obj.decompress(data) @@ -81,16 +81,40 @@ class GzipDecoder(object): self._state = GzipDecoderState.SWALLOW_DATA if previous_state == GzipDecoderState.OTHER_MEMBERS: # Allow trailing garbage acceptable in other gzip clients - return ret + return bytes(ret) raise data = self._obj.unused_data if not data: - return ret + return bytes(ret) self._state = GzipDecoderState.OTHER_MEMBERS self._obj = zlib.decompressobj(16 + zlib.MAX_WBITS) +class MultiDecoder(object): + """ + From RFC7231: + If one or more encodings have been applied to a representation, the + sender that applied the encodings MUST generate a Content-Encoding + header field that lists the content codings in the order in which + they were applied. + """ + + def __init__(self, modes): + self._decoders = [_get_decoder(m.strip()) for m in modes.split(',')] + + def flush(self): + return self._decoders[0].flush() + + def decompress(self, data): + for d in reversed(self._decoders): + data = d.decompress(data) + return data + + def _get_decoder(mode): + if ',' in mode: + return MultiDecoder(mode) + if mode == 'gzip': return GzipDecoder() @@ -159,7 +183,7 @@ class HTTPResponse(io.IOBase): self.msg = msg self._request_url = request_url - if body and isinstance(body, (basestring, binary_type)): + if body and isinstance(body, (basestring, bytes)): self._body = body self._pool = pool @@ -283,8 +307,13 @@ class HTTPResponse(io.IOBase): # Note: content-encoding value should be case-insensitive, per RFC 7230 # Section 3.2 content_encoding = self.headers.get('content-encoding', '').lower() - if self._decoder is None and content_encoding in self.CONTENT_DECODERS: - self._decoder = _get_decoder(content_encoding) + if self._decoder is None: + if content_encoding in self.CONTENT_DECODERS: + self._decoder = _get_decoder(content_encoding) + elif ',' in content_encoding: + encodings = [e.strip() for e in content_encoding.split(',') if e.strip() in self.CONTENT_DECODERS] + if len(encodings): + self._decoder = _get_decoder(content_encoding) def _decode(self, data, decode_content, flush_decoder): """ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/__init__.cpython-37.pyc index fe28417..8c4c89b 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/connection.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/connection.cpython-37.pyc index 40c054a..046534f 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/connection.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/connection.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/queue.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/queue.cpython-37.pyc index ed62fcd..7e5a1ea 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/queue.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/queue.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/request.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/request.cpython-37.pyc index cda3ff7..06c7746 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/request.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/request.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/response.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/response.cpython-37.pyc index 2c0255f..b8c57b6 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/response.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/response.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/retry.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/retry.cpython-37.pyc index 9ccaa2c..1fe8963 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/retry.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/retry.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/ssl_.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/ssl_.cpython-37.pyc index b2f977a..d9c7e1f 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/ssl_.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/ssl_.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/timeout.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/timeout.cpython-37.pyc index fcf7c23..026fba1 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/timeout.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/timeout.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/url.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/url.cpython-37.pyc index 96f664a..ec4198a 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/url.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/url.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/wait.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/wait.cpython-37.pyc index 3b83d33..1e6bd0d 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/wait.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__pycache__/wait.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/connection.py b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/connection.py index 5cf488f..5ad70b2 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/connection.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/connection.py @@ -1,6 +1,7 @@ from __future__ import absolute_import import socket from .wait import NoWayToWaitForSocketError, wait_for_read +from ..contrib import _appengine_environ def is_connection_dropped(conn): # Platform-specific @@ -105,6 +106,13 @@ def _has_ipv6(host): sock = None has_ipv6 = False + # App Engine doesn't support IPV6 sockets and actually has a quota on the + # number of sockets that can be used, so just early out here instead of + # creating a socket needlessly. + # See https://github.com/urllib3/urllib3/issues/1446 + if _appengine_environ.is_appengine_sandbox(): + return False + if socket.has_ipv6: # has_ipv6 returns true if cPython was compiled with IPv6 support. # It does not tell us if the system has IPv6 support enabled. To diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/response.py b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/response.py index 67cf730..3d54864 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/response.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/response.py @@ -59,8 +59,14 @@ def assert_header_parsing(headers): get_payload = getattr(headers, 'get_payload', None) unparsed_data = None - if get_payload: # Platform-specific: Python 3. - unparsed_data = get_payload() + if get_payload: + # get_payload is actually email.message.Message.get_payload; + # we're only interested in the result if it's not a multipart message + if not headers.is_multipart(): + payload = get_payload() + + if isinstance(payload, (bytes, str)): + unparsed_data = payload if defects or unparsed_data: raise HeaderParsingError(defects=defects, unparsed_data=unparsed_data) diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/retry.py b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/retry.py index 7ad3dc6..e7d0abd 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/retry.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/retry.py @@ -115,7 +115,7 @@ class Retry(object): (most errors are resolved immediately by a second try without a delay). urllib3 will sleep for:: - {backoff factor} * (2 ^ ({number of total retries} - 1)) + {backoff factor} * (2 ** ({number of total retries} - 1)) seconds. If the backoff_factor is 0.1, then :func:`.sleep` will sleep for [0.0s, 0.2s, 0.4s, ...] between retries. It will never be longer diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/ssl_.py b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/ssl_.py index 3254280..dfc553f 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/ssl_.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/ssl_.py @@ -56,9 +56,8 @@ except ImportError: OP_NO_COMPRESSION = 0x20000 -# Python 2.7 and earlier didn't have inet_pton on non-Linux -# so we fallback on inet_aton in those cases. This means that -# we can only detect IPv4 addresses in this case. +# Python 2.7 doesn't have inet_pton on non-Linux so we fallback on inet_aton in +# those cases. This means that we can only detect IPv4 addresses in this case. if hasattr(socket, 'inet_pton'): inet_pton = socket.inet_pton else: @@ -67,7 +66,7 @@ else: from pip._vendor import ipaddress def inet_pton(_, host): - if isinstance(host, six.binary_type): + if isinstance(host, bytes): host = host.decode('ascii') return ipaddress.ip_address(host) @@ -115,10 +114,7 @@ try: except ImportError: import sys - class SSLContext(object): # Platform-specific: Python 2 & 3.1 - supports_set_ciphers = ((2, 7) <= sys.version_info < (3,) or - (3, 2) <= sys.version_info) - + class SSLContext(object): # Platform-specific: Python 2 def __init__(self, protocol_version): self.protocol = protocol_version # Use default values from a real SSLContext @@ -141,12 +137,6 @@ except ImportError: raise SSLError("CA directories not supported in older Pythons") def set_ciphers(self, cipher_suite): - if not self.supports_set_ciphers: - raise TypeError( - 'Your version of Python does not support setting ' - 'a custom cipher suite. Please upgrade to Python ' - '2.7, 3.2, or later if you need this functionality.' - ) self.ciphers = cipher_suite def wrap_socket(self, socket, server_hostname=None, server_side=False): @@ -167,10 +157,7 @@ except ImportError: 'ssl_version': self.protocol, 'server_side': server_side, } - if self.supports_set_ciphers: # Platform-specific: Python 2.7+ - return wrap_socket(socket, ciphers=self.ciphers, **kwargs) - else: # Platform-specific: Python 2.6 - return wrap_socket(socket, **kwargs) + return wrap_socket(socket, ciphers=self.ciphers, **kwargs) def assert_fingerprint(cert, fingerprint): @@ -276,6 +263,8 @@ def create_urllib3_context(ssl_version=None, cert_reqs=None, """ context = SSLContext(ssl_version or ssl.PROTOCOL_SSLv23) + context.set_ciphers(ciphers or DEFAULT_CIPHERS) + # Setting the default here, as we may have no ssl module on import cert_reqs = ssl.CERT_REQUIRED if cert_reqs is None else cert_reqs @@ -291,9 +280,6 @@ def create_urllib3_context(ssl_version=None, cert_reqs=None, context.options |= options - if getattr(context, 'supports_set_ciphers', True): # Platform-specific: Python 2.6 - context.set_ciphers(ciphers or DEFAULT_CIPHERS) - context.verify_mode = cert_reqs if getattr(context, 'check_hostname', None) is not None: # Platform-specific: Python 3.2 # We do our own verification, including fingerprints and alternative @@ -316,8 +302,7 @@ def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None, A pre-made :class:`SSLContext` object. If none is provided, one will be created using :func:`create_urllib3_context`. :param ciphers: - A string of ciphers we wish the client to support. This is not - supported on Python 2.6 as the ssl module does not support it. + A string of ciphers we wish the client to support. :param ca_cert_dir: A directory containing CA certificates in multiple separate files, as supported by OpenSSL's -CApath flag or the capath argument to @@ -334,7 +319,7 @@ def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None, if ca_certs or ca_cert_dir: try: context.load_verify_locations(ca_certs, ca_cert_dir) - except IOError as e: # Platform-specific: Python 2.6, 2.7, 3.2 + except IOError as e: # Platform-specific: Python 2.7 raise SSLError(e) # Py33 raises FileNotFoundError which subclasses OSError # These are not equivalent unless we check the errno attribute @@ -378,7 +363,7 @@ def is_ipaddress(hostname): :param str hostname: Hostname to examine. :return: True if the hostname is an IP address, False otherwise. """ - if six.PY3 and isinstance(hostname, six.binary_type): + if six.PY3 and isinstance(hostname, bytes): # IDN A-label bytes are ASCII compatible. hostname = hostname.decode('ascii') diff --git a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/wait.py b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/wait.py index fa686ef..4db71ba 100644 --- a/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/wait.py +++ b/env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/wait.py @@ -43,9 +43,6 @@ if sys.version_info >= (3, 5): else: # Old and broken Pythons. def _retry_on_intr(fn, timeout): - if timeout is not None and timeout <= 0: - return fn(timeout) - if timeout is None: deadline = float("inf") else: @@ -117,7 +114,7 @@ def _have_working_poll(): # from libraries like eventlet/greenlet. try: poll_obj = select.poll() - poll_obj.poll(0) + _retry_on_intr(poll_obj.poll, 0) except (AttributeError, OSError): return False else: diff --git a/env/lib/python3.7/site-packages/pip/_vendor/webencodings/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/webencodings/__pycache__/__init__.cpython-37.pyc index d869d28..76f58c6 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/webencodings/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/webencodings/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/webencodings/__pycache__/labels.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/webencodings/__pycache__/labels.cpython-37.pyc index ffc978f..4484d86 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/webencodings/__pycache__/labels.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/webencodings/__pycache__/labels.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/webencodings/__pycache__/mklabels.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/webencodings/__pycache__/mklabels.cpython-37.pyc index f9480e0..f195b8e 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/webencodings/__pycache__/mklabels.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/webencodings/__pycache__/mklabels.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/webencodings/__pycache__/tests.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/webencodings/__pycache__/tests.cpython-37.pyc index c009020..5a2c6b6 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/webencodings/__pycache__/tests.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/webencodings/__pycache__/tests.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pip/_vendor/webencodings/__pycache__/x_user_defined.cpython-37.pyc b/env/lib/python3.7/site-packages/pip/_vendor/webencodings/__pycache__/x_user_defined.cpython-37.pyc index 3c711d3..d234637 100644 Binary files a/env/lib/python3.7/site-packages/pip/_vendor/webencodings/__pycache__/x_user_defined.cpython-37.pyc and b/env/lib/python3.7/site-packages/pip/_vendor/webencodings/__pycache__/x_user_defined.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pkg_resources/__init__.py b/env/lib/python3.7/site-packages/pkg_resources/__init__.py index 6ca68da..97e08d6 100644 --- a/env/lib/python3.7/site-packages/pkg_resources/__init__.py +++ b/env/lib/python3.7/site-packages/pkg_resources/__init__.py @@ -39,6 +39,8 @@ import tempfile import textwrap import itertools import inspect +import ntpath +import posixpath from pkgutil import get_importer try: @@ -1401,8 +1403,15 @@ class NullProvider: def has_resource(self, resource_name): return self._has(self._fn(self.module_path, resource_name)) + def _get_metadata_path(self, name): + return self._fn(self.egg_info, name) + def has_metadata(self, name): - return self.egg_info and self._has(self._fn(self.egg_info, name)) + if not self.egg_info: + return self.egg_info + + path = self._get_metadata_path(name) + return self._has(path) def get_metadata(self, name): if not self.egg_info: @@ -1466,10 +1475,86 @@ class NullProvider: ) def _fn(self, base, resource_name): + self._validate_resource_path(resource_name) if resource_name: return os.path.join(base, *resource_name.split('/')) return base + @staticmethod + def _validate_resource_path(path): + """ + Validate the resource paths according to the docs. + https://setuptools.readthedocs.io/en/latest/pkg_resources.html#basic-resource-access + + >>> warned = getfixture('recwarn') + >>> warnings.simplefilter('always') + >>> vrp = NullProvider._validate_resource_path + >>> vrp('foo/bar.txt') + >>> bool(warned) + False + >>> vrp('../foo/bar.txt') + >>> bool(warned) + True + >>> warned.clear() + >>> vrp('/foo/bar.txt') + >>> bool(warned) + True + >>> vrp('foo/../../bar.txt') + >>> bool(warned) + True + >>> warned.clear() + >>> vrp('foo/f../bar.txt') + >>> bool(warned) + False + + Windows path separators are straight-up disallowed. + >>> vrp(r'\\foo/bar.txt') + Traceback (most recent call last): + ... + ValueError: Use of .. or absolute path in a resource path \ +is not allowed. + + >>> vrp(r'C:\\foo/bar.txt') + Traceback (most recent call last): + ... + ValueError: Use of .. or absolute path in a resource path \ +is not allowed. + + Blank values are allowed + + >>> vrp('') + >>> bool(warned) + False + + Non-string values are not. + + >>> vrp(None) + Traceback (most recent call last): + ... + AttributeError: ... + """ + invalid = ( + os.path.pardir in path.split(posixpath.sep) or + posixpath.isabs(path) or + ntpath.isabs(path) + ) + if not invalid: + return + + msg = "Use of .. or absolute path in a resource path is not allowed." + + # Aggressively disallow Windows absolute paths + if ntpath.isabs(path) and not posixpath.isabs(path): + raise ValueError(msg) + + # for compatibility, warn; in future + # raise ValueError(msg) + warnings.warn( + msg[:-1] + " and will raise exceptions in a future release.", + DeprecationWarning, + stacklevel=4, + ) + def _get(self, path): if hasattr(self.loader, 'get_data'): return self.loader.get_data(path) @@ -1790,6 +1875,9 @@ class FileMetadata(EmptyProvider): def __init__(self, path): self.path = path + def _get_metadata_path(self, name): + return self.path + def has_metadata(self, name): return name == 'PKG-INFO' and os.path.isfile(self.path) @@ -1888,7 +1976,7 @@ def find_eggs_in_zip(importer, path_item, only=False): if only: # don't yield nested distros return - for subitem in metadata.resource_listdir('/'): + for subitem in metadata.resource_listdir(''): if _is_egg_path(subitem): subpath = os.path.join(path_item, subitem) dists = find_eggs_in_zip(zipimport.zipimporter(subpath), subpath) @@ -2583,10 +2671,14 @@ class Distribution: try: return self._version except AttributeError: - version = _version_from_file(self._get_metadata(self.PKG_INFO)) + version = self._get_version() if version is None: - tmpl = "Missing 'Version:' header and/or %s file" - raise ValueError(tmpl % self.PKG_INFO, self) + path = self._get_metadata_path_for_display(self.PKG_INFO) + msg = ( + "Missing 'Version:' header and/or {} file at path: {}" + ).format(self.PKG_INFO, path) + raise ValueError(msg, self) + return version @property @@ -2644,11 +2736,34 @@ class Distribution: ) return deps + def _get_metadata_path_for_display(self, name): + """ + Return the path to the given metadata file, if available. + """ + try: + # We need to access _get_metadata_path() on the provider object + # directly rather than through this class's __getattr__() + # since _get_metadata_path() is marked private. + path = self._provider._get_metadata_path(name) + + # Handle exceptions e.g. in case the distribution's metadata + # provider doesn't support _get_metadata_path(). + except Exception: + return '[could not detect]' + + return path + def _get_metadata(self, name): if self.has_metadata(name): for line in self.get_metadata_lines(name): yield line + def _get_version(self): + lines = self._get_metadata(self.PKG_INFO) + version = _version_from_file(lines) + + return version + def activate(self, path=None, replace=False): """Ensure distribution is importable on `path` (default=sys.path)""" if path is None: @@ -2867,7 +2982,7 @@ class EggInfoDistribution(Distribution): take an extra step and try to get the version number from the metadata file itself instead of the filename. """ - md_version = _version_from_file(self._get_metadata(self.PKG_INFO)) + md_version = self._get_version() if md_version: self._version = md_version return self diff --git a/env/lib/python3.7/site-packages/pkg_resources/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pkg_resources/__pycache__/__init__.cpython-37.pyc index 132b989..8baa11e 100644 Binary files a/env/lib/python3.7/site-packages/pkg_resources/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pkg_resources/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pkg_resources/__pycache__/py31compat.cpython-37.pyc b/env/lib/python3.7/site-packages/pkg_resources/__pycache__/py31compat.cpython-37.pyc index 498d04a..ec42082 100644 Binary files a/env/lib/python3.7/site-packages/pkg_resources/__pycache__/py31compat.cpython-37.pyc and b/env/lib/python3.7/site-packages/pkg_resources/__pycache__/py31compat.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pkg_resources/_vendor/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pkg_resources/_vendor/__pycache__/__init__.cpython-37.pyc index d2de1fc..b8e297b 100644 Binary files a/env/lib/python3.7/site-packages/pkg_resources/_vendor/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pkg_resources/_vendor/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pkg_resources/_vendor/__pycache__/appdirs.cpython-37.pyc b/env/lib/python3.7/site-packages/pkg_resources/_vendor/__pycache__/appdirs.cpython-37.pyc index 72890db..e105db4 100644 Binary files a/env/lib/python3.7/site-packages/pkg_resources/_vendor/__pycache__/appdirs.cpython-37.pyc and b/env/lib/python3.7/site-packages/pkg_resources/_vendor/__pycache__/appdirs.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pkg_resources/_vendor/__pycache__/pyparsing.cpython-37.pyc b/env/lib/python3.7/site-packages/pkg_resources/_vendor/__pycache__/pyparsing.cpython-37.pyc index 14ee0d7..6387f9c 100644 Binary files a/env/lib/python3.7/site-packages/pkg_resources/_vendor/__pycache__/pyparsing.cpython-37.pyc and b/env/lib/python3.7/site-packages/pkg_resources/_vendor/__pycache__/pyparsing.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pkg_resources/_vendor/__pycache__/six.cpython-37.pyc b/env/lib/python3.7/site-packages/pkg_resources/_vendor/__pycache__/six.cpython-37.pyc index 252e7a0..b5e4dfb 100644 Binary files a/env/lib/python3.7/site-packages/pkg_resources/_vendor/__pycache__/six.cpython-37.pyc and b/env/lib/python3.7/site-packages/pkg_resources/_vendor/__pycache__/six.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/__about__.cpython-37.pyc b/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/__about__.cpython-37.pyc index 0fc54a5..560fd91 100644 Binary files a/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/__about__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/__about__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/__init__.cpython-37.pyc index 6ca5cea..a07fbcf 100644 Binary files a/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/_compat.cpython-37.pyc b/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/_compat.cpython-37.pyc index b82d2cc..3b51b6f 100644 Binary files a/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/_compat.cpython-37.pyc and b/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/_compat.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/_structures.cpython-37.pyc b/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/_structures.cpython-37.pyc index 8e0efa0..4b57bef 100644 Binary files a/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/_structures.cpython-37.pyc and b/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/_structures.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/markers.cpython-37.pyc b/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/markers.cpython-37.pyc index 630a5b5..c3a1c5d 100644 Binary files a/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/markers.cpython-37.pyc and b/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/markers.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/requirements.cpython-37.pyc b/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/requirements.cpython-37.pyc index 87a21f9..8c338e7 100644 Binary files a/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/requirements.cpython-37.pyc and b/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/requirements.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc b/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc index 6c318f5..3d0828e 100644 Binary files a/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc and b/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/utils.cpython-37.pyc b/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/utils.cpython-37.pyc index ff13261..6b8dc09 100644 Binary files a/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/utils.cpython-37.pyc and b/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/utils.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/version.cpython-37.pyc b/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/version.cpython-37.pyc index cf960fe..755bf5b 100644 Binary files a/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/version.cpython-37.pyc and b/env/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__pycache__/version.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/pkg_resources/extern/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/pkg_resources/extern/__pycache__/__init__.cpython-37.pyc index 6fe3338..188737a 100644 Binary files a/env/lib/python3.7/site-packages/pkg_resources/extern/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/pkg_resources/extern/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/INSTALLER b/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/INSTALLER deleted file mode 100644 index a1b589e..0000000 --- a/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/INSTALLER +++ /dev/null @@ -1 +0,0 @@ -pip diff --git a/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/LICENSE b/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/LICENSE deleted file mode 100644 index 6e0693b..0000000 --- a/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2016 Jason R Coombs - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/METADATA b/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/METADATA deleted file mode 100644 index dc811f4..0000000 --- a/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/METADATA +++ /dev/null @@ -1,73 +0,0 @@ -Metadata-Version: 2.1 -Name: setuptools -Version: 40.6.3 -Summary: Easily download, build, install, upgrade, and uninstall Python packages -Home-page: https://github.com/pypa/setuptools -Author: Python Packaging Authority -Author-email: distutils-sig@python.org -License: UNKNOWN -Project-URL: Documentation, https://setuptools.readthedocs.io/ -Keywords: CPAN PyPI distutils eggs package management -Platform: UNKNOWN -Classifier: Development Status :: 5 - Production/Stable -Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: MIT License -Classifier: Operating System :: OS Independent -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.4 -Classifier: Programming Language :: Python :: 3.5 -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 -Classifier: Topic :: Software Development :: Libraries :: Python Modules -Classifier: Topic :: System :: Archiving :: Packaging -Classifier: Topic :: System :: Systems Administration -Classifier: Topic :: Utilities -Requires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.* -Description-Content-Type: text/x-rst; charset=UTF-8 -Provides-Extra: certs -Requires-Dist: certifi (==2016.9.26) ; extra == 'certs' -Provides-Extra: ssl -Requires-Dist: wincertstore (==0.2) ; (sys_platform=='win32') and extra == 'ssl' - -.. image:: https://img.shields.io/pypi/v/setuptools.svg - :target: https://pypi.org/project/setuptools - -.. image:: https://readthedocs.org/projects/setuptools/badge/?version=latest - :target: https://setuptools.readthedocs.io - -.. image:: https://img.shields.io/travis/pypa/setuptools/master.svg?label=Linux%20build%20%40%20Travis%20CI - :target: https://travis-ci.org/pypa/setuptools - -.. image:: https://img.shields.io/appveyor/ci/pypa/setuptools/master.svg?label=Windows%20build%20%40%20Appveyor - :target: https://ci.appveyor.com/project/pypa/setuptools/branch/master - -.. image:: https://img.shields.io/codecov/c/github/pypa/setuptools/master.svg - :target: https://codecov.io/gh/pypa/setuptools - -.. image:: https://img.shields.io/pypi/pyversions/setuptools.svg - -.. image:: https://tidelift.com/badges/github/pypa/setuptools - :target: https://tidelift.com/subscription/pkg/pypi-setuptools?utm_source=pypi-setuptools&utm_medium=readme - -See the `Installation Instructions -`_ in the Python Packaging -User's Guide for instructions on installing, upgrading, and uninstalling -Setuptools. - -Questions and comments should be directed to the `distutils-sig -mailing list `_. -Bug reports and especially tested patches may be -submitted directly to the `bug tracker -`_. - - -Code of Conduct ---------------- - -Everyone interacting in the setuptools project's codebases, issue trackers, -chat rooms, and mailing lists is expected to follow the -`PyPA Code of Conduct `_. - - diff --git a/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/RECORD b/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/RECORD deleted file mode 100644 index 7a8a2b5..0000000 --- a/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/RECORD +++ /dev/null @@ -1,188 +0,0 @@ -easy_install.py,sha256=MDC9vt5AxDsXX5qcKlBz2TnW6Tpuv_AobnfhCJ9X3PM,126 -pkg_resources/__init__.py,sha256=d7w_yqCD39lZE0-qxhWXPYoc-pZc3G2mD7EU2xhRLpM,104720 -pkg_resources/py31compat.py,sha256=-WQ0e4c3RG_acdhwC3gLiXhP_lg4G5q7XYkZkQg0gxU,558 -pkg_resources/_vendor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 -pkg_resources/_vendor/appdirs.py,sha256=MievUEuv3l_mQISH5SF0shDk_BNhHHzYiAPrT3ITN4I,24701 -pkg_resources/_vendor/pyparsing.py,sha256=tmrp-lu-qO1i75ZzIN5A12nKRRD1Cm4Vpk-5LR9rims,232055 -pkg_resources/_vendor/six.py,sha256=A6hdJZVjI3t_geebZ9BzUvwRrIXo0lfwzQlM2LcKyas,30098 -pkg_resources/_vendor/packaging/__about__.py,sha256=zkcCPTN_6TcLW0Nrlg0176-R1QQ_WVPTm8sz1R4-HjM,720 -pkg_resources/_vendor/packaging/__init__.py,sha256=_vNac5TrzwsrzbOFIbF-5cHqc_Y2aPT2D7zrIR06BOo,513 -pkg_resources/_vendor/packaging/_compat.py,sha256=Vi_A0rAQeHbU-a9X0tt1yQm9RqkgQbDSxzRw8WlU9kA,860 -pkg_resources/_vendor/packaging/_structures.py,sha256=RImECJ4c_wTlaTYYwZYLHEiebDMaAJmK1oPARhw1T5o,1416 -pkg_resources/_vendor/packaging/markers.py,sha256=uEcBBtGvzqltgnArqb9c4RrcInXezDLos14zbBHhWJo,8248 -pkg_resources/_vendor/packaging/requirements.py,sha256=SikL2UynbsT0qtY9ltqngndha_sfo0w6XGFhAhoSoaQ,4355 -pkg_resources/_vendor/packaging/specifiers.py,sha256=SAMRerzO3fK2IkFZCaZkuwZaL_EGqHNOz4pni4vhnN0,28025 -pkg_resources/_vendor/packaging/utils.py,sha256=3m6WvPm6NNxE8rkTGmn0r75B_GZSGg7ikafxHsBN1WA,421 -pkg_resources/_vendor/packaging/version.py,sha256=OwGnxYfr2ghNzYx59qWIBkrK3SnB6n-Zfd1XaLpnnM0,11556 -pkg_resources/extern/__init__.py,sha256=cHiEfHuLmm6rs5Ve_ztBfMI7Lr31vss-D4wkqF5xzlI,2498 -setuptools/__init__.py,sha256=ipsF2yFkfHmryPP8ASJEtOj9N9OuYkk8HxxIJyOHtj0,6001 -setuptools/_deprecation_warning.py,sha256=jU9-dtfv6cKmtQJOXN8nP1mm7gONw5kKEtiPtbwnZyI,218 -setuptools/archive_util.py,sha256=kw8Ib_lKjCcnPKNbS7h8HztRVK0d5RacU3r_KRdVnmM,6592 -setuptools/build_meta.py,sha256=v5rAo9IKlgjNHNcpStcUBG0ChHI-OjNOkCZ_liGuuLA,5995 -setuptools/cli-32.exe,sha256=dfEuovMNnA2HLa3jRfMPVi5tk4R7alCbpTvuxtCyw0Y,65536 -setuptools/cli-64.exe,sha256=KLABu5pyrnokJCv6skjXZ6GsXeyYHGcqOUT3oHI3Xpo,74752 -setuptools/cli.exe,sha256=dfEuovMNnA2HLa3jRfMPVi5tk4R7alCbpTvuxtCyw0Y,65536 -setuptools/config.py,sha256=nCkzIQRWTpVwvtSlFm1kOeSLMMHXmB7hENxwZUT6X9Q,19751 -setuptools/dep_util.py,sha256=fgixvC1R7sH3r13ktyf7N0FALoqEXL1cBarmNpSEoWg,935 -setuptools/depends.py,sha256=hC8QIDcM3VDpRXvRVA6OfL9AaQfxvhxHcN_w6sAyNq8,5837 -setuptools/dist.py,sha256=HyRYLlPp_gkcnvQf8o1RsGq99LtghAeAfxWxbf40KxA,44675 -setuptools/extension.py,sha256=uc6nHI-MxwmNCNPbUiBnybSyqhpJqjbhvOQ-emdvt_E,1729 -setuptools/glibc.py,sha256=X64VvGPL2AbURKwYRsWJOXXGAYOiF_v2qixeTkAULuU,3146 -setuptools/glob.py,sha256=o75cHrOxYsvn854thSxE0x9k8JrKDuhP_rRXlVB00Q4,5084 -setuptools/gui-32.exe,sha256=XBr0bHMA6Hpz2s9s9Bzjl-PwXfa9nH4ie0rFn4V2kWA,65536 -setuptools/gui-64.exe,sha256=aYKMhX1IJLn4ULHgWX0sE0yREUt6B3TEHf_jOw6yNyE,75264 -setuptools/gui.exe,sha256=XBr0bHMA6Hpz2s9s9Bzjl-PwXfa9nH4ie0rFn4V2kWA,65536 -setuptools/launch.py,sha256=sd7ejwhBocCDx_wG9rIs0OaZ8HtmmFU8ZC6IR_S0Lvg,787 -setuptools/lib2to3_ex.py,sha256=t5e12hbR2pi9V4ezWDTB4JM-AISUnGOkmcnYHek3xjg,2013 -setuptools/monkey.py,sha256=FGc9fffh7gAxMLFmJs2DW_OYWpBjkdbNS2n14UAK4NA,5264 -setuptools/msvc.py,sha256=uuRFaZzjJt5Fv3ZmyKUUuLtjx12_8G9RILigGec4irI,40838 -setuptools/namespaces.py,sha256=F0Nrbv8KCT2OrO7rwa03om4N4GZKAlnce-rr-cgDQa8,3199 -setuptools/package_index.py,sha256=yeifZQhJVRwPSaQmRrVPxbXRy-1lF5KdTFV8NAb3YcE,40342 -setuptools/pep425tags.py,sha256=bSGwlybcIpssx9kAv_hqAUJzfEpXSzYRp2u-nDYPdbk,10862 -setuptools/py27compat.py,sha256=3mwxRMDk5Q5O1rSXOERbQDXhFqwDJhhUitfMW_qpUCo,536 -setuptools/py31compat.py,sha256=REvrUBibUHgqI9S-ww0C9bhU-n8PyaQ8Slr1_NRxaaE,820 -setuptools/py33compat.py,sha256=OubjldHJH1KGE1CKt1kRU-Q55keftHT3ea1YoL0ZSco,1195 -setuptools/py36compat.py,sha256=VUDWxmu5rt4QHlGTRtAFu6W5jvfL6WBjeDAzeoBy0OM,2891 -setuptools/sandbox.py,sha256=9UbwfEL5QY436oMI1LtFWohhoZ-UzwHvGyZjUH_qhkw,14276 -setuptools/script (dev).tmpl,sha256=RUzQzCQUaXtwdLtYHWYbIQmOaES5Brqq1FvUA_tu-5I,218 -setuptools/script.tmpl,sha256=WGTt5piezO27c-Dbx6l5Q4T3Ff20A5z7872hv3aAhYY,138 -setuptools/site-patch.py,sha256=OumkIHMuoSenRSW1382kKWI1VAwxNE86E5W8iDd34FY,2302 -setuptools/ssl_support.py,sha256=YBDJsCZjSp62CWjxmSkke9kn9rhHHj25Cus6zhJRW3c,8492 -setuptools/unicode_utils.py,sha256=NOiZ_5hD72A6w-4wVj8awHFM3n51Kmw1Ic_vx15XFqw,996 -setuptools/version.py,sha256=og_cuZQb0QI6ukKZFfZWPlr1HgJBPPn2vO2m_bI9ZTE,144 -setuptools/wheel.py,sha256=A8hKSqHWZ5KM0-VP_DtptxpMxVF9pQwjWZcHGklxq2o,8102 -setuptools/windows_support.py,sha256=5GrfqSP2-dLGJoZTq2g6dCKkyQxxa2n5IQiXlJCoYEE,714 -setuptools/_vendor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 -setuptools/_vendor/pyparsing.py,sha256=tmrp-lu-qO1i75ZzIN5A12nKRRD1Cm4Vpk-5LR9rims,232055 -setuptools/_vendor/six.py,sha256=A6hdJZVjI3t_geebZ9BzUvwRrIXo0lfwzQlM2LcKyas,30098 -setuptools/_vendor/packaging/__about__.py,sha256=zkcCPTN_6TcLW0Nrlg0176-R1QQ_WVPTm8sz1R4-HjM,720 -setuptools/_vendor/packaging/__init__.py,sha256=_vNac5TrzwsrzbOFIbF-5cHqc_Y2aPT2D7zrIR06BOo,513 -setuptools/_vendor/packaging/_compat.py,sha256=Vi_A0rAQeHbU-a9X0tt1yQm9RqkgQbDSxzRw8WlU9kA,860 -setuptools/_vendor/packaging/_structures.py,sha256=RImECJ4c_wTlaTYYwZYLHEiebDMaAJmK1oPARhw1T5o,1416 -setuptools/_vendor/packaging/markers.py,sha256=Gvpk9EY20yKaMTiKgQZ8yFEEpodqVgVYtfekoic1Yts,8239 -setuptools/_vendor/packaging/requirements.py,sha256=t44M2HVWtr8phIz2OhnILzuGT3rTATaovctV1dpnVIg,4343 -setuptools/_vendor/packaging/specifiers.py,sha256=SAMRerzO3fK2IkFZCaZkuwZaL_EGqHNOz4pni4vhnN0,28025 -setuptools/_vendor/packaging/utils.py,sha256=3m6WvPm6NNxE8rkTGmn0r75B_GZSGg7ikafxHsBN1WA,421 -setuptools/_vendor/packaging/version.py,sha256=OwGnxYfr2ghNzYx59qWIBkrK3SnB6n-Zfd1XaLpnnM0,11556 -setuptools/command/__init__.py,sha256=NWzJ0A1BEengZpVeqUyWLNm2bk4P3F4iL5QUErHy7kA,594 -setuptools/command/alias.py,sha256=KjpE0sz_SDIHv3fpZcIQK-sCkJz-SrC6Gmug6b9Nkc8,2426 -setuptools/command/bdist_egg.py,sha256=be-IBpr1zhS9i6GjKANJgzkbH3ChImdWY7S-j0r2BK8,18167 -setuptools/command/bdist_rpm.py,sha256=B7l0TnzCGb-0nLlm6rS00jWLkojASwVmdhW2w5Qz_Ak,1508 -setuptools/command/bdist_wininst.py,sha256=_6dz3lpB1tY200LxKPLM7qgwTCceOMgaWFF-jW2-pm0,637 -setuptools/command/build_clib.py,sha256=bQ9aBr-5ZSO-9fGsGsDLz0mnnFteHUZnftVLkhvHDq0,4484 -setuptools/command/build_ext.py,sha256=81CTgsqjBjNl_HOgCJ1lQ5vv1NIM3RBpcoVGpqT4N1M,12897 -setuptools/command/build_py.py,sha256=yWyYaaS9F3o9JbIczn064A5g1C5_UiKRDxGaTqYbtLE,9596 -setuptools/command/develop.py,sha256=Sl1iMOORbAnp5BqiXmyMBD0uuvEnhSfOCqbxIPRiJPc,8060 -setuptools/command/dist_info.py,sha256=5t6kOfrdgALT-P3ogss6PF9k-Leyesueycuk3dUyZnI,960 -setuptools/command/easy_install.py,sha256=telww7CuPsoTtvlpY-ktnZGT85cZ6xGCGZa0vHvFJ-Q,87273 -setuptools/command/egg_info.py,sha256=3lsuTHQFjmAw6slzRrB3HjLiF2TaImpWHREllAPhyv8,25541 -setuptools/command/install.py,sha256=a0EZpL_A866KEdhicTGbuyD_TYl1sykfzdrri-zazT4,4683 -setuptools/command/install_egg_info.py,sha256=bMgeIeRiXzQ4DAGPV1328kcjwQjHjOWU4FngAWLV78Q,2203 -setuptools/command/install_lib.py,sha256=11mxf0Ch12NsuYwS8PHwXBRvyh671QAM4cTRh7epzG0,3840 -setuptools/command/install_scripts.py,sha256=UD0rEZ6861mTYhIdzcsqKnUl8PozocXWl9VBQ1VTWnc,2439 -setuptools/command/launcher manifest.xml,sha256=xlLbjWrB01tKC0-hlVkOKkiSPbzMml2eOPtJ_ucCnbE,628 -setuptools/command/py36compat.py,sha256=SzjZcOxF7zdFUT47Zv2n7AM3H8koDys_0OpS-n9gIfc,4986 -setuptools/command/register.py,sha256=LO3MvYKPE8dN1m-KkrBRHC68ZFoPvA_vI8Xgp7vv6zI,534 -setuptools/command/rotate.py,sha256=co5C1EkI7P0GGT6Tqz-T2SIj2LBJTZXYELpmao6d4KQ,2164 -setuptools/command/saveopts.py,sha256=za7QCBcQimKKriWcoCcbhxPjUz30gSB74zuTL47xpP4,658 -setuptools/command/sdist.py,sha256=obDTe2BmWt2PlnFPZZh7e0LWvemEsbCCO9MzhrTZjm8,6711 -setuptools/command/setopt.py,sha256=NTWDyx-gjDF-txf4dO577s7LOzHVoKR0Mq33rFxaRr8,5085 -setuptools/command/test.py,sha256=fSl5OsZWSmFR3QJRvyy2OxbcYkuIkPvykWNOhFvAcUA,9228 -setuptools/command/upload.py,sha256=BpQCjKtJZ4kEb0qIOiTjlJtbpapmNacC27nG2ZlSxTY,6825 -setuptools/command/upload_docs.py,sha256=oXiGplM_cUKLwE4CWWw98RzCufAu8tBhMC97GegFcms,7311 -setuptools/extern/__init__.py,sha256=TxeNKFMSfBMzBpBDiHx8Dh3RzsdVmvWaXhtZ03DZMs0,2499 -setuptools-40.6.3.dist-info/LICENSE,sha256=wyo6w5WvYyHv0ovnPQagDw22q4h9HCHU_sRhKNIFbVo,1078 -setuptools-40.6.3.dist-info/METADATA,sha256=zQ7OKsTw2wXshXUxcGIuLdaogfxtuSBL0etbFqo_PoY,3094 -setuptools-40.6.3.dist-info/WHEEL,sha256=_wJFdOYk7i3xxT8ElOkUJvOdOvfNGbR9g-bf6UQT6sU,110 -setuptools-40.6.3.dist-info/dependency_links.txt,sha256=HlkCFkoK5TbZ5EMLbLKYhLcY_E31kBWD8TqW2EgmatQ,239 -setuptools-40.6.3.dist-info/entry_points.txt,sha256=jBqCYDlVjl__sjYFGXo1JQGIMAYFJE-prYWUtnMZEew,2990 -setuptools-40.6.3.dist-info/top_level.txt,sha256=2HUXVVwA4Pff1xgTFr3GsTXXKaPaO6vlG6oNJ_4u4Tg,38 -setuptools-40.6.3.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1 -setuptools-40.6.3.dist-info/RECORD,, -../../../bin/easy_install,sha256=i9AMXcQNSROizXtuqR3_a2F5KS3S3g6Qsh82N-U6tpA,276 -../../../bin/easy_install-3.7,sha256=i9AMXcQNSROizXtuqR3_a2F5KS3S3g6Qsh82N-U6tpA,276 -setuptools-40.6.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 -__pycache__/easy_install.cpython-37.pyc,, -setuptools/__pycache__/windows_support.cpython-37.pyc,, -setuptools/__pycache__/wheel.cpython-37.pyc,, -setuptools/__pycache__/version.cpython-37.pyc,, -setuptools/__pycache__/unicode_utils.cpython-37.pyc,, -setuptools/__pycache__/ssl_support.cpython-37.pyc,, -setuptools/__pycache__/site-patch.cpython-37.pyc,, -setuptools/__pycache__/sandbox.cpython-37.pyc,, -setuptools/__pycache__/py36compat.cpython-37.pyc,, -setuptools/__pycache__/py33compat.cpython-37.pyc,, -setuptools/__pycache__/py31compat.cpython-37.pyc,, -setuptools/__pycache__/py27compat.cpython-37.pyc,, -setuptools/__pycache__/pep425tags.cpython-37.pyc,, -setuptools/__pycache__/package_index.cpython-37.pyc,, -setuptools/__pycache__/namespaces.cpython-37.pyc,, -setuptools/__pycache__/msvc.cpython-37.pyc,, -setuptools/__pycache__/monkey.cpython-37.pyc,, -setuptools/__pycache__/lib2to3_ex.cpython-37.pyc,, -setuptools/__pycache__/launch.cpython-37.pyc,, -setuptools/__pycache__/glob.cpython-37.pyc,, -setuptools/__pycache__/glibc.cpython-37.pyc,, -setuptools/__pycache__/extension.cpython-37.pyc,, -setuptools/__pycache__/dist.cpython-37.pyc,, -setuptools/__pycache__/depends.cpython-37.pyc,, -setuptools/__pycache__/dep_util.cpython-37.pyc,, -setuptools/__pycache__/config.cpython-37.pyc,, -setuptools/__pycache__/build_meta.cpython-37.pyc,, -setuptools/__pycache__/archive_util.cpython-37.pyc,, -setuptools/__pycache__/_deprecation_warning.cpython-37.pyc,, -setuptools/__pycache__/__init__.cpython-37.pyc,, -setuptools/extern/__pycache__/__init__.cpython-37.pyc,, -setuptools/command/__pycache__/upload_docs.cpython-37.pyc,, -setuptools/command/__pycache__/upload.cpython-37.pyc,, -setuptools/command/__pycache__/test.cpython-37.pyc,, -setuptools/command/__pycache__/setopt.cpython-37.pyc,, -setuptools/command/__pycache__/sdist.cpython-37.pyc,, -setuptools/command/__pycache__/saveopts.cpython-37.pyc,, -setuptools/command/__pycache__/rotate.cpython-37.pyc,, -setuptools/command/__pycache__/register.cpython-37.pyc,, -setuptools/command/__pycache__/py36compat.cpython-37.pyc,, -setuptools/command/__pycache__/install_scripts.cpython-37.pyc,, -setuptools/command/__pycache__/install_lib.cpython-37.pyc,, -setuptools/command/__pycache__/install_egg_info.cpython-37.pyc,, -setuptools/command/__pycache__/install.cpython-37.pyc,, -setuptools/command/__pycache__/egg_info.cpython-37.pyc,, -setuptools/command/__pycache__/easy_install.cpython-37.pyc,, -setuptools/command/__pycache__/dist_info.cpython-37.pyc,, -setuptools/command/__pycache__/develop.cpython-37.pyc,, -setuptools/command/__pycache__/build_py.cpython-37.pyc,, -setuptools/command/__pycache__/build_ext.cpython-37.pyc,, -setuptools/command/__pycache__/build_clib.cpython-37.pyc,, -setuptools/command/__pycache__/bdist_wininst.cpython-37.pyc,, -setuptools/command/__pycache__/bdist_rpm.cpython-37.pyc,, -setuptools/command/__pycache__/bdist_egg.cpython-37.pyc,, -setuptools/command/__pycache__/alias.cpython-37.pyc,, -setuptools/command/__pycache__/__init__.cpython-37.pyc,, -setuptools/_vendor/__pycache__/six.cpython-37.pyc,, -setuptools/_vendor/__pycache__/pyparsing.cpython-37.pyc,, -setuptools/_vendor/__pycache__/__init__.cpython-37.pyc,, -setuptools/_vendor/packaging/__pycache__/version.cpython-37.pyc,, -setuptools/_vendor/packaging/__pycache__/utils.cpython-37.pyc,, -setuptools/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc,, -setuptools/_vendor/packaging/__pycache__/requirements.cpython-37.pyc,, -setuptools/_vendor/packaging/__pycache__/markers.cpython-37.pyc,, -setuptools/_vendor/packaging/__pycache__/_structures.cpython-37.pyc,, -setuptools/_vendor/packaging/__pycache__/_compat.cpython-37.pyc,, -setuptools/_vendor/packaging/__pycache__/__init__.cpython-37.pyc,, -setuptools/_vendor/packaging/__pycache__/__about__.cpython-37.pyc,, -pkg_resources/__pycache__/py31compat.cpython-37.pyc,, -pkg_resources/__pycache__/__init__.cpython-37.pyc,, -pkg_resources/extern/__pycache__/__init__.cpython-37.pyc,, -pkg_resources/_vendor/__pycache__/six.cpython-37.pyc,, -pkg_resources/_vendor/__pycache__/pyparsing.cpython-37.pyc,, -pkg_resources/_vendor/__pycache__/appdirs.cpython-37.pyc,, -pkg_resources/_vendor/__pycache__/__init__.cpython-37.pyc,, -pkg_resources/_vendor/packaging/__pycache__/version.cpython-37.pyc,, -pkg_resources/_vendor/packaging/__pycache__/utils.cpython-37.pyc,, -pkg_resources/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc,, -pkg_resources/_vendor/packaging/__pycache__/requirements.cpython-37.pyc,, -pkg_resources/_vendor/packaging/__pycache__/markers.cpython-37.pyc,, -pkg_resources/_vendor/packaging/__pycache__/_structures.cpython-37.pyc,, -pkg_resources/_vendor/packaging/__pycache__/_compat.cpython-37.pyc,, -pkg_resources/_vendor/packaging/__pycache__/__init__.cpython-37.pyc,, -pkg_resources/_vendor/packaging/__pycache__/__about__.cpython-37.pyc,, diff --git a/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/WHEEL b/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/WHEEL deleted file mode 100644 index c4bde30..0000000 --- a/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/WHEEL +++ /dev/null @@ -1,6 +0,0 @@ -Wheel-Version: 1.0 -Generator: bdist_wheel (0.32.3) -Root-Is-Purelib: true -Tag: py2-none-any -Tag: py3-none-any - diff --git a/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/dependency_links.txt b/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/dependency_links.txt deleted file mode 100644 index e87d021..0000000 --- a/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/dependency_links.txt +++ /dev/null @@ -1,2 +0,0 @@ -https://files.pythonhosted.org/packages/source/c/certifi/certifi-2016.9.26.tar.gz#md5=baa81e951a29958563689d868ef1064d -https://files.pythonhosted.org/packages/source/w/wincertstore/wincertstore-0.2.zip#md5=ae728f2f007185648d0c7a8679b361e2 diff --git a/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/entry_points.txt b/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/entry_points.txt deleted file mode 100644 index 4159fd0..0000000 --- a/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/entry_points.txt +++ /dev/null @@ -1,65 +0,0 @@ -[console_scripts] -easy_install = setuptools.command.easy_install:main -easy_install-3.6 = setuptools.command.easy_install:main - -[distutils.commands] -alias = setuptools.command.alias:alias -bdist_egg = setuptools.command.bdist_egg:bdist_egg -bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm -bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst -build_clib = setuptools.command.build_clib:build_clib -build_ext = setuptools.command.build_ext:build_ext -build_py = setuptools.command.build_py:build_py -develop = setuptools.command.develop:develop -dist_info = setuptools.command.dist_info:dist_info -easy_install = setuptools.command.easy_install:easy_install -egg_info = setuptools.command.egg_info:egg_info -install = setuptools.command.install:install -install_egg_info = setuptools.command.install_egg_info:install_egg_info -install_lib = setuptools.command.install_lib:install_lib -install_scripts = setuptools.command.install_scripts:install_scripts -register = setuptools.command.register:register -rotate = setuptools.command.rotate:rotate -saveopts = setuptools.command.saveopts:saveopts -sdist = setuptools.command.sdist:sdist -setopt = setuptools.command.setopt:setopt -test = setuptools.command.test:test -upload = setuptools.command.upload:upload -upload_docs = setuptools.command.upload_docs:upload_docs - -[distutils.setup_keywords] -convert_2to3_doctests = setuptools.dist:assert_string_list -dependency_links = setuptools.dist:assert_string_list -eager_resources = setuptools.dist:assert_string_list -entry_points = setuptools.dist:check_entry_points -exclude_package_data = setuptools.dist:check_package_data -extras_require = setuptools.dist:check_extras -include_package_data = setuptools.dist:assert_bool -install_requires = setuptools.dist:check_requirements -namespace_packages = setuptools.dist:check_nsp -package_data = setuptools.dist:check_package_data -packages = setuptools.dist:check_packages -python_requires = setuptools.dist:check_specifier -setup_requires = setuptools.dist:check_requirements -test_loader = setuptools.dist:check_importable -test_runner = setuptools.dist:check_importable -test_suite = setuptools.dist:check_test_suite -tests_require = setuptools.dist:check_requirements -use_2to3 = setuptools.dist:assert_bool -use_2to3_exclude_fixers = setuptools.dist:assert_string_list -use_2to3_fixers = setuptools.dist:assert_string_list -zip_safe = setuptools.dist:assert_bool - -[egg_info.writers] -PKG-INFO = setuptools.command.egg_info:write_pkg_info -dependency_links.txt = setuptools.command.egg_info:overwrite_arg -depends.txt = setuptools.command.egg_info:warn_depends_obsolete -eager_resources.txt = setuptools.command.egg_info:overwrite_arg -entry_points.txt = setuptools.command.egg_info:write_entries -namespace_packages.txt = setuptools.command.egg_info:overwrite_arg -requires.txt = setuptools.command.egg_info:write_requirements -top_level.txt = setuptools.command.egg_info:write_toplevel_names - -[setuptools.installation] -eggsecutable = setuptools.command.easy_install:bootstrap - diff --git a/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/top_level.txt b/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/top_level.txt deleted file mode 100644 index 4577c6a..0000000 --- a/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/top_level.txt +++ /dev/null @@ -1,3 +0,0 @@ -easy_install -pkg_resources -setuptools diff --git a/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/zip-safe b/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/zip-safe deleted file mode 100644 index 8b13789..0000000 --- a/env/lib/python3.7/site-packages/setuptools-40.6.3.dist-info/zip-safe +++ /dev/null @@ -1 +0,0 @@ - diff --git a/env/lib/python3.7/site-packages/setuptools/__init__.py b/env/lib/python3.7/site-packages/setuptools/__init__.py index e438036..a71b2bb 100644 --- a/env/lib/python3.7/site-packages/setuptools/__init__.py +++ b/env/lib/python3.7/site-packages/setuptools/__init__.py @@ -5,12 +5,14 @@ import sys import functools import distutils.core import distutils.filelist +import re +from distutils.errors import DistutilsOptionError from distutils.util import convert_path from fnmatch import fnmatchcase from ._deprecation_warning import SetuptoolsDeprecationWarning -from setuptools.extern.six import PY3 +from setuptools.extern.six import PY3, string_types from setuptools.extern.six.moves import filter, map import setuptools.version @@ -161,6 +163,37 @@ class Command(_Command): _Command.__init__(self, dist) vars(self).update(kw) + def _ensure_stringlike(self, option, what, default=None): + val = getattr(self, option) + if val is None: + setattr(self, option, default) + return default + elif not isinstance(val, string_types): + raise DistutilsOptionError("'%s' must be a %s (got `%s`)" + % (option, what, val)) + return val + + def ensure_string_list(self, option): + r"""Ensure that 'option' is a list of strings. If 'option' is + currently a string, we split it either on /,\s*/ or /\s+/, so + "foo bar baz", "foo,bar,baz", and "foo, bar baz" all become + ["foo", "bar", "baz"]. + """ + val = getattr(self, option) + if val is None: + return + elif isinstance(val, string_types): + setattr(self, option, re.split(r',\s*|\s+', val)) + else: + if isinstance(val, list): + ok = all(isinstance(v, string_types) for v in val) + else: + ok = False + if not ok: + raise DistutilsOptionError( + "'%s' must be a list of strings (got %r)" + % (option, val)) + def reinitialize_command(self, command, reinit_subcommands=0, **kw): cmd = _Command.reinitialize_command(self, command, reinit_subcommands) vars(cmd).update(kw) diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/__init__.cpython-37.pyc index b35792d..fbc9872 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/_deprecation_warning.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/_deprecation_warning.cpython-37.pyc index 7c6bda1..035a8d2 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/_deprecation_warning.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/_deprecation_warning.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/archive_util.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/archive_util.cpython-37.pyc index 1010c80..d22c9d7 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/archive_util.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/archive_util.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/build_meta.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/build_meta.cpython-37.pyc index c5e04eb..b168463 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/build_meta.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/build_meta.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/config.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/config.cpython-37.pyc index 9b17b2f..2c6ab01 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/config.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/config.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/dep_util.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/dep_util.cpython-37.pyc index ea11093..d31184c 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/dep_util.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/dep_util.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/depends.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/depends.cpython-37.pyc index 7531424..7b44884 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/depends.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/depends.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/dist.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/dist.cpython-37.pyc index 2005750..3ba01d8 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/dist.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/dist.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/extension.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/extension.cpython-37.pyc index 7153415..9b373d1 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/extension.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/extension.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/glibc.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/glibc.cpython-37.pyc index 3ae9183..62b7e50 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/glibc.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/glibc.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/glob.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/glob.cpython-37.pyc index 7d9e4d2..ccf2a33 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/glob.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/glob.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/launch.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/launch.cpython-37.pyc index 7c08480..2e26d1e 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/launch.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/launch.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/lib2to3_ex.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/lib2to3_ex.cpython-37.pyc index 44981eb..733b223 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/lib2to3_ex.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/lib2to3_ex.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/monkey.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/monkey.cpython-37.pyc index aabe15e..dcb2e22 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/monkey.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/monkey.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/msvc.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/msvc.cpython-37.pyc index b4dc8ac..994a5f7 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/msvc.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/msvc.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/namespaces.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/namespaces.cpython-37.pyc index a9c2886..701d2d2 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/namespaces.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/namespaces.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/package_index.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/package_index.cpython-37.pyc index 1553312..baec63d 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/package_index.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/package_index.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/pep425tags.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/pep425tags.cpython-37.pyc index 8482a0a..1c1ddc5 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/pep425tags.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/pep425tags.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/py27compat.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/py27compat.cpython-37.pyc index e24404c..4b6d72a 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/py27compat.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/py27compat.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/py31compat.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/py31compat.cpython-37.pyc index 335f0be..63078a9 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/py31compat.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/py31compat.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/py33compat.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/py33compat.cpython-37.pyc index ceb34e5..22947cc 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/py33compat.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/py33compat.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/py36compat.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/py36compat.cpython-37.pyc deleted file mode 100644 index d14207d..0000000 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/py36compat.cpython-37.pyc and /dev/null differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/sandbox.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/sandbox.cpython-37.pyc index 0a0defc..b854f18 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/sandbox.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/sandbox.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/site-patch.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/site-patch.cpython-37.pyc index dc49a1f..bccae15 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/site-patch.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/site-patch.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/ssl_support.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/ssl_support.cpython-37.pyc index bb17526..87957a2 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/ssl_support.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/ssl_support.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/unicode_utils.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/unicode_utils.cpython-37.pyc index fb92f2e..94f89d1 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/unicode_utils.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/unicode_utils.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/version.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/version.cpython-37.pyc index e159913..727f2e6 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/version.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/version.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/wheel.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/wheel.cpython-37.pyc index b0f745d..60c5079 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/wheel.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/wheel.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/__pycache__/windows_support.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/__pycache__/windows_support.cpython-37.pyc index 49fa5d3..80dbe59 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/__pycache__/windows_support.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/__pycache__/windows_support.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/_vendor/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/_vendor/__pycache__/__init__.cpython-37.pyc index 97c8945..2a3f589 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/_vendor/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/_vendor/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/_vendor/__pycache__/pyparsing.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/_vendor/__pycache__/pyparsing.cpython-37.pyc index 2160210..e279403 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/_vendor/__pycache__/pyparsing.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/_vendor/__pycache__/pyparsing.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/_vendor/__pycache__/six.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/_vendor/__pycache__/six.cpython-37.pyc index 933326a..60d07e9 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/_vendor/__pycache__/six.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/_vendor/__pycache__/six.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/__about__.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/__about__.cpython-37.pyc index 5abb62b..1c46e21 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/__about__.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/__about__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/__init__.cpython-37.pyc index c4ed9d2..54d85a0 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/_compat.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/_compat.cpython-37.pyc index 32408c9..73a75ca 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/_compat.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/_compat.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/_structures.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/_structures.cpython-37.pyc index 0348d7c..caa2b44 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/_structures.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/_structures.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/markers.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/markers.cpython-37.pyc index 734e69f..7f0dd45 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/markers.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/markers.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/requirements.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/requirements.cpython-37.pyc index 5496a5e..64edc87 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/requirements.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/requirements.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc index 42bd9c9..aabdd03 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/specifiers.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/utils.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/utils.cpython-37.pyc index 89bbd06..44f5743 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/utils.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/utils.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/version.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/version.cpython-37.pyc index 25e3dcc..18fd553 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/version.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/_vendor/packaging/__pycache__/version.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/build_meta.py b/env/lib/python3.7/site-packages/setuptools/build_meta.py index 463d375..e40904a 100644 --- a/env/lib/python3.7/site-packages/setuptools/build_meta.py +++ b/env/lib/python3.7/site-packages/setuptools/build_meta.py @@ -26,6 +26,7 @@ bug reports or API stability): Again, this is not a formal definition! Just a "taste" of the module. """ +import io import os import sys import tokenize @@ -34,7 +35,17 @@ import contextlib import setuptools import distutils +from setuptools.py31compat import TemporaryDirectory +from pkg_resources import parse_requirements + +__all__ = ['get_requires_for_build_sdist', + 'get_requires_for_build_wheel', + 'prepare_metadata_for_build_wheel', + 'build_wheel', + 'build_sdist', + '__legacy__', + 'SetupRequirementsError'] class SetupRequirementsError(BaseException): def __init__(self, specifiers): @@ -43,7 +54,9 @@ class SetupRequirementsError(BaseException): class Distribution(setuptools.dist.Distribution): def fetch_build_eggs(self, specifiers): - raise SetupRequirementsError(specifiers) + specifier_list = list(map(str, parse_requirements(specifiers))) + + raise SetupRequirementsError(specifier_list) @classmethod @contextlib.contextmanager @@ -74,109 +87,168 @@ def _to_str(s): return s -def _run_setup(setup_script='setup.py'): - # Note that we can reuse our build directory between calls - # Correctness comes first, then optimization later - __file__ = setup_script - __name__ = '__main__' - f = getattr(tokenize, 'open', open)(__file__) - code = f.read().replace('\\r\\n', '\\n') - f.close() - exec(compile(code, __file__, 'exec'), locals()) - - -def _fix_config(config_settings): - config_settings = config_settings or {} - config_settings.setdefault('--global-option', []) - return config_settings - - -def _get_build_requires(config_settings, requirements): - config_settings = _fix_config(config_settings) - - sys.argv = sys.argv[:1] + ['egg_info'] + \ - config_settings["--global-option"] - try: - with Distribution.patch(): - _run_setup() - except SetupRequirementsError as e: - requirements += e.specifiers - - return requirements - - def _get_immediate_subdirectories(a_dir): return [name for name in os.listdir(a_dir) if os.path.isdir(os.path.join(a_dir, name))] -def get_requires_for_build_wheel(config_settings=None): - config_settings = _fix_config(config_settings) - return _get_build_requires(config_settings, requirements=['wheel']) +def _file_with_extension(directory, extension): + matching = ( + f for f in os.listdir(directory) + if f.endswith(extension) + ) + file, = matching + return file -def get_requires_for_build_sdist(config_settings=None): - config_settings = _fix_config(config_settings) - return _get_build_requires(config_settings, requirements=[]) +def _open_setup_script(setup_script): + if not os.path.exists(setup_script): + # Supply a default setup.py + return io.StringIO(u"from setuptools import setup; setup()") + + return getattr(tokenize, 'open', open)(setup_script) -def prepare_metadata_for_build_wheel(metadata_directory, config_settings=None): - sys.argv = sys.argv[:1] + ['dist_info', '--egg-base', _to_str(metadata_directory)] - _run_setup() +class _BuildMetaBackend(object): - dist_info_directory = metadata_directory - while True: - dist_infos = [f for f in os.listdir(dist_info_directory) - if f.endswith('.dist-info')] + def _fix_config(self, config_settings): + config_settings = config_settings or {} + config_settings.setdefault('--global-option', []) + return config_settings - if len(dist_infos) == 0 and \ - len(_get_immediate_subdirectories(dist_info_directory)) == 1: - dist_info_directory = os.path.join( - dist_info_directory, os.listdir(dist_info_directory)[0]) - continue + def _get_build_requires(self, config_settings, requirements): + config_settings = self._fix_config(config_settings) - assert len(dist_infos) == 1 - break + sys.argv = sys.argv[:1] + ['egg_info'] + \ + config_settings["--global-option"] + try: + with Distribution.patch(): + self.run_setup() + except SetupRequirementsError as e: + requirements += e.specifiers - # PEP 517 requires that the .dist-info directory be placed in the - # metadata_directory. To comply, we MUST copy the directory to the root - if dist_info_directory != metadata_directory: - shutil.move( - os.path.join(dist_info_directory, dist_infos[0]), - metadata_directory) - shutil.rmtree(dist_info_directory, ignore_errors=True) + return requirements - return dist_infos[0] + def run_setup(self, setup_script='setup.py'): + # Note that we can reuse our build directory between calls + # Correctness comes first, then optimization later + __file__ = setup_script + __name__ = '__main__' + + with _open_setup_script(__file__) as f: + code = f.read().replace(r'\r\n', r'\n') + + exec(compile(code, __file__, 'exec'), locals()) + + def get_requires_for_build_wheel(self, config_settings=None): + config_settings = self._fix_config(config_settings) + return self._get_build_requires(config_settings, requirements=['wheel']) + + def get_requires_for_build_sdist(self, config_settings=None): + config_settings = self._fix_config(config_settings) + return self._get_build_requires(config_settings, requirements=[]) + + def prepare_metadata_for_build_wheel(self, metadata_directory, + config_settings=None): + sys.argv = sys.argv[:1] + ['dist_info', '--egg-base', + _to_str(metadata_directory)] + self.run_setup() + + dist_info_directory = metadata_directory + while True: + dist_infos = [f for f in os.listdir(dist_info_directory) + if f.endswith('.dist-info')] + + if (len(dist_infos) == 0 and + len(_get_immediate_subdirectories(dist_info_directory)) == 1): + + dist_info_directory = os.path.join( + dist_info_directory, os.listdir(dist_info_directory)[0]) + continue + + assert len(dist_infos) == 1 + break + + # PEP 517 requires that the .dist-info directory be placed in the + # metadata_directory. To comply, we MUST copy the directory to the root + if dist_info_directory != metadata_directory: + shutil.move( + os.path.join(dist_info_directory, dist_infos[0]), + metadata_directory) + shutil.rmtree(dist_info_directory, ignore_errors=True) + + return dist_infos[0] + + def build_wheel(self, wheel_directory, config_settings=None, + metadata_directory=None): + config_settings = self._fix_config(config_settings) + wheel_directory = os.path.abspath(wheel_directory) + + # Build the wheel in a temporary directory, then copy to the target + with TemporaryDirectory(dir=wheel_directory) as tmp_dist_dir: + sys.argv = (sys.argv[:1] + + ['bdist_wheel', '--dist-dir', tmp_dist_dir] + + config_settings["--global-option"]) + self.run_setup() + + wheel_basename = _file_with_extension(tmp_dist_dir, '.whl') + wheel_path = os.path.join(wheel_directory, wheel_basename) + if os.path.exists(wheel_path): + # os.rename will fail overwriting on non-unix env + os.remove(wheel_path) + os.rename(os.path.join(tmp_dist_dir, wheel_basename), wheel_path) + + return wheel_basename + + def build_sdist(self, sdist_directory, config_settings=None): + config_settings = self._fix_config(config_settings) + sdist_directory = os.path.abspath(sdist_directory) + sys.argv = sys.argv[:1] + ['sdist', '--formats', 'gztar'] + \ + config_settings["--global-option"] + \ + ["--dist-dir", sdist_directory] + self.run_setup() + + return _file_with_extension(sdist_directory, '.tar.gz') -def build_wheel(wheel_directory, config_settings=None, - metadata_directory=None): - config_settings = _fix_config(config_settings) - wheel_directory = os.path.abspath(wheel_directory) - sys.argv = sys.argv[:1] + ['bdist_wheel'] + \ - config_settings["--global-option"] - _run_setup() - if wheel_directory != 'dist': - shutil.rmtree(wheel_directory) - shutil.copytree('dist', wheel_directory) +class _BuildMetaLegacyBackend(_BuildMetaBackend): + """Compatibility backend for setuptools - wheels = [f for f in os.listdir(wheel_directory) - if f.endswith('.whl')] + This is a version of setuptools.build_meta that endeavors to maintain backwards + compatibility with pre-PEP 517 modes of invocation. It exists as a temporary + bridge between the old packaging mechanism and the new packaging mechanism, + and will eventually be removed. + """ + def run_setup(self, setup_script='setup.py'): + # In order to maintain compatibility with scripts assuming that + # the setup.py script is in a directory on the PYTHONPATH, inject + # '' into sys.path. (pypa/setuptools#1642) + sys_path = list(sys.path) # Save the original path - assert len(wheels) == 1 - return wheels[0] + script_dir = os.path.dirname(os.path.abspath(setup_script)) + if script_dir not in sys.path: + sys.path.insert(0, script_dir) + + try: + super(_BuildMetaLegacyBackend, + self).run_setup(setup_script=setup_script) + finally: + # While PEP 517 frontends should be calling each hook in a fresh + # subprocess according to the standard (and thus it should not be + # strictly necessary to restore the old sys.path), we'll restore + # the original path so that the path manipulation does not persist + # within the hook after run_setup is called. + sys.path[:] = sys_path + +# The primary backend +_BACKEND = _BuildMetaBackend() + +get_requires_for_build_wheel = _BACKEND.get_requires_for_build_wheel +get_requires_for_build_sdist = _BACKEND.get_requires_for_build_sdist +prepare_metadata_for_build_wheel = _BACKEND.prepare_metadata_for_build_wheel +build_wheel = _BACKEND.build_wheel +build_sdist = _BACKEND.build_sdist -def build_sdist(sdist_directory, config_settings=None): - config_settings = _fix_config(config_settings) - sdist_directory = os.path.abspath(sdist_directory) - sys.argv = sys.argv[:1] + ['sdist'] + \ - config_settings["--global-option"] + \ - ["--dist-dir", sdist_directory] - _run_setup() - - sdists = [f for f in os.listdir(sdist_directory) - if f.endswith('.tar.gz')] - - assert len(sdists) == 1 - return sdists[0] +# The legacy backend +__legacy__ = _BuildMetaLegacyBackend() diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/__init__.cpython-37.pyc index ae8e277..c1f0375 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/alias.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/alias.cpython-37.pyc index 088f91d..2af65c7 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/alias.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/alias.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/bdist_egg.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/bdist_egg.cpython-37.pyc index 1215c27..aeeda65 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/bdist_egg.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/bdist_egg.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/bdist_rpm.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/bdist_rpm.cpython-37.pyc index cb9732e..8343061 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/bdist_rpm.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/bdist_rpm.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/bdist_wininst.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/bdist_wininst.cpython-37.pyc index 4639f78..38c078f 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/bdist_wininst.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/bdist_wininst.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/build_clib.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/build_clib.cpython-37.pyc index ab27e9e..a80c9c6 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/build_clib.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/build_clib.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/build_ext.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/build_ext.cpython-37.pyc index 7eab208..26494a9 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/build_ext.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/build_ext.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/build_py.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/build_py.cpython-37.pyc index 553beba..4bff49e 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/build_py.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/build_py.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/develop.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/develop.cpython-37.pyc index 865d512..b664b94 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/develop.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/develop.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/dist_info.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/dist_info.cpython-37.pyc index b78b8df..bbcd8b0 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/dist_info.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/dist_info.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/easy_install.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/easy_install.cpython-37.pyc index 4cb12d1..b197f5b 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/easy_install.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/easy_install.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/egg_info.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/egg_info.cpython-37.pyc index dc35e0f..a4f8a2a 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/egg_info.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/egg_info.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/install.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/install.cpython-37.pyc index f833fb1..a2aec6e 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/install.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/install.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/install_egg_info.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/install_egg_info.cpython-37.pyc index 8da6f6a..b2df38f 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/install_egg_info.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/install_egg_info.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/install_lib.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/install_lib.cpython-37.pyc index a9be6bd..f1d4e9f 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/install_lib.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/install_lib.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/install_scripts.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/install_scripts.cpython-37.pyc index fb0d513..f7ae8c8 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/install_scripts.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/install_scripts.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/py36compat.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/py36compat.cpython-37.pyc index a9a5240..4d825eb 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/py36compat.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/py36compat.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/register.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/register.cpython-37.pyc index 0fa3954..473e28f 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/register.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/register.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/rotate.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/rotate.cpython-37.pyc index 6892cd9..e3dd386 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/rotate.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/rotate.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/saveopts.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/saveopts.cpython-37.pyc index 4467d4b..6caeac5 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/saveopts.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/saveopts.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/sdist.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/sdist.cpython-37.pyc index 8af1358..50b5a61 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/sdist.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/sdist.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/setopt.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/setopt.cpython-37.pyc index 428a0f4..7d8fa3b 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/setopt.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/setopt.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/test.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/test.cpython-37.pyc index 35725bc..9a944dd 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/test.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/test.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/upload.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/upload.cpython-37.pyc index 635fbd8..5654eab 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/upload.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/upload.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/upload_docs.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/upload_docs.cpython-37.pyc index 6057339..238e2cd 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/command/__pycache__/upload_docs.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/command/__pycache__/upload_docs.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/command/develop.py b/env/lib/python3.7/site-packages/setuptools/command/develop.py index fdc9fc4..009e4f9 100644 --- a/env/lib/python3.7/site-packages/setuptools/command/develop.py +++ b/env/lib/python3.7/site-packages/setuptools/command/develop.py @@ -7,7 +7,7 @@ import io from setuptools.extern import six -from pkg_resources import Distribution, PathMetadata, normalize_path +import pkg_resources from setuptools.command.easy_install import easy_install from setuptools import namespaces import setuptools @@ -65,9 +65,9 @@ class develop(namespaces.DevelopInstaller, easy_install): if self.egg_path is None: self.egg_path = os.path.abspath(ei.egg_base) - target = normalize_path(self.egg_base) - egg_path = normalize_path(os.path.join(self.install_dir, - self.egg_path)) + target = pkg_resources.normalize_path(self.egg_base) + egg_path = pkg_resources.normalize_path( + os.path.join(self.install_dir, self.egg_path)) if egg_path != target: raise DistutilsOptionError( "--egg-path must be a relative path from the install" @@ -75,9 +75,9 @@ class develop(namespaces.DevelopInstaller, easy_install): ) # Make a distribution for the package's source - self.dist = Distribution( + self.dist = pkg_resources.Distribution( target, - PathMetadata(target, os.path.abspath(ei.egg_info)), + pkg_resources.PathMetadata(target, os.path.abspath(ei.egg_info)), project_name=ei.egg_name ) @@ -97,13 +97,14 @@ class develop(namespaces.DevelopInstaller, easy_install): path_to_setup = egg_base.replace(os.sep, '/').rstrip('/') if path_to_setup != os.curdir: path_to_setup = '../' * (path_to_setup.count('/') + 1) - resolved = normalize_path( + resolved = pkg_resources.normalize_path( os.path.join(install_dir, egg_path, path_to_setup) ) - if resolved != normalize_path(os.curdir): + if resolved != pkg_resources.normalize_path(os.curdir): raise DistutilsOptionError( "Can't get a consistent path to setup script from" - " installation directory", resolved, normalize_path(os.curdir)) + " installation directory", resolved, + pkg_resources.normalize_path(os.curdir)) return path_to_setup def install_for_development(self): @@ -114,7 +115,7 @@ class develop(namespaces.DevelopInstaller, easy_install): self.reinitialize_command('build_py', inplace=0) self.run_command('build_py') bpy_cmd = self.get_finalized_command("build_py") - build_path = normalize_path(bpy_cmd.build_lib) + build_path = pkg_resources.normalize_path(bpy_cmd.build_lib) # Build extensions self.reinitialize_command('egg_info', egg_base=build_path) @@ -128,7 +129,8 @@ class develop(namespaces.DevelopInstaller, easy_install): self.egg_path = build_path self.dist.location = build_path # XXX - self.dist._provider = PathMetadata(build_path, ei_cmd.egg_info) + self.dist._provider = pkg_resources.PathMetadata( + build_path, ei_cmd.egg_info) else: # Without 2to3 inplace works fine: self.run_command('egg_info') @@ -200,6 +202,7 @@ class VersionlessRequirement: name as the 'requirement' so that scripts will work across multiple versions. + >>> from pkg_resources import Distribution >>> dist = Distribution(project_name='foo', version='1.0') >>> str(dist.as_requirement()) 'foo==1.0' diff --git a/env/lib/python3.7/site-packages/setuptools/command/egg_info.py b/env/lib/python3.7/site-packages/setuptools/command/egg_info.py index d9fe3da..5d8f451 100644 --- a/env/lib/python3.7/site-packages/setuptools/command/egg_info.py +++ b/env/lib/python3.7/site-packages/setuptools/command/egg_info.py @@ -568,6 +568,7 @@ class manifest_maker(sdist): def add_defaults(self): sdist.add_defaults(self) + self.check_license() self.filelist.append(self.template) self.filelist.append(self.manifest) rcfiles = list(walk_revctrl()) diff --git a/env/lib/python3.7/site-packages/setuptools/command/sdist.py b/env/lib/python3.7/site-packages/setuptools/command/sdist.py index bcfae4d..dc25398 100644 --- a/env/lib/python3.7/site-packages/setuptools/command/sdist.py +++ b/env/lib/python3.7/site-packages/setuptools/command/sdist.py @@ -198,3 +198,24 @@ class sdist(sdist_add_defaults, orig.sdist): continue self.filelist.append(line) manifest.close() + + def check_license(self): + """Checks if license_file' is configured and adds it to + 'self.filelist' if the value contains a valid path. + """ + + opts = self.distribution.get_option_dict('metadata') + + # ignore the source of the value + _, license_file = opts.get('license_file', (None, None)) + + if license_file is None: + log.debug("'license_file' option was not specified") + return + + if not os.path.exists(license_file): + log.warn("warning: Failed to find the configured license file '%s'", + license_file) + return + + self.filelist.append(license_file) diff --git a/env/lib/python3.7/site-packages/setuptools/command/test.py b/env/lib/python3.7/site-packages/setuptools/command/test.py index dde0118..973e4eb 100644 --- a/env/lib/python3.7/site-packages/setuptools/command/test.py +++ b/env/lib/python3.7/site-packages/setuptools/command/test.py @@ -15,6 +15,7 @@ from pkg_resources import (resource_listdir, resource_exists, normalize_path, working_set, _namespace_packages, evaluate_marker, add_activation_listener, require, EntryPoint) from setuptools import Command +from .build_py import _unique_everseen __metaclass__ = type @@ -186,7 +187,7 @@ class test(Command): orig_pythonpath = os.environ.get('PYTHONPATH', nothing) current_pythonpath = os.environ.get('PYTHONPATH', '') try: - prefix = os.pathsep.join(paths) + prefix = os.pathsep.join(_unique_everseen(paths)) to_join = filter(None, [prefix, current_pythonpath]) new_path = os.pathsep.join(to_join) if new_path: diff --git a/env/lib/python3.7/site-packages/setuptools/command/upload.py b/env/lib/python3.7/site-packages/setuptools/command/upload.py index dd17f7a..6db8888 100644 --- a/env/lib/python3.7/site-packages/setuptools/command/upload.py +++ b/env/lib/python3.7/site-packages/setuptools/command/upload.py @@ -2,7 +2,6 @@ import io import os import hashlib import getpass -import platform from base64 import standard_b64encode @@ -16,6 +15,7 @@ from setuptools.extern.six.moves.urllib.request import urlopen, Request from setuptools.extern.six.moves.urllib.error import HTTPError from setuptools.extern.six.moves.urllib.parse import urlparse + class upload(orig.upload): """ Override default upload behavior to obtain password @@ -80,7 +80,7 @@ class upload(orig.upload): 'version': meta.get_version(), # file content - 'content': (os.path.basename(filename),content), + 'content': (os.path.basename(filename), content), 'filetype': command, 'pyversion': pyversion, 'md5_digest': hashlib.md5(content).hexdigest(), diff --git a/env/lib/python3.7/site-packages/setuptools/config.py b/env/lib/python3.7/site-packages/setuptools/config.py index d1ac673..b662604 100644 --- a/env/lib/python3.7/site-packages/setuptools/config.py +++ b/env/lib/python3.7/site-packages/setuptools/config.py @@ -246,6 +246,26 @@ class ConfigHandler: value = value.lower() return value in ('1', 'true', 'yes') + @classmethod + def _exclude_files_parser(cls, key): + """Returns a parser function to make sure field inputs + are not files. + + Parses a value after getting the key so error messages are + more informative. + + :param key: + :rtype: callable + """ + def parser(value): + exclude_directive = 'file:' + if value.startswith(exclude_directive): + raise ValueError( + 'Only strings are accepted for the {0} field, ' + 'files are not accepted'.format(key)) + return value + return parser + @classmethod def _parse_file(cls, value): """Represents value as a string, allowing including text @@ -255,7 +275,6 @@ class ConfigHandler: directory with setup.py. Examples: - file: LICENSE file: README.rst, CHANGELOG.md, src/file.txt :param str value: @@ -394,7 +413,7 @@ class ConfigHandler: section_parser_method = getattr( self, - # Dots in section names are tranlsated into dunderscores. + # Dots in section names are translated into dunderscores. ('parse_section%s' % method_postfix).replace('.', '__'), None) @@ -407,8 +426,8 @@ class ConfigHandler: def _deprecated_config_handler(self, func, msg, warning_class): """ this function will wrap around parameters that are deprecated - - :param msg: deprecation message + + :param msg: deprecation message :param warning_class: class of warning exception to be raised :param func: function to be wrapped around """ @@ -416,7 +435,7 @@ class ConfigHandler: def config_handler(*args, **kwargs): warnings.warn(msg, warning_class) return func(*args, **kwargs) - + return config_handler @@ -449,18 +468,20 @@ class ConfigMetadataHandler(ConfigHandler): parse_list = self._parse_list parse_file = self._parse_file parse_dict = self._parse_dict + exclude_files_parser = self._exclude_files_parser return { 'platforms': parse_list, 'keywords': parse_list, 'provides': parse_list, - 'requires': self._deprecated_config_handler(parse_list, - "The requires parameter is deprecated, please use " + + 'requires': self._deprecated_config_handler( + parse_list, + "The requires parameter is deprecated, please use " "install_requires for runtime dependencies.", DeprecationWarning), 'obsoletes': parse_list, 'classifiers': self._get_parser_compound(parse_file, parse_list), - 'license': parse_file, + 'license': exclude_files_parser('license'), 'description': parse_file, 'long_description': parse_file, 'version': self._parse_version, diff --git a/env/lib/python3.7/site-packages/setuptools/dist.py b/env/lib/python3.7/site-packages/setuptools/dist.py index 7062ae8..9a165de 100644 --- a/env/lib/python3.7/site-packages/setuptools/dist.py +++ b/env/lib/python3.7/site-packages/setuptools/dist.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- __all__ = ['Distribution'] +import io +import sys import re import os import warnings @@ -9,9 +11,11 @@ import distutils.log import distutils.core import distutils.cmd import distutils.dist +from distutils.util import strtobool +from distutils.debug import DEBUG +from distutils.fancy_getopt import translate_longopt import itertools - from collections import defaultdict from email import message_from_file @@ -32,7 +36,6 @@ from setuptools import windows_support from setuptools.monkey import get_unpatched from setuptools.config import parse_configuration import pkg_resources -from .py36compat import Distribution_parse_config_files __import__('setuptools.extern.packaging.specifiers') __import__('setuptools.extern.packaging.version') @@ -130,7 +133,6 @@ def write_pkg_file(self, file): def write_field(key, value): file.write("%s: %s\n" % (key, value)) - write_field('Metadata-Version', str(version)) write_field('Name', self.get_name()) write_field('Version', self.get_version()) @@ -332,7 +334,7 @@ def check_packages(dist, attr, value): _Distribution = get_unpatched(distutils.core.Distribution) -class Distribution(Distribution_parse_config_files, _Distribution): +class Distribution(_Distribution): """Distribution with support for features, tests, and package data This is an enhanced version of 'distutils.dist.Distribution' that @@ -556,12 +558,141 @@ class Distribution(Distribution_parse_config_files, _Distribution): req.marker = None return req + def _parse_config_files(self, filenames=None): + """ + Adapted from distutils.dist.Distribution.parse_config_files, + this method provides the same functionality in subtly-improved + ways. + """ + from setuptools.extern.six.moves.configparser import ConfigParser + + # Ignore install directory options if we have a venv + if six.PY3 and sys.prefix != sys.base_prefix: + ignore_options = [ + 'install-base', 'install-platbase', 'install-lib', + 'install-platlib', 'install-purelib', 'install-headers', + 'install-scripts', 'install-data', 'prefix', 'exec-prefix', + 'home', 'user', 'root'] + else: + ignore_options = [] + + ignore_options = frozenset(ignore_options) + + if filenames is None: + filenames = self.find_config_files() + + if DEBUG: + self.announce("Distribution.parse_config_files():") + + parser = ConfigParser() + for filename in filenames: + with io.open(filename, encoding='utf-8') as reader: + if DEBUG: + self.announce(" reading {filename}".format(**locals())) + (parser.read_file if six.PY3 else parser.readfp)(reader) + for section in parser.sections(): + options = parser.options(section) + opt_dict = self.get_option_dict(section) + + for opt in options: + if opt != '__name__' and opt not in ignore_options: + val = self._try_str(parser.get(section, opt)) + opt = opt.replace('-', '_') + opt_dict[opt] = (filename, val) + + # Make the ConfigParser forget everything (so we retain + # the original filenames that options come from) + parser.__init__() + + # If there was a "global" section in the config file, use it + # to set Distribution options. + + if 'global' in self.command_options: + for (opt, (src, val)) in self.command_options['global'].items(): + alias = self.negative_opt.get(opt) + try: + if alias: + setattr(self, alias, not strtobool(val)) + elif opt in ('verbose', 'dry_run'): # ugh! + setattr(self, opt, strtobool(val)) + else: + setattr(self, opt, val) + except ValueError as msg: + raise DistutilsOptionError(msg) + + @staticmethod + def _try_str(val): + """ + On Python 2, much of distutils relies on string values being of + type 'str' (bytes) and not unicode text. If the value can be safely + encoded to bytes using the default encoding, prefer that. + + Why the default encoding? Because that value can be implicitly + decoded back to text if needed. + + Ref #1653 + """ + if six.PY3: + return val + try: + return val.encode() + except UnicodeEncodeError: + pass + return val + + def _set_command_options(self, command_obj, option_dict=None): + """ + Set the options for 'command_obj' from 'option_dict'. Basically + this means copying elements of a dictionary ('option_dict') to + attributes of an instance ('command'). + + 'command_obj' must be a Command instance. If 'option_dict' is not + supplied, uses the standard option dictionary for this command + (from 'self.command_options'). + + (Adopted from distutils.dist.Distribution._set_command_options) + """ + command_name = command_obj.get_command_name() + if option_dict is None: + option_dict = self.get_option_dict(command_name) + + if DEBUG: + self.announce(" setting options for '%s' command:" % command_name) + for (option, (source, value)) in option_dict.items(): + if DEBUG: + self.announce(" %s = %s (from %s)" % (option, value, + source)) + try: + bool_opts = [translate_longopt(o) + for o in command_obj.boolean_options] + except AttributeError: + bool_opts = [] + try: + neg_opt = command_obj.negative_opt + except AttributeError: + neg_opt = {} + + try: + is_string = isinstance(value, six.string_types) + if option in neg_opt and is_string: + setattr(command_obj, neg_opt[option], not strtobool(value)) + elif option in bool_opts and is_string: + setattr(command_obj, option, strtobool(value)) + elif hasattr(command_obj, option): + setattr(command_obj, option, value) + else: + raise DistutilsOptionError( + "error in %s: command '%s' has no such option '%s'" + % (source, command_name, option)) + except ValueError as msg: + raise DistutilsOptionError(msg) + def parse_config_files(self, filenames=None, ignore_option_errors=False): """Parses configuration files from various levels and loads configuration. """ - _Distribution.parse_config_files(self, filenames=filenames) + self._parse_config_files(filenames=filenames) parse_configuration(self, self.command_options, ignore_option_errors=ignore_option_errors) @@ -747,7 +878,7 @@ class Distribution(Distribution_parse_config_files, _Distribution): def include(self, **attrs): """Add items to distribution that are named in keyword arguments - For example, 'dist.exclude(py_modules=["x"])' would add 'x' to + For example, 'dist.include(py_modules=["x"])' would add 'x' to the distribution's 'py_modules' attribute, if it was not already there. @@ -965,7 +1096,6 @@ class Distribution(Distribution_parse_config_files, _Distribution): return _Distribution.handle_display_options(self, option_order) # Stdout may be StringIO (e.g. in tests) - import io if not isinstance(sys.stdout, io.TextIOWrapper): return _Distribution.handle_display_options(self, option_order) @@ -1144,4 +1274,5 @@ class Feature: class DistDeprecationWarning(SetuptoolsDeprecationWarning): - """Class for warning about deprecations in dist in setuptools. Not ignored by default, unlike DeprecationWarning.""" + """Class for warning about deprecations in dist in + setuptools. Not ignored by default, unlike DeprecationWarning.""" diff --git a/env/lib/python3.7/site-packages/setuptools/extern/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/setuptools/extern/__pycache__/__init__.cpython-37.pyc index e0e2c8a..5a22f7e 100644 Binary files a/env/lib/python3.7/site-packages/setuptools/extern/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/setuptools/extern/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/setuptools/package_index.py b/env/lib/python3.7/site-packages/setuptools/package_index.py index 1608b91..6b06f2c 100644 --- a/env/lib/python3.7/site-packages/setuptools/package_index.py +++ b/env/lib/python3.7/site-packages/setuptools/package_index.py @@ -856,7 +856,7 @@ class PackageIndex(Environment): scheme, netloc, path, p, q, f = urllib.parse.urlparse(url) if not netloc and path.startswith('//') and '/' in path[2:]: netloc, path = path[2:].split('/', 1) - auth, host = urllib.parse.splituser(netloc) + auth, host = _splituser(netloc) if auth: if ':' in auth: user, pw = auth.split(':', 1) @@ -897,7 +897,7 @@ class PackageIndex(Environment): if rev is not None: self.info("Checking out %s", rev) - os.system("(cd %s && git checkout --quiet %s)" % ( + os.system("git -C %s checkout --quiet %s" % ( filename, rev, )) @@ -913,7 +913,7 @@ class PackageIndex(Environment): if rev is not None: self.info("Updating to %s", rev) - os.system("(cd %s && hg up -C -r %s -q)" % ( + os.system("hg --cwd %s up -C -r %s -q" % ( filename, rev, )) @@ -1047,7 +1047,8 @@ class PyPIConfig(configparser.RawConfigParser): def open_with_auth(url, opener=urllib.request.urlopen): """Open a urllib2 request, handling HTTP authentication""" - scheme, netloc, path, params, query, frag = urllib.parse.urlparse(url) + parsed = urllib.parse.urlparse(url) + scheme, netloc, path, params, query, frag = parsed # Double scheme does not raise on Mac OS X as revealed by a # failing test. We would expect "nonnumeric port". Refs #20. @@ -1055,7 +1056,7 @@ def open_with_auth(url, opener=urllib.request.urlopen): raise http_client.InvalidURL("nonnumeric port: ''") if scheme in ('http', 'https'): - auth, host = urllib.parse.splituser(netloc) + auth, address = _splituser(netloc) else: auth = None @@ -1068,7 +1069,7 @@ def open_with_auth(url, opener=urllib.request.urlopen): if auth: auth = "Basic " + _encode_auth(auth) - parts = scheme, host, path, params, query, frag + parts = scheme, address, path, params, query, frag new_url = urllib.parse.urlunparse(parts) request = urllib.request.Request(new_url) request.add_header("Authorization", auth) @@ -1082,13 +1083,20 @@ def open_with_auth(url, opener=urllib.request.urlopen): # Put authentication info back into request URL if same host, # so that links found on the page will work s2, h2, path2, param2, query2, frag2 = urllib.parse.urlparse(fp.url) - if s2 == scheme and h2 == host: + if s2 == scheme and h2 == address: parts = s2, netloc, path2, param2, query2, frag2 fp.url = urllib.parse.urlunparse(parts) return fp +# copy of urllib.parse._splituser from Python 3.8 +def _splituser(host): + """splituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.""" + user, delim, host = host.rpartition('@') + return (user if delim else None), host + + # adding a timeout to avoid freezing package_index open_with_auth = socket_timeout(_SOCKET_TIMEOUT)(open_with_auth) diff --git a/env/lib/python3.7/site-packages/setuptools/pep425tags.py b/env/lib/python3.7/site-packages/setuptools/pep425tags.py index 8bf4277..48745a2 100644 --- a/env/lib/python3.7/site-packages/setuptools/pep425tags.py +++ b/env/lib/python3.7/site-packages/setuptools/pep425tags.py @@ -161,7 +161,7 @@ def is_manylinux1_compatible(): def get_darwin_arches(major, minor, machine): """Return a list of supported arches (including group arches) for - the given major, minor and machine architecture of an macOS machine. + the given major, minor and machine architecture of a macOS machine. """ arches = [] diff --git a/env/lib/python3.7/site-packages/setuptools/py31compat.py b/env/lib/python3.7/site-packages/setuptools/py31compat.py index 1a0705e..e1da7ee 100644 --- a/env/lib/python3.7/site-packages/setuptools/py31compat.py +++ b/env/lib/python3.7/site-packages/setuptools/py31compat.py @@ -17,9 +17,9 @@ except ImportError: errors on deletion. """ - def __init__(self): + def __init__(self, **kwargs): self.name = None # Handle mkdtemp raising an exception - self.name = tempfile.mkdtemp() + self.name = tempfile.mkdtemp(**kwargs) def __enter__(self): return self.name diff --git a/env/lib/python3.7/site-packages/setuptools/py36compat.py b/env/lib/python3.7/site-packages/setuptools/py36compat.py deleted file mode 100644 index f527969..0000000 --- a/env/lib/python3.7/site-packages/setuptools/py36compat.py +++ /dev/null @@ -1,82 +0,0 @@ -import sys -from distutils.errors import DistutilsOptionError -from distutils.util import strtobool -from distutils.debug import DEBUG - - -class Distribution_parse_config_files: - """ - Mix-in providing forward-compatibility for functionality to be - included by default on Python 3.7. - - Do not edit the code in this class except to update functionality - as implemented in distutils. - """ - def parse_config_files(self, filenames=None): - from configparser import ConfigParser - - # Ignore install directory options if we have a venv - if sys.prefix != sys.base_prefix: - ignore_options = [ - 'install-base', 'install-platbase', 'install-lib', - 'install-platlib', 'install-purelib', 'install-headers', - 'install-scripts', 'install-data', 'prefix', 'exec-prefix', - 'home', 'user', 'root'] - else: - ignore_options = [] - - ignore_options = frozenset(ignore_options) - - if filenames is None: - filenames = self.find_config_files() - - if DEBUG: - self.announce("Distribution.parse_config_files():") - - parser = ConfigParser(interpolation=None) - for filename in filenames: - if DEBUG: - self.announce(" reading %s" % filename) - parser.read(filename) - for section in parser.sections(): - options = parser.options(section) - opt_dict = self.get_option_dict(section) - - for opt in options: - if opt != '__name__' and opt not in ignore_options: - val = parser.get(section,opt) - opt = opt.replace('-', '_') - opt_dict[opt] = (filename, val) - - # Make the ConfigParser forget everything (so we retain - # the original filenames that options come from) - parser.__init__() - - # If there was a "global" section in the config file, use it - # to set Distribution options. - - if 'global' in self.command_options: - for (opt, (src, val)) in self.command_options['global'].items(): - alias = self.negative_opt.get(opt) - try: - if alias: - setattr(self, alias, not strtobool(val)) - elif opt in ('verbose', 'dry_run'): # ugh! - setattr(self, opt, strtobool(val)) - else: - setattr(self, opt, val) - except ValueError as msg: - raise DistutilsOptionError(msg) - - -if sys.version_info < (3,): - # Python 2 behavior is sufficient - class Distribution_parse_config_files: - pass - - -if False: - # When updated behavior is available upstream, - # disable override here. - class Distribution_parse_config_files: - pass diff --git a/env/lib/python3.7/site-packages/setuptools/ssl_support.py b/env/lib/python3.7/site-packages/setuptools/ssl_support.py index 6362f1f..226db69 100644 --- a/env/lib/python3.7/site-packages/setuptools/ssl_support.py +++ b/env/lib/python3.7/site-packages/setuptools/ssl_support.py @@ -59,7 +59,7 @@ if not match_hostname: def _dnsname_match(dn, hostname, max_wildcards=1): """Matching according to RFC 6125, section 6.4.3 - http://tools.ietf.org/html/rfc6125#section-6.4.3 + https://tools.ietf.org/html/rfc6125#section-6.4.3 """ pats = [] if not dn: diff --git a/env/lib/python3.7/site-packages/setuptools/wheel.py b/env/lib/python3.7/site-packages/setuptools/wheel.py index 95a794a..e11f0a1 100644 --- a/env/lib/python3.7/site-packages/setuptools/wheel.py +++ b/env/lib/python3.7/site-packages/setuptools/wheel.py @@ -8,10 +8,11 @@ import posixpath import re import zipfile -from pkg_resources import Distribution, PathMetadata, parse_version +import pkg_resources +import setuptools +from pkg_resources import parse_version from setuptools.extern.packaging.utils import canonicalize_name from setuptools.extern.six import PY3 -from setuptools import Distribution as SetuptoolsDistribution from setuptools import pep425tags from setuptools.command.egg_info import write_requirements @@ -79,7 +80,7 @@ class Wheel: return next((True for t in self.tags() if t in supported_tags), False) def egg_name(self): - return Distribution( + return pkg_resources.Distribution( project_name=self.project_name, version=self.version, platform=(None if self.platform == 'any' else get_platform()), ).egg_name() + '.egg' @@ -130,9 +131,9 @@ class Wheel: zf.extractall(destination_eggdir) # Convert metadata. dist_info = os.path.join(destination_eggdir, dist_info) - dist = Distribution.from_location( + dist = pkg_resources.Distribution.from_location( destination_eggdir, dist_info, - metadata=PathMetadata(destination_eggdir, dist_info), + metadata=pkg_resources.PathMetadata(destination_eggdir, dist_info), ) # Note: Evaluate and strip markers now, @@ -155,7 +156,7 @@ class Wheel: os.path.join(egg_info, 'METADATA'), os.path.join(egg_info, 'PKG-INFO'), ) - setup_dist = SetuptoolsDistribution( + setup_dist = setuptools.Distribution( attrs=dict( install_requires=install_requires, extras_require=extras_require, diff --git a/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/INSTALLER b/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/INSTALLER deleted file mode 100644 index a1b589e..0000000 --- a/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/INSTALLER +++ /dev/null @@ -1 +0,0 @@ -pip diff --git a/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/LICENSE.txt b/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/LICENSE.txt deleted file mode 100644 index c3441e6..0000000 --- a/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -"wheel" copyright (c) 2012-2014 Daniel Holth and -contributors. - -The MIT License - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/METADATA b/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/METADATA deleted file mode 100644 index cef8071..0000000 --- a/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/METADATA +++ /dev/null @@ -1,60 +0,0 @@ -Metadata-Version: 2.1 -Name: wheel -Version: 0.32.3 -Summary: A built-package format for Python. -Home-page: https://github.com/pypa/wheel -Author: Daniel Holth -Author-email: dholth@fastmail.fm -Maintainer: Alex Grönholm -Maintainer-email: alex.gronholm@nextday.fi -License: MIT -Project-URL: Issue Tracker, https://github.com/pypa/wheel/issues -Project-URL: Documentation, https://wheel.readthedocs.io/ -Project-URL: Changelog, https://wheel.readthedocs.io/en/stable/news.html -Keywords: wheel,packaging -Platform: UNKNOWN -Classifier: Development Status :: 5 - Production/Stable -Classifier: Intended Audience :: Developers -Classifier: Topic :: System :: Archiving :: Packaging -Classifier: License :: OSI Approved :: MIT License -Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.4 -Classifier: Programming Language :: Python :: 3.5 -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 -Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* -Provides-Extra: test -Requires-Dist: pytest (>=3.0.0) ; extra == 'test' -Requires-Dist: pytest-cov ; extra == 'test' - -wheel -===== - -This library is the reference implementation of the Python wheel packaging -standard, as defined in `PEP 427`_. - -It has two different roles: - -#. A setuptools_ extension for building wheels that provides the - ``bdist_wheel`` setuptools command -#. A command line tool for working with wheel files - -It should be noted that wheel is **not** intended to be used as a library, and -as such there is no stable, public API. - -.. _PEP 427: https://www.python.org/dev/peps/pep-0427/ -.. _setuptools: https://pypi.org/project/setuptools/ - - -Code of Conduct ---------------- - -Everyone interacting in the wheel project's codebases, issue trackers, chat -rooms, and mailing lists is expected to follow the `PyPA Code of Conduct`_. - -.. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/ - - diff --git a/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/RECORD b/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/RECORD deleted file mode 100644 index b535e48..0000000 --- a/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/RECORD +++ /dev/null @@ -1,34 +0,0 @@ -wheel/__init__.py,sha256=AgAP7YAmbZj84_nCH9za8R0UXHylXdfKNSyg5g1xLZ4,96 -wheel/__main__.py,sha256=lF-YLO4hdQmoWuh4eWZd8YL1U95RSdm76sNLBXa0vjE,417 -wheel/bdist_wheel.py,sha256=0hM63ZD01ATEMRAr6t0mbmhf2y8pbRkMnWGioed9n-o,14627 -wheel/metadata.py,sha256=a3QgT8C4QOvrS-8RFdNCn7XWUUqEZpcHelmI8XLTDnY,4691 -wheel/pep425tags.py,sha256=Jdjbnq17kqwPRKJCMb2E1VccNgnC3H6iQL7VGaxkPao,5908 -wheel/pkginfo.py,sha256=GR76kupQzn1x9sKDaXuE6B6FsZ4OkfRtG7pndlXPvQ4,1257 -wheel/util.py,sha256=bYkw5oMccfazVCoYQwKkkemoVyMAFoR34mmKBx8R1NI,859 -wheel/wheelfile.py,sha256=mxv8kcRvXMME4xQstpiiQv59bHc42edS6z8kDAco6iw,6990 -wheel/cli/__init__.py,sha256=DsCXkrL_jsTHoR0nhmcwkrlNdkaXw0uV0NL-yYoYQuU,2461 -wheel/cli/convert.py,sha256=me0l6G4gSw-EBVhzjSr7yWYWBp9spMz7mnXlyJTiXso,9497 -wheel/cli/install.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 -wheel/cli/pack.py,sha256=RViq4mnUk8s7R5kcrgX0XntX2zalDTeoTSBzLk31SaI,2145 -wheel/cli/unpack.py,sha256=0VWzT7U_xyenTPwEVavxqvdee93GPvAFHnR3Uu91aRc,673 -wheel-0.32.3.dist-info/LICENSE.txt,sha256=zKniDGrx_Pv2lAjzd3aShsvuvN7TNhAMm0o_NfvmNeQ,1125 -wheel-0.32.3.dist-info/METADATA,sha256=1gweIMsoaCjJWccLOuQJCZqj_cWYVM80LkUQosJ4wC8,2082 -wheel-0.32.3.dist-info/WHEEL,sha256=_wJFdOYk7i3xxT8ElOkUJvOdOvfNGbR9g-bf6UQT6sU,110 -wheel-0.32.3.dist-info/entry_points.txt,sha256=N8HbYFST3yrNQYeB2wXWBEPUhFsEtKNRPaCFGJPyqyc,108 -wheel-0.32.3.dist-info/top_level.txt,sha256=HxSBIbgEstMPe4eFawhA66Mq-QYHMopXVoAncfjb_1c,6 -wheel-0.32.3.dist-info/RECORD,, -../../../bin/wheel,sha256=C2tTqyXPXEVjwHG2wEstUaTSZQqHNo2IvGKL_5xerTw,254 -wheel-0.32.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 -wheel/__pycache__/wheelfile.cpython-37.pyc,, -wheel/__pycache__/util.cpython-37.pyc,, -wheel/__pycache__/pkginfo.cpython-37.pyc,, -wheel/__pycache__/pep425tags.cpython-37.pyc,, -wheel/__pycache__/metadata.cpython-37.pyc,, -wheel/__pycache__/bdist_wheel.cpython-37.pyc,, -wheel/__pycache__/__main__.cpython-37.pyc,, -wheel/__pycache__/__init__.cpython-37.pyc,, -wheel/cli/__pycache__/unpack.cpython-37.pyc,, -wheel/cli/__pycache__/pack.cpython-37.pyc,, -wheel/cli/__pycache__/install.cpython-37.pyc,, -wheel/cli/__pycache__/convert.cpython-37.pyc,, -wheel/cli/__pycache__/__init__.cpython-37.pyc,, diff --git a/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/WHEEL b/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/WHEEL deleted file mode 100644 index c4bde30..0000000 --- a/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/WHEEL +++ /dev/null @@ -1,6 +0,0 @@ -Wheel-Version: 1.0 -Generator: bdist_wheel (0.32.3) -Root-Is-Purelib: true -Tag: py2-none-any -Tag: py3-none-any - diff --git a/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/entry_points.txt b/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/entry_points.txt deleted file mode 100644 index b27acad..0000000 --- a/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/entry_points.txt +++ /dev/null @@ -1,6 +0,0 @@ -[console_scripts] -wheel = wheel.cli:main - -[distutils.commands] -bdist_wheel = wheel.bdist_wheel:bdist_wheel - diff --git a/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/top_level.txt b/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/top_level.txt deleted file mode 100644 index 2309722..0000000 --- a/env/lib/python3.7/site-packages/wheel-0.32.3.dist-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -wheel diff --git a/env/lib/python3.7/site-packages/wheel/__init__.py b/env/lib/python3.7/site-packages/wheel/__init__.py index 6938633..0f8ca70 100644 --- a/env/lib/python3.7/site-packages/wheel/__init__.py +++ b/env/lib/python3.7/site-packages/wheel/__init__.py @@ -1,2 +1,2 @@ # __variables__ with double-quoted values will be available in setup.py: -__version__ = "0.32.3" +__version__ = "0.33.4" diff --git a/env/lib/python3.7/site-packages/wheel/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/wheel/__pycache__/__init__.cpython-37.pyc index ada2e52..f342b64 100644 Binary files a/env/lib/python3.7/site-packages/wheel/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/wheel/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/wheel/__pycache__/__main__.cpython-37.pyc b/env/lib/python3.7/site-packages/wheel/__pycache__/__main__.cpython-37.pyc index cc9b760..504fe97 100644 Binary files a/env/lib/python3.7/site-packages/wheel/__pycache__/__main__.cpython-37.pyc and b/env/lib/python3.7/site-packages/wheel/__pycache__/__main__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/wheel/__pycache__/bdist_wheel.cpython-37.pyc b/env/lib/python3.7/site-packages/wheel/__pycache__/bdist_wheel.cpython-37.pyc index 6fbc889..44680ff 100644 Binary files a/env/lib/python3.7/site-packages/wheel/__pycache__/bdist_wheel.cpython-37.pyc and b/env/lib/python3.7/site-packages/wheel/__pycache__/bdist_wheel.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/wheel/__pycache__/metadata.cpython-37.pyc b/env/lib/python3.7/site-packages/wheel/__pycache__/metadata.cpython-37.pyc index 90e9a6a..cc2b309 100644 Binary files a/env/lib/python3.7/site-packages/wheel/__pycache__/metadata.cpython-37.pyc and b/env/lib/python3.7/site-packages/wheel/__pycache__/metadata.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/wheel/__pycache__/pep425tags.cpython-37.pyc b/env/lib/python3.7/site-packages/wheel/__pycache__/pep425tags.cpython-37.pyc index e5339c7..5c79286 100644 Binary files a/env/lib/python3.7/site-packages/wheel/__pycache__/pep425tags.cpython-37.pyc and b/env/lib/python3.7/site-packages/wheel/__pycache__/pep425tags.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/wheel/__pycache__/pkginfo.cpython-37.pyc b/env/lib/python3.7/site-packages/wheel/__pycache__/pkginfo.cpython-37.pyc index 5311d5a..19278d3 100644 Binary files a/env/lib/python3.7/site-packages/wheel/__pycache__/pkginfo.cpython-37.pyc and b/env/lib/python3.7/site-packages/wheel/__pycache__/pkginfo.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/wheel/__pycache__/util.cpython-37.pyc b/env/lib/python3.7/site-packages/wheel/__pycache__/util.cpython-37.pyc index ce1530e..31ba8b7 100644 Binary files a/env/lib/python3.7/site-packages/wheel/__pycache__/util.cpython-37.pyc and b/env/lib/python3.7/site-packages/wheel/__pycache__/util.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/wheel/__pycache__/wheelfile.cpython-37.pyc b/env/lib/python3.7/site-packages/wheel/__pycache__/wheelfile.cpython-37.pyc index fb97741..ca28521 100644 Binary files a/env/lib/python3.7/site-packages/wheel/__pycache__/wheelfile.cpython-37.pyc and b/env/lib/python3.7/site-packages/wheel/__pycache__/wheelfile.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/wheel/bdist_wheel.py b/env/lib/python3.7/site-packages/wheel/bdist_wheel.py index 5796970..c79307b 100644 --- a/env/lib/python3.7/site-packages/wheel/bdist_wheel.py +++ b/env/lib/python3.7/site-packages/wheel/bdist_wheel.py @@ -57,7 +57,7 @@ class bdist_wheel(Command): ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), ('relative', None, - "build the archive using relative paths" + "build the archive using relative paths " "(default: false)"), ('owner=', 'u', "Owner name used when creating a tar file" @@ -183,6 +183,10 @@ class bdist_wheel(Command): def run(self): build_scripts = self.reinitialize_command('build_scripts') build_scripts.executable = 'python' + build_scripts.force = True + + build_ext = self.reinitialize_command('build_ext') + build_ext.inplace = False if not self.skip_build: self.run_command('build') diff --git a/env/lib/python3.7/site-packages/wheel/cli/__init__.py b/env/lib/python3.7/site-packages/wheel/cli/__init__.py index 635f40f..95740bf 100644 --- a/env/lib/python3.7/site-packages/wheel/cli/__init__.py +++ b/env/lib/python3.7/site-packages/wheel/cli/__init__.py @@ -27,7 +27,7 @@ def unpack_f(args): def pack_f(args): from .pack import pack - pack(args.directory, args.dest_dir) + pack(args.directory, args.dest_dir, args.build_number) def convert_f(args): @@ -54,6 +54,7 @@ def parser(): repack_parser.add_argument('directory', help='Root directory of the unpacked wheel') repack_parser.add_argument('--dest-dir', '-d', default=os.path.curdir, help="Directory to store the wheel (default %(default)s)") + repack_parser.add_argument('--build-number', help="Build tag to use in the wheel name") repack_parser.set_defaults(func=pack_f) convert_parser = s.add_parser('convert', help='Convert egg or wininst to wheel') diff --git a/env/lib/python3.7/site-packages/wheel/cli/__pycache__/__init__.cpython-37.pyc b/env/lib/python3.7/site-packages/wheel/cli/__pycache__/__init__.cpython-37.pyc index 7ea10d0..9666108 100644 Binary files a/env/lib/python3.7/site-packages/wheel/cli/__pycache__/__init__.cpython-37.pyc and b/env/lib/python3.7/site-packages/wheel/cli/__pycache__/__init__.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/wheel/cli/__pycache__/convert.cpython-37.pyc b/env/lib/python3.7/site-packages/wheel/cli/__pycache__/convert.cpython-37.pyc index b949203..6954188 100644 Binary files a/env/lib/python3.7/site-packages/wheel/cli/__pycache__/convert.cpython-37.pyc and b/env/lib/python3.7/site-packages/wheel/cli/__pycache__/convert.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/wheel/cli/__pycache__/install.cpython-37.pyc b/env/lib/python3.7/site-packages/wheel/cli/__pycache__/install.cpython-37.pyc deleted file mode 100644 index 57f8ba0..0000000 Binary files a/env/lib/python3.7/site-packages/wheel/cli/__pycache__/install.cpython-37.pyc and /dev/null differ diff --git a/env/lib/python3.7/site-packages/wheel/cli/__pycache__/pack.cpython-37.pyc b/env/lib/python3.7/site-packages/wheel/cli/__pycache__/pack.cpython-37.pyc index f58b066..768bc82 100644 Binary files a/env/lib/python3.7/site-packages/wheel/cli/__pycache__/pack.cpython-37.pyc and b/env/lib/python3.7/site-packages/wheel/cli/__pycache__/pack.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/wheel/cli/__pycache__/unpack.cpython-37.pyc b/env/lib/python3.7/site-packages/wheel/cli/__pycache__/unpack.cpython-37.pyc index 59fa601..d3cf0f0 100644 Binary files a/env/lib/python3.7/site-packages/wheel/cli/__pycache__/unpack.cpython-37.pyc and b/env/lib/python3.7/site-packages/wheel/cli/__pycache__/unpack.cpython-37.pyc differ diff --git a/env/lib/python3.7/site-packages/wheel/cli/pack.py b/env/lib/python3.7/site-packages/wheel/cli/pack.py index 45c70f2..af6e81c 100644 --- a/env/lib/python3.7/site-packages/wheel/cli/pack.py +++ b/env/lib/python3.7/site-packages/wheel/cli/pack.py @@ -10,7 +10,7 @@ from wheel.wheelfile import WheelFile DIST_INFO_RE = re.compile(r"^(?P(?P.+?)-(?P\d.*?))\.dist-info$") -def pack(directory, dest_dir): +def pack(directory, dest_dir, build_number): """Repack a previously unpacked wheel directory into a new wheel file. The .dist-info/WHEEL file must contain one or more tags so that the target @@ -31,6 +31,10 @@ def pack(directory, dest_dir): dist_info_dir = dist_info_dirs[0] name_version = DIST_INFO_RE.match(dist_info_dir).group('namever') + # Add the build number if specific + if build_number: + name_version += '-' + build_number + # Read the tags from .dist-info/WHEEL with open(os.path.join(directory, dist_info_dir, 'WHEEL')) as f: tags = [line.split(' ')[1].rstrip() for line in f if line.startswith('Tag: ')] diff --git a/env/lib/python3.7/site-packages/wheel/metadata.py b/env/lib/python3.7/site-packages/wheel/metadata.py index 3edf6ae..ab0c07e 100644 --- a/env/lib/python3.7/site-packages/wheel/metadata.py +++ b/env/lib/python3.7/site-packages/wheel/metadata.py @@ -34,7 +34,7 @@ def convert_requirements(requirements): for req in requirements: parsed_requirement = pkg_resources.Requirement.parse(req) spec = requires_to_requires_dist(parsed_requirement) - extras = ",".join(parsed_requirement.extras) + extras = ",".join(sorted(parsed_requirement.extras)) if extras: extras = "[%s]" % extras yield (parsed_requirement.project_name + extras + spec) diff --git a/env/lib/python3.7/site-packages/wheel/util.py b/env/lib/python3.7/site-packages/wheel/util.py index be0aa9b..0afb54a 100644 --- a/env/lib/python3.7/site-packages/wheel/util.py +++ b/env/lib/python3.7/site-packages/wheel/util.py @@ -1,10 +1,13 @@ import base64 +import io import sys if sys.version_info[0] < 3: text_type = unicode # noqa: F821 + StringIO = io.BytesIO + def native(s, encoding='utf-8'): if isinstance(s, unicode): return s.encode(encoding) @@ -12,6 +15,8 @@ if sys.version_info[0] < 3: else: text_type = str + StringIO = io.StringIO + def native(s, encoding='utf-8'): if isinstance(s, bytes): return s.decode(encoding) diff --git a/env/lib/python3.7/site-packages/wheel/wheelfile.py b/env/lib/python3.7/site-packages/wheel/wheelfile.py index 635aa77..ddf8509 100644 --- a/env/lib/python3.7/site-packages/wheel/wheelfile.py +++ b/env/lib/python3.7/site-packages/wheel/wheelfile.py @@ -1,15 +1,17 @@ from __future__ import print_function +import csv import hashlib import os.path import re +import stat import time from collections import OrderedDict from distutils import log as logger from zipfile import ZIP_DEFLATED, ZipInfo, ZipFile from wheel.cli import WheelError -from wheel.util import urlsafe_b64decode, as_unicode, native, urlsafe_b64encode, as_bytes +from wheel.util import urlsafe_b64decode, as_unicode, native, urlsafe_b64encode, as_bytes, StringIO # Non-greedy matching of an optional build number may be too clever (more # invalid wheel filenames will match). Separate regex for .dist-info? @@ -131,7 +133,7 @@ class WheelFile(ZipFile): data = f.read() zinfo = ZipInfo(arcname or filename, date_time=get_zipinfo_datetime(st.st_mtime)) - zinfo.external_attr = st.st_mode << 16 + zinfo.external_attr = (stat.S_IMODE(st.st_mode) | stat.S_IFMT(st.st_mode)) << 16 zinfo.compress_type = ZIP_DEFLATED self.writestr(zinfo, data, compress_type) @@ -148,13 +150,20 @@ class WheelFile(ZipFile): def close(self): # Write RECORD if self.fp is not None and self.mode == 'w' and self._file_hashes: - content = '\n'.join('{},{}={},{}'.format(fname, algorithm, hash_, - self._file_sizes[fname]) - for fname, (algorithm, hash_) in self._file_hashes.items()) - content += '\n{},,\n'.format(self.record_path) + data = StringIO() + writer = csv.writer(data, delimiter=',', quotechar='"', lineterminator='\n') + writer.writerows(( + ( + fname, + algorithm + "=" + hash_, + self._file_sizes[fname] + ) + for fname, (algorithm, hash_) in self._file_hashes.items() + )) + writer.writerow((format(self.record_path), "", "")) zinfo = ZipInfo(native(self.record_path), date_time=get_zipinfo_datetime()) zinfo.compress_type = ZIP_DEFLATED zinfo.external_attr = 0o664 << 16 - self.writestr(zinfo, as_bytes(content)) + self.writestr(zinfo, as_bytes(data.getvalue())) ZipFile.close(self) diff --git a/env/lib/python3.7/site.py b/env/lib/python3.7/site.py index 7969769..dc9887a 100644 --- a/env/lib/python3.7/site.py +++ b/env/lib/python3.7/site.py @@ -63,8 +63,9 @@ ImportError exception, it is silently ignored. """ -import sys import os +import sys + try: import __builtin__ as builtins except ImportError: @@ -83,33 +84,34 @@ ENABLE_USER_SITE = None USER_SITE = None USER_BASE = None -_is_64bit = (getattr(sys, 'maxsize', None) or getattr(sys, 'maxint')) > 2**32 -_is_pypy = hasattr(sys, 'pypy_version_info') -_is_jython = sys.platform[:4] == 'java' +_is_64bit = (getattr(sys, "maxsize", None) or getattr(sys, "maxint")) > 2 ** 32 +_is_pypy = hasattr(sys, "pypy_version_info") +_is_jython = sys.platform[:4] == "java" if _is_jython: ModuleType = type(os) + def makepath(*paths): dir = os.path.join(*paths) - if _is_jython and (dir == '__classpath__' or - dir.startswith('__pyclasspath__')): + if _is_jython and (dir == "__classpath__" or dir.startswith("__pyclasspath__")): return dir, dir dir = os.path.abspath(dir) return dir, os.path.normcase(dir) + def abs__file__(): """Set all module' __file__ attribute to an absolute path""" for m in sys.modules.values(): - if ((_is_jython and not isinstance(m, ModuleType)) or - hasattr(m, '__loader__')): + if (_is_jython and not isinstance(m, ModuleType)) or hasattr(m, "__loader__"): # only modules need the abspath in Jython. and don't mess # with a PEP 302-supplied __file__ continue - f = getattr(m, '__file__', None) + f = getattr(m, "__file__", None) if f is None: continue m.__file__ = os.path.abspath(f) + def removeduppaths(): """ Remove duplicate entries from sys.path along with making them absolute""" @@ -128,18 +130,21 @@ def removeduppaths(): sys.path[:] = L return known_paths + # XXX This should not be part of site.py, since it is needed even when # using the -S option for Python. See http://www.python.org/sf/586680 def addbuilddir(): """Append ./build/lib. in case we're running in the build dir (especially for Guido :-)""" from distutils.util import get_platform - s = "build/lib.%s-%.3s" % (get_platform(), sys.version) - if hasattr(sys, 'gettotalrefcount'): - s += '-pydebug' + + s = "build/lib.{}-{:.3}".format(get_platform(), sys.version) + if hasattr(sys, "gettotalrefcount"): + s += "-pydebug" s = os.path.join(os.path.dirname(sys.path[-1]), s) sys.path.append(s) + def _init_pathinfo(): """Return a set containing all existing directory entries from sys.path""" d = set() @@ -152,6 +157,7 @@ def _init_pathinfo(): continue return d + def addpackage(sitedir, name, known_paths): """Add a new path to known_paths by combining sitedir and 'name' or execute sitedir if it starts with 'import'""" @@ -162,7 +168,7 @@ def addpackage(sitedir, name, known_paths): reset = 0 fullname = os.path.join(sitedir, name) try: - f = open(fullname, "rU") + f = open(fullname, "r") except IOError: return try: @@ -183,6 +189,7 @@ def addpackage(sitedir, name, known_paths): known_paths = None return known_paths + def addsitedir(sitedir, known_paths=None): """Add 'sitedir' argument to sys.path if missing and handle .pth files in 'sitedir'""" @@ -193,7 +200,7 @@ def addsitedir(sitedir, known_paths=None): reset = 0 sitedir, sitedircase = makepath(sitedir) if not sitedircase in known_paths: - sys.path.append(sitedir) # Add path component + sys.path.append(sitedir) # Add path component try: names = os.listdir(sitedir) except os.error: @@ -206,6 +213,7 @@ def addsitedir(sitedir, known_paths=None): known_paths = None return known_paths + def addsitepackages(known_paths, sys_prefix=sys.prefix, exec_prefix=sys.exec_prefix): """Add site-packages (and possibly site-python) to sys.path""" prefixes = [os.path.join(sys_prefix, "local"), sys_prefix] @@ -214,31 +222,32 @@ def addsitepackages(known_paths, sys_prefix=sys.prefix, exec_prefix=sys.exec_pre for prefix in prefixes: if prefix: - if sys.platform in ('os2emx', 'riscos') or _is_jython: + if sys.platform in ("os2emx", "riscos") or _is_jython: sitedirs = [os.path.join(prefix, "Lib", "site-packages")] elif _is_pypy: - sitedirs = [os.path.join(prefix, 'site-packages')] - elif sys.platform == 'darwin' and prefix == sys_prefix: + sitedirs = [os.path.join(prefix, "site-packages")] + elif sys.platform == "darwin" and prefix == sys_prefix: - if prefix.startswith("/System/Library/Frameworks/"): # Apple's Python + if prefix.startswith("/System/Library/Frameworks/"): # Apple's Python - sitedirs = [os.path.join("/Library/Python", sys.version[:3], "site-packages"), - os.path.join(prefix, "Extras", "lib", "python")] + sitedirs = [ + os.path.join("/Library/Python", sys.version[:3], "site-packages"), + os.path.join(prefix, "Extras", "lib", "python"), + ] - else: # any other Python distros on OSX work this way - sitedirs = [os.path.join(prefix, "lib", - "python" + sys.version[:3], "site-packages")] + else: # any other Python distros on OSX work this way + sitedirs = [os.path.join(prefix, "lib", "python" + sys.version[:3], "site-packages")] - elif os.sep == '/': - sitedirs = [os.path.join(prefix, - "lib", - "python" + sys.version[:3], - "site-packages"), - os.path.join(prefix, "lib", "site-python"), - os.path.join(prefix, "python" + sys.version[:3], "lib-dynload")] + elif os.sep == "/": + sitedirs = [ + os.path.join(prefix, "lib", "python" + sys.version[:3], "site-packages"), + os.path.join(prefix, "lib", "site-python"), + os.path.join(prefix, "python" + sys.version[:3], "lib-dynload"), + ] lib64_dir = os.path.join(prefix, "lib64", "python" + sys.version[:3], "site-packages") - if (os.path.exists(lib64_dir) and - os.path.realpath(lib64_dir) not in [os.path.realpath(p) for p in sitedirs]): + if os.path.exists(lib64_dir) and os.path.realpath(lib64_dir) not in [ + os.path.realpath(p) for p in sitedirs + ]: if _is_64bit: sitedirs.insert(0, lib64_dir) else: @@ -246,42 +255,32 @@ def addsitepackages(known_paths, sys_prefix=sys.prefix, exec_prefix=sys.exec_pre try: # sys.getobjects only available in --with-pydebug build sys.getobjects - sitedirs.insert(0, os.path.join(sitedirs[0], 'debug')) + sitedirs.insert(0, os.path.join(sitedirs[0], "debug")) except AttributeError: pass # Debian-specific dist-packages directories: - sitedirs.append(os.path.join(prefix, "local/lib", - "python" + sys.version[:3], - "dist-packages")) - if sys.version[0] == '2': - sitedirs.append(os.path.join(prefix, "lib", - "python" + sys.version[:3], - "dist-packages")) + sitedirs.append(os.path.join(prefix, "local/lib", "python" + sys.version[:3], "dist-packages")) + if sys.version[0] == "2": + sitedirs.append(os.path.join(prefix, "lib", "python" + sys.version[:3], "dist-packages")) else: - sitedirs.append(os.path.join(prefix, "lib", - "python" + sys.version[0], - "dist-packages")) + sitedirs.append(os.path.join(prefix, "lib", "python" + sys.version[0], "dist-packages")) sitedirs.append(os.path.join(prefix, "lib", "dist-python")) else: sitedirs = [prefix, os.path.join(prefix, "lib", "site-packages")] - if sys.platform == 'darwin': + if sys.platform == "darwin": # for framework builds *only* we add the standard Apple # locations. Currently only per-user, but /Library and # /Network/Library could be added too - if 'Python.framework' in prefix: - home = os.environ.get('HOME') + if "Python.framework" in prefix: + home = os.environ.get("HOME") if home: - sitedirs.append( - os.path.join(home, - 'Library', - 'Python', - sys.version[:3], - 'site-packages')) + sitedirs.append(os.path.join(home, "Library", "Python", sys.version[:3], "site-packages")) for sitedir in sitedirs: if os.path.isdir(sitedir): addsitedir(sitedir, known_paths) return None + def check_enableusersite(): """Check if user site directory is safe for inclusion @@ -292,7 +291,7 @@ def check_enableusersite(): False: Disabled by user (command line option) True: Safe and enabled """ - if hasattr(sys, 'flags') and getattr(sys.flags, 'no_user_site', False): + if hasattr(sys, "flags") and getattr(sys.flags, "no_user_site", False): return False if hasattr(os, "getuid") and hasattr(os, "geteuid"): @@ -306,6 +305,7 @@ def check_enableusersite(): return True + def addusersitepackages(known_paths): """Add a per user site-package to sys.path @@ -324,7 +324,7 @@ def addusersitepackages(known_paths): def joinuser(*args): return os.path.expanduser(os.path.join(*args)) - #if sys.platform in ('os2emx', 'riscos'): + # if sys.platform in ('os2emx', 'riscos'): # # Don't know what to put here # USER_BASE = '' # USER_SITE = '' @@ -334,31 +334,24 @@ def addusersitepackages(known_paths): USER_BASE = env_base else: USER_BASE = joinuser(base, "Python") - USER_SITE = os.path.join(USER_BASE, - "Python" + sys.version[0] + sys.version[2], - "site-packages") + USER_SITE = os.path.join(USER_BASE, "Python" + sys.version[0] + sys.version[2], "site-packages") else: if env_base: USER_BASE = env_base else: USER_BASE = joinuser("~", ".local") - USER_SITE = os.path.join(USER_BASE, "lib", - "python" + sys.version[:3], - "site-packages") + USER_SITE = os.path.join(USER_BASE, "lib", "python" + sys.version[:3], "site-packages") if ENABLE_USER_SITE and os.path.isdir(USER_SITE): addsitedir(USER_SITE, known_paths) if ENABLE_USER_SITE: for dist_libdir in ("lib", "local/lib"): - user_site = os.path.join(USER_BASE, dist_libdir, - "python" + sys.version[:3], - "dist-packages") + user_site = os.path.join(USER_BASE, dist_libdir, "python" + sys.version[:3], "dist-packages") if os.path.isdir(user_site): addsitedir(user_site, known_paths) return known_paths - def setBEGINLIBPATH(): """The OS/2 EMX port has optional extension modules that do double duty as DLLs (and must use the .DLL file extension) for other extensions. @@ -368,12 +361,12 @@ def setBEGINLIBPATH(): """ dllpath = os.path.join(sys.prefix, "Lib", "lib-dynload") - libpath = os.environ['BEGINLIBPATH'].split(';') + libpath = os.environ["BEGINLIBPATH"].split(";") if libpath[-1]: libpath.append(dllpath) else: libpath[-1] = dllpath - os.environ['BEGINLIBPATH'] = ';'.join(libpath) + os.environ["BEGINLIBPATH"] = ";".join(libpath) def setquit(): @@ -381,18 +374,20 @@ def setquit(): These are simply strings that display a hint on how to exit. """ - if os.sep == ':': - eof = 'Cmd-Q' - elif os.sep == '\\': - eof = 'Ctrl-Z plus Return' + if os.sep == ":": + eof = "Cmd-Q" + elif os.sep == "\\": + eof = "Ctrl-Z plus Return" else: - eof = 'Ctrl-D (i.e. EOF)' + eof = "Ctrl-D (i.e. EOF)" class Quitter(object): def __init__(self, name): self.name = name + def __repr__(self): - return 'Use %s() or %s to exit' % (self.name, eof) + return "Use {}() or {} to exit".format(self.name, eof) + def __call__(self, code=None): # Shells like IDLE catch the SystemExit, but listen when their # stdin wrapper is closed. @@ -401,8 +396,9 @@ def setquit(): except: pass raise SystemExit(code) - builtins.quit = Quitter('quit') - builtins.exit = Quitter('exit') + + builtins.quit = Quitter("quit") + builtins.exit = Quitter("exit") class _Printer(object): @@ -426,7 +422,7 @@ class _Printer(object): for filename in self.__files: filename = os.path.join(dir, filename) try: - fp = open(filename, "rU") + fp = open(filename, "r") data = fp.read() fp.close() break @@ -436,7 +432,7 @@ class _Printer(object): break if not data: data = self.__data - self.__lines = data.split('\n') + self.__lines = data.split("\n") self.__linecnt = len(self.__lines) def __repr__(self): @@ -444,11 +440,11 @@ class _Printer(object): if len(self.__lines) <= self.MAXLINES: return "\n".join(self.__lines) else: - return "Type %s() to see the full %s text" % ((self.__name,)*2) + return "Type %s() to see the full %s text" % ((self.__name,) * 2) def __call__(self): self.__setup() - prompt = 'Hit Return for more, or q (and Return) to quit: ' + prompt = "Hit Return for more, or q (and Return) to quit: " lineno = 0 while 1: try: @@ -464,31 +460,33 @@ class _Printer(object): key = raw_input(prompt) except NameError: key = input(prompt) - if key not in ('', 'q'): + if key not in ("", "q"): key = None - if key == 'q': + if key == "q": break + def setcopyright(): """Set 'copyright' and 'credits' in __builtin__""" builtins.copyright = _Printer("copyright", sys.copyright) if _is_jython: - builtins.credits = _Printer( - "credits", - "Jython is maintained by the Jython developers (www.jython.org).") + builtins.credits = _Printer("credits", "Jython is maintained by the Jython developers (www.jython.org).") elif _is_pypy: + builtins.credits = _Printer("credits", "PyPy is maintained by the PyPy developers: http://pypy.org/") + else: builtins.credits = _Printer( "credits", - "PyPy is maintained by the PyPy developers: http://pypy.org/") - else: - builtins.credits = _Printer("credits", """\ + """\ Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands - for supporting Python development. See www.python.org for more information.""") + for supporting Python development. See www.python.org for more information.""", + ) here = os.path.dirname(os.__file__) builtins.license = _Printer( - "license", "See http://www.python.org/%.3s/license.html" % sys.version, + "license", + "See http://www.python.org/%.3s/license.html" % sys.version, ["LICENSE.txt", "LICENSE"], - [os.path.join(here, os.pardir), here, os.curdir]) + [os.path.join(here, os.pardir), here, os.curdir], + ) class _Helper(object): @@ -498,38 +496,45 @@ class _Helper(object): """ def __repr__(self): - return "Type help() for interactive help, " \ - "or help(object) for help about object." + return "Type help() for interactive help, " "or help(object) for help about object." + def __call__(self, *args, **kwds): import pydoc + return pydoc.help(*args, **kwds) + def sethelper(): builtins.help = _Helper() + def aliasmbcs(): """On Windows, some default encodings are not provided by Python, while they are always available as "mbcs" in each locale. Make them usable by aliasing to "mbcs" in such a case.""" - if sys.platform == 'win32': + if sys.platform == "win32": import locale, codecs + enc = locale.getdefaultlocale()[1] - if enc.startswith('cp'): # "cp***" ? + if enc.startswith("cp"): # "cp***" ? try: codecs.lookup(enc) except LookupError: import encodings + encodings._cache[enc] = encodings._unknown - encodings.aliases.aliases[enc] = 'mbcs' + encodings.aliases.aliases[enc] = "mbcs" + def setencoding(): """Set the string encoding used by the Unicode implementation. The default is 'ascii', but if you're willing to experiment, you can change this.""" - encoding = "ascii" # Default value set by _PyUnicode_Init() + encoding = "ascii" # Default value set by _PyUnicode_Init() if 0: # Enable to support locale aware default string encodings. import locale + loc = locale.getdefaultlocale() if loc[1]: encoding = loc[1] @@ -539,7 +544,7 @@ def setencoding(): encoding = "undefined" if encoding != "ascii": # On Non-Unicode builds this will raise an AttributeError... - sys.setdefaultencoding(encoding) # Needs Python Unicode build ! + sys.setdefaultencoding(encoding) # Needs Python Unicode build ! def execsitecustomize(): @@ -549,41 +554,40 @@ def execsitecustomize(): except ImportError: pass + def virtual_install_main_packages(): - f = open(os.path.join(os.path.dirname(__file__), 'orig-prefix.txt')) + f = open(os.path.join(os.path.dirname(__file__), "orig-prefix.txt")) sys.real_prefix = f.read().strip() f.close() pos = 2 hardcoded_relative_dirs = [] - if sys.path[0] == '': + if sys.path[0] == "": pos += 1 if _is_jython: - paths = [os.path.join(sys.real_prefix, 'Lib')] + paths = [os.path.join(sys.real_prefix, "Lib")] elif _is_pypy: if sys.version_info > (3, 2): - cpyver = '%d' % sys.version_info[0] + cpyver = "%d" % sys.version_info[0] elif sys.pypy_version_info >= (1, 5): - cpyver = '%d.%d' % sys.version_info[:2] + cpyver = "%d.%d" % sys.version_info[:2] else: - cpyver = '%d.%d.%d' % sys.version_info[:3] - paths = [os.path.join(sys.real_prefix, 'lib_pypy'), - os.path.join(sys.real_prefix, 'lib-python', cpyver)] + cpyver = "%d.%d.%d" % sys.version_info[:3] + paths = [os.path.join(sys.real_prefix, "lib_pypy"), os.path.join(sys.real_prefix, "lib-python", cpyver)] if sys.pypy_version_info < (1, 9): - paths.insert(1, os.path.join(sys.real_prefix, - 'lib-python', 'modified-%s' % cpyver)) - hardcoded_relative_dirs = paths[:] # for the special 'darwin' case below + paths.insert(1, os.path.join(sys.real_prefix, "lib-python", "modified-%s" % cpyver)) + hardcoded_relative_dirs = paths[:] # for the special 'darwin' case below # # This is hardcoded in the Python executable, but relative to sys.prefix: for path in paths[:]: - plat_path = os.path.join(path, 'plat-%s' % sys.platform) + plat_path = os.path.join(path, "plat-%s" % sys.platform) if os.path.exists(plat_path): paths.append(plat_path) - elif sys.platform == 'win32': - paths = [os.path.join(sys.real_prefix, 'Lib'), os.path.join(sys.real_prefix, 'DLLs')] + elif sys.platform == "win32": + paths = [os.path.join(sys.real_prefix, "Lib"), os.path.join(sys.real_prefix, "DLLs")] else: - paths = [os.path.join(sys.real_prefix, 'lib', 'python'+sys.version[:3])] - hardcoded_relative_dirs = paths[:] # for the special 'darwin' case below - lib64_path = os.path.join(sys.real_prefix, 'lib64', 'python'+sys.version[:3]) + paths = [os.path.join(sys.real_prefix, "lib", "python" + sys.version[:3])] + hardcoded_relative_dirs = paths[:] # for the special 'darwin' case below + lib64_path = os.path.join(sys.real_prefix, "lib64", "python" + sys.version[:3]) if os.path.exists(lib64_path): if _is_64bit: paths.insert(0, lib64_path) @@ -595,28 +599,28 @@ def virtual_install_main_packages(): # Python 3.3+, this lives in sys.implementation, while in Python 2.7 # it lives in sys. try: - arch = getattr(sys, 'implementation', sys)._multiarch + arch = getattr(sys, "implementation", sys)._multiarch except AttributeError: # This is a non-multiarch aware Python. Fallback to the old way. arch = sys.platform - plat_path = os.path.join(sys.real_prefix, 'lib', - 'python'+sys.version[:3], - 'plat-%s' % arch) + plat_path = os.path.join(sys.real_prefix, "lib", "python" + sys.version[:3], "plat-%s" % arch) if os.path.exists(plat_path): paths.append(plat_path) # This is hardcoded in the Python executable, but # relative to sys.prefix, so we have to fix up: for path in list(paths): - tk_dir = os.path.join(path, 'lib-tk') + tk_dir = os.path.join(path, "lib-tk") if os.path.exists(tk_dir): paths.append(tk_dir) # These are hardcoded in the Apple's Python executable, # but relative to sys.prefix, so we have to fix them up: - if sys.platform == 'darwin': - hardcoded_paths = [os.path.join(relative_dir, module) - for relative_dir in hardcoded_relative_dirs - for module in ('plat-darwin', 'plat-mac', 'plat-mac/lib-scriptpackages')] + if sys.platform == "darwin": + hardcoded_paths = [ + os.path.join(relative_dir, module) + for relative_dir in hardcoded_relative_dirs + for module in ("plat-darwin", "plat-mac", "plat-mac/lib-scriptpackages") + ] for path in hardcoded_paths: if os.path.exists(path): @@ -624,6 +628,7 @@ def virtual_install_main_packages(): sys.path.extend(paths) + def force_global_eggs_after_local_site_packages(): """ Force easy_installed eggs in the global environment to get placed @@ -633,16 +638,18 @@ def force_global_eggs_after_local_site_packages(): around. """ - egginsert = getattr(sys, '__egginsert', 0) + egginsert = getattr(sys, "__egginsert", 0) for i, path in enumerate(sys.path): if i > egginsert and path.startswith(sys.prefix): egginsert = i sys.__egginsert = egginsert + 1 + def virtual_addsitepackages(known_paths): force_global_eggs_after_local_site_packages() return addsitepackages(known_paths, sys_prefix=sys.real_prefix) + def fixclasspath(): """Adjust the special classpath sys.path entries for Jython. These entries should follow the base virtualenv lib directories. @@ -650,13 +657,14 @@ def fixclasspath(): paths = [] classpaths = [] for path in sys.path: - if path == '__classpath__' or path.startswith('__pyclasspath__'): + if path == "__classpath__" or path.startswith("__pyclasspath__"): classpaths.append(path) else: paths.append(path) sys.path = paths sys.path.extend(classpaths) + def execusercustomize(): """Run custom user specific code, if available.""" try: @@ -665,17 +673,76 @@ def execusercustomize(): pass +def enablerlcompleter(): + """Enable default readline configuration on interactive prompts, by + registering a sys.__interactivehook__. + If the readline module can be imported, the hook will set the Tab key + as completion key and register ~/.python_history as history file. + This can be overridden in the sitecustomize or usercustomize module, + or in a PYTHONSTARTUP file. + """ + + def register_readline(): + import atexit + + try: + import readline + import rlcompleter + except ImportError: + return + + # Reading the initialization (config) file may not be enough to set a + # completion key, so we set one first and then read the file. + readline_doc = getattr(readline, "__doc__", "") + if readline_doc is not None and "libedit" in readline_doc: + readline.parse_and_bind("bind ^I rl_complete") + else: + readline.parse_and_bind("tab: complete") + + try: + readline.read_init_file() + except OSError: + # An OSError here could have many causes, but the most likely one + # is that there's no .inputrc file (or .editrc file in the case of + # Mac OS X + libedit) in the expected location. In that case, we + # want to ignore the exception. + pass + + if readline.get_current_history_length() == 0: + # If no history was loaded, default to .python_history. + # The guard is necessary to avoid doubling history size at + # each interpreter exit when readline was already configured + # through a PYTHONSTARTUP hook, see: + # http://bugs.python.org/issue5845#msg198636 + history = os.path.join(os.path.expanduser("~"), ".python_history") + try: + readline.read_history_file(history) + except OSError: + pass + + def write_history(): + try: + readline.write_history_file(history) + except (FileNotFoundError, PermissionError): + # home directory does not exist or is not writable + # https://bugs.python.org/issue19891 + pass + + atexit.register(write_history) + + sys.__interactivehook__ = register_readline + + def main(): global ENABLE_USER_SITE virtual_install_main_packages() abs__file__() paths_in_sys = removeduppaths() - if (os.name == "posix" and sys.path and - os.path.basename(sys.path[-1]) == "Modules"): + if os.name == "posix" and sys.path and os.path.basename(sys.path[-1]) == "Modules": addbuilddir() if _is_jython: fixclasspath() - GLOBAL_SITE_PACKAGES = not os.path.exists(os.path.join(os.path.dirname(__file__), 'no-global-site-packages.txt')) + GLOBAL_SITE_PACKAGES = not os.path.exists(os.path.join(os.path.dirname(__file__), "no-global-site-packages.txt")) if not GLOBAL_SITE_PACKAGES: ENABLE_USER_SITE = False if ENABLE_USER_SITE is None: @@ -684,11 +751,13 @@ def main(): paths_in_sys = addusersitepackages(paths_in_sys) if GLOBAL_SITE_PACKAGES: paths_in_sys = virtual_addsitepackages(paths_in_sys) - if sys.platform == 'os2emx': + if sys.platform == "os2emx": setBEGINLIBPATH() setquit() setcopyright() sethelper() + if sys.version_info[0] == 3: + enablerlcompleter() aliasmbcs() setencoding() execsitecustomize() @@ -700,8 +769,10 @@ def main(): if hasattr(sys, "setdefaultencoding"): del sys.setdefaultencoding + main() + def _script(): help = """\ %s [--user-base] [--user-site] @@ -721,22 +792,24 @@ def _script(): if not args: print("sys.path = [") for dir in sys.path: - print(" %r," % (dir,)) + print(" {!r},".format(dir)) print("]") + def exists(path): if os.path.isdir(path): return "exists" else: return "doesn't exist" - print("USER_BASE: %r (%s)" % (USER_BASE, exists(USER_BASE))) - print("USER_SITE: %r (%s)" % (USER_SITE, exists(USER_BASE))) - print("ENABLE_USER_SITE: %r" % ENABLE_USER_SITE) + + print("USER_BASE: {!r} ({})".format(USER_BASE, exists(USER_BASE))) + print("USER_SITE: {!r} ({})".format(USER_SITE, exists(USER_BASE))) + print("ENABLE_USER_SITE: %r" % ENABLE_USER_SITE) sys.exit(0) buffer = [] - if '--user-base' in args: + if "--user-base" in args: buffer.append(USER_BASE) - if '--user-site' in args: + if "--user-site" in args: buffer.append(USER_SITE) if buffer: @@ -751,8 +824,10 @@ def _script(): sys.exit(3) else: import textwrap + print(textwrap.dedent(help % (sys.argv[0], os.pathsep))) sys.exit(10) -if __name__ == '__main__': + +if __name__ == "__main__": _script() diff --git a/env/pip-selfcheck.json b/env/pip-selfcheck.json deleted file mode 100644 index 7b9f0fe..0000000 --- a/env/pip-selfcheck.json +++ /dev/null @@ -1 +0,0 @@ -{"last_check":"2018-12-28T22:10:35Z","pypi_version":"18.1"} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index f2590b2..97af891 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ ipwhois +dnspython \ No newline at end of file