Skip to content

Commit

Permalink
setup.py: package template files in the vsc/templates folder
Browse files Browse the repository at this point in the history
Improve setup.py script to properly package and install files inside the
templates folder. Now setup.py will install the *.tpl and *.html files
into the respective python3 packages directory. This allows to use
module independently.

Signed-off-by: Mikhail Tsukerman <mikhail.tcukerman@daimler.com>
Signed-off-by: Magnus Feuer <magnus.feuer@mercedes-benz.com>
  • Loading branch information
miketsukerman authored and gunnarx committed Sep 21, 2022
1 parent f5cfeb2 commit 46cb12b
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
#!/usr/bin/env python

from distutils import extension
import glob
from distutils.core import setup
from importlib.metadata import entry_points
from setuptools import find_packages

from vsc.templates import TemplatePath

def get_template_files():
extensions = ['tpl', 'html']
paths = []
for ext in extensions:
paths.extend(glob.glob(f"{TemplatePath}/**/*.{ext}", recursive=True))

print(f"{paths}")

return paths


setup(name='vsc',
version='0.1',
description='Vehicle service catalog tools',
author='',
author_email='',
url='https://github.com/covesa/vsc-tools',
packages=['vsc','tests'],
packages=find_packages(),
package_data={
'vsc': get_template_files()
},
entry_points='''
[console_scripts]
vscgen=vsc.scripts.generator:vsc_generator_run
Expand Down

0 comments on commit 46cb12b

Please sign in to comment.