From 04b2a806314f6b26d0c4808b70b6201e17c09586 Mon Sep 17 00:00:00 2001 From: Wim Glenn Date: Thu, 14 Mar 2024 12:40:33 -0500 Subject: [PATCH] formatting --- luddite.py | 9 ++++++--- test_luddite.py | 12 ++++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/luddite.py b/luddite.py index faf6e1f..cd48467 100755 --- a/luddite.py +++ b/luddite.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # coding: utf-8 -from __future__ import unicode_literals, print_function +from __future__ import print_function +from __future__ import unicode_literals import argparse import json @@ -9,8 +10,10 @@ import sys from concurrent.futures import ThreadPoolExecutor -from packaging.requirements import Requirement, InvalidRequirement -from packaging.version import Version, InvalidVersion +from packaging.requirements import InvalidRequirement +from packaging.requirements import Requirement +from packaging.version import InvalidVersion +from packaging.version import Version try: from urllib2 import Request, urlopen diff --git a/test_luddite.py b/test_luddite.py index b3f3abe..0a30504 100644 --- a/test_luddite.py +++ b/test_luddite.py @@ -105,7 +105,12 @@ def test_parse_reqs_file_with_index(tmpdir): def test_parse_reqs_file_with_two_indices(tmpdir): reqs = tmpdir.join("reqs.txt") - reqs.write("-i http://myindex\n--index-url=http://anotherindexwtf\nabc==1.0\ndef==2.0") + reqs.write( + "-i http://myindex\n" + "--index-url=http://anotherindexwtf\n" + "abc==1.0\n" + "def==2.0" + ) file = luddite.RequirementsFile(reqs) with pytest.raises(luddite.MultipleIndicesError): file.index @@ -183,7 +188,10 @@ def test_guess_index_type_pypi(mocker): def test_guess_index_type_devpi(mocker): mock_response = mocker.MagicMock() mock_response.code = 200 - mock_response.headers = {"Content-type": "awesomesauce", "X-Devpi-Server-Version": "4.0.0\r\n"} + mock_response.headers = { + "Content-type": "awesomesauce", + "X-Devpi-Server-Version": "4.0.0\r\n", + } mocker.patch("luddite.urlopen", return_value=mock_response) assert luddite.guess_index_type("http://test-index/") == "devpi"