Matt Spinler | bf7fca7 | 2022-05-03 10:51:52 -0500 | [diff] [blame] | 1 | import os |
| 2 | import shutil |
| 3 | |
Patrick Williams | d27675d | 2022-12-08 06:18:00 -0600 | [diff] [blame] | 4 | from setuptools import setup |
| 5 | |
Matt Spinler | bf7fca7 | 2022-05-03 10:51:52 -0500 | [diff] [blame] | 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. |
| 11 | this_dir = os.path.dirname(__file__) |
Patrick Williams | e6555f5 | 2022-08-04 13:56:17 -0500 | [diff] [blame] | 12 | target_dir = os.path.join(this_dir, "pel_registry") |
| 13 | shutil.copy( |
| 14 | os.path.join(this_dir, "registry/message_registry.json"), target_dir |
| 15 | ) |
| 16 | shutil.copy( |
| 17 | os.path.join(this_dir, "registry/O_component_ids.json"), target_dir |
| 18 | ) |
| 19 | shutil.copy( |
| 20 | os.path.join(this_dir, "registry/B_component_ids.json"), target_dir |
| 21 | ) |
Matt Spinler | bf7fca7 | 2022-05-03 10:51:52 -0500 | [diff] [blame] | 22 | |
| 23 | setup( |
| 24 | name="pel_message_registry", |
Patrick Williams | e6555f5 | 2022-08-04 13:56:17 -0500 | [diff] [blame] | 25 | version=os.getenv("PELTOOL_VERSION", "1.0"), |
Matt Spinler | bf7fca7 | 2022-05-03 10:51:52 -0500 | [diff] [blame] | 26 | classifiers=["License :: OSI Approved :: Apache Software License"], |
Patrick Williams | e6555f5 | 2022-08-04 13:56:17 -0500 | [diff] [blame] | 27 | packages=["pel_registry"], |
| 28 | package_data={ |
| 29 | "": [ |
| 30 | "message_registry.json", |
| 31 | "O_component_ids.json", |
| 32 | "B_component_ids.json", |
| 33 | ] |
| 34 | }, |
Matt Spinler | bf7fca7 | 2022-05-03 10:51:52 -0500 | [diff] [blame] | 35 | ) |