From bd8a07790c051d388d20c272d7ba20b8e6983148 Mon Sep 17 00:00:00 2001 From: Tyson Smith Date: Mon, 18 Nov 2024 16:20:05 -0800 Subject: [PATCH 1/3] build: switch project to src-layout --- MANIFEST.in | 10 +++++----- setup.cfg | 2 ++ {grizzly => src/grizzly}/__init__.py | 0 {grizzly => src/grizzly}/__main__.py | 0 {grizzly => src/grizzly}/adapter/__init__.py | 0 {grizzly => src/grizzly}/adapter/adapter.py | 0 .../grizzly}/adapter/no_op_adapter/__init__.py | 0 .../grizzly}/adapter/no_op_adapter/test_no_op.py | 0 {grizzly => src/grizzly}/adapter/test_adapter.py | 0 {grizzly => src/grizzly}/args.py | 0 {grizzly => src/grizzly}/common/__init__.py | 0 {grizzly => src/grizzly}/common/bugzilla.py | 0 {grizzly => src/grizzly}/common/fuzzmanager.py | 0 {grizzly => src/grizzly}/common/harness.html | 0 {grizzly => src/grizzly}/common/iomanager.py | 0 {grizzly => src/grizzly}/common/plugins.py | 0 {grizzly => src/grizzly}/common/post_launch_delay.html | 0 {grizzly => src/grizzly}/common/report.py | 0 {grizzly => src/grizzly}/common/reporter.py | 0 {grizzly => src/grizzly}/common/runner.py | 0 {grizzly => src/grizzly}/common/stack_hasher.py | 0 {grizzly => src/grizzly}/common/status.py | 0 {grizzly => src/grizzly}/common/status_reporter.py | 0 {grizzly => src/grizzly}/common/storage.py | 3 ++- {grizzly => src/grizzly}/common/test_bugzilla.py | 0 {grizzly => src/grizzly}/common/test_fuzzmanager.py | 0 {grizzly => src/grizzly}/common/test_iomanager.py | 0 {grizzly => src/grizzly}/common/test_plugins.py | 0 {grizzly => src/grizzly}/common/test_report.py | 0 {grizzly => src/grizzly}/common/test_reporter.py | 0 {grizzly => src/grizzly}/common/test_runner.py | 0 {grizzly => src/grizzly}/common/test_stack_hasher.py | 0 {grizzly => src/grizzly}/common/test_status.py | 0 .../grizzly}/common/test_status_reporter.py | 0 {grizzly => src/grizzly}/common/test_storage.py | 0 {grizzly => src/grizzly}/common/test_utils.py | 0 {grizzly => src/grizzly}/common/utils.py | 0 {grizzly => src/grizzly}/conftest.py | 0 {grizzly => src/grizzly}/main.py | 0 {grizzly => src/grizzly}/py.typed | 0 {grizzly => src/grizzly}/reduce/__init__.py | 0 {grizzly => src/grizzly}/reduce/__main__.py | 0 {grizzly => src/grizzly}/reduce/args.py | 0 {grizzly => src/grizzly}/reduce/bucket.py | 0 {grizzly => src/grizzly}/reduce/conftest.py | 0 {grizzly => src/grizzly}/reduce/core.py | 0 {grizzly => src/grizzly}/reduce/crash.py | 0 {grizzly => src/grizzly}/reduce/exceptions.py | 0 {grizzly => src/grizzly}/reduce/strategies/__init__.py | 0 {grizzly => src/grizzly}/reduce/strategies/beautify.py | 0 {grizzly => src/grizzly}/reduce/strategies/lithium.py | 0 .../grizzly}/reduce/strategies/testcases.py | 0 {grizzly => src/grizzly}/reduce/test_main.py | 0 {grizzly => src/grizzly}/reduce/test_main_fm.py | 0 {grizzly => src/grizzly}/reduce/test_reduce.py | 0 {grizzly => src/grizzly}/reduce/test_strategies.py | 0 .../grizzly}/reduce/test_strategies_beautify.py | 0 {grizzly => src/grizzly}/replay/__init__.py | 0 {grizzly => src/grizzly}/replay/__main__.py | 0 {grizzly => src/grizzly}/replay/args.py | 0 {grizzly => src/grizzly}/replay/bucket.py | 0 {grizzly => src/grizzly}/replay/bugzilla.py | 0 {grizzly => src/grizzly}/replay/conftest.py | 0 {grizzly => src/grizzly}/replay/crash.py | 0 {grizzly => src/grizzly}/replay/replay.py | 0 {grizzly => src/grizzly}/replay/test_args.py | 0 {grizzly => src/grizzly}/replay/test_bugzilla.py | 0 {grizzly => src/grizzly}/replay/test_main.py | 0 {grizzly => src/grizzly}/replay/test_main_fm.py | 0 {grizzly => src/grizzly}/replay/test_replay.py | 0 {grizzly => src/grizzly}/session.py | 0 {grizzly => src/grizzly}/target/__init__.py | 0 {grizzly => src/grizzly}/target/assets.py | 0 {grizzly => src/grizzly}/target/puppet_target.py | 0 {grizzly => src/grizzly}/target/target.py | 0 {grizzly => src/grizzly}/target/target_monitor.py | 0 {grizzly => src/grizzly}/target/test_assets.py | 0 {grizzly => src/grizzly}/target/test_puppet_target.py | 0 {grizzly => src/grizzly}/target/test_target.py | 0 {grizzly => src/grizzly}/target/test_target_monitor.py | 0 {grizzly => src/grizzly}/test_args.py | 0 {grizzly => src/grizzly}/test_main.py | 0 {grizzly => src/grizzly}/test_session.py | 0 {loki => src/loki}/README.md | 0 {loki => src/loki}/__init__.py | 0 {loki => src/loki}/__main__.py | 0 {loki => src/loki}/args.py | 0 {loki => src/loki}/loki.py | 0 {loki => src/loki}/py.typed | 0 {loki => src/loki}/test_loki.py | 0 {sapphire => src/sapphire}/__init__.py | 0 {sapphire => src/sapphire}/__main__.py | 0 {sapphire => src/sapphire}/certificate_bundle.py | 0 {sapphire => src/sapphire}/conftest.py | 0 {sapphire => src/sapphire}/connection_manager.py | 0 {sapphire => src/sapphire}/core.py | 0 {sapphire => src/sapphire}/job.py | 0 {sapphire => src/sapphire}/py.typed | 0 {sapphire => src/sapphire}/server_map.py | 0 {sapphire => src/sapphire}/test_connection_manager.py | 0 {sapphire => src/sapphire}/test_job.py | 0 {sapphire => src/sapphire}/test_sapphire.py | 0 {sapphire => src/sapphire}/test_server_map.py | 0 {sapphire => src/sapphire}/test_worker.py | 0 {sapphire => src/sapphire}/worker.py | 0 105 files changed, 9 insertions(+), 6 deletions(-) rename {grizzly => src/grizzly}/__init__.py (100%) rename {grizzly => src/grizzly}/__main__.py (100%) rename {grizzly => src/grizzly}/adapter/__init__.py (100%) rename {grizzly => src/grizzly}/adapter/adapter.py (100%) rename {grizzly => src/grizzly}/adapter/no_op_adapter/__init__.py (100%) rename {grizzly => src/grizzly}/adapter/no_op_adapter/test_no_op.py (100%) rename {grizzly => src/grizzly}/adapter/test_adapter.py (100%) rename {grizzly => src/grizzly}/args.py (100%) rename {grizzly => src/grizzly}/common/__init__.py (100%) rename {grizzly => src/grizzly}/common/bugzilla.py (100%) rename {grizzly => src/grizzly}/common/fuzzmanager.py (100%) rename {grizzly => src/grizzly}/common/harness.html (100%) rename {grizzly => src/grizzly}/common/iomanager.py (100%) rename {grizzly => src/grizzly}/common/plugins.py (100%) rename {grizzly => src/grizzly}/common/post_launch_delay.html (100%) rename {grizzly => src/grizzly}/common/report.py (100%) rename {grizzly => src/grizzly}/common/reporter.py (100%) rename {grizzly => src/grizzly}/common/runner.py (100%) rename {grizzly => src/grizzly}/common/stack_hasher.py (100%) rename {grizzly => src/grizzly}/common/status.py (100%) rename {grizzly => src/grizzly}/common/status_reporter.py (100%) rename {grizzly => src/grizzly}/common/storage.py (99%) rename {grizzly => src/grizzly}/common/test_bugzilla.py (100%) rename {grizzly => src/grizzly}/common/test_fuzzmanager.py (100%) rename {grizzly => src/grizzly}/common/test_iomanager.py (100%) rename {grizzly => src/grizzly}/common/test_plugins.py (100%) rename {grizzly => src/grizzly}/common/test_report.py (100%) rename {grizzly => src/grizzly}/common/test_reporter.py (100%) rename {grizzly => src/grizzly}/common/test_runner.py (100%) rename {grizzly => src/grizzly}/common/test_stack_hasher.py (100%) rename {grizzly => src/grizzly}/common/test_status.py (100%) rename {grizzly => src/grizzly}/common/test_status_reporter.py (100%) rename {grizzly => src/grizzly}/common/test_storage.py (100%) rename {grizzly => src/grizzly}/common/test_utils.py (100%) rename {grizzly => src/grizzly}/common/utils.py (100%) rename {grizzly => src/grizzly}/conftest.py (100%) rename {grizzly => src/grizzly}/main.py (100%) rename {grizzly => src/grizzly}/py.typed (100%) rename {grizzly => src/grizzly}/reduce/__init__.py (100%) rename {grizzly => src/grizzly}/reduce/__main__.py (100%) rename {grizzly => src/grizzly}/reduce/args.py (100%) rename {grizzly => src/grizzly}/reduce/bucket.py (100%) rename {grizzly => src/grizzly}/reduce/conftest.py (100%) rename {grizzly => src/grizzly}/reduce/core.py (100%) rename {grizzly => src/grizzly}/reduce/crash.py (100%) rename {grizzly => src/grizzly}/reduce/exceptions.py (100%) rename {grizzly => src/grizzly}/reduce/strategies/__init__.py (100%) rename {grizzly => src/grizzly}/reduce/strategies/beautify.py (100%) rename {grizzly => src/grizzly}/reduce/strategies/lithium.py (100%) rename {grizzly => src/grizzly}/reduce/strategies/testcases.py (100%) rename {grizzly => src/grizzly}/reduce/test_main.py (100%) rename {grizzly => src/grizzly}/reduce/test_main_fm.py (100%) rename {grizzly => src/grizzly}/reduce/test_reduce.py (100%) rename {grizzly => src/grizzly}/reduce/test_strategies.py (100%) rename {grizzly => src/grizzly}/reduce/test_strategies_beautify.py (100%) rename {grizzly => src/grizzly}/replay/__init__.py (100%) rename {grizzly => src/grizzly}/replay/__main__.py (100%) rename {grizzly => src/grizzly}/replay/args.py (100%) rename {grizzly => src/grizzly}/replay/bucket.py (100%) rename {grizzly => src/grizzly}/replay/bugzilla.py (100%) rename {grizzly => src/grizzly}/replay/conftest.py (100%) rename {grizzly => src/grizzly}/replay/crash.py (100%) rename {grizzly => src/grizzly}/replay/replay.py (100%) rename {grizzly => src/grizzly}/replay/test_args.py (100%) rename {grizzly => src/grizzly}/replay/test_bugzilla.py (100%) rename {grizzly => src/grizzly}/replay/test_main.py (100%) rename {grizzly => src/grizzly}/replay/test_main_fm.py (100%) rename {grizzly => src/grizzly}/replay/test_replay.py (100%) rename {grizzly => src/grizzly}/session.py (100%) rename {grizzly => src/grizzly}/target/__init__.py (100%) rename {grizzly => src/grizzly}/target/assets.py (100%) rename {grizzly => src/grizzly}/target/puppet_target.py (100%) rename {grizzly => src/grizzly}/target/target.py (100%) rename {grizzly => src/grizzly}/target/target_monitor.py (100%) rename {grizzly => src/grizzly}/target/test_assets.py (100%) rename {grizzly => src/grizzly}/target/test_puppet_target.py (100%) rename {grizzly => src/grizzly}/target/test_target.py (100%) rename {grizzly => src/grizzly}/target/test_target_monitor.py (100%) rename {grizzly => src/grizzly}/test_args.py (100%) rename {grizzly => src/grizzly}/test_main.py (100%) rename {grizzly => src/grizzly}/test_session.py (100%) rename {loki => src/loki}/README.md (100%) rename {loki => src/loki}/__init__.py (100%) rename {loki => src/loki}/__main__.py (100%) rename {loki => src/loki}/args.py (100%) rename {loki => src/loki}/loki.py (100%) rename {loki => src/loki}/py.typed (100%) rename {loki => src/loki}/test_loki.py (100%) rename {sapphire => src/sapphire}/__init__.py (100%) rename {sapphire => src/sapphire}/__main__.py (100%) rename {sapphire => src/sapphire}/certificate_bundle.py (100%) rename {sapphire => src/sapphire}/conftest.py (100%) rename {sapphire => src/sapphire}/connection_manager.py (100%) rename {sapphire => src/sapphire}/core.py (100%) rename {sapphire => src/sapphire}/job.py (100%) rename {sapphire => src/sapphire}/py.typed (100%) rename {sapphire => src/sapphire}/server_map.py (100%) rename {sapphire => src/sapphire}/test_connection_manager.py (100%) rename {sapphire => src/sapphire}/test_job.py (100%) rename {sapphire => src/sapphire}/test_sapphire.py (100%) rename {sapphire => src/sapphire}/test_server_map.py (100%) rename {sapphire => src/sapphire}/test_worker.py (100%) rename {sapphire => src/sapphire}/worker.py (100%) diff --git a/MANIFEST.in b/MANIFEST.in index 0cb61074..fb11301b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ -include loki/py.typed -include grizzly/common/harness.html -include grizzly/common/post_launch_delay.html -include grizzly/py.typed -include sapphire/py.typed +include src/loki/py.typed +include src/grizzly/common/harness.html +include src/grizzly/common/post_launch_delay.html +include src/grizzly/py.typed +include src/sapphire/py.typed diff --git a/setup.cfg b/setup.cfg index 6f184ebd..684d8599 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,6 +29,8 @@ install_requires = lithium-reducer >= 3.0.0 prefpicker >= 1.23.0 psutil >= 5.9.4 +package_dir = + = src packages = grizzly grizzly.adapter diff --git a/grizzly/__init__.py b/src/grizzly/__init__.py similarity index 100% rename from grizzly/__init__.py rename to src/grizzly/__init__.py diff --git a/grizzly/__main__.py b/src/grizzly/__main__.py similarity index 100% rename from grizzly/__main__.py rename to src/grizzly/__main__.py diff --git a/grizzly/adapter/__init__.py b/src/grizzly/adapter/__init__.py similarity index 100% rename from grizzly/adapter/__init__.py rename to src/grizzly/adapter/__init__.py diff --git a/grizzly/adapter/adapter.py b/src/grizzly/adapter/adapter.py similarity index 100% rename from grizzly/adapter/adapter.py rename to src/grizzly/adapter/adapter.py diff --git a/grizzly/adapter/no_op_adapter/__init__.py b/src/grizzly/adapter/no_op_adapter/__init__.py similarity index 100% rename from grizzly/adapter/no_op_adapter/__init__.py rename to src/grizzly/adapter/no_op_adapter/__init__.py diff --git a/grizzly/adapter/no_op_adapter/test_no_op.py b/src/grizzly/adapter/no_op_adapter/test_no_op.py similarity index 100% rename from grizzly/adapter/no_op_adapter/test_no_op.py rename to src/grizzly/adapter/no_op_adapter/test_no_op.py diff --git a/grizzly/adapter/test_adapter.py b/src/grizzly/adapter/test_adapter.py similarity index 100% rename from grizzly/adapter/test_adapter.py rename to src/grizzly/adapter/test_adapter.py diff --git a/grizzly/args.py b/src/grizzly/args.py similarity index 100% rename from grizzly/args.py rename to src/grizzly/args.py diff --git a/grizzly/common/__init__.py b/src/grizzly/common/__init__.py similarity index 100% rename from grizzly/common/__init__.py rename to src/grizzly/common/__init__.py diff --git a/grizzly/common/bugzilla.py b/src/grizzly/common/bugzilla.py similarity index 100% rename from grizzly/common/bugzilla.py rename to src/grizzly/common/bugzilla.py diff --git a/grizzly/common/fuzzmanager.py b/src/grizzly/common/fuzzmanager.py similarity index 100% rename from grizzly/common/fuzzmanager.py rename to src/grizzly/common/fuzzmanager.py diff --git a/grizzly/common/harness.html b/src/grizzly/common/harness.html similarity index 100% rename from grizzly/common/harness.html rename to src/grizzly/common/harness.html diff --git a/grizzly/common/iomanager.py b/src/grizzly/common/iomanager.py similarity index 100% rename from grizzly/common/iomanager.py rename to src/grizzly/common/iomanager.py diff --git a/grizzly/common/plugins.py b/src/grizzly/common/plugins.py similarity index 100% rename from grizzly/common/plugins.py rename to src/grizzly/common/plugins.py diff --git a/grizzly/common/post_launch_delay.html b/src/grizzly/common/post_launch_delay.html similarity index 100% rename from grizzly/common/post_launch_delay.html rename to src/grizzly/common/post_launch_delay.html diff --git a/grizzly/common/report.py b/src/grizzly/common/report.py similarity index 100% rename from grizzly/common/report.py rename to src/grizzly/common/report.py diff --git a/grizzly/common/reporter.py b/src/grizzly/common/reporter.py similarity index 100% rename from grizzly/common/reporter.py rename to src/grizzly/common/reporter.py diff --git a/grizzly/common/runner.py b/src/grizzly/common/runner.py similarity index 100% rename from grizzly/common/runner.py rename to src/grizzly/common/runner.py diff --git a/grizzly/common/stack_hasher.py b/src/grizzly/common/stack_hasher.py similarity index 100% rename from grizzly/common/stack_hasher.py rename to src/grizzly/common/stack_hasher.py diff --git a/grizzly/common/status.py b/src/grizzly/common/status.py similarity index 100% rename from grizzly/common/status.py rename to src/grizzly/common/status.py diff --git a/grizzly/common/status_reporter.py b/src/grizzly/common/status_reporter.py similarity index 100% rename from grizzly/common/status_reporter.py rename to src/grizzly/common/status_reporter.py diff --git a/grizzly/common/storage.py b/src/grizzly/common/storage.py similarity index 99% rename from grizzly/common/storage.py rename to src/grizzly/common/storage.py index fe9adfcc..4f150b70 100644 --- a/grizzly/common/storage.py +++ b/src/grizzly/common/storage.py @@ -78,7 +78,8 @@ def __init__( self.env_vars: dict[str, str] = {} self.hang = False self.https = False - self.input_fname = input_fname # file that was used to create the test case + # file that was used to create the test case + self.input_fname = input_fname self.entry_point = self.sanitize_path(entry_point) self.timestamp = time() if timestamp is None else timestamp self.version = GRZ_VERSION diff --git a/grizzly/common/test_bugzilla.py b/src/grizzly/common/test_bugzilla.py similarity index 100% rename from grizzly/common/test_bugzilla.py rename to src/grizzly/common/test_bugzilla.py diff --git a/grizzly/common/test_fuzzmanager.py b/src/grizzly/common/test_fuzzmanager.py similarity index 100% rename from grizzly/common/test_fuzzmanager.py rename to src/grizzly/common/test_fuzzmanager.py diff --git a/grizzly/common/test_iomanager.py b/src/grizzly/common/test_iomanager.py similarity index 100% rename from grizzly/common/test_iomanager.py rename to src/grizzly/common/test_iomanager.py diff --git a/grizzly/common/test_plugins.py b/src/grizzly/common/test_plugins.py similarity index 100% rename from grizzly/common/test_plugins.py rename to src/grizzly/common/test_plugins.py diff --git a/grizzly/common/test_report.py b/src/grizzly/common/test_report.py similarity index 100% rename from grizzly/common/test_report.py rename to src/grizzly/common/test_report.py diff --git a/grizzly/common/test_reporter.py b/src/grizzly/common/test_reporter.py similarity index 100% rename from grizzly/common/test_reporter.py rename to src/grizzly/common/test_reporter.py diff --git a/grizzly/common/test_runner.py b/src/grizzly/common/test_runner.py similarity index 100% rename from grizzly/common/test_runner.py rename to src/grizzly/common/test_runner.py diff --git a/grizzly/common/test_stack_hasher.py b/src/grizzly/common/test_stack_hasher.py similarity index 100% rename from grizzly/common/test_stack_hasher.py rename to src/grizzly/common/test_stack_hasher.py diff --git a/grizzly/common/test_status.py b/src/grizzly/common/test_status.py similarity index 100% rename from grizzly/common/test_status.py rename to src/grizzly/common/test_status.py diff --git a/grizzly/common/test_status_reporter.py b/src/grizzly/common/test_status_reporter.py similarity index 100% rename from grizzly/common/test_status_reporter.py rename to src/grizzly/common/test_status_reporter.py diff --git a/grizzly/common/test_storage.py b/src/grizzly/common/test_storage.py similarity index 100% rename from grizzly/common/test_storage.py rename to src/grizzly/common/test_storage.py diff --git a/grizzly/common/test_utils.py b/src/grizzly/common/test_utils.py similarity index 100% rename from grizzly/common/test_utils.py rename to src/grizzly/common/test_utils.py diff --git a/grizzly/common/utils.py b/src/grizzly/common/utils.py similarity index 100% rename from grizzly/common/utils.py rename to src/grizzly/common/utils.py diff --git a/grizzly/conftest.py b/src/grizzly/conftest.py similarity index 100% rename from grizzly/conftest.py rename to src/grizzly/conftest.py diff --git a/grizzly/main.py b/src/grizzly/main.py similarity index 100% rename from grizzly/main.py rename to src/grizzly/main.py diff --git a/grizzly/py.typed b/src/grizzly/py.typed similarity index 100% rename from grizzly/py.typed rename to src/grizzly/py.typed diff --git a/grizzly/reduce/__init__.py b/src/grizzly/reduce/__init__.py similarity index 100% rename from grizzly/reduce/__init__.py rename to src/grizzly/reduce/__init__.py diff --git a/grizzly/reduce/__main__.py b/src/grizzly/reduce/__main__.py similarity index 100% rename from grizzly/reduce/__main__.py rename to src/grizzly/reduce/__main__.py diff --git a/grizzly/reduce/args.py b/src/grizzly/reduce/args.py similarity index 100% rename from grizzly/reduce/args.py rename to src/grizzly/reduce/args.py diff --git a/grizzly/reduce/bucket.py b/src/grizzly/reduce/bucket.py similarity index 100% rename from grizzly/reduce/bucket.py rename to src/grizzly/reduce/bucket.py diff --git a/grizzly/reduce/conftest.py b/src/grizzly/reduce/conftest.py similarity index 100% rename from grizzly/reduce/conftest.py rename to src/grizzly/reduce/conftest.py diff --git a/grizzly/reduce/core.py b/src/grizzly/reduce/core.py similarity index 100% rename from grizzly/reduce/core.py rename to src/grizzly/reduce/core.py diff --git a/grizzly/reduce/crash.py b/src/grizzly/reduce/crash.py similarity index 100% rename from grizzly/reduce/crash.py rename to src/grizzly/reduce/crash.py diff --git a/grizzly/reduce/exceptions.py b/src/grizzly/reduce/exceptions.py similarity index 100% rename from grizzly/reduce/exceptions.py rename to src/grizzly/reduce/exceptions.py diff --git a/grizzly/reduce/strategies/__init__.py b/src/grizzly/reduce/strategies/__init__.py similarity index 100% rename from grizzly/reduce/strategies/__init__.py rename to src/grizzly/reduce/strategies/__init__.py diff --git a/grizzly/reduce/strategies/beautify.py b/src/grizzly/reduce/strategies/beautify.py similarity index 100% rename from grizzly/reduce/strategies/beautify.py rename to src/grizzly/reduce/strategies/beautify.py diff --git a/grizzly/reduce/strategies/lithium.py b/src/grizzly/reduce/strategies/lithium.py similarity index 100% rename from grizzly/reduce/strategies/lithium.py rename to src/grizzly/reduce/strategies/lithium.py diff --git a/grizzly/reduce/strategies/testcases.py b/src/grizzly/reduce/strategies/testcases.py similarity index 100% rename from grizzly/reduce/strategies/testcases.py rename to src/grizzly/reduce/strategies/testcases.py diff --git a/grizzly/reduce/test_main.py b/src/grizzly/reduce/test_main.py similarity index 100% rename from grizzly/reduce/test_main.py rename to src/grizzly/reduce/test_main.py diff --git a/grizzly/reduce/test_main_fm.py b/src/grizzly/reduce/test_main_fm.py similarity index 100% rename from grizzly/reduce/test_main_fm.py rename to src/grizzly/reduce/test_main_fm.py diff --git a/grizzly/reduce/test_reduce.py b/src/grizzly/reduce/test_reduce.py similarity index 100% rename from grizzly/reduce/test_reduce.py rename to src/grizzly/reduce/test_reduce.py diff --git a/grizzly/reduce/test_strategies.py b/src/grizzly/reduce/test_strategies.py similarity index 100% rename from grizzly/reduce/test_strategies.py rename to src/grizzly/reduce/test_strategies.py diff --git a/grizzly/reduce/test_strategies_beautify.py b/src/grizzly/reduce/test_strategies_beautify.py similarity index 100% rename from grizzly/reduce/test_strategies_beautify.py rename to src/grizzly/reduce/test_strategies_beautify.py diff --git a/grizzly/replay/__init__.py b/src/grizzly/replay/__init__.py similarity index 100% rename from grizzly/replay/__init__.py rename to src/grizzly/replay/__init__.py diff --git a/grizzly/replay/__main__.py b/src/grizzly/replay/__main__.py similarity index 100% rename from grizzly/replay/__main__.py rename to src/grizzly/replay/__main__.py diff --git a/grizzly/replay/args.py b/src/grizzly/replay/args.py similarity index 100% rename from grizzly/replay/args.py rename to src/grizzly/replay/args.py diff --git a/grizzly/replay/bucket.py b/src/grizzly/replay/bucket.py similarity index 100% rename from grizzly/replay/bucket.py rename to src/grizzly/replay/bucket.py diff --git a/grizzly/replay/bugzilla.py b/src/grizzly/replay/bugzilla.py similarity index 100% rename from grizzly/replay/bugzilla.py rename to src/grizzly/replay/bugzilla.py diff --git a/grizzly/replay/conftest.py b/src/grizzly/replay/conftest.py similarity index 100% rename from grizzly/replay/conftest.py rename to src/grizzly/replay/conftest.py diff --git a/grizzly/replay/crash.py b/src/grizzly/replay/crash.py similarity index 100% rename from grizzly/replay/crash.py rename to src/grizzly/replay/crash.py diff --git a/grizzly/replay/replay.py b/src/grizzly/replay/replay.py similarity index 100% rename from grizzly/replay/replay.py rename to src/grizzly/replay/replay.py diff --git a/grizzly/replay/test_args.py b/src/grizzly/replay/test_args.py similarity index 100% rename from grizzly/replay/test_args.py rename to src/grizzly/replay/test_args.py diff --git a/grizzly/replay/test_bugzilla.py b/src/grizzly/replay/test_bugzilla.py similarity index 100% rename from grizzly/replay/test_bugzilla.py rename to src/grizzly/replay/test_bugzilla.py diff --git a/grizzly/replay/test_main.py b/src/grizzly/replay/test_main.py similarity index 100% rename from grizzly/replay/test_main.py rename to src/grizzly/replay/test_main.py diff --git a/grizzly/replay/test_main_fm.py b/src/grizzly/replay/test_main_fm.py similarity index 100% rename from grizzly/replay/test_main_fm.py rename to src/grizzly/replay/test_main_fm.py diff --git a/grizzly/replay/test_replay.py b/src/grizzly/replay/test_replay.py similarity index 100% rename from grizzly/replay/test_replay.py rename to src/grizzly/replay/test_replay.py diff --git a/grizzly/session.py b/src/grizzly/session.py similarity index 100% rename from grizzly/session.py rename to src/grizzly/session.py diff --git a/grizzly/target/__init__.py b/src/grizzly/target/__init__.py similarity index 100% rename from grizzly/target/__init__.py rename to src/grizzly/target/__init__.py diff --git a/grizzly/target/assets.py b/src/grizzly/target/assets.py similarity index 100% rename from grizzly/target/assets.py rename to src/grizzly/target/assets.py diff --git a/grizzly/target/puppet_target.py b/src/grizzly/target/puppet_target.py similarity index 100% rename from grizzly/target/puppet_target.py rename to src/grizzly/target/puppet_target.py diff --git a/grizzly/target/target.py b/src/grizzly/target/target.py similarity index 100% rename from grizzly/target/target.py rename to src/grizzly/target/target.py diff --git a/grizzly/target/target_monitor.py b/src/grizzly/target/target_monitor.py similarity index 100% rename from grizzly/target/target_monitor.py rename to src/grizzly/target/target_monitor.py diff --git a/grizzly/target/test_assets.py b/src/grizzly/target/test_assets.py similarity index 100% rename from grizzly/target/test_assets.py rename to src/grizzly/target/test_assets.py diff --git a/grizzly/target/test_puppet_target.py b/src/grizzly/target/test_puppet_target.py similarity index 100% rename from grizzly/target/test_puppet_target.py rename to src/grizzly/target/test_puppet_target.py diff --git a/grizzly/target/test_target.py b/src/grizzly/target/test_target.py similarity index 100% rename from grizzly/target/test_target.py rename to src/grizzly/target/test_target.py diff --git a/grizzly/target/test_target_monitor.py b/src/grizzly/target/test_target_monitor.py similarity index 100% rename from grizzly/target/test_target_monitor.py rename to src/grizzly/target/test_target_monitor.py diff --git a/grizzly/test_args.py b/src/grizzly/test_args.py similarity index 100% rename from grizzly/test_args.py rename to src/grizzly/test_args.py diff --git a/grizzly/test_main.py b/src/grizzly/test_main.py similarity index 100% rename from grizzly/test_main.py rename to src/grizzly/test_main.py diff --git a/grizzly/test_session.py b/src/grizzly/test_session.py similarity index 100% rename from grizzly/test_session.py rename to src/grizzly/test_session.py diff --git a/loki/README.md b/src/loki/README.md similarity index 100% rename from loki/README.md rename to src/loki/README.md diff --git a/loki/__init__.py b/src/loki/__init__.py similarity index 100% rename from loki/__init__.py rename to src/loki/__init__.py diff --git a/loki/__main__.py b/src/loki/__main__.py similarity index 100% rename from loki/__main__.py rename to src/loki/__main__.py diff --git a/loki/args.py b/src/loki/args.py similarity index 100% rename from loki/args.py rename to src/loki/args.py diff --git a/loki/loki.py b/src/loki/loki.py similarity index 100% rename from loki/loki.py rename to src/loki/loki.py diff --git a/loki/py.typed b/src/loki/py.typed similarity index 100% rename from loki/py.typed rename to src/loki/py.typed diff --git a/loki/test_loki.py b/src/loki/test_loki.py similarity index 100% rename from loki/test_loki.py rename to src/loki/test_loki.py diff --git a/sapphire/__init__.py b/src/sapphire/__init__.py similarity index 100% rename from sapphire/__init__.py rename to src/sapphire/__init__.py diff --git a/sapphire/__main__.py b/src/sapphire/__main__.py similarity index 100% rename from sapphire/__main__.py rename to src/sapphire/__main__.py diff --git a/sapphire/certificate_bundle.py b/src/sapphire/certificate_bundle.py similarity index 100% rename from sapphire/certificate_bundle.py rename to src/sapphire/certificate_bundle.py diff --git a/sapphire/conftest.py b/src/sapphire/conftest.py similarity index 100% rename from sapphire/conftest.py rename to src/sapphire/conftest.py diff --git a/sapphire/connection_manager.py b/src/sapphire/connection_manager.py similarity index 100% rename from sapphire/connection_manager.py rename to src/sapphire/connection_manager.py diff --git a/sapphire/core.py b/src/sapphire/core.py similarity index 100% rename from sapphire/core.py rename to src/sapphire/core.py diff --git a/sapphire/job.py b/src/sapphire/job.py similarity index 100% rename from sapphire/job.py rename to src/sapphire/job.py diff --git a/sapphire/py.typed b/src/sapphire/py.typed similarity index 100% rename from sapphire/py.typed rename to src/sapphire/py.typed diff --git a/sapphire/server_map.py b/src/sapphire/server_map.py similarity index 100% rename from sapphire/server_map.py rename to src/sapphire/server_map.py diff --git a/sapphire/test_connection_manager.py b/src/sapphire/test_connection_manager.py similarity index 100% rename from sapphire/test_connection_manager.py rename to src/sapphire/test_connection_manager.py diff --git a/sapphire/test_job.py b/src/sapphire/test_job.py similarity index 100% rename from sapphire/test_job.py rename to src/sapphire/test_job.py diff --git a/sapphire/test_sapphire.py b/src/sapphire/test_sapphire.py similarity index 100% rename from sapphire/test_sapphire.py rename to src/sapphire/test_sapphire.py diff --git a/sapphire/test_server_map.py b/src/sapphire/test_server_map.py similarity index 100% rename from sapphire/test_server_map.py rename to src/sapphire/test_server_map.py diff --git a/sapphire/test_worker.py b/src/sapphire/test_worker.py similarity index 100% rename from sapphire/test_worker.py rename to src/sapphire/test_worker.py diff --git a/sapphire/worker.py b/src/sapphire/worker.py similarity index 100% rename from sapphire/worker.py rename to src/sapphire/worker.py From c81060d0297d842f993352e327b59aa2b845b0a4 Mon Sep 17 00:00:00 2001 From: Tyson Smith Date: Mon, 18 Nov 2024 16:58:37 -0800 Subject: [PATCH 2/3] fix: remove casts that are no longer required --- src/grizzly/common/report.py | 3 +-- src/grizzly/common/reporter.py | 3 +-- src/grizzly/common/storage.py | 3 +-- src/grizzly/target/assets.py | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/grizzly/common/report.py b/src/grizzly/common/report.py index 8dc4163e..deff9ea2 100644 --- a/src/grizzly/common/report.py +++ b/src/grizzly/common/report.py @@ -474,5 +474,4 @@ def tail(in_file: Path, size_limit: int) -> None: out_fp.write(b"[LOG TAILED]\n") copyfileobj(in_fp, out_fp, 0x10000) # 64KB chunks in_file.unlink() - # Python 3.9+: move() accepts a path-like object for both src and dst - move(out_file, str(in_file.resolve())) + move(out_file, in_file) diff --git a/src/grizzly/common/reporter.py b/src/grizzly/common/reporter.py index 10a33a40..7e481400 100644 --- a/src/grizzly/common/reporter.py +++ b/src/grizzly/common/reporter.py @@ -173,8 +173,7 @@ def _submit_report( log_path = dest / f"{self.report_prefix}_logs" if log_path.is_dir(): LOG.warning("Report log path exists '%s'", log_path) - # Python 3.9+: move() accepts a path-like object for both src and dst - move(str(report.path.resolve()), str(log_path.resolve())) + move(report.path, log_path) # avoid filling the disk free_space = disk_usage(str(log_path.resolve())).free if free_space < self.min_space: diff --git a/src/grizzly/common/storage.py b/src/grizzly/common/storage.py index 4f150b70..b960ff8c 100644 --- a/src/grizzly/common/storage.py +++ b/src/grizzly/common/storage.py @@ -209,8 +209,7 @@ def add_from_file( if copy: copyfile(src_file, dst_file) else: - # Python 3.9+: move() accepts a path-like object for both src and dst - move(str(src_file.resolve()), str(dst_file.resolve())) + move(src_file, dst_file) # entry_point is always 'required' if required or url_path == self.entry_point: diff --git a/src/grizzly/target/assets.py b/src/grizzly/target/assets.py index c550ba3c..142bddfb 100644 --- a/src/grizzly/target/assets.py +++ b/src/grizzly/target/assets.py @@ -60,8 +60,7 @@ def add(self, asset: str, path: Path, copy: bool = True) -> Path: else: copytree(path, dst) else: - # Python 3.9+: move() accepts a path-like object for both src and dst - move(str(path.resolve()), str(self.path.resolve())) + move(path, self.path) self.assets[asset] = path.name LOG.debug("%s asset %r to '%s'", "copied" if copy else "moved", asset, dst) return dst From b9aff3c7d9d0f82a3a7a62a0d988f4caf90d576b Mon Sep 17 00:00:00 2001 From: Tyson Smith Date: Mon, 18 Nov 2024 17:00:24 -0800 Subject: [PATCH 3/3] fix(sapphire): unquote() is now able to handle bytes --- src/sapphire/test_worker.py | 5 +++++ src/sapphire/worker.py | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/sapphire/test_worker.py b/src/sapphire/test_worker.py index 7f439930..d332e9c4 100644 --- a/src/sapphire/test_worker.py +++ b/src/sapphire/test_worker.py @@ -198,13 +198,18 @@ def test_response_01(req, method, scheme, path): @mark.parametrize( "req", [ + b"", b"a", # Invalid IPv6 URL b"GET http://[test/ HTTP/1.1", + # Missing Path b"GET HTTP/1.1", + # Invalid Path b"GET a a a a a HTTP/1.1", # Invalid characters under NFKC normalization b"GET http://%E2%84%80/ HTTP/1.1", + # Missing method + b" / HTTP/1.1", ], ) def test_response_02(req): diff --git a/src/sapphire/worker.py b/src/sapphire/worker.py index a261d4d7..95b9d2dc 100644 --- a/src/sapphire/worker.py +++ b/src/sapphire/worker.py @@ -50,10 +50,9 @@ def parse(cls, raw_data: bytes) -> Request | None: # TODO: parse headers if needed + raw_url = req_match.group("url") try: - url_str = req_match.group("url").decode("ascii", errors="replace") - # unquote() accepts str | bytes as of Python 3.9 - url = urlparse(unquote(url_str)) + url = urlparse(unquote(raw_url)) except ValueError as exc: msg = str(exc) if ( @@ -61,7 +60,7 @@ def parse(cls, raw_data: bytes) -> Request | None: and "Invalid IPv6 URL" not in msg and "does not appear to be an IPv4 or IPv6 address" not in msg ): - LOG.error("Failed to parse URL: %r", url_str) + LOG.error("Failed to parse URL: %r", raw_url) raise LOG.debug("failed to parse url from request") return None