Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
lmbsog0 committed Jan 27, 2025
2 parents cf49299 + 81fe13d commit 6fdec9f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Python package

on: [ push ]
on: [ push, pull_request ]

env:
A2L_GRPC_VERSION: v0.1.18

jobs:
generate-grpc-sources:
Expand All @@ -14,7 +17,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install grpcio-tools
wget https://github.com/Sauci/a2l-grpc/releases/download/v0.1.16/a2l_grpc.tar.gz
wget https://github.com/Sauci/a2l-grpc/releases/download/$A2L_GRPC_VERSION/a2l_grpc.tar.gz
tar -xf a2l_grpc.tar.gz -C pya2l
- name: Generate gRPC sources
run: |
Expand All @@ -41,7 +44,7 @@ jobs:
python -m pip install --upgrade pip
# see https://github.com/pytest-dev/pytest/issues/11868
pip install codecov dictdiffer grpcio-tools mktestdocs mock pytest==7.4.3 pytest-cases pytest-cov pytest-xdist
wget https://github.com/Sauci/a2l-grpc/releases/download/v0.1.17/a2l_grpc.tar.gz
wget https://github.com/Sauci/a2l-grpc/releases/download/$A2L_GRPC_VERSION/a2l_grpc.tar.gz
tar -xf a2l_grpc.tar.gz -C pya2l
- uses: actions/download-artifact@v4
with:
Expand All @@ -68,7 +71,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install codecov dictdiffer grpcio-tools mktestdocs mock pytest pytest-cases pytest-cov pytest-xdist
powershell.exe -Command "Invoke-WebRequest -OutFile ./a2l_grpc.tar.gz https://github.com/Sauci/a2l-grpc/releases/download/v0.1.17/a2l_grpc.tar.gz"
powershell.exe -Command "Invoke-WebRequest -OutFile ./a2l_grpc.tar.gz https://github.com/Sauci/a2l-grpc/releases/download/$env:A2L_GRPC_VERSION/a2l_grpc.tar.gz"
tar -xf a2l_grpc.tar.gz -C pya2l
- uses: actions/download-artifact@v4
with:
Expand All @@ -89,7 +92,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install build
wget https://github.com/Sauci/a2l-grpc/releases/download/v0.1.17/a2l_grpc.tar.gz
wget https://github.com/Sauci/a2l-grpc/releases/download/$A2L_GRPC_VERSION/a2l_grpc.tar.gz
tar -xf a2l_grpc.tar.gz -C pya2l
- uses: actions/download-artifact@v4
with:
Expand Down
10 changes: 10 additions & 0 deletions pya2l/parser_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,16 @@ def test_coeffs(module, s, float_string, float_value):
assert coeffs.F.Value == float_value


@pytest.mark.parametrize('module', [pytest.param(['COMPU_METHOD', 0, 'COEFFS_LINEAR'], id='COMPU_METHOD')], indirect=True)
@pytest.mark.parametrize('s', ['COEFFS_LINEAR {float} {float}'])
@pytest.mark.parametrize('float_string, float_value', floats)
def test_coeffs_linear(module, s, float_string, float_value):
with Parser() as p:
coeffs = get_node_from_ast(p.tree_from_a2l(module[0].format(s.format(float=float_string)).encode()), module[1])
assert coeffs.A.Value == float_value
assert coeffs.B.Value == float_value


@pytest.mark.parametrize('module', [
pytest.param(['CHARACTERISTIC', 0, 'COMPARISON_QUANTITY'], id='CHARACTERISTIC')], indirect=True)
@pytest.mark.parametrize('e', [pytest.param('COMPARISON_QUANTITY {}')])
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pya2l
version = 0.1.5
version = 0.1.6
author = Guillaume Sottas
author_email = [email protected]
description = utility for a2l files
Expand Down

0 comments on commit 6fdec9f

Please sign in to comment.