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

[FR] Add Support for Python 3.13 #4534

Open
eric-forte-elastic opened this issue Mar 13, 2025 · 0 comments
Open

[FR] Add Support for Python 3.13 #4534

eric-forte-elastic opened this issue Mar 13, 2025 · 0 comments
Labels
community enhancement New feature or request python Internal python for the repository Team: TRADE

Comments

@eric-forte-elastic
Copy link
Contributor

eric-forte-elastic commented Mar 13, 2025

Repository Feature

Core Repo - (rule management, validation, testing, lib, cicd, etc.)

Problem Description

Summary

Thanks @NC-Netrunner for walking through this issue with us!

Currently the repo does not support using Python 3.13. Users can install the necessary packages; however, when one tries to run Detection Rules CLI commands, an error similar to the following will occur:

detection-rules on  main [?] is  v0.4.22 via  v3.13.2 (13_venv) on  eric.forte
❯ python -m detection_rules --help
Traceback (most recent call last):
 File "<frozen runpy>", line 189, in _run_module_as_main
 File "<frozen runpy>", line 148, in _get_module_details
 File "<frozen runpy>", line 112, in _get_module_details
 File "/home/forteea1/Code/clean_mains/fix_dr/detection-rules/detection_rules/__init__.py", line 13, in <module>
   from . import (  # noqa: E402
   ...<15 lines>...
   )
 File "/home/forteea1/Code/clean_mains/fix_dr/detection-rules/detection_rules/custom_rules.py", line 13, in <module>
   from .docs import REPO_DOCS_DIR
 File "/home/forteea1/Code/clean_mains/fix_dr/detection-rules/detection_rules/docs.py", line 22, in <module>
   from .packaging import Package
 File "/home/forteea1/Code/clean_mains/fix_dr/detection-rules/detection_rules/packaging.py", line 24, in <module>
   from .navigator import NavigatorBuilder, Navigator
 File "/home/forteea1/Code/clean_mains/fix_dr/detection-rules/detection_rules/navigator.py", line 18, in <module>
   from .mixins import MarshmallowDataclassMixin
 File "/home/forteea1/Code/clean_mains/fix_dr/detection-rules/detection_rules/mixins.py", line 21, in <module>
   from .schemas import definitions
 File "/home/forteea1/Code/clean_mains/fix_dr/detection-rules/detection_rules/schemas/__init__.py", line 10, in <module>
   import jsonschema
 File "/home/forteea1/Code/clean_mains/fix_dr/detection-rules/13_venv/lib/python3.13/site-packages/jsonschema/__init__.py", line 13, in <module>
   from jsonschema._format import FormatChecker
 File "/home/forteea1/Code/clean_mains/fix_dr/detection-rules/13_venv/lib/python3.13/site-packages/jsonschema/_format.py", line 11, in <module>
   from jsonschema.exceptions import FormatError
 File "/home/forteea1/Code/clean_mains/fix_dr/detection-rules/13_venv/lib/python3.13/site-packages/jsonschema/exceptions.py", line 15, in <module>
   from referencing.exceptions import Unresolvable as _Unresolvable
 File "/home/forteea1/Code/clean_mains/fix_dr/detection-rules/13_venv/lib/python3.13/site-packages/referencing/__init__.py", line 5, in <module>
   from referencing._core import Anchor, Registry, Resource, Specification
 File "/home/forteea1/Code/clean_mains/fix_dr/detection-rules/13_venv/lib/python3.13/site-packages/referencing/_core.py", line 18, in <module>
   from referencing.typing import URI, Anchor as AnchorType, D, Mapping, Retrieve
 File "/home/forteea1/Code/clean_mains/fix_dr/detection-rules/13_venv/lib/python3.13/site-packages/referencing/typing.py", line 22, in <module>
   D = TypeVar("D", default=Any)
 File "/home/forteea1/Code/clean_mains/fix_dr/detection-rules/13_venv/lib/python3.13/site-packages/typing_extensions.py", line 1455, in __new__
   _set_default(typevar, default)
   ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
 File "/home/forteea1/Code/clean_mains/fix_dr/detection-rules/13_venv/lib/python3.13/site-packages/typing_extensions.py", line 1410, in _set_default
   type_param.__default__ = typing._type_check(default, "Default must be a type")
   ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: attribute '__default__' of 'typing.TypeVar' objects is not writable

This error does not occur on Python 3.12

Image

Desired Solution

We should add support for Python 3.13 when possible.

Considered Alternatives

No response

Additional Context

No response

@eric-forte-elastic eric-forte-elastic added enhancement New feature or request Team: TRADE python Internal python for the repository community labels Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community enhancement New feature or request python Internal python for the repository Team: TRADE
Projects
None yet
Development

No branches or pull requests

1 participant