Skip to content

Commit

Permalink
The codegen tool requires Python >= 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
avalentino committed Dec 27, 2023
1 parent 6e2608d commit 6694606
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions bpack/tests/test_tools_codegen.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
"""Unit tests for bpack.tools.codegen."""

import sys
import inspect
import pathlib

import pytest

import bpack.tools.codegen

from .data.flat import Flat
Expand All @@ -11,6 +14,7 @@
flat_data = pathlib.Path(__file__).parent.joinpath("data/flat.py").read_text()


@pytest.mark.skipif(sys.version_info < (3, 10), reason="needs Python >= 3.10")
def test_flat_descriptor_code_generator():
codegen = bpack.tools.codegen.FlatDescriptorCodeGenerator(
Nested, name="Flat"
Expand All @@ -20,6 +24,7 @@ def test_flat_descriptor_code_generator():
assert code.strip() == inspect.getsource(Flat).strip()


@pytest.mark.skipif(sys.version_info < (3, 10), reason="needs Python >= 3.10")
def test_flat_descriptor_code_generator_with_includes():
codegen = bpack.tools.codegen.FlatDescriptorCodeGenerator(
Nested, name="Flat"
Expand Down
3 changes: 2 additions & 1 deletion docs/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ bpack v1.2.0 (UNRELEASED)
- :func:`bpack.typing.type_params_to_str`
- :func:`bpack.descriptors.flat_fields_iterator`
* New :mod:`bpack.tools.codegen` module. It includes tool to generate flat
binary record descriptors starting from nested ones.
binary record descriptors starting from nested ones
(requires Python >= 3.10).

.. _flake8: https://github.com/pycqa/flake8
.. _PyPy3: https://www.pypy.org
Expand Down

0 comments on commit 6694606

Please sign in to comment.