Skip to content

Commit 2c6855b

Browse files
authored
Add hook to sort __all__. (#459)
1 parent 7f38d32 commit 2c6855b

File tree

9 files changed

+19
-14
lines changed

9 files changed

+19
-14
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ repos:
3939
# rev: 1.2.0
4040
# hooks:
4141
# - id: pyproject-fmt
42+
- repo: https://github.com/aio-libs/sort-all
43+
rev: v1.2.0
44+
hooks:
45+
- id: sort-all
4246
- repo: https://github.com/psf/black
4347
rev: 23.9.1
4448
hooks:

docs/source/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and
1414
execution.
1515
- {pull}`456` refers to the source code on Github when clicking on a source link.
1616
- {pull}`457` refactors everything around formatting node names.
17+
- {pull}`459` adds a pre-commit hook to sort `__all__`.
1718

1819
## 0.4.1 - 2023-10-11
1920

src/_pytask/collect_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
__all__ = [
4141
"depends_on",
4242
"parse_dependencies_from_task_function",
43-
"parse_products_from_task_function",
4443
"parse_nodes",
44+
"parse_products_from_task_function",
4545
"produces",
4646
]
4747

src/_pytask/console.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939

4040

4141
__all__ = [
42+
"console",
4243
"create_summary_panel",
43-
"create_url_style_for_task",
4444
"create_url_style_for_path",
45-
"console",
46-
"format_task_name",
45+
"create_url_style_for_task",
4746
"format_strings_as_flat_tree",
47+
"format_task_name",
4848
"get_file",
4949
"is_jupyter",
5050
"render_to_string",

src/_pytask/database_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818

1919

2020
__all__ = [
21-
"create_database",
22-
"update_states_in_database",
2321
"BaseTable",
2422
"DatabaseSession",
23+
"create_database",
24+
"update_states_in_database",
2525
]
2626

2727

src/_pytask/traceback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
__all__ = [
2222
"format_exception_without_traceback",
23-
"remove_internal_traceback_frames_from_exception",
2423
"remove_internal_traceback_frames_from_exc_info",
24+
"remove_internal_traceback_frames_from_exception",
2525
"remove_traceback_from_exc_info",
2626
"render_exc_info",
2727
]

src/_pytask/tree_util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414

1515

1616
__all__ = [
17+
"PyTree",
18+
"TREE_UTIL_LIB_DIRECTORY",
1719
"tree_flatten_with_path",
1820
"tree_leaves",
1921
"tree_map",
2022
"tree_map_with_path",
2123
"tree_structure",
22-
"PyTree",
23-
"TREE_UTIL_LIB_DIRECTORY",
2424
]
2525

2626
TREE_UTIL_LIB_DIRECTORY = Path(optree.__file__).parent

src/pytask/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,21 @@
9292
"ExecutionReport",
9393
"Exit",
9494
"ExitCode",
95-
"PathNode",
9695
"Mark",
9796
"MarkDecorator",
9897
"MarkGenerator",
9998
"MetaNode",
10099
"NodeInfo",
101100
"NodeNotCollectedError",
102101
"NodeNotFoundError",
103-
"PathNode",
104-
"Persisted",
105102
"PNode",
106103
"PPathNode",
107-
"Product",
108104
"PTask",
109105
"PTaskWithPath",
106+
"PathNode",
107+
"PathNode",
108+
"Persisted",
109+
"Product",
110110
"PytaskError",
111111
"PythonNode",
112112
"ResolvingDependenciesError",

src/pytask/tree_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111

1212
__all__ = [
13+
"PyTree",
1314
"tree_flatten_with_path",
1415
"tree_leaves",
1516
"tree_map",
1617
"tree_map_with_path",
1718
"tree_structure",
18-
"PyTree",
1919
]

0 commit comments

Comments
 (0)