Skip to content

Commit c260fef

Browse files
committed
Support Python 3.7
Signed-off-by: Christian Vetter <christian.vetter@here.com>
1 parent 710ddb1 commit c260fef

36 files changed

Lines changed: 83 additions & 7 deletions

.github/workflows/generator.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,22 @@ env:
1212
jobs:
1313
Build:
1414
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
18+
name: Build (Python ${{ matrix.python-version }})
1519
steps:
1620
- uses: actions/checkout@v2
1721
- name: Dependencies
1822
uses: astral-sh/setup-uv@v6
23+
- name: Install Python ${{ matrix.python-version }}
24+
run: uv python install ${{ matrix.python-version }}
1925
- name: Run tests
2026
run: |
2127
cd flatdata-generator
22-
uv run --with pytest pytest -v
23-
pip install .
24-
flatdata-generator --help
28+
uv run --python ${{ matrix.python-version }} --with pytest pytest -v
2529
- name: Type check
30+
if: contains(fromJSON('["3.10", "3.11", "3.12"]'), matrix.python-version)
2631
run: |
2732
cd flatdata-generator
28-
uv run --with mypy mypy flatdata/
33+
uv run --python ${{ matrix.python-version }} --with mypy mypy flatdata/

.github/workflows/py.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,26 @@ env:
1212
jobs:
1313
Build:
1414
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
18+
name: Build (Python ${{ matrix.python-version }})
1519
steps:
1620
- uses: actions/checkout@v2
1721
- name: Dependencies
1822
uses: astral-sh/setup-uv@v6
23+
- name: Install Python ${{ matrix.python-version }}
24+
run: uv python install ${{ matrix.python-version }}
1925
- name: Run tests
2026
run: |
2127
cd flatdata-py
22-
uv venv
28+
uv venv --python ${{ matrix.python-version }}
2329
uv pip install ../flatdata-generator
2430
uv pip install ".[inspector]" pytest mypy
2531
.venv/bin/pytest -v
2632
.venv/bin/flatdata-inspector --help
2733
- name: Type check
34+
if: contains(fromJSON('["3.10", "3.11", "3.12"]'), matrix.python-version)
2835
run: |
2936
cd flatdata-py
3037
.venv/bin/mypy flatdata/

flatdata-generator/flatdata/generator/engine.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
See the LICENSE file in the root of this project for license details.
44
'''
55

6+
from __future__ import annotations
7+
68
import types
79
from typing import overload
810

flatdata-generator/flatdata/generator/generators/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
See the LICENSE file in the root of this project for license details.
44
'''
55

6+
from __future__ import annotations
7+
68
from abc import ABCMeta, abstractmethod
79
from typing import NoReturn
810

flatdata-generator/flatdata/generator/generators/cpp.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
See the LICENSE file in the root of this project for license details.
44
'''
55

6+
from __future__ import annotations
7+
68
import posixpath
79

810
from jinja2 import Environment

flatdata-generator/flatdata/generator/generators/dot.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
See the LICENSE file in the root of this project for license details.
44
'''
55

6+
from __future__ import annotations
7+
68
from flatdata.generator.tree.nodes.archive import Archive
79
from flatdata.generator.tree.nodes.trivial import Field
810
from flatdata.generator.tree.syntax_tree import SyntaxTree

flatdata-generator/flatdata/generator/generators/flatdata.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
See the LICENSE file in the root of this project for license details.
44
'''
55

6+
from __future__ import annotations
7+
68
from jinja2 import Environment
79

810
from flatdata.generator.tree.nodes.node import Node

flatdata-generator/flatdata/generator/generators/python.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Copyright (c) 2017 HERE Europe B.V.
33
See the LICENSE file in the root of this project for license details.
44
'''
5+
6+
from __future__ import annotations
57
from jinja2 import Environment
68

79
from flatdata.generator.tree.nodes.resources import Instance, Vector, Multivector, RawData

flatdata-generator/flatdata/generator/generators/rust.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Copyright (c) 2018 HERE Europe B.V.
33
See the LICENSE file in the root of this project for license details.
44
'''
5+
6+
from __future__ import annotations
57
import posixpath
68
import re
79

flatdata-generator/flatdata/generator/tree/builder.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
See the LICENSE file in the root of this project for license details.
44
'''
55

6+
from __future__ import annotations
7+
68
import os
79
from typing import Any
810

0 commit comments

Comments
 (0)