Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some small cleanups to launch #759

Merged
merged 2 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Cleanup some type annotations.
Certain versions of mypy complain that these annotations
are not being used, since the annotations are only in
comments.  But we use the "inline" types everywhere else,
so switch this over to the same thing, which should remove
the warning.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
  • Loading branch information
clalancette committed Feb 13, 2024
commit 3d8e77fe7703324dc8e5722c29454c3c2dc28a58
24 changes: 12 additions & 12 deletions launch/launch/launch_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,24 @@ def __init__(
self.__argv = argv if argv is not None else []
self.__noninteractive = noninteractive

self._event_queue = asyncio.Queue() # type: asyncio.Queue
self._event_handlers = collections.deque() # type: collections.deque
self._completion_futures = [] # type: List[asyncio.Future]
self._event_queue: asyncio.Queue = asyncio.Queue()
self._event_handlers: collections.deque = collections.deque()
self._completion_futures: List[asyncio.Future] = []

self.__globals = {} # type: Dict[Text, Any]
self.__locals_stack = [] # type: List[Dict[Text, Any]]
self.__locals = {} # type: Dict[Text, Any]
self.__combined_locals_cache = None # type: Optional[Dict[Text, Any]]
self.__globals: Dict[Text, Any] = {}
self.__locals_stack: List[Dict[Text, Any]] = []
self.__locals: Dict[Text, Any] = {}
self.__combined_locals_cache: Optional[Dict[Text, Any]] = None

self.__launch_configurations_stack = [] # type: List[Dict[Text, Text]]
self.__launch_configurations = {} # type: Dict[Text, Text]
self.__launch_configurations_stack: List[Dict[Text, Text]] = []
self.__launch_configurations: Dict[Text, Text] = {}

self.__environment_stack = [] # type: List[Mapping[Text, Text]]
self.__environment_stack: List[Mapping[Text, Text]] = []
# We will reset to this copy when "reset_environment" is called
self.__environment_reset = os.environ.copy() # type: Mapping[Text, Text]
self.__environment_reset: Mapping[Text, Text] = os.environ.copy()

self.__is_shutdown = False
self.__asyncio_loop = None # type: Optional[asyncio.AbstractEventLoop]
self.__asyncio_loop: Optional[asyncio.AbstractEventLoop] = None

self.__logger = launch.logging.get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion launch/launch/logging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ def get_output_loggers(process_name, output_config):

# Mypy does not support dynamic base classes, so workaround by typing the base
# class as Any
_Base = logging.getLoggerClass() # type: Any
_Base: Any = logging.getLoggerClass()


# Track all loggers to support module resets
Expand Down