From ef5d772cb212bb9d3049523be8a7bd2e01301090 Mon Sep 17 00:00:00 2001 From: "Liguros - Gitlab CI/CD [develop]" Date: Wed, 1 Oct 2025 12:11:11 +0000 Subject: Adding metadata --- .../passlib/files/passlib-1.7.4-bcrypt.patch | 21 ++++++ dev-python/passlib/passlib-1.7.4-r3.ebuild | 71 ------------------- dev-python/passlib/passlib-1.7.4-r4.ebuild | 81 ++++++++++++++++++++++ 3 files changed, 102 insertions(+), 71 deletions(-) create mode 100644 dev-python/passlib/files/passlib-1.7.4-bcrypt.patch delete mode 100644 dev-python/passlib/passlib-1.7.4-r3.ebuild create mode 100644 dev-python/passlib/passlib-1.7.4-r4.ebuild (limited to 'dev-python/passlib') diff --git a/dev-python/passlib/files/passlib-1.7.4-bcrypt.patch b/dev-python/passlib/files/passlib-1.7.4-bcrypt.patch new file mode 100644 index 000000000000..19bb604dbef4 --- /dev/null +++ b/dev-python/passlib/files/passlib-1.7.4-bcrypt.patch @@ -0,0 +1,21 @@ +diff -r 7aafcc60b4f5 passlib/handlers/bcrypt.py +--- a/passlib/handlers/bcrypt.py Thu Oct 08 15:01:32 2020 -0400 ++++ b/passlib/handlers/bcrypt.py Wed Oct 01 09:04:12 2025 +0200 +@@ -366,6 +366,8 @@ + NOTE: if in future we need to deliberately create hashes which have this bug, + can use something like 'hashpw(repeat_string(secret[:((1+secret) % 256) or 1]), 72)' + """ ++ return False ++ + # check if it exhibits wraparound bug + secret = (b"0123456789"*26)[:255] + bug_hash = ident.encode("ascii") + b"04$R1lJ2gkNaoPGdafE.H.16.nVyh2niHsGJhayOHLMiXlI45o8/DU.6" +@@ -609,7 +611,7 @@ + except ImportError: # pragma: no cover + return False + try: +- version = _bcrypt.__about__.__version__ ++ version = _bcrypt.__version__ + except: + log.warning("(trapped) error reading bcrypt version", exc_info=True) + version = '' diff --git a/dev-python/passlib/passlib-1.7.4-r3.ebuild b/dev-python/passlib/passlib-1.7.4-r3.ebuild deleted file mode 100644 index be2a4edfcafe..000000000000 --- a/dev-python/passlib/passlib-1.7.4-r3.ebuild +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright 1999-2025 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{9,10,11,12,13} pypy3 ) - -inherit distutils-r1 optfeature pypi - -DESCRIPTION="Password hashing framework supporting over 20 schemes" -HOMEPAGE=" - https://foss.heptapod.net/python-libs/passlib/-/wikis/home - https://pypi.org/project/passlib/ -" - -LICENSE="BSD-2" -SLOT="0" -KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~x64-macos" -IUSE="doc test-rust" - -BDEPEND=" - test? ( - dev-python/scrypt[${PYTHON_USEDEP}] - test-rust? ( - dev-python/bcrypt[${PYTHON_USEDEP}] - dev-python/cryptography[${PYTHON_USEDEP}] - ) - )" - -distutils_enable_tests pytest - -src_prepare() { - # fix compatibility with >=dev-python/bcrypt-4.1 - # https://foss.heptapod.net/python-libs/passlib/-/issues/190 - sed -i -e '/bcrypt/s:__about__\.::' passlib/handlers/bcrypt.py || die - - distutils-r1_src_prepare -} - -python_test() { - local EPYTEST_DESELECT=( - # broken all the time by new django releases - passlib/tests/test_ext_django.py - ) - - case ${EPYTHON} in - python3.13*|python3.14*) - EPYTEST_DESELECT+=( - # crypt module has been removed, so the platform backend - # does not work anymore - passlib/tests/test_handlers.py::{des,md5,sha256,sha512}_crypt_os_crypt_test - ) - ;; - esac - - # skip fuzzing tests, they are very slow - epytest -k "not fuzz_input" -} - -python_install_all() { - distutils-r1_python_install_all - use doc && dodoc docs/{*.rst,requirements.txt,lib/*.rst} -} - -pkg_postinst() { - optfeature "Argon2 support" dev-python/argon2-cffi - optfeature "bcrypt support" dev-python/bcrypt - optfeature "scrypt support" dev-python/scrypt - optfeature "Time-based One-Time Password (TOTP) support" dev-python/cryptography -} diff --git a/dev-python/passlib/passlib-1.7.4-r4.ebuild b/dev-python/passlib/passlib-1.7.4-r4.ebuild new file mode 100644 index 000000000000..c3fee75559ae --- /dev/null +++ b/dev-python/passlib/passlib-1.7.4-r4.ebuild @@ -0,0 +1,81 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{9,10,11,12,13} pypy3 ) + +inherit distutils-r1 optfeature pypi + +DESCRIPTION="Password hashing framework supporting over 20 schemes" +HOMEPAGE=" + https://foss.heptapod.net/python-libs/passlib/-/wikis/home + https://pypi.org/project/passlib/ +" + +LICENSE="BSD-2" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~x64-macos" +IUSE="doc test-rust" + +BDEPEND=" + test? ( + dev-python/scrypt[${PYTHON_USEDEP}] + test-rust? ( + dev-python/bcrypt[${PYTHON_USEDEP}] + dev-python/cryptography[${PYTHON_USEDEP}] + ) + )" + +EPYTEST_PLUGINS=() +EPYTEST_XDIST=1 +distutils_enable_tests pytest + +src_prepare() { + local PATCHES=( + # combined bcrypt compatibility fixes + # https://foss.heptapod.net/python-libs/passlib/-/issues/190 + # https://foss.heptapod.net/python-libs/passlib/-/issues/196 + "${FILESDIR}/${P}-bcrypt.patch" + ) + + distutils-r1_src_prepare +} + +python_test() { + local EPYTEST_DESELECT=( + # broken all the time by new django releases + passlib/tests/test_ext_django.py + + # bcrypt now disallows implicit password truncation + passlib/tests/test_handlers_bcrypt.py::bcrypt_bcrypt_test::test_70_hashes + passlib/tests/test_handlers_bcrypt.py::bcrypt_bcrypt_test::test_secret_w_truncate_size + passlib/tests/test_handlers_django.py::django_bcrypt_test::test_secret_w_truncate_size + ) + + case ${EPYTHON} in + python3.13*|python3.14*) + EPYTEST_DESELECT+=( + # crypt module has been removed, so the platform backend + # does not work anymore + passlib/tests/test_handlers.py::{des,md5,sha256,sha512}_crypt_os_crypt_test + ) + ;; + esac + + # skip fuzzing tests, they are very slow + epytest -k "not fuzz_input" +} + +python_install_all() { + distutils-r1_python_install_all + use doc && dodoc docs/{*.rst,requirements.txt,lib/*.rst} +} + +pkg_postinst() { + optfeature "Argon2 support" dev-python/argon2-cffi + optfeature "bcrypt support" dev-python/bcrypt + optfeature "scrypt support" dev-python/scrypt + optfeature "Time-based One-Time Password (TOTP) support" dev-python/cryptography +} -- cgit v1.3.1