* [gentoo-commits] proj/sci:master commit in: dev-python/keyrings_alt/, dev-python/keyrings_alt/files/
@ 2022-09-23 21:37 Horea Christian
0 siblings, 0 replies; only message in thread
From: Horea Christian @ 2022-09-23 21:37 UTC (permalink / raw
To: gentoo-commits
commit: ab870a494b331f77988a1bbe0748a2a190c5e0f8
Author: Horea Christian <chr <AT> chymera <DOT> eu>
AuthorDate: Fri Sep 23 21:37:24 2022 +0000
Commit: Horea Christian <horea.christ <AT> gmail <DOT> com>
CommitDate: Fri Sep 23 21:37:24 2022 +0000
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=ab870a49
dev-python/keyrings_alt: treeclean
Signed-off-by: Horea Christian <chr <AT> chymera.eu>
.../files/keyrings_alt-4.1.0-pycryptodome.patch | 90 ----------------------
.../keyrings_alt/keyrings_alt-4.1.0-r1.ebuild | 31 --------
dev-python/keyrings_alt/metadata.xml | 24 ------
3 files changed, 145 deletions(-)
diff --git a/dev-python/keyrings_alt/files/keyrings_alt-4.1.0-pycryptodome.patch b/dev-python/keyrings_alt/files/keyrings_alt-4.1.0-pycryptodome.patch
deleted file mode 100644
index e0ca3a012..000000000
--- a/dev-python/keyrings_alt/files/keyrings_alt-4.1.0-pycryptodome.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-diff --git a/keyrings/alt/file.py b/keyrings/alt/file.py
-index 37c837f..866e8d0 100644
---- a/keyrings/alt/file.py
-+++ b/keyrings/alt/file.py
-@@ -44,8 +44,12 @@ class Encrypted:
- """
- Create the cipher object to encrypt or decrypt a payload.
- """
-- from Cryptodome.Protocol.KDF import PBKDF2
-- from Cryptodome.Cipher import AES
-+ try:
-+ from Cryptodome.Protocol.KDF import PBKDF2
-+ from Cryptodome.Cipher import AES
-+ except ImportError:
-+ from Crypto.Protocol.KDF import PBKDF2
-+ from Crypto.Cipher import AES
-
- pw = PBKDF2(password, salt, dkLen=self.block_size)
- return AES.new(pw[: self.block_size], AES.MODE_CFB, IV)
-@@ -79,7 +83,12 @@ class EncryptedKeyring(Encrypted, Keyring):
- __import__('Cryptodome.Protocol.KDF')
- __import__('Cryptodome.Random')
- except ImportError: # pragma: no cover
-- raise RuntimeError("pycryptodomex required")
-+ try:
-+ __import__('Crypto.Cipher.AES')
-+ __import__('Crypto.Protocol.KDF')
-+ __import__('Crypto.Random')
-+ except ImportError:
-+ raise RuntimeError("pycryptodomex or pycryptodome required")
- if not json: # pragma: no cover
- raise RuntimeError("JSON implementation such as simplejson required.")
- return 0.6
-@@ -190,10 +199,16 @@ class EncryptedKeyring(Encrypted, Keyring):
-
- def encrypt(self, password, assoc=None):
- # encrypt password, ignore associated data
-- from Cryptodome.Random import get_random_bytes
-+ try:
-+ from Cryptodome.Random import get_random_bytes
-+ except ImportError:
-+ from Crypto.Random import get_random_bytes
-
- salt = get_random_bytes(self.block_size)
-- from Cryptodome.Cipher import AES
-+ try:
-+ from Cryptodome.Cipher import AES
-+ except ImportError:
-+ from Crypto.Cipher import AES
-
- IV = get_random_bytes(AES.block_size)
- cipher = self._create_cipher(self.keyring_key, salt, IV)
-diff --git a/tests/test_crypto.py b/tests/test_crypto.py
-index cfc782a..7396023 100644
---- a/tests/test_crypto.py
-+++ b/tests/test_crypto.py
-@@ -14,7 +14,12 @@ def is_crypto_supported():
- __import__('Cryptodome.Protocol.KDF')
- __import__('Cryptodome.Random')
- except ImportError:
-- return False
-+ try:
-+ __import__('Crypto.Cipher.AES')
-+ __import__('Crypto.Protocol.KDF')
-+ __import__('Crypto.Random')
-+ except ImportError:
-+ return False
- return True
-
-
-diff --git a/tests/test_file.py b/tests/test_file.py
-index 62192da..3f813f0 100644
---- a/tests/test_file.py
-+++ b/tests/test_file.py
-@@ -157,7 +157,14 @@ class FileKeyringTests(BackendBasicTests):
- class TestEncryptedFileKeyring(FileKeyringTests):
- @pytest.fixture(autouse=True)
- def crypt_fixture(self, monkeypatch):
-- pytest.importorskip('Cryptodome')
-+ try:
-+ import Cryptodome
-+ except ImportError:
-+ try:
-+ import Crypto
-+ except ImportError:
-+ pytest.skip("Neither pycryptodome nor pycryptodomex are available",
-+ allow_module_level=True)
- fake_getpass = mock.Mock(return_value='abcdef')
- monkeypatch.setattr(getpass, 'getpass', fake_getpass)
-
diff --git a/dev-python/keyrings_alt/keyrings_alt-4.1.0-r1.ebuild b/dev-python/keyrings_alt/keyrings_alt-4.1.0-r1.ebuild
deleted file mode 100644
index 290c2f434..000000000
--- a/dev-python/keyrings_alt/keyrings_alt-4.1.0-r1.ebuild
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( pypy3 python3_{8..10} )
-
-inherit distutils-r1
-
-MY_PN="keyrings.alt"
-MY_P="${MY_PN}-${PV}"
-
-DESCRIPTION="Alternate keyring backend implementations used with dev-python/keyring"
-HOMEPAGE="https://github.com/jaraco/keyrings.alt/"
-SRC_URI="mirror://pypi/${MY_P:0:1}/${MY_PN}/${MY_P}.tar.gz"
-
-SLOT="0"
-LICENSE="MIT"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~x86"
-
-DEPEND=""
-
-S="${WORKDIR}/${MY_P}"
-
-# Patch sumbitted upstream:
-# https://github.com/jaraco/keyrings.alt/pull/46
-PATCHES=( "${FILESDIR}/${P}-pycryptodome.patch" )
-
-distutils_enable_tests pytest
-distutils_enable_sphinx docs
diff --git a/dev-python/keyrings_alt/metadata.xml b/dev-python/keyrings_alt/metadata.xml
deleted file mode 100644
index 59728c331..000000000
--- a/dev-python/keyrings_alt/metadata.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
- <maintainer type="person">
- <email>gentoo@chymera.eu</email>
- <name>Horea Christian</name>
- </maintainer>
- <maintainer type="project">
- <email>sci@gentoo.org</email>
- <name>Gentoo Science Project</name>
- </maintainer>
- <longdescription lang="en">
- This package distributes backends extracted from the main Python keyring
- project to make them available for those who wish to employ them, but
- are discouraged for general production use. Include this module and use
- its backends at your own risk.
- For example, the PlaintextKeyring stores passwords in plain text on the
- file system, defeating the intended purpose of this library to encourage
- best practices for security.
- </longdescription>
- <upstream>
- <remote-id type="github">jaraco/keyrings.alt</remote-id>
- </upstream>
-</pkgmetadata>
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-09-23 21:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-23 21:37 [gentoo-commits] proj/sci:master commit in: dev-python/keyrings_alt/, dev-python/keyrings_alt/files/ Horea Christian
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox