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

Start adding type annotations to gunicorn #2377

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
15 changes: 10 additions & 5 deletions gunicorn/arbiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@
import sys
import time
import traceback
from typing import TYPE_CHECKING, Any, List, Dict, Tuple

from gunicorn.errors import HaltServer, AppImportError
from gunicorn.pidfile import Pidfile
from gunicorn import sock, systemd, util

from gunicorn import __version__, SERVER_SOFTWARE

if TYPE_CHECKING:
from gunicorn.workers.base import Worker
from gunicorn.sock import BaseSocket


class Arbiter(object):
"""
Expand All @@ -33,14 +38,14 @@ class Arbiter(object):
# A flag indicating if an application failed to be loaded
APP_LOAD_ERROR = 4

START_CTX = {}
START_CTX = {} # type: Dict[Any, Any]

LISTENERS = []
WORKERS = {}
PIPE = []
LISTENERS = [] # type: List[Any]
WORKERS = {} # type: Dict[int, Worker]
PIPE = [] # type: List[Tuple[BaseSocket, BaseSocket]]

# I love dynamic languages
SIG_QUEUE = []
SIG_QUEUE = [] # type: List[Any]
SIGNALS = [getattr(signal, "SIG%s" % x)
for x in "HUP QUIT INT TERM TTIN TTOU USR1 USR2 WINCH".split()]
SIG_NAMES = dict(
Expand Down
Loading