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

upgrade pyre version in fbcode/fbpcs - batch 1 #2295

Open
wants to merge 1 commit into
base: main
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
1 change: 1 addition & 0 deletions fbpcs/common/service/secret_scrubber.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class SecretScrubber:
REPLACEMENT_STR: str = "********"

def __init__(self) -> None:
# pyre-fixme[24]: Generic type `re.Pattern` expects 1 type parameter.
self.patterns: Dict[str, re.Pattern] = {
secret.name: re.compile(secret.regex_pattern_str) for secret in self.SECRETS
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# initiate
print("Loading lambda function...")

# pyre-fixme[24]: Generic type `re.Pattern` expects 1 type parameter.
BROWSER_NAME_REGEXES: List[Tuple[re.Pattern, str]] = [
(re.compile(r".*Chrome.*Mobile Safari/[0-9.]+$"), "Chrome Mobile"),
(re.compile(r".*Chrome.*Safari/[0-9.]+$"), "Chrome Desktop"),
Expand All @@ -31,13 +32,15 @@
(re.compile(r".*FB4A.*"), "Facebook for Android"),
]

# pyre-fixme[24]: Generic type `re.Pattern` expects 1 type parameter.
DEVICE_OS_REGEXES: List[Tuple[re.Pattern, str]] = [
(re.compile(r".*(CPU OS|iPhone OS|CPU iPhone).*"), "iOS"),
(re.compile(r".*Android.*"), "Android"),
(re.compile(r".*Windows NT.*"), "Windows NT"),
(re.compile(r".*Mac OS X.*"), "Mac OS X"),
]

# pyre-fixme[24]: Generic type `re.Pattern` expects 1 type parameter.
OS_VERSION_REGEXES: List[re.Pattern] = [
re.compile(r".*(CPU OS|iPhone OS|CPU iPhone) +(\d+)[_\.](\d+)(?:[_\.](\d+))?.*"),
re.compile(r".*(Intel Mac OS X) +(\d+)[_\.](\d+)(?:[_\.](\d+))?.*"),
Expand Down
2 changes: 2 additions & 0 deletions fbpcs/utils/abstract_file_ctx.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def abstract_file_reader_path(path: pathlib.Path) -> pathlib.Path:
return pathlib.Path(path)


# pyre-fixme[24]: Generic type `contextlib.AbstractContextManager` expects 1 type
# parameter.
def abstract_file_writer_ctx(path: pathlib.Path) -> contextlib.AbstractContextManager:
if path.parts[0].lower() == S3_PATH_DRIVE:
region = os.environ.get("PL_AWS_REGION")
Expand Down