Skip to content

Commit

Permalink
Merge pull request #117 from shunichironomura/feature/add-__all__
Browse files Browse the repository at this point in the history
Add __all__
  • Loading branch information
shunichironomura authored Jul 31, 2023
2 parents e1ff0f4 + bf4b858 commit 2835012
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 2 deletions.
10 changes: 10 additions & 0 deletions capsula/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
__all__ = [
"monitor",
"__version__",
"CapsulaConfigurationError",
"CapsulaError",
"get_capsule_dir",
"get_capsule_name",
"set_capsule_dir",
"set_capsule_name",
]
from ._monitor import monitor
from ._version import __version__
from .exceptions import CapsulaConfigurationError, CapsulaError
Expand Down
15 changes: 15 additions & 0 deletions capsula/_monitor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
__all__ = [
"PreRunInfoBase",
"PreRunInfoCli",
"PreRunInfoFunc",
"OutputFileInfo",
"PostRunInfoBase",
"PostRunInfoCli",
"PostRunInfoFunc",
"ExceptionInfo",
"OutputFileInfo",
"MonitoringHandlerBase",
"MonitoringHandlerCli",
"MonitoringHandlerFunc",
"monitor",
]
import inspect
import logging
import subprocess
Expand Down
7 changes: 7 additions & 0 deletions capsula/config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
__all__ = [
"GitConfig",
"CaptureConfig",
"MonitorItemConfig",
"MonitorConfig",
"CapsulaConfig",
]
import sys
from datetime import datetime
from pathlib import Path
Expand Down
10 changes: 10 additions & 0 deletions capsula/context.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
__all__ = [
"ContextItem",
"Architecture",
"PythonInfo",
"Platform",
"GitRemote",
"GitInfo",
"FileContext",
"Context",
]
import os
import platform as pf
import sys
Expand Down
3 changes: 3 additions & 0 deletions capsula/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
__all__ = ["CapsulaError", "CapsulaConfigurationError"]


class CapsulaError(Exception):
pass

Expand Down
1 change: 1 addition & 0 deletions capsula/file.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
__all__ = ["CaptureFileConfig"]
from typing import Optional

from pydantic import BaseModel, Field, model_validator
Expand Down
7 changes: 6 additions & 1 deletion capsula/globalvars.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
__all__ = [
"set_capsule_dir",
"get_capsule_dir",
"set_capsule_name",
"get_capsule_name",
]
import os
from pathlib import Path
from typing import Union
Expand All @@ -10,7 +16,6 @@ def set_capsule_dir(path: Union[Path, str]) -> None:
os.environ["CAPSULA_CAPSULE_DIR"] = str(path)



def get_capsule_dir() -> Path:
"""Get the capsule directory used by the CLI."""
try:
Expand Down
4 changes: 4 additions & 0 deletions capsula/hash.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__all__ = [
"HashAlgorithm",
"compute_hash",
]
import hashlib
import logging
from enum import Enum
Expand Down
2 changes: 1 addition & 1 deletion reports/coverage/badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2835012

Please sign in to comment.