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