1import os
2import shutil
3
4from setuptools import setup
5
6# Builds the message registry and other data files into a python package
7
8# Copy the msg registry and comp IDs files into the subdir with
9# the __init__.py before building the package so they can reside in
10# ../site-packages/pel_registry/ instead of site-packages/registry.
11this_dir = os.path.dirname(__file__)
12target_dir = os.path.join(this_dir, "pel_registry")
13shutil.copy(
14    os.path.join(this_dir, "registry/message_registry.json"), target_dir
15)
16shutil.copy(
17    os.path.join(this_dir, "registry/O_component_ids.json"), target_dir
18)
19shutil.copy(
20    os.path.join(this_dir, "registry/B_component_ids.json"), target_dir
21)
22
23setup(
24    name="pel_message_registry",
25    version=os.getenv("PELTOOL_VERSION", "1.0"),
26    classifiers=["License :: OSI Approved :: Apache Software License"],
27    packages=["pel_registry"],
28    package_data={
29        "": [
30            "message_registry.json",
31            "O_component_ids.json",
32            "B_component_ids.json",
33        ]
34    },
35)
36