splunk / contentctl

Splunk Content Control Tool
Apache License 2.0
91 stars 25 forks source link

Python 3.13 support #302

Open ljstella opened 1 month ago

ljstella commented 1 month ago

Python 3.13.0 was released today: https://www.python.org/downloads/release/python-3130/

I do not think there's any python 3.13.0 specific features we want or need, but I would like to test to confirm contentctl functions as expected with 3.13

ljstella commented 1 month ago

Current status: I think we're waiting on Python 3.13 to land in actions/python-versions so that actions/setup-python can use it.

This also pushes us up close to 50 jobs- which is a lot! I think we can pare this back a bit too- at the moment, there are no macOS 15 runners, so macos-14 and macos-latest are duplicates currently. Additionally, I think we have some duplication between pull_request and push that we can trim.

ljstella commented 1 month ago

Update: Waiting on https://github.com/actions/python-versions/pull/312 to merge

ljstella commented 1 month ago

Update: python-version and setup-python are working now, python 3.13 installs.

Currently blocked on: pygit2 Details: https://github.com/libgit2/pygit2/issues/1317

Looks like pygit2 on master currently builds with 3.13, but there isn't a release yet.

ljstella commented 1 month ago

Tweaked the matrices and OS:

Edit: With these changes to the tests being run, the rules for expected checks need to be revisited.

ljstella commented 1 month ago

pygit2 has been updated and contentctl now installs. Looks like there's a bit of an issue with Tyro now though:

/Users/lstella/ThreatResearch/github/contentctl/.venv/lib/python3.13/site-packages/splunklib/client.py:772: SyntaxWarning: invalid escape sequence '\/'
  versionSearch = re.search('(?:servicesNS\/[^/]+\/[^/]+|services)\/[^/]+\/v(\d+)\/', path)
Traceback (most recent call last):
  File "/Users/lstella/ThreatResearch/github/contentctl/.venv/bin/contentctl", line 6, in <module>
    sys.exit(main())
             ~~~~^^
  File "/Users/lstella/ThreatResearch/github/contentctl/contentctl/contentctl.py", line 166, in main
    models = tyro.extras.subcommand_type_from_defaults(
        {
    ...<10 lines>...
        }
    )
  File "/Users/lstella/ThreatResearch/github/contentctl/.venv/lib/python3.13/site-packages/tyro/extras/_base_configs.py", line 134, in subcommand_type_from_defaults
    tuple(
    ~~~~~^
        Annotated.__class_getitem__(  # type: ignore
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<10 lines>...
        for k, v in defaults.items()
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/lstella/ThreatResearch/github/contentctl/.venv/lib/python3.13/site-packages/tyro/extras/_base_configs.py", line 135, in <genexpr>
    Annotated.__class_getitem__(  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.13/3.13.0_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/typing.py", line 548, in __getattr__
    raise AttributeError(item)
AttributeError: __class_getitem__
ljstella commented 1 week ago

Pending on https://github.com/brentyi/tyro/pull/200 to add Python 3.13 support. Confirmed current error appears to be addressed in the changes.

ljstella commented 6 days ago

Tyro 0.9.0 was released (This closes #328) but was yanked due to an issue. Once its re-released, this should be good to go.

ljstella commented 6 days ago

Tyro 0.9.1 introduced a whole new issue for us: https://github.com/brentyi/tyro/issues/203

ljstella commented 6 days ago

Re: Tyro 0.9.1- current issues are caused by the use_enum_values config for pydantic that we've already decided we want to remove (see #266 )- we should prioritize that work.