tests: use a local `typing` module with Python 3.4 only
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 22 Sep 2023 15:35:22 +0000 (11:35 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 13 Oct 2023 15:46:37 +0000 (11:46 -0400)
commit7747a39ff4d33f722737ff57a1a3b69cca97909a
treea5b92c847b377138499022fe3dc18a7815566439
parent86f24b106e04c81bf252f2a4b1b99ad99b938de8
tests: use a local `typing` module with Python 3.4 only

This patch changes the strategy to support the `typing` module in tests.

To make it possible to include compatible third-party/portable Python
modules as is, Python needs to find the `typing` module. Python 3.5+
will find it, but Python 3.4 won't.

To fix this:

1. `tests/utils/utils.sh` calls the Python interpreter specified by
   BT_TESTS_PYTHON_BIN to get the Python version.

2. The run_python() function in `tests/utils/utils.sh` adds the
   `tests/utils/python/typing` directory to `PYTHONPATH` if the version
   of Python is 3.4.

3. Move `tests/utils/python/local_typing.py` to
   `tests/utils/python/typing/typing.py`.

4. Remove `tests/utils/python/utils.py` (not needed anymore).

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ifc939f617627ff11cd6a7cbf8642c7b33006d303
Reviewed-on: https://review.lttng.org/c/babeltrace/+/10915
Tested-by: jenkins <jenkins@lttng.org>
LICENSE
pyproject.toml
setup.cfg
tests/utils/python/local_typing.py [deleted file]
tests/utils/python/typing/typing.py [new file with mode: 0644]
tests/utils/python/utils.py [deleted file]
tests/utils/utils.sh
This page took 0.025547 seconds and 4 git commands to generate.