summaryrefslogtreecommitdiff
path: root/dev-python/cookies
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-12-15 18:09:03 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-12-15 18:09:03 +0000
commit7bc9c63c9da678a7e6fceb095d56c634afd22c56 (patch)
tree4a67d50a439e9af63947e5f8b6ba3719af98b6c9 /dev-python/cookies
parentb284a3168fa91a038925d2ecf5e4791011ea5e7d (diff)
gentoo resync : 15.12.2019
Diffstat (limited to 'dev-python/cookies')
-rw-r--r--dev-python/cookies/Manifest5
-rw-r--r--dev-python/cookies/cookies-2.2.1-r1.ebuild26
-rw-r--r--dev-python/cookies/cookies-2.2.1.ebuild1
-rw-r--r--dev-python/cookies/files/cookies-2.2.1-fix-warnings.patch201
-rw-r--r--dev-python/cookies/files/cookies-2.2.1-tests.patch28
5 files changed, 260 insertions, 1 deletions
diff --git a/dev-python/cookies/Manifest b/dev-python/cookies/Manifest
index 4ee02038ebb7..3a1566729feb 100644
--- a/dev-python/cookies/Manifest
+++ b/dev-python/cookies/Manifest
@@ -1,3 +1,6 @@
+AUX cookies-2.2.1-fix-warnings.patch 9038 BLAKE2B 78692c413a2a5495dc43c544cbc27410a341088c8ffc8cfb8543ef0a6f7e7393ae37379912dada2cf0e4ce8b238160244305869a12629ede435dfcb6df334910 SHA512 cc18c782d07bda0518a1d0824281ac068bc97684abc505ba24bc895e6f43f70bc16835c9781ffada42175ac2cb9dde7a200b0746910e7106c3b41e8a9a0cb382
+AUX cookies-2.2.1-tests.patch 1131 BLAKE2B c98b40cab2a20b5779e670bfb481f34abaa080d0780a76127f12783f0fd108b67c590d01304f2f173ab5808fd8f9ad7ef65d0227a1f31eac4296302b7610ea81 SHA512 ff571d810ca576a9dbcea1960056ed05ceaf738148324d434409b03cf399d43ecb5b13fe228da54465d020c6cabe109a447f1a04a37d1276feaf5be6cf38eea9
DIST cookies-2.2.1.tar.gz 40704 BLAKE2B 422d70f15e93193ac9c4865f988b22a895a81c59ae98a86cb90289940c283f3998a7e1d3b7ecc0a4f4b004d6b4b64de6743cae7a10f45d9bd1e6136ff35518c0 SHA512 76f362a9a1d74b87c90c5b91ad806d872612d31f487e4067a627409316f6099602c9e5a429f85ce20adcb0a7b63dd131b9e1ecc5c0c6444d1569367432a719de
-EBUILD cookies-2.2.1.ebuild 555 BLAKE2B b6329b746b7fadb23797f655f19f01f8550bb3ac108d155bc0a5799a2ad5aca11fb6732847ddd106a3e7d8a3af58c6433fc5315ba72bf7b7114fdb91d00ae1d2 SHA512 013afa45a602cf73448d3346fd8e46a05addaa96bb574a924159879f449ee2385faded53ab23a9952a58f2da3e4d5b0b7c9f35a84c27bbb600abfdd0fb3c1d6e
+EBUILD cookies-2.2.1-r1.ebuild 665 BLAKE2B 01d31578bc9f4fdcf2761fc6a3a93ca386fce133504a51448d2d2d86ae649557ad5a74ac8c4ba6544794443b583599abc5db8dd98fb1c4edfddfb74c5ca08ff1 SHA512 6d41b4cd71679bd2ad44f214f1f359da6e2fe20d6478d84dbf62bb6ff47dd939b070acf15dbd92cf9f6b447a9237aedead1643bc7e5aa937c5d0efa86f2fd6ce
+EBUILD cookies-2.2.1.ebuild 582 BLAKE2B 7465825e51c93e9a331c11502fb0ecfd7783069bff2cd95c5d4092bee69a15a74b01306c998029bbed05206b1db317eaaadfdd79eca5e9cd650e12549be63526 SHA512 f800f137571c3c66c184dfc820f0d60189c2fc55f9958921d3bf3cea03a490911c8cbd42a7ad80b7cd584ae2936e65e607d4051d543957ee6ebd20d3b3d1c876
MISC metadata.xml 310 BLAKE2B 3f44f9692738692ca4eff801de2fa67bf33220d8b5a94985dcf33c21d1b18b78f6dc8f13bdc42b4edb4afa96a869583c6caa0643190ec68a24c57852c4212d8b SHA512 b98da30bc8b8f3deb352a59ca73a88a9640cadbc20b3049523930f6e671cd057d19b4dbd559702efdac09ba1ed238b7df95502e9203f1d34147fdea5a308c82b
diff --git a/dev-python/cookies/cookies-2.2.1-r1.ebuild b/dev-python/cookies/cookies-2.2.1-r1.ebuild
new file mode 100644
index 000000000000..7902a8e44f21
--- /dev/null
+++ b/dev-python/cookies/cookies-2.2.1-r1.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=(python{2_7,3_{5,6,7,8}} pypy{,3} )
+
+inherit distutils-r1
+
+DESCRIPTION="Friendlier RFC 6265-compliant cookie parser/renderer"
+HOMEPAGE="https://gitlab.com/sashahart/cookies"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+
+BDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
+
+PATCHES=(
+ # https://gitlab.com/sashahart/cookies/merge_requests/2
+ "${FILESDIR}/cookies-2.2.1-fix-warnings.patch"
+
+ "${FILESDIR}/cookies-2.2.1-tests.patch"
+)
+
+distutils_enable_tests pytest
diff --git a/dev-python/cookies/cookies-2.2.1.ebuild b/dev-python/cookies/cookies-2.2.1.ebuild
index 5c5d5337d9b0..6762c79f54a6 100644
--- a/dev-python/cookies/cookies-2.2.1.ebuild
+++ b/dev-python/cookies/cookies-2.2.1.ebuild
@@ -14,6 +14,7 @@ LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
IUSE="test"
+RESTRICT="!test? ( test )"
DEPEND="test? ( dev-python/pytest[${PYTHON_USEDEP}] )
dev-python/setuptools[${PYTHON_USEDEP}]"
diff --git a/dev-python/cookies/files/cookies-2.2.1-fix-warnings.patch b/dev-python/cookies/files/cookies-2.2.1-fix-warnings.patch
new file mode 100644
index 000000000000..adb43f4241df
--- /dev/null
+++ b/dev-python/cookies/files/cookies-2.2.1-fix-warnings.patch
@@ -0,0 +1,201 @@
+diff --git a/cookies.py b/cookies.py
+index d1637d22630580e25cb0b1405754dd7e195bf85f..4fd0ebbd07384e02d6f40e45a4432a2baa95fc8b 100644
+--- a/cookies.py
++++ b/cookies.py
+@@ -132,7 +132,7 @@ class Definitions(object):
+ # attribute and extract it appropriately.
+ # As compared with the RFC production grammar, it is must more liberal with
+ # space characters, in order not to break on data made by barbarians.
+- SET_COOKIE_HEADER = """(?x) # Verbose mode
++ SET_COOKIE_HEADER = r"""(?x) # Verbose mode
+ ^(?:Set-Cookie:[ ]*)?
+ (?P<name>[{name}:]+)
+ [ ]*=[ ]*
+@@ -203,7 +203,7 @@ class Definitions(object):
+ # Here is the overall date format; ~99% of cases fold into one generalized
+ # syntax like RFC 1123, and many of the rest use asctime-like formats.
+ # (see test_date_formats for a full exegesis)
+- DATE = """(?ix) # Case-insensitive mode, verbose mode
++ _DATE = """
+ (?:
+ (?P<weekday>(?:{wdy}|{weekday}),[ ])?
+ (?P<day>{day})
+@@ -230,11 +230,17 @@ class Definitions(object):
+ (?P<year2>\d\d\d\d)
+ (?:[ ]GMT)? # GMT (Amazon)
+ )
+- """
+- DATE = DATE.format(wdy=WEEKDAY_SHORT, weekday=WEEKDAY_LONG,
+- day=DAY_OF_MONTH, mon=MONTH_SHORT, month=MONTH_LONG)
++ """.format(wdy=WEEKDAY_SHORT, weekday=WEEKDAY_LONG,
++ day=DAY_OF_MONTH, mon=MONTH_SHORT, month=MONTH_LONG)
++
++ # Starting in Python 3.6, embedding a regex that starts with "(?ix)" in
++ # the middle of another regex produces a warning (and will stop working
++ # altogether in some future Python version). We thus create two variables
++ # here: _DATE is for embedding inside other regexes (which must themselves
++ # begin with "(?ix)"), DATE is for standalone matching.
++ DATE = '(?ix)' + _DATE
+
+- EXPIRES_AV = "Expires=(?P<expires>%s)" % DATE
++ EXPIRES_AV = "Expires=(?P<expires>%s)" % _DATE
+
+ # Now we're ready to define a regexp which can match any number of attrs
+ # in the variable portion of the Set-Cookie header (like the unnamed latter
+@@ -263,7 +269,7 @@ class Definitions(object):
+ path=PATH_AV, stuff=EXTENSION_AV)
+
+ # For request data ("Cookie: ") parsing, with finditer cf. RFC 6265 4.2.1
+- COOKIE = """(?x) # Verbose mode
++ COOKIE = r"""(?x) # Verbose mode
+ (?: # Either something close to valid...
+
+ # Match starts at start of string, or at separator.
+@@ -306,13 +312,13 @@ class Definitions(object):
+ """.format(name=COOKIE_NAME, value=COOKIE_OCTET)
+
+ # Precompile externally useful definitions into re objects.
+- COOKIE_NAME_RE = re.compile("^([%s:]+)\Z" % COOKIE_NAME)
++ COOKIE_NAME_RE = re.compile(r"^([%s:]+)\Z" % COOKIE_NAME)
+ COOKIE_RE = re.compile(COOKIE)
+ SET_COOKIE_HEADER_RE = re.compile(SET_COOKIE_HEADER)
+ ATTR_RE = re.compile(ATTR)
+ DATE_RE = re.compile(DATE)
+ DOMAIN_RE = re.compile(DOMAIN)
+- PATH_RE = re.compile('^([%s]+)\Z' % EXTENSION_AV)
++ PATH_RE = re.compile(r'^([%s]+)\Z' % EXTENSION_AV)
+ EOL = re.compile("(?:\r\n|\n)")
+
+
+@@ -965,7 +971,7 @@ class Cookie(object):
+ 'path': valid_path,
+ 'max_age': valid_max_age,
+ 'comment': valid_value,
+- 'version': lambda number: re.match("^\d+\Z", str(number)),
++ 'version': lambda number: re.match(r"^\d+\Z", str(number)),
+ 'secure': lambda item: item is True or item is False,
+ 'httponly': lambda item: item is True or item is False,
+ }
+diff --git a/test_cookies.py b/test_cookies.py
+index 2197916effae23a85e571dcb4a1acf78fbe1c71e..abc95a6346a1522556b95e03de81baaa0a478031 100644
+--- a/test_cookies.py
++++ b/test_cookies.py
+@@ -35,19 +35,19 @@ class RFC1034:
+ digit = "[0-9]"
+ letter = "[A-Za-z]"
+ let_dig = "[0-9A-Za-z]"
+- let_dig_hyp = "[0-9A-Za-z\-]"
++ let_dig_hyp = r"[0-9A-Za-z\-]"
+ assert "\\" in let_dig_hyp
+ ldh_str = "%s+" % let_dig_hyp
+ label = "(?:%s|%s|%s)" % (
+ letter,
+ letter + let_dig,
+ letter + ldh_str + let_dig)
+- subdomain = "(?:%s\.)*(?:%s)" % (label, label)
++ subdomain = r"(?:%s\.)*(?:%s)" % (label, label)
+ domain = "( |%s)" % (subdomain)
+
+ def test_sanity(self):
+ "Basic smoke tests that definitions transcribed OK"
+- match = re.compile("^%s\Z" % self.domain).match
++ match = re.compile(r"^%s\Z" % self.domain).match
+ assert match("A.ISI.EDU")
+ assert match("XX.LCS.MIT.EDU")
+ assert match("SRI-NIC.ARPA")
+@@ -74,12 +74,12 @@ class RFC1123:
+ # n.b.: there are length limits in the real thing
+ label = "{let_dig}(?:(?:{let_dig_hyp}+)?{let_dig})?".format(
+ let_dig=RFC1034.let_dig, let_dig_hyp=RFC1034.let_dig_hyp)
+- subdomain = "(?:%s\.)*(?:%s)" % (label, label)
++ subdomain = r"(?:%s\.)*(?:%s)" % (label, label)
+ domain = "( |%s)" % (subdomain)
+
+ def test_sanity(self):
+ "Basic smoke tests that definitions transcribed OK"
+- match = re.compile("^%s\Z" % self.domain).match
++ match = re.compile(r"^%s\Z" % self.domain).match
+ assert match("A.ISI.EDU")
+ assert match("XX.LCS.MIT.EDU")
+ assert match("SRI-NIC.ARPA")
+@@ -241,7 +241,7 @@ class TestDefinitions(object):
+ ; whitespace DQUOTE, comma, semicolon,
+ ; and backslash
+ """
+- match = re.compile("^[%s]+\Z" % Definitions.COOKIE_OCTET).match
++ match = re.compile(r"^[%s]+\Z" % Definitions.COOKIE_OCTET).match
+ for c in RFC5234.CTL:
+ assert not match(c)
+ assert not match("a%sb" % c)
+@@ -331,7 +331,7 @@ class TestDefinitions(object):
+ ('frob', 'laz', '')]
+
+ def assert_correct(s):
+- #naive = re.findall(" *([^;]+)=([^;]+) *(?:;|\Z)", s)
++ #naive = re.findall(r" *([^;]+)=([^;]+) *(?:;|\Z)", s)
+ result = regex.findall(s)
+ assert result == correct
+ # normal-looking case should work normally
+@@ -390,7 +390,7 @@ class TestDefinitions(object):
+ extension_av_explicit = "".join(sorted(
+ set(RFC5234.CHAR) - set(RFC5234.CTL + ";")))
+ # ... that should turn out to be the same as Definitions.EXTENSION_AV
+- match = re.compile("^([%s]+)\Z" % Definitions.EXTENSION_AV).match
++ match = re.compile(r"^([%s]+)\Z" % Definitions.EXTENSION_AV).match
+ # Verify I didn't mess up on escaping here first
+ assert match(r']')
+ assert match(r'[')
+@@ -411,7 +411,7 @@ class TestDefinitions(object):
+ def test_max_age_av(self):
+ "Smoke test Definitions.MAX_AGE_AV"
+ # Not a lot to this, it's just digits
+- match = re.compile("^%s\Z" % Definitions.MAX_AGE_AV).match
++ match = re.compile(r"^%s\Z" % Definitions.MAX_AGE_AV).match
+ assert not match("")
+ assert not match("Whiskers")
+ assert not match("Max-Headroom=992")
+@@ -424,7 +424,7 @@ class TestDefinitions(object):
+
+ def test_label(self, check_unicode=False):
+ "Test label, as used in Domain attribute"
+- match = re.compile("^(%s)\Z" % Definitions.LABEL).match
++ match = re.compile(r"^(%s)\Z" % Definitions.LABEL).match
+ for i in range(0, 10):
+ assert match(str(i))
+ assert not match(".")
+@@ -459,7 +459,7 @@ class TestDefinitions(object):
+ assert match(domain)
+
+ # Now same tests through DOMAIN_AV
+- match = re.compile("^%s\Z" % Definitions.DOMAIN_AV).match
++ match = re.compile(r"^%s\Z" % Definitions.DOMAIN_AV).match
+ for domain in bad_domains:
+ assert not match("Domain=%s" % domain)
+ for domain in good_domains:
+@@ -487,7 +487,7 @@ class TestDefinitions(object):
+ for path in good_paths:
+ assert match(path)
+
+- match = re.compile("^%s\Z" % Definitions.PATH_AV).match
++ match = re.compile(r"^%s\Z" % Definitions.PATH_AV).match
+ for path in bad_paths:
+ assert not match("Path=%s" % path)
+ for path in good_paths:
+@@ -575,7 +575,7 @@ class TestDefinitions(object):
+ # dependencies, and odds are good that other implementations are loose.
+ # so this parser is also loose. "liberal in what you accept,
+ # conservative in what you produce"
+- match = re.compile("^%s\Z" % Definitions.EXPIRES_AV).match
++ match = re.compile(r"^%s\Z" % Definitions.EXPIRES_AV, flags=re.I | re.X).match
+ assert not match("")
+ assert not match("Expires=")
+
+@@ -610,7 +610,7 @@ class TestDefinitions(object):
+
+ If this works, then ATTR should work
+ """
+- match = re.compile("^[%s]+\Z" % Definitions.EXTENSION_AV).match
++ match = re.compile(r"^[%s]+\Z" % Definitions.EXTENSION_AV).match
+ assert match("Expires=Sun, 06 Nov 1994 08:49:37 GMT")
+ assert match("Expires=Sunday, 06-Nov-94 08:49:37 GMT")
+ assert match("Expires=Sun Nov 6 08:49:37 1994")
diff --git a/dev-python/cookies/files/cookies-2.2.1-tests.patch b/dev-python/cookies/files/cookies-2.2.1-tests.patch
new file mode 100644
index 000000000000..9d8c84bb3c9d
--- /dev/null
+++ b/dev-python/cookies/files/cookies-2.2.1-tests.patch
@@ -0,0 +1,28 @@
+diff --git a/test_cookies.py b/test_cookies.py
+index 2197916..502ce86 100644
+--- a/test_cookies.py
++++ b/test_cookies.py
+@@ -2225,7 +2225,10 @@ def test_encoding_assumptions(check_unicode=False):
+ else:
+ assert cookie_value_re.match(quoted)
+
+- assert set(dont_quote) == set("!#$%&'()*+/:<=>?@[]^`{|}~")
++ if sys.hexversion < 0x3070000:
++ assert set(dont_quote) == set("!#$%&'()*+/:<=>?@[]^`{|}~")
++ else:
++ assert set(dont_quote) == set("!#$%&'()*+/:<=>?@[]^`{|}")
+
+ # From 128 on urllib.quote will not work on a unichr() return value.
+ # We'll want to encode utf-8 values into ASCII, then do the quoting.
+@@ -2257,7 +2260,10 @@ def test_encoding_assumptions(check_unicode=False):
+ else:
+ assert extension_av_re.match(quoted)
+
+- assert set(dont_quote) == set(' !"#$%&\'()*+,/:<=>?@[\\]^`{|}~')
++ if sys.hexversion < 0x3070000:
++ assert set(dont_quote) == set(' !"#$%&\'()*+,/:<=>?@[\\]^`{|}~')
++ else:
++ assert set(dont_quote) == set(' !"#$%&\'()*+,/:<=>?@[\\]^`{|}')
+
+
+ test_encode_cookie_value = _simple_test(encode_cookie_value,