-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vsc-tools: refactor python module structure
* Add python setuptools setup.py script. * Move python code to the vsc folder. * Move templates folder to the vsc folder. * Install vscgen tool to simplify codegenerator use via cmd. * Update github actions (use python 3.10 and vscgen). Signed-off-by: Mikhail Tsukerman <mikhail.tcukerman@daimler.com> Signed-off-by: Magnus Feuer <magnus.feuer@mercedes-benz.com>
- Loading branch information
1 parent
90b70c7
commit 3b004df
Showing
26 changed files
with
110 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
anytree>=2.8.0 | ||
Jinja2>=3.0.0 | ||
pytest>=2.7.2 | ||
PyYAML>=5.4.1 | ||
anytree==2.8.0 | ||
attrs==22.1.0 | ||
iniconfig==1.1.1 | ||
Jinja2==3.1.2 | ||
MarkupSafe==2.1.1 | ||
packaging==21.3 | ||
pluggy==1.0.0 | ||
py==1.11.0 | ||
pyparsing==3.0.9 | ||
pytest==7.1.2 | ||
PyYAML==6.0 | ||
six==1.16.0 | ||
tomli==2.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env python | ||
|
||
from distutils.core import setup | ||
from importlib.metadata import entry_points | ||
|
||
setup(name='vsc', | ||
version='0.1', | ||
description='Vehicle service catalog tools', | ||
author='', | ||
author_email='', | ||
url='https://github.com/covesa/vsc-tools', | ||
packages=['vsc','tests'], | ||
entry_points=''' | ||
[console_scripts] | ||
vscgen=vsc.scripts.generator:vsc_generator_run | ||
''' | ||
) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2022 MBition GmbH. | ||
# All rights reserved. | ||
# SPDX-License-Identifier: MPL-2.0 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2022 MBition GmbH. | ||
# All rights reserved. | ||
# SPDX-License-Identifier: MPL-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2022 MBition GmbH. | ||
# All rights reserved. | ||
# SPDX-License-Identifier: MPL-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2022 MBition GmbH. | ||
# All rights reserved. | ||
# SPDX-License-Identifier: MPL-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2022 MBition GmbH. | ||
# All rights reserved. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
from vsc.model.vsc_generator import gen | ||
from vsc.model.vsc_parser import get_ast_from_file | ||
import argparse | ||
|
||
def vsc_generator_run(): | ||
parser = argparse.ArgumentParser(description='Runs vehicle service catalog code generator.') | ||
parser.add_argument('input', metavar='input', type=str, | ||
help='input.yaml-file (path)') | ||
parser.add_argument('template', metavar='template', type=str, | ||
help='output-template-file (name only, not path)') | ||
|
||
args = parser.parse_args() | ||
|
||
ast = get_ast_from_file(args.input) | ||
|
||
templatename = args.template | ||
|
||
print(gen(ast, templatename)) | ||
|
||
|
||
if __name__ == "__main__": | ||
vsc_generator_run() |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2022 MBition GmbH. | ||
# All rights reserved. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
import os | ||
|
||
TemplatePath = os.path.dirname(os.path.realpath(__file__)) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.