From 716e19d767543e7fa036f32295c2d6469b4dff3b Mon Sep 17 00:00:00 2001 From: Branch Vincent Date: Thu, 28 Dec 2023 18:32:12 -0800 Subject: [PATCH] more manual fixes, drop requirements.txt --- freeze/tests/fakeserver.py | 1 - requirements.in | 13 ----------- requirements.txt | 47 -------------------------------------- shub/image/deploy.py | 2 +- shub/image/run/wrapper.py | 1 - shub/image/test.py | 6 ++--- tests/test_deploy.py | 5 +--- tests/test_deploy_egg.py | 3 --- tests/test_deploy_reqs.py | 3 --- tests/test_end_to_end.py | 2 -- tox.ini | 2 -- 11 files changed, 4 insertions(+), 81 deletions(-) delete mode 100644 requirements.in delete mode 100644 requirements.txt diff --git a/freeze/tests/fakeserver.py b/freeze/tests/fakeserver.py index 95cea17c..1c86c47e 100644 --- a/freeze/tests/fakeserver.py +++ b/freeze/tests/fakeserver.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python import json import multiprocessing from threading import Thread diff --git a/requirements.in b/requirements.in deleted file mode 100644 index 44dac8ae..00000000 --- a/requirements.in +++ /dev/null @@ -1,13 +0,0 @@ -docker -PyYAML -requests -retrying -toml - -click -tqdm==4.55.1 -scrapinghub>=2.4 - -# address known vulnerabilities -requests>=2.20.0 # CVE-2018-18074 -pyyaml>=4.2b1 # CVE-2017-18342 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 4cc79b1a..00000000 --- a/requirements.txt +++ /dev/null @@ -1,47 +0,0 @@ -# -# This file is autogenerated by pip-compile with python 3.6 -# To update, run: -# -# pip-compile -# -certifi==2023.11.17 - # via requests -charset-normalizer==2.0.12 - # via requests -click==8.0.4 - # via -r requirements.in -docker==5.0.3 - # via -r requirements.in -idna==3.6 - # via requests -importlib-metadata==4.8.3 - # via click -pyyaml==6.0.1 - # via -r requirements.in -requests==2.27.1 - # via - # -r requirements.in - # docker - # scrapinghub -retrying==1.3.4 - # via - # -r requirements.in - # scrapinghub -scrapinghub==2.4.0 - # via -r requirements.in -six==1.16.0 - # via - # retrying - # scrapinghub -toml==0.10.2 - # via -r requirements.in -tqdm==4.55.1 - # via -r requirements.in -typing-extensions==4.1.1 - # via importlib-metadata -urllib3==1.26.18 - # via requests -websocket-client==1.3.1 - # via docker -zipp==3.6.0 - # via importlib-metadata diff --git a/shub/image/deploy.py b/shub/image/deploy.py index 43e262cb..ee5f53d0 100644 --- a/shub/image/deploy.py +++ b/shub/image/deploy.py @@ -136,7 +136,7 @@ def show(self): super().show() def handle_event(self, event): - click.echo(f"{event}") + click.echo(event) class _DeployProgress(utils.BaseProgress): diff --git a/shub/image/run/wrapper.py b/shub/image/run/wrapper.py index aea004b1..bcd5aa25 100644 --- a/shub/image/run/wrapper.py +++ b/shub/image/run/wrapper.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python """ A helper wrapper over start-crawl to run a custom image locally. diff --git a/shub/image/test.py b/shub/image/test.py index 78eadbfc..cc5b339f 100644 --- a/shub/image/test.py +++ b/shub/image/test.py @@ -4,8 +4,6 @@ from shub.config import load_shub_config, list_targets_callback from shub.image import utils -long = int - SHORT_HELP = "Test a built image with Scrapy Cloud contract" HELP = """ A command to test an image after build step to make sure it fits contract. @@ -77,11 +75,11 @@ def _check_image_size(image_name, docker_client): from docker.errors import NotFound try: size = docker_client.inspect_image(image_name).get('Size') - if size and isinstance(size, (int, long)) and size > IMAGE_SIZE_LIMIT: + if size and isinstance(size, int) and size > IMAGE_SIZE_LIMIT: raise shub_exceptions.CustomImageTooLargeException( IMAGE_TOO_LARGE_WARNING) except NotFound as exc: - utils.debug_log(f"{exc}") + utils.debug_log(exc) raise shub_exceptions.NotFoundException( "The image doesn't exist yet, please use build command at first.") diff --git a/tests/test_deploy.py b/tests/test_deploy.py index e513c7a9..0dbc9699 100644 --- a/tests/test_deploy.py +++ b/tests/test_deploy.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python - - import os import sys import unittest @@ -257,7 +254,7 @@ def test_egg_glob_pattern(self): def test_add_sources(self): convert_deps_to_pip = Mock( side_effect=[ - './requirements.txt', + './tests/requirements.txt', ['package==0.0.0', 'hash-package==0.0.1', 'hash-package2==0.0.1'], ], ) diff --git a/tests/test_deploy_egg.py b/tests/test_deploy_egg.py index 8a6b086a..76217a02 100644 --- a/tests/test_deploy_egg.py +++ b/tests/test_deploy_egg.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python - - import os import shutil import tempfile diff --git a/tests/test_deploy_reqs.py b/tests/test_deploy_reqs.py index a7ffc022..2b4acfb0 100644 --- a/tests/test_deploy_reqs.py +++ b/tests/test_deploy_reqs.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python - - import unittest import os import tempfile diff --git a/tests/test_end_to_end.py b/tests/test_end_to_end.py index e6bc3f1f..af3d9cf8 100644 --- a/tests/test_end_to_end.py +++ b/tests/test_end_to_end.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - import unittest from click.testing import CliRunner from shub import tool diff --git a/tox.ini b/tox.ini index ff752e64..a81e1ab6 100644 --- a/tox.ini +++ b/tox.ini @@ -13,13 +13,11 @@ commands = [testenv:min] deps = {[testenv]deps} - -r requirements.txt [testenv:freeze] install_command = python -m pip install {opts} {packages} deps = - -rrequirements.txt pyinstaller==4.10 pytest packaging==20.4