Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.12", "3.13"]
python-version: ["3.12", "3.13", "3.14"]
env:
PYTHONPATH: "."
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
- name: Run mypy on all files
run: |
mkdir .mypy_cache
poetry run mypy --install-types --cache-dir .mypy_cache --non-interactive -p dftimewolf
poetry run mypy --install-types --non-interactive --config-file ./mypy.ini
2 changes: 1 addition & 1 deletion .github/workflows/pytype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.13"]
python-version: ["3.12"] # Pytype won't suppoer higher than 3.12 - https://github.com/google/pytype/tree/main
Comment thread
ramo-j marked this conversation as resolved.

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.12", "3.13"]
python-version: ["3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
6 changes: 3 additions & 3 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ignore-patterns=^\.#

# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
# number of processors available to use.
jobs=1
jobs=0

# Control the amount of potential inferred values when inferring a single
# object. This can help the performance when dealing with large functions or
Expand All @@ -57,7 +57,7 @@ persistent=yes

# Minimum Python version to use for version dependent checks. Will default to
# the version used to run pylint.
py-version=3.12
py-version=3.13

# Discover python modules and packages in the file system subtree.
recursive=yes
Expand Down Expand Up @@ -436,7 +436,7 @@ indent-after-paren=4
indent-string=' '

# Maximum number of characters on a single line.
max-line-length=80
max-line-length=140

# Maximum number of lines in a module.
max-module-lines=1000
Expand Down
3 changes: 1 addition & 2 deletions dftimewolf/lib/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ def GetGoogleOauth2Credential(
with lock:
if os.path.exists(credentials_path):
credentials = Credentials.from_authorized_user_file(
credentials_path, scopes
)
credentials_path, scopes) # type: ignore[no-untyped-call]

# If there are no (valid) credentials available, let the user log in.
if not credentials or not credentials.valid:
Expand Down
7 changes: 3 additions & 4 deletions dftimewolf/lib/collectors/gcp_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

def _CustomToAPIRepr(self: entries.ProtobufEntry) -> Dict[str, Any]:
"""API repr (JSON format) for entry."""
info = super(entries.ProtobufEntry, self).to_api_repr()
info = super(entries.ProtobufEntry, self).to_api_repr() # type: ignore[no-untyped-call]
info['protoPayload'] = self.payload # type: ignore
return info # type: ignore

Expand Down Expand Up @@ -70,9 +70,8 @@ def SetupLoggingClient(self) -> Any:
logging.Client: A GCP logging client
"""
if self._project_name:
return logging.Client(_use_grpc=False,
project=self._project_name)
return logging.Client(_use_grpc=False)
return logging.Client(_use_grpc=False, project=self._project_name) # type: ignore[no-untyped-call]
return logging.Client(_use_grpc=False) # type: ignore[no-untyped-call]

def ListPages(self, logging_client: Any) -> Any:
"""Returns pages based on a Cloud Logging filter
Expand Down
4 changes: 2 additions & 2 deletions dftimewolf/lib/collectors/grr_hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import re
import stat
import time
from concurrent.futures import ThreadPoolExecutor
from concurrent import futures
from typing import List, Optional, Tuple, Type, Callable

import pandas as pd
Expand Down Expand Up @@ -1422,7 +1422,7 @@ def Process(self, container: containers.Host
osquery_containers = self.GetContainers(containers.OsqueryQuery)

host_osquery_futures = []
with ThreadPoolExecutor(self.GetQueryThreadPoolSize()) as executor:
with futures.ThreadPoolExecutor(self.GetQueryThreadPoolSize()) as executor:
for osquery_container in osquery_containers:
host_osquery_future = executor.submit(
self._ProcessQuery, container.hostname, client, osquery_container)
Expand Down
2 changes: 1 addition & 1 deletion dftimewolf/lib/collectors/gsheets.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def _GetCredentials(self) -> Optional[Credentials]:
if os.path.exists(credentials_path):
try:
credentials = Credentials.from_authorized_user_file(
credentials_path, self.SCOPES)
credentials_path, self.SCOPES) # type: ignore[no-untyped-call]
except ValueError as exception:
self.logger.warning(f'Unable to load credentials: {exception}')
credentials = None
Expand Down
2 changes: 1 addition & 1 deletion dftimewolf/lib/collectors/workspace_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def _GetCredentials(self) -> Optional[Credentials]:
if os.path.exists(credentials_path):
try:
credentials = Credentials.from_authorized_user_file(
credentials_path, self.SCOPES)
credentials_path, self.SCOPES) # type: ignore[no-untyped-call]
except ValueError as exception:
self.logger.warning(
f'Unable to load credentials: {exception:s}')
Expand Down
4 changes: 1 addition & 3 deletions dftimewolf/lib/processors/llmproviders/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ def _configure(self) -> None:
sa_content = json.loads(sa_file.read())
sa_credential = (
service_account.Credentials.from_service_account_info(
sa_content
)
)
sa_content)) # type: ignore[no-untyped-call]
genai.configure(credentials=sa_credential) # type: ignore
else:
raise RuntimeError(
Expand Down
2 changes: 1 addition & 1 deletion dftimewolf/lib/processors/llmproviders/vertex_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _configure(self) -> None:
with open(service_account_path) as sa_file:
info = json.loads(sa_file.read())
sa_credential = (
service_account.Credentials.from_service_account_info(info))
service_account.Credentials.from_service_account_info(info)) # type: ignore[no-untyped-call]
vertexai.init(
credentials=sa_credential,
api_key=api_key,
Expand Down
4 changes: 2 additions & 2 deletions dftimewolf/lib/processors/turbinia_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def GetCredentials(self, credentials_path: str,
if os.path.exists(credentials_path):
try:
credentials = Credentials.from_authorized_user_file(
credentials_path, scopes)
credentials_path, scopes) # type: ignore[no-untyped-call]
except ValueError as exception:
msg = f'Error loading credentials: {exception!s}'
self.ModuleError(msg, critical=True)
Expand Down Expand Up @@ -330,7 +330,7 @@ def GetCredentials(self, credentials_path: str,
# Save credentials
if credentials:
with open(credentials_path, 'w', encoding='utf-8') as token:
token.write(credentials.to_json())
token.write(credentials.to_json()) # type: ignore[no-untyped-call]

return credentials

Expand Down
5 changes: 3 additions & 2 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[mypy]
python_version = 3.10
python_version = 3.13
packages = dftimewolf
disable_error_code = override
ignore_missing_imports = True
strict = True
exclude = _pb2.py|tests
disallow_untyped_calls = False
cache_dir = .mypy_cache
Loading
Loading