Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8ca6342

Browse files
committed
bt2: add local copy of typing module
Add a local copy of the typing module [1], in order to be able to use the typing module features with Python 3.4. Add notes about the license in the top-level LICENSE file. Add exclusions to avoid this file being reformatted by black and analyzed by flake8. Add an import in utils.py, such that other files will be able to use the typing module using: typing = utils._typing_mod ... and not care where the typing module comes from. [1] https://github.com/python/typing/blob/3.10.0.2/src/typing.py Change-Id: Id36fb65804ad8e00962b70f185c99325e314fee7 Signed-off-by: Simon Marchi <[email protected]> Reviewed-on: https://review.lttng.org/c/babeltrace/+/10300 Reviewed-by: Philippe Proulx <[email protected]> Tested-by: jenkins <[email protected]>
1 parent bbfe7cf commit 8ca6342

8 files changed

Lines changed: 2475 additions & 4 deletions

File tree

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ repos:
88
rev: 23.12.1
99
hooks:
1010
- id: black
11-
exclude: '(tests/utils/python/normand.py|tests/utils/python/tap/.*|tests/utils/python/typing/.*)'
11+
exclude: '(src/bindings/python/bt2/bt2/local_typing.py|tests/utils/python/normand.py|tests/utils/python/tap/.*|tests/utils/python/typing/.*)'
1212
- repo: https://github.com/pycqa/flake8
1313
rev: 7.1.1
1414
hooks:
1515
- id: flake8
16-
exclude: '(tests/utils/python/normand.py|tests/utils/python/tap/.*|tests/utils/python/typing/.*)'
16+
exclude: '(src/bindings/python/bt2/bt2/local_typing.py|tests/utils/python/normand.py|tests/utils/python/tap/.*|tests/utils/python/typing/.*)'
1717
- repo: https://github.com/pycqa/isort
1818
rev: 5.13.2
1919
hooks:
2020
- id: isort
21-
exclude: '(tests/utils/python/normand.py|tests/utils/python/tap/.*|tests/utils/python/typing/.*)'
21+
exclude: '(src/bindings/python/bt2/bt2/local_typing.py|tests/utils/python/normand.py|tests/utils/python/tap/.*|tests/utils/python/typing/.*)'

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ According with:
103103

104104
This applies to:
105105

106+
src/bindings/python/bt2/bt2/local_typing.py
106107
tests/utils/python/typing/typing.py
107108

108109
The Normand Python module is provided under the terms of the

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
(
1010
src/bindings/python/bt2/build/
1111
| src/bindings/python/bt2/setup\.py$
12+
| src/bindings/python/bt2/bt2/local_typing\.py$
1213
| src/bindings/python/bt2/bt2/native_bt\.py$
1314
| src/bindings/python/bt2/bt2/version\.py$
1415
| tests/utils/python/normand\.py$
@@ -21,6 +22,7 @@
2122
[tool.isort]
2223
profile = "black"
2324
extend_skip_glob = [
25+
"src/bindings/python/bt2/bt2/local_typing.py",
2426
"tests/utils/python/tap",
2527
"tests/utils/python/normand.py",
2628
"tests/utils/python/typing/typing.py",

setup.cfg

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@ ignore = E501,W503,E203
1414
# Has code to set up the DLL search path before imports.
1515
per-file-ignores = src/bindings/python/bt2/bt2/__init__.py:F401,E402
1616

17-
exclude = tests/utils/python/normand.py tests/utils/python/tap tests/utils/python/typing/typing.py
17+
exclude =
18+
src/bindings/python/bt2/bt2/local_typing.py
19+
tests/utils/python/normand.py
20+
tests/utils/python/tap
21+
tests/utils/python/typing/typing.py

src/bindings/python/bt2/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ STATIC_BINDINGS_DEPS = \
7575
bt2/graph.py \
7676
bt2/integer_range_set.py \
7777
bt2/interrupter.py \
78+
bt2/local_typing.py \
7879
bt2/logging.py \
7980
bt2/message.py \
8081
bt2/message_iterator.py \

0 commit comments

Comments
 (0)