Skip to content

Commit

Permalink
Update documentation for installing in isolated env (#724)
Browse files Browse the repository at this point in the history
* Update documentation for installing in isolated env

* update params

* update docs

* domaintools fix for tldextract
tldextract 5.0 has changed result type from namedtuple to dataclass

* Typo in previous fix

* Typo 2 in previous fix

* Typo 3

* Mypy suppression for fix type check

* New mypy suppression
In observationlist.py ln 96 - likely new mypy version

---------

Co-authored-by: Christopher Cianelli <ccianelli@microsoft.com>
Co-authored-by: Ian Hellen <ianhelle@microsoft.com>
  • Loading branch information
3 people committed Oct 12, 2023
1 parent 61ed9dc commit 04a4336
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/source/getting_started/Installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ Example:

.. code-block:: powershell
python \path\to\python\file --python-version "3.8.5" --module-name "msticpy[sentinel]" --module-version "2.7.0" --directory \path\to\destination
python [path]\download_python_package.py --python-version "3.8.5" --package-name "msticpy[sentinel]" --package-version "2.7.0" --directory \path\to\destination
3. Copy the directory folder to the isolated environment.

Expand Down
2 changes: 1 addition & 1 deletion msticpy/analysis/observationlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def all_fields(cls) -> Set[str]:
Set of all field names.
"""
return {field.name for field in attr.fields(cls)}
return {field.name for field in attr.fields(cls)} # type: ignore[misc]

def display(self):
"""Display the observation."""
Expand Down
6 changes: 5 additions & 1 deletion msticpy/context/domain_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import json
import ssl
import time
from dataclasses import asdict
from datetime import datetime
from enum import Enum
from typing import Any, Dict, Optional, Tuple
Expand Down Expand Up @@ -261,7 +262,10 @@ def dns_components(domain: str) -> dict:
Returns subdomain and TLD components from a domain.
"""
return tldextract.extract(domain.lower())._asdict()
result = tldextract.extract(domain.lower())
if isinstance(result, tuple):
return result._asdict() # type: ignore
return asdict(result)


def url_components(url: str) -> Dict[str, str]:
Expand Down

0 comments on commit 04a4336

Please sign in to comment.