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

Enable support for Python 3.9+ #4073

Merged
merged 2 commits into from Mar 26, 2024
Merged

Conversation

satta
Copy link
Contributor

@satta satta commented Mar 26, 2024

This commit basically removes Python 3.10+ language features from the code required to use the python operator in pipelines. This mostly means rewriting code using:

  • PEP-604 (Union types written with |)
  • PEP-613 (Explicit Type Aliases)
  • PEP-634 (Structural Pattern Matching)

We also lower the version requirement in pyproject.toml and update dependencies in poetry.lock.

Tests still succeed:

❯ pyenv exec poetry run pytest
=========================================================================== test session starts ===========================================================================
platform linux -- Python 3.11.2, pytest-8.1.1, pluggy-1.4.0
rootdir: /home/satta/tmp/tenzir/python
configfile: pyproject.toml
plugins: asyncio-0.23.6
asyncio: mode=Mode.AUTO
collected 15 items / 1 skipped                                                                                                                                            

tests/test_convert.py ..                                                                                                                                            [ 13%]
tests/test_utils_arrow.py .............                                                                                                                             [100%]

====================================================================== 15 passed, 1 skipped in 0.25s ======================================================================

If there is anything else to test that you know of, please do so. I have no knowledge of what remains unconvered by pytest.

Copy link
Member

@dominiklohmann dominiklohmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am willing to accept this, but please be aware that we will not restrict ourselves to compatibility with Python 3.9 in the future, as this slows down developers. If as part of future development of the Tenzir Python library someone wants to bump the minimum version, we will allow it.

libtenzir/aux/simdjson Outdated Show resolved Hide resolved
python/pyproject.toml Show resolved Hide resolved
python/poetry.lock Show resolved Hide resolved
@dominiklohmann dominiklohmann added operator Source, transformation, and sink improvement An incremental enhancement of an existing feature packaging Relating to the build scaffold labels Mar 26, 2024
This commit basically removes Python 3.10+ language features from the
code required to use the `python` operator in pipelines. This mostly
means rewriting code using:

* PEP-604 (Union types written with '|')
* PEP-613 (Explicit Type Aliases)
* PEP-634 (Structural Pattern Matching)

We also lower the version requirement in pyproject.toml and update
dependencies in poetry.lock.
@satta
Copy link
Contributor Author

satta commented Mar 26, 2024

I am willing to accept this, but please be aware that we will not restrict ourselves to compatibility with Python 3.9 in the future, as this slows down developers. If as part of future development of the Tenzir Python library someone wants to bump the minimum version, we will allow it.

TBH once Threat Bus is gone I assume we will quickly update to more recent versions of everything anyway. So I don't worry we will be kept back by this for much longer.

@dominiklohmann dominiklohmann changed the base branch from main to topic/python-39 March 26, 2024 16:17
@dominiklohmann dominiklohmann merged commit 7e35f75 into tenzir:topic/python-39 Mar 26, 2024
23 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement An incremental enhancement of an existing feature operator Source, transformation, and sink packaging Relating to the build scaffold
Projects
None yet
2 participants