From ecdac123787b96ce6649f0f91da12ea6458cc2b1 Mon Sep 17 00:00:00 2001 From: Palica Date: Tue, 23 Jun 2020 22:35:08 +0200 Subject: Updating liguros repo --- dev-python/passlib/Manifest | 1 + dev-python/passlib/files/passlib-1.7.2-py39.patch | 19 +++++++ dev-python/passlib/files/passlib-1.7.2-pypy3.patch | 65 ++++++++++++++++++++++ dev-python/passlib/metadata.xml | 26 +++++++++ dev-python/passlib/passlib-1.7.2.ebuild | 38 +++++++++++++ 5 files changed, 149 insertions(+) create mode 100644 dev-python/passlib/Manifest create mode 100644 dev-python/passlib/files/passlib-1.7.2-py39.patch create mode 100644 dev-python/passlib/files/passlib-1.7.2-pypy3.patch create mode 100644 dev-python/passlib/metadata.xml create mode 100644 dev-python/passlib/passlib-1.7.2.ebuild (limited to 'dev-python/passlib') diff --git a/dev-python/passlib/Manifest b/dev-python/passlib/Manifest new file mode 100644 index 000000000000..2da76b89308b --- /dev/null +++ b/dev-python/passlib/Manifest @@ -0,0 +1 @@ +DIST passlib-1.7.2.tar.gz 649654 BLAKE2B 40279113d9ff633cea47222f2d72af0abee78dc52a9b46adf66aaae213594eaae7f245cc80004f85b5055b882741b4bedfd81ee39132db23760d37a34e87ac6a SHA512 1ea0654b177b5ab2e1a7e5c3949642c34805ace6e4e4a0f82fafdb3f374edd99c667906ce598c335b668da049860648d5cbebb3e62d775898d5b0cb8cfc7bf53 diff --git a/dev-python/passlib/files/passlib-1.7.2-py39.patch b/dev-python/passlib/files/passlib-1.7.2-py39.patch new file mode 100644 index 000000000000..c5dbc208a88b --- /dev/null +++ b/dev-python/passlib/files/passlib-1.7.2-py39.patch @@ -0,0 +1,19 @@ +diff --git a/passlib/utils/__init__.py b/passlib/utils/__init__.py +index 69b55e5..d18ec50 100644 +--- a/passlib/utils/__init__.py ++++ b/passlib/utils/__init__.py +@@ -807,7 +807,13 @@ else: + + if isinstance(hash, bytes): + hash = hash.decode("ascii") +- result = _crypt(secret, hash) ++ try: ++ result = _crypt(secret, hash) ++ except OSError: ++ # new in py39 -- per https://bugs.python.org/issue39289, ++ # crypt() now throws OSError for various things, mainly unknown hash formats ++ # translating that to None for now (may revise safe_crypt behavior in future) ++ return None + if PYPY and isinstance(result, bytes): + result = result.decode("utf-8") + if not result or result[0:1] in _invalid_prefixes: diff --git a/dev-python/passlib/files/passlib-1.7.2-pypy3.patch b/dev-python/passlib/files/passlib-1.7.2-pypy3.patch new file mode 100644 index 000000000000..304388196b23 --- /dev/null +++ b/dev-python/passlib/files/passlib-1.7.2-pypy3.patch @@ -0,0 +1,65 @@ +diff -ur a/passlib/utils/__init__.py b/passlib/utils/__init__.py +--- a/passlib/utils/__init__.py 2019-11-19 11:41:26.000000000 -0800 ++++ b/passlib/utils/__init__.py 2019-12-03 14:16:15.153791186 -0800 +@@ -57,7 +57,7 @@ + ) + from passlib.exc import ExpectedStringError + from passlib.utils.compat import (add_doc, join_bytes, join_byte_values, +- join_byte_elems, irange, imap, PY3, u, ++ join_byte_elems, irange, imap, PY3, PYPY, u, + join_unicode, unicode, byte_elem_value, nextgetter, + unicode_or_bytes_types, + get_method_function, suppress_cause) +@@ -776,23 +776,41 @@ + + if PY3: + def safe_crypt(secret, hash): +- if isinstance(secret, bytes): +- # Python 3's crypt() only accepts unicode, which is then +- # encoding using utf-8 before passing to the C-level crypt(). +- # so we have to decode the secret. +- orig = secret ++ if not PYPY: ++ if isinstance(secret, bytes): ++ # Python 3's crypt() only accepts unicode, which is then ++ # encoding using utf-8 before passing to the C-level crypt(). ++ # so we have to decode the secret. ++ orig = secret ++ try: ++ secret = secret.decode("utf-8") ++ except UnicodeDecodeError: ++ return None ++ assert secret.encode("utf-8") == orig, \ ++ "utf-8 spec says this can't happen!" ++ if _NULL in secret: ++ raise ValueError("null character in secret") ++ else: ++ if isinstance(secret, str): ++ orig = secret ++ try: ++ secret = secret.encode("utf-8") ++ except UnicodeEncodeError: ++ return None ++ assert secret.decode("utf-8") == orig, \ ++ "utf-8 spec says this can't happen!" + try: +- secret = secret.decode("utf-8") ++ if _NULL in secret.decode("utf-8"): ++ raise ValueError("null character in secret") + except UnicodeDecodeError: + return None +- assert secret.encode("utf-8") == orig, \ +- "utf-8 spec says this can't happen!" +- if _NULL in secret: +- raise ValueError("null character in secret") ++ + if isinstance(hash, bytes): + hash = hash.decode("ascii") + result = _crypt(secret, hash) +- if not result or result[0] in _invalid_prefixes: ++ if PYPY and isinstance(result, bytes): ++ result = result.decode("utf-8") ++ if not result or result[0:1] in _invalid_prefixes: + return None + return result + else: diff --git a/dev-python/passlib/metadata.xml b/dev-python/passlib/metadata.xml new file mode 100644 index 000000000000..ee090a3b1952 --- /dev/null +++ b/dev-python/passlib/metadata.xml @@ -0,0 +1,26 @@ + + + + + prometheanfire@gentoo.org + Matthew Thode + + + openstack@gentoo.org + Openstack + + + python@gentoo.org + Python + + + bcrpyt hash algoryptm support + time based one time password support + accelerated scrypt algoythm support + + + passlib + ecollins/passlib + + gentoo-staging + diff --git a/dev-python/passlib/passlib-1.7.2.ebuild b/dev-python/passlib/passlib-1.7.2.ebuild new file mode 100644 index 000000000000..0794ac4dad0f --- /dev/null +++ b/dev-python/passlib/passlib-1.7.2.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +PYTHON_COMPAT=( python{2_7,3_{6,7,8,9}} pypy3 ) + +inherit distutils-r1 + +DESCRIPTION="Password hashing framework supporting over 20 schemes" +HOMEPAGE="https://foss.heptapod.net/python-libs/passlib/wikis/home" +SRC_URI="mirror://pypi/p/${PN}/${P}.tar.gz" + +LICENSE="BSD-2" +KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc x86" +SLOT="0" +IUSE="+bcrypt doc +scrypt +totp" + +RDEPEND="bcrypt? ( dev-python/bcrypt[${PYTHON_USEDEP}] ) + totp? ( dev-python/cryptography[${PYTHON_USEDEP}] ) + scrypt? ( dev-python/scrypt[${PYTHON_USEDEP}] )" +BDEPEND=" + test? ( + dev-python/bcrypt[${PYTHON_USEDEP}] + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/scrypt[${PYTHON_USEDEP}] + )" + +PATCHES=( + "${FILESDIR}/passlib-1.7.2-pypy3.patch" + "${FILESDIR}/passlib-1.7.2-py39.patch" +) + +distutils_enable_tests nose + +python_install_all() { + distutils-r1_python_install_all + use doc && dodoc docs/{*.rst,requirements.txt,lib/*.rst} +} -- cgit v1.3.1