Skip to content

Commit

Permalink
Merge pull request #158 from shunichironomura/sort-export
Browse files Browse the repository at this point in the history
Sort export statement
  • Loading branch information
shunichironomura authored Feb 3, 2024
2 parents f9998f3 + 30db7d4 commit a42c55d
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 47 deletions.
34 changes: 17 additions & 17 deletions capsula/__init__.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
__all__ = [
"monitor",
"__version__",
"CapsulaConfigurationError",
"CapsulaError",
"get_capsule_dir",
"get_capsule_name",
"set_capsule_dir",
"set_capsule_name",
"Encapsulator",
"record",
"Run",
"CommandContext",
"ContextBase",
"CpuContext",
"CwdContext",
"Encapsulator",
"EnvVarContext",
"GitRepositoryContext",
"FileContext",
"PlatformContext",
"CpuContext",
"CommandContext",
"GitRepositoryContext",
"JsonDumpReporter",
"PlatformContext",
"ReporterBase",
"WatcherBase",
"Run",
"TimeWatcher",
"watcher",
"reporter",
"context",
"UncaughtExceptionWatcher",
"WatcherBase",
"__version__",
"context",
"get_capsule_dir",
"get_capsule_name",
"monitor",
"record",
"reporter",
"run",
"set_capsule_dir",
"set_capsule_name",
"watcher",
]
from ._context import (
CommandContext,
Expand Down
2 changes: 1 addition & 1 deletion capsula/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def monitor(ctx: click.Context, items: Iterable[str], args: tuple[str]) -> None:

handler = MonitoringHandlerCli(config=config)
pre_run_info = handler.setup(args)
post_run_info, exc = handler.run_and_teardown(pre_run_info=pre_run_info, items=items)
post_run_info, _exc = handler.run_and_teardown(pre_run_info=pre_run_info, items=items)

# propagate the exit code
ctx.exit(post_run_info.exit_code)
2 changes: 1 addition & 1 deletion capsula/_backport.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

__all__ = ["TypeAlias", "file_digest", "Self", "ParamSpec"]
__all__ = ["ParamSpec", "Self", "TypeAlias", "file_digest"]

import hashlib
import sys
Expand Down
6 changes: 3 additions & 3 deletions capsula/_context/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
__all__ = [
"CommandContext",
"ContextBase",
"CpuContext",
"CwdContext",
"EnvVarContext",
"GitRepositoryContext",
"FileContext",
"GitRepositoryContext",
"PlatformContext",
"CpuContext",
"CommandContext",
]
from ._base import ContextBase
from ._command import CommandContext
Expand Down
16 changes: 8 additions & 8 deletions capsula/_monitor.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
__all__ = [
"PreRunInfoBase",
"PreRunInfoCli",
"PreRunInfoFunc",
"OutputFileInfo",
"PostRunInfoBase",
"PostRunInfoCli",
"PostRunInfoFunc",
"ExceptionInfo",
"OutputFileInfo",
"MonitoringHandlerBase",
"MonitoringHandlerCli",
"MonitoringHandlerFunc",
"OutputFileInfo",
"OutputFileInfo",
"PostRunInfoBase",
"PostRunInfoCli",
"PostRunInfoFunc",
"PreRunInfoBase",
"PreRunInfoCli",
"PreRunInfoFunc",
"monitor",
]
import inspect
Expand Down
2 changes: 1 addition & 1 deletion capsula/_watcher/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__all__ = ["WatcherBase", "TimeWatcher", "UncaughtExceptionWatcher"]
__all__ = ["TimeWatcher", "UncaughtExceptionWatcher", "WatcherBase"]
from ._base import WatcherBase
from ._exception import UncaughtExceptionWatcher
from ._time import TimeWatcher
6 changes: 3 additions & 3 deletions capsula/config.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
__all__ = [
"GitConfig",
"CapsulaConfig",
"CaptureConfig",
"MonitorItemConfig",
"GitConfig",
"MonitorConfig",
"CapsulaConfig",
"MonitorItemConfig",
]
import sys
from datetime import datetime
Expand Down
12 changes: 6 additions & 6 deletions capsula/context_deprecated.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
__all__ = [
"ContextItem",
"Architecture",
"PythonInfo",
"Platform",
"GitRemote",
"GitInfo",
"FileContext",
"Context",
"ContextItem",
"FileContext",
"GitInfo",
"GitRemote",
"Platform",
"PythonInfo",
]
import os
import platform as pf
Expand Down
2 changes: 1 addition & 1 deletion capsula/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__all__ = ["CapsulaError", "CapsulaConfigurationError"]
__all__ = ["CapsulaConfigurationError", "CapsulaError"]


class CapsulaError(Exception):
Expand Down
4 changes: 2 additions & 2 deletions capsula/globalvars.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
__all__ = [
"set_capsule_dir",
"get_capsule_dir",
"set_capsule_name",
"get_capsule_name",
"set_capsule_dir",
"set_capsule_name",
]
import os
from pathlib import Path
Expand Down
13 changes: 9 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ ignore_missing_imports = true
[tool.ruff]
target-version = "py38"
line-length = 120
select = ["ALL"]

[tool.ruff.lint]
preview = true
explicit-preview-rules = true

select = ["ALL", "RUF022"]
ignore = [
"PLR2004", # magic numbers
"S101", # use of assert
Expand Down Expand Up @@ -81,14 +86,14 @@ ignore = [
]


[tool.ruff.flake8-type-checking]
[tool.ruff.lint.flake8-type-checking]
runtime-evaluated-base-classes = ["pydantic.BaseModel"]

[tool.ruff.pyupgrade]
[tool.ruff.lint.pyupgrade]
# Keep runtime typing for Pydantic.
keep-runtime-typing = true

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"examples/*" = [
"INP001", # implicit-namespace-package
]
Expand Down

0 comments on commit a42c55d

Please sign in to comment.