From 6f51b7f540eddd79c6d74485cf42557f310a7102 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Tue, 16 Dec 2025 01:53:18 +0800 Subject: [PATCH] Fix typos Found via `codespell -L alog,hart` Signed-off-by: Kian-Meng Ang --- Makefile | 2 +- README.md | 2 +- import_tracker/import_tracker.py | 2 +- import_tracker/lazy_import_errors.py | 6 +++--- scripts/build_wheel.sh | 2 +- test/test_import_tracker.py | 2 +- test/test_setup_tools.py | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index fdcc19c..619590a 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ all: help -# NOTE: Help stolen from operator-sdk auto-generated makfile! +# NOTE: Help stolen from operator-sdk auto-generated makefile! .PHONY: help help: ## Display this help. @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_0-9-\\.]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) diff --git a/README.md b/README.md index 7a34f53..d540eae 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ my_module/ ### Enabling `lazy_import_errors` -The `import_tracker.lazy_import_errors` function can be invoked directly to enable lazy import errors globally, or used as a context manager to enable them only for a selcted set of modules. +The `import_tracker.lazy_import_errors` function can be invoked directly to enable lazy import errors globally, or used as a context manager to enable them only for a selected set of modules. To globally enable lazy import errors, `my_module/__init__.py` would look like the following: diff --git a/import_tracker/import_tracker.py b/import_tracker/import_tracker.py index 5723fea..fa514e2 100644 --- a/import_tracker/import_tracker.py +++ b/import_tracker/import_tracker.py @@ -224,7 +224,7 @@ def track_module( def _get_dylib_dir(): - """Differnet versions/builds of python manage different builtin libraries as + """Different versions/builds of python manage different builtin libraries as "builtins" versus extensions. As such, we need some heuristics to try to find the base directory that holds shared objects from the standard library. """ diff --git a/import_tracker/lazy_import_errors.py b/import_tracker/lazy_import_errors.py index 482f9e8..4e6e670 100644 --- a/import_tracker/lazy_import_errors.py +++ b/import_tracker/lazy_import_errors.py @@ -39,7 +39,7 @@ def lazy_import_errors( setup_tools.parse_requirements. (Mutually exclusive with make_error_message) make_error_message: Optional[Callable[[str], str]] - Optional callable that takes the name of the module which faild to + Optional callable that takes the name of the module which failed to import and returns an error message string to be used for the ModuleNotFoundError. (Mutually exclusive with get_extras_modules) """ @@ -221,10 +221,10 @@ def __call__(self, *_, **__): if _is_import_time(): # Calling _LazyErrorAttr at import time may happen if the attribute # is a decorator from a missing dependency, in this case we want - # the call to succeed but the resulting value to deffer the error. + # the call to succeed but the resulting value to defer the error. # Other import time calls besides decorators could occur, such as # as constants, in those cases, we also want the call to succeed - # and the result value to be a defferred error + # and the result value to be a deferred error return self self._raise() diff --git a/scripts/build_wheel.sh b/scripts/build_wheel.sh index 18f7351..7f4176d 100755 --- a/scripts/build_wheel.sh +++ b/scripts/build_wheel.sh @@ -40,7 +40,7 @@ while (($# > 0)); do -v | --release_version) shift; release_version="$1";; *) - echo "Unkown argument: $1" + echo "Unknown argument: $1" show_help exit 2 ;; diff --git a/test/test_import_tracker.py b/test/test_import_tracker.py index 672ad02..8a5ecea 100644 --- a/test/test_import_tracker.py +++ b/test/test_import_tracker.py @@ -394,7 +394,7 @@ def test_upstream_optional_deps(): def test_get_imports_no_bytecode(): - """Excercise _get_imports and _mod_defined_in_init_file on a module with no + """Exercise _get_imports and _mod_defined_in_init_file on a module with no bytecode to ensure that they doesn't explode! """ new_mod = ModuleType("new_mod") diff --git a/test/test_setup_tools.py b/test/test_setup_tools.py index 4970bda..09274f4 100644 --- a/test/test_setup_tools.py +++ b/test/test_setup_tools.py @@ -178,7 +178,7 @@ def test_parent_direct_deps(): def test_nested_deps(): - """Make sure that direct depencencies show up in requirements + """Make sure that direct dependencies show up in requirements for nested modules """ requirements, extras_require = parse_requirements( @@ -197,7 +197,7 @@ def test_nested_deps(): def test_full_depth_direct_and_transitive(): """Make sure that a library which holds a dependency as both a direct import dependency and also requires it transitively through another third party - library correclty allocates the dependency to places where the intermediate + library correctly allocates the dependency to places where the intermediate third party library is required. """ # Run without full_depth and ensure that alog is only allocated to foo and