diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2bb775938..80660ca74 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,12 +6,12 @@ repos: - repo: https://github.com/ambv/black - rev: 22.3.0 + rev: 23.11.0 hooks: - id: black args: [--line-length=100] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v4.5.0 hooks: - id: trailing-whitespace # ensures files are either empty or end with a blank line @@ -27,6 +27,6 @@ repos: - id: isort args: ["--profile", "black", --line-length=100] - repo: https://github.com/pycqa/flake8 - rev: 5.0.4 + rev: 6.1.0 hooks: - id: flake8 diff --git a/contrib/setup.cfg b/contrib/setup.cfg index 26946c07b..b8abec40d 100644 --- a/contrib/setup.cfg +++ b/contrib/setup.cfg @@ -2,8 +2,13 @@ max-line-length = 100 exclude = build/,.git/,venv/ ignore = - E203, # whitespace before ':' \ - E402, # module level import not at top of file \ - E501, # line too long \ - W503, # line break before binary operator \ - W605 # invalid escape sequence + # whitespace before ':' + E203, + # module level import not at top of file + E402, + # line too long + E501, + # line break before binary operator + W503, + # invalid escape sequence + W605 diff --git a/examples/data_quality/pandera/run_ray.py b/examples/data_quality/pandera/run_ray.py index 7313bab6a..e750b2545 100644 --- a/examples/data_quality/pandera/run_ray.py +++ b/examples/data_quality/pandera/run_ray.py @@ -26,7 +26,6 @@ from hamilton.plugins import h_ray if __name__ == "__main__": - logging.basicConfig(stream=sys.stdout) logger = logging.getLogger(__name__) # Setup a local cluster. diff --git a/examples/data_quality/simple/run_ray.py b/examples/data_quality/simple/run_ray.py index 0e4b595dc..7adddd896 100644 --- a/examples/data_quality/simple/run_ray.py +++ b/examples/data_quality/simple/run_ray.py @@ -26,7 +26,6 @@ from hamilton.plugins import h_ray if __name__ == "__main__": - logging.basicConfig(stream=sys.stdout) logger = logging.getLogger(__name__) # Setup a local cluster. diff --git a/examples/decoupling_io/adapters.py b/examples/decoupling_io/adapters.py index b1486d3a4..8e861356a 100644 --- a/examples/decoupling_io/adapters.py +++ b/examples/decoupling_io/adapters.py @@ -45,7 +45,6 @@ @dataclasses.dataclass class SklearnPlotSaver(DataSaver): - path: Union[str, PathLike] # kwargs dpi: float = 200 diff --git a/examples/model_examples/time-series/utils.py b/examples/model_examples/time-series/utils.py index e5632c063..5293d5e8c 100644 --- a/examples/model_examples/time-series/utils.py +++ b/examples/model_examples/time-series/utils.py @@ -19,7 +19,6 @@ def reduce_mem_usage(df: pd.DataFrame, name: str, verbose=True): for col in df.columns: col_type = df[col].dtypes if col_type in numerics: - c_min = df[col].min() c_max = df[col].max() if str(col_type)[:3] == "int": diff --git a/hamilton/experimental/h_async.py b/hamilton/experimental/h_async.py index cd84e19bf..3c3cd1be4 100644 --- a/hamilton/experimental/h_async.py +++ b/hamilton/experimental/h_async.py @@ -67,7 +67,7 @@ async def new_fn(fn=callabl, **fn_kwargs): task_dict = {key: process_value(value) for key, value in fn_kwargs.items()} fn_kwargs = await await_dict_of_tasks(task_dict) if inspect.iscoroutinefunction(fn): - return await (fn(**fn_kwargs)) + return await fn(**fn_kwargs) return fn(**fn_kwargs) coroutine = new_fn(**kwargs) diff --git a/hamilton/plugins/sklearn_plot_extensions.py b/hamilton/plugins/sklearn_plot_extensions.py index 2d4bcbd4a..9ddcacebc 100644 --- a/hamilton/plugins/sklearn_plot_extensions.py +++ b/hamilton/plugins/sklearn_plot_extensions.py @@ -46,7 +46,6 @@ @dataclasses.dataclass class SklearnPlotSaver(DataSaver): - path: Union[str, PathLike] # kwargs dpi: float = 200 diff --git a/scripts/test_memory.py b/scripts/test_memory.py index a3358842a..8567fca75 100644 --- a/scripts/test_memory.py +++ b/scripts/test_memory.py @@ -49,7 +49,7 @@ def foo_0(memory_size: int = 100_000_000) -> pd.DataFrame: @parameterize( - **{f"foo_{i}": {"foo_i_minus_one": source(f"foo_{i-1}")} for i in range(1, NUM_ITERS)} + **{f"foo_{i}": {"foo_i_minus_one": source(f"foo_{i - 1}")} for i in range(1, NUM_ITERS)} ) def foo_i(foo_i_minus_one: pd.DataFrame) -> pd.DataFrame: global count @@ -61,4 +61,4 @@ def foo_i(foo_i_minus_one: pd.DataFrame) -> pd.DataFrame: if __name__ == "__main__": mod = create_temporary_module(foo_i, foo_0) dr = driver.Builder().with_modules(mod).build() - output = dr.execute([f"foo_{NUM_ITERS-1}"], inputs=dict(memory_size=100_000_000)) + output = dr.execute([f"foo_{NUM_ITERS - 1}"], inputs=dict(memory_size=100_000_000)) diff --git a/setup.cfg b/setup.cfg index 26946c07b..b8abec40d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,8 +2,13 @@ max-line-length = 100 exclude = build/,.git/,venv/ ignore = - E203, # whitespace before ':' \ - E402, # module level import not at top of file \ - E501, # line too long \ - W503, # line break before binary operator \ - W605 # invalid escape sequence + # whitespace before ':' + E203, + # module level import not at top of file + E402, + # line too long + E501, + # line break before binary operator + W503, + # invalid escape sequence + W605 diff --git a/writeups/garbage_collection/memory_test.py b/writeups/garbage_collection/memory_test.py index 7794a8754..572517bbb 100644 --- a/writeups/garbage_collection/memory_test.py +++ b/writeups/garbage_collection/memory_test.py @@ -46,7 +46,7 @@ def foo_0(memory_size: int = 100_000_000) -> pd.DataFrame: @parameterize( - **{f"foo_{i}": {"foo_i_minus_one": source(f"foo_{i-1}")} for i in range(1, NUM_ITERS)} + **{f"foo_{i}": {"foo_i_minus_one": source(f"foo_{i - 1}")} for i in range(1, NUM_ITERS)} ) def foo_i(foo_i_minus_one: pd.DataFrame) -> pd.DataFrame: global count @@ -56,7 +56,6 @@ def foo_i(foo_i_minus_one: pd.DataFrame) -> pd.DataFrame: if __name__ == "__main__": - import os import psutil