From b323f3bd4dee5fc9a52f3e52ff88868fde138c9d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 14 Jan 2016 13:37:05 -0500 Subject: Resave with excess whitespace removed --- wheel/tool/__init__.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/wheel/tool/__init__.py b/wheel/tool/__init__.py index a997d1f..6f4abd7 100644 --- a/wheel/tool/__init__.py +++ b/wheel/tool/__init__.py @@ -10,7 +10,7 @@ import wheel.paths from glob import iglob from .. import signatures -from ..util import (urlsafe_b64decode, urlsafe_b64encode, native, binary, +from ..util import (urlsafe_b64decode, urlsafe_b64encode, native, binary, matches_requirement) from ..install import WheelFile @@ -94,9 +94,9 @@ def sign(wheelfile, replace=False, get_keyring=get_keyring): def unsign(wheelfile): """ Remove RECORD.jws from a wheel by truncating the zip file. - - RECORD.jws must be at the end of the archive. The zip file must be an - ordinary archive, with the compressed files and the directory in the same + + RECORD.jws must be at the end of the archive. The zip file must be an + ordinary archive, with the compressed files and the directory in the same order, and without any non-zip content after the truncation point. """ import wheel.install @@ -109,8 +109,8 @@ def unsign(wheelfile): def verify(wheelfile): """Verify a wheel. - - The signature will be verified for internal consistency ONLY and printed. + + The signature will be verified for internal consistency ONLY and printed. Wheel's own unpack/install commands verify the manifest against the signature and file contents. """ @@ -142,7 +142,7 @@ def install(requirements, requirements_file=None, wheel_dirs=None, force=False, list_files=False, dry_run=False): """Install wheels. - + :param requirements: A list of requirements or wheel files to install. :param requirements_file: A file containing requirements to install. :param wheel_dirs: A list of directories to search for wheels. @@ -243,7 +243,7 @@ def install_scripts(distributions): def convert(installers, dest_dir, verbose): require_pkgresources('wheel convert') - + # Only support wheel convert if pkg_resources is present from ..wininst2wheel import bdist_wininst2wheel from ..egg2wheel import egg2wheel @@ -318,7 +318,7 @@ def parser(): "but don't actually install anything.") install_parser.set_defaults(func=install_f) - def install_scripts_f(args): + def install_scripts_f(args): install_scripts(args.distributions) install_scripts_parser = s.add_parser('install-scripts', help='Install console_scripts') install_scripts_parser.add_argument('distributions', nargs='*', -- cgit v1.2.1 From 15af49d3b04214834b520c90ab43a6f56553b8b2 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 14 Jan 2016 13:41:14 -0500 Subject: More simply render keyrings using repr. Planned versions of keyring will move the file-based backends. This technique will be more robust, and updates to keyrings.alt will allow the file path to be included in the repr. --- wheel/tool/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/wheel/tool/__init__.py b/wheel/tool/__init__.py index 6f4abd7..389e619 100644 --- a/wheel/tool/__init__.py +++ b/wheel/tool/__init__.py @@ -47,10 +47,7 @@ def keygen(get_keyring=get_keyring): kr = keyring.get_keyring() kr.set_password("wheel", vk, sk) sys.stdout.write("Created Ed25519 keypair with vk={0}\n".format(vk)) - if isinstance(kr, keyring.backends.file.BaseKeyring): - sys.stdout.write("in {0}\n".format(kr.file_path)) - else: - sys.stdout.write("in %r\n" % kr.__class__) + sys.stdout.write("in {0!r}\n".format(kr)) sk2 = kr.get_password('wheel', vk) if sk2 != sk: -- cgit v1.2.1 From 2cfafb1b82b59a98f45dde570e1433774206d97b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 2 Feb 2016 19:57:50 -0500 Subject: Resave without excess whitespace --- wheel/test/test_tool.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wheel/test/test_tool.py b/wheel/test/test_tool.py index 31a927c..bce7fd2 100644 --- a/wheel/test/test_tool.py +++ b/wheel/test/test_tool.py @@ -1,13 +1,13 @@ from .. import tool -def test_keygen(): +def test_keygen(): def get_keyring(): WheelKeys, keyring = tool.get_keyring() - + class WheelKeysTest(WheelKeys): def save(self): pass - + class keyringTest: backend = keyring.backend class backends: @@ -20,9 +20,9 @@ def test_keygen(): self.pw = c def get_password(self, a, b): return self.pw - + return keyringTest2() - + return WheelKeysTest, keyringTest - + tool.keygen(get_keyring=get_keyring) -- cgit v1.2.1 From 6f5c73fa83765d1d23552ee7ca0b68704409969f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 2 Feb 2016 19:59:11 -0500 Subject: Remove monkeypatch of keyring.backends.file, no longer necessary --- wheel/test/test_tool.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/wheel/test/test_tool.py b/wheel/test/test_tool.py index bce7fd2..078f1ed 100644 --- a/wheel/test/test_tool.py +++ b/wheel/test/test_tool.py @@ -9,9 +9,6 @@ def test_keygen(): pass class keyringTest: - backend = keyring.backend - class backends: - file = keyring.backends.file @classmethod def get_keyring(cls): class keyringTest2: -- cgit v1.2.1 From 8cd33fccc7384ef531731b6ddf87c19f7f768d20 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 2 Feb 2016 20:03:13 -0500 Subject: Update signatures to require keyrings.alt for improved compatibility with keyring 8.0 --- setup.py | 2 +- wheel/tool/__init__.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 62cd584..24957ca 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,7 @@ setup(name='wheel', ], extras_require={ ':python_version=="2.6"': ['argparse'], - 'signatures': ['keyring'], + 'signatures': ['keyring', 'keyrings.alt'], 'signatures:sys_platform!="win32"': ['pyxdg'], 'faster-signatures': ['ed25519ll'], 'tool': [] diff --git a/wheel/tool/__init__.py b/wheel/tool/__init__.py index 389e619..95f0a9b 100644 --- a/wheel/tool/__init__.py +++ b/wheel/tool/__init__.py @@ -29,8 +29,9 @@ def get_keyring(): try: from ..signatures import keys import keyring - except ImportError: - raise WheelError("Install wheel[signatures] (requires keyring, pyxdg) for signatures.") + assert keyring.get_keyring().priority + except (ImportError, AssertionError): + raise WheelError("Install wheel[signatures] (requires keyring, keyrings.alt, pyxdg) for signatures.") return keys.WheelKeys, keyring def keygen(get_keyring=get_keyring): -- cgit v1.2.1