From d05eadb47d2cb6ec52fb0388f309e38578ea1e7e Mon Sep 17 00:00:00 2001 From: Jirka Borovec <6035284+Borda@users.noreply.github.com> Date: Tue, 21 Nov 2023 13:55:39 +0100 Subject: [PATCH] add codespell to prevent simple typos (#754) * add codespell to prevent simple typos * fixing --- .pre-commit-config.yaml | 7 +++++++ docs/changelog.md | 18 +++++++++--------- papermill/engines.py | 2 +- papermill/exceptions.py | 2 +- papermill/translators.py | 2 +- pyproject.toml | 9 +++++++++ 6 files changed, 28 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 658c6447..cbd9ba92 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,6 +34,13 @@ repos: # - id: docformatter # args: [--in-place, --wrap-summaries=120, --wrap-descriptions=120] + - repo: https://github.com/codespell-project/codespell + rev: v2.2.6 + hooks: + - id: codespell + additional_dependencies: [tomli] + #args: ["--write-changes"] # uncomment if you want to get automatic fixing + - repo: https://github.com/psf/black rev: 23.11.0 hooks: diff --git a/docs/changelog.md b/docs/changelog.md index 9ca56f16..4d500ada 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -12,19 +12,19 @@ - Added “github” extra deps. to the “all” extra [PR #715](https://github.com/nteract/papermill/pull/715) - Github actions updated to latest version [PR #732](https://github.com/nteract/papermill/pull/732) - Added a warning if non set parameter is passed through CLI [PR #701](https://github.com/nteract/papermill/pull/701) -- Skip black formatting when encounting attribute errors [PR #699](https://github.com/nteract/papermill/pull/699) -- Removed fored deepcopy of notebook objects [PR #694](https://github.com/nteract/papermill/pull/694) +- Skip black formatting when encountering attribute errors [PR #699](https://github.com/nteract/papermill/pull/699) +- Removed forced deepcopy of notebook objects [PR #694](https://github.com/nteract/papermill/pull/694) - Always update notebook version on execute [PR #691](https://github.com/nteract/papermill/pull/691) - Set minimum version for tenacity [PR #682](https://github.com/nteract/papermill/pull/682) - Removed use of ansiwrap [PR #681](https://github.com/nteract/papermill/pull/681) -- Added precommit hook [PR #678](https://github.com/nteract/papermill/pull/678) +- Added pre-commit hook [PR #678](https://github.com/nteract/papermill/pull/678) - Added dependabot for GHA [PR #677](https://github.com/nteract/papermill/pull/677) ## 2.4.0 - Add tracking cell executions with cell descriptions [PR #650](https://github.com/nteract/papermill/pull/650) - Fixed Azure Blob URI matching for prefixes [PR #654](https://github.com/nteract/papermill/pull/654) -- Updates HDFS handler to use PyArrow.fs.HadoopFileSystm [PR #658](https://github.com/nteract/papermill/pull/658) +- Updates HDFS handler to use `PyArrow.fs.HadoopFileSystm` [PR #658](https://github.com/nteract/papermill/pull/658) - Drop support for Python 3.6 [PR #666](https://github.com/nteract/papermill/pull/666) - CI Build fixes [PR #664](https://github.com/nteract/papermill/pull/664) - Updated mock references in tests [PR #668](https://github.com/nteract/papermill/pull/668) @@ -224,7 +224,7 @@ pip install papermill[all] - Optional IO extensions are now separated into different dependencies. - Added gs:// optional dependency for google cloud storage support. -- null json fields in parmaeters now translate correctly to equivilent fields in each supported language +- null json fields in parameters now translate correctly to equivalent fields in each supported language ### Fixes @@ -240,7 +240,7 @@ pip install papermill[all] ### Features - Log level can now be set with `--log-level` -- The working directory of papermill can be set with the `--cwd` option. This will set the executing context of the kernel but not impact input/output paths. `papermill --cwd foo bar/input_nb.ipynb bar/output_nb.ipynb` would make the notebook able to reference files in the `foo` directoy without `../foo` but still save the output notebook in the `bar` directory. +- The working directory of papermill can be set with the `--cwd` option. This will set the executing context of the kernel but not impact input/output paths. `papermill --cwd foo bar/input_nb.ipynb bar/output_nb.ipynb` would make the notebook able to reference files in the `foo` directory without `../foo` but still save the output notebook in the `bar` directory. - Tox has been added for testing papermill. This makes it easier to catch linting and manifest issues without waiting for a failed Travis build. ### Fixes @@ -274,7 +274,7 @@ pip install papermill[all] - Added engines abstraction and command line argument - Moved some nbconvert wrappers out of papermill - Added Azure blob storage support -- Fixed botocore upgrade comptability issue (all version of boto now supported again) +- Fixed botocore upgrade compatibility issue (all version of boto now supported again) - Removed whitelisted environment variable assignment ## 0.15.1 @@ -286,7 +286,7 @@ pip install papermill[all] - Warnings added when an unexpected file extension is used - Papermill version is visible to the CLI - More messages us logging module now (and can be filtered accordingly) -- Binder link from README was greatly improved to demostrate papermill features +- Binder link from README was greatly improved to demonstrate papermill features ## 0.15.0 @@ -333,7 +333,7 @@ pip install papermill[all] ## 0.12.6 - Changed CLI outputs from papermill messaging to stderr -- Changed IOResolvers to perseve ordering of definition in resolving paths +- Changed IOResolvers to persevere ordering of definition in resolving paths ## 0.12.5 diff --git a/papermill/engines.py b/papermill/engines.py index e0e5c832..bb936025 100644 --- a/papermill/engines.py +++ b/papermill/engines.py @@ -108,7 +108,7 @@ def __init__( self.last_save_time = self.now() # Not exactly true, but simplifies testing logic self.pbar = None if progress_bar: - # lazy import due to implict slow ipython import + # lazy import due to implicit slow ipython import from tqdm.auto import tqdm self.pbar = tqdm(total=len(self.nb.cells), unit="cell", desc="Executing") diff --git a/papermill/exceptions.py b/papermill/exceptions.py index d27ce2bf..73ed4574 100644 --- a/papermill/exceptions.py +++ b/papermill/exceptions.py @@ -30,7 +30,7 @@ def __init__(self, cell_index, exec_count, source, ename, evalue, traceback): def __str__(self): # Standard Behavior of an exception is to produce a string representation of its arguments - # when called with str(). In order to maintain compatability with previous versions which + # when called with str(). In order to maintain compatibility with previous versions which # passed only the message to the superclass constructor, __str__ method is implemented to # provide the same result as was produced in the past. message = "\n" + 75 * "-" + "\n" diff --git a/papermill/translators.py b/papermill/translators.py index 89e89c90..490e2d5f 100644 --- a/papermill/translators.py +++ b/papermill/translators.py @@ -84,7 +84,7 @@ def translate_list(cls, val): @classmethod def translate(cls, val): - """Translate each of the standard json/yaml types to appropiate objects.""" + """Translate each of the standard json/yaml types to appropriate objects.""" if val is None: return cls.translate_none(val) elif isinstance(val, str): diff --git a/pyproject.toml b/pyproject.toml index 46db153e..15284930 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,15 @@ exclude = ''' skip-string-normalization = true +[tool.codespell] +quiet-level = 3 +# comma separated list of words; waiting for: +# https://github.com/codespell-project/codespell/issues/2839#issuecomment-1731601603 +# also adding links until they ignored by its: nature +# https://github.com/codespell-project/codespell/issues/2243#issuecomment-1732019960 +ignore-words-list = "dne, compiletime" + + [tool.ruff] line-length = 120 # Enable Pyflakes `E` and `F` codes by default.