43 lines
1.2 KiB
Python
43 lines
1.2 KiB
Python
"""Setuptools entry point; bundle rules are read from pyproject.toml.
|
|
|
|
``dev_install`` bundle items (configs/sensors) are staged into the ``orisys``
|
|
package during build so ``pip install .`` places them at
|
|
``site-packages/orisys/...`` (importlib / configs resolvers), not under
|
|
``sys.prefix/orisys`` via deprecated ``data_files``.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
from setuptools import setup
|
|
from setuptools.command.build_py import build_py as _build_py
|
|
|
|
REPO_ROOT = Path(__file__).resolve().parent
|
|
sys.path.insert(0, str(REPO_ROOT / "build" / "common"))
|
|
|
|
from pyproject_utils import stage_dev_bundle_into # noqa: E402
|
|
|
|
|
|
class build_py(_build_py):
|
|
def run(self) -> None:
|
|
super().run()
|
|
# After pure modules are copied, stage configs/sensors into build/lib/orisys.
|
|
pkg_dir = Path(self.build_lib) / "orisys"
|
|
pkg_dir.mkdir(parents=True, exist_ok=True)
|
|
stage_dev_bundle_into(REPO_ROOT, pkg_dir)
|
|
|
|
|
|
setup(
|
|
cmdclass={"build_py": build_py},
|
|
# Declared so wheels record the staged files; actual copy happens in build_py.
|
|
package_data={
|
|
"orisys": [
|
|
"configs/*.json",
|
|
"sensors/**/*",
|
|
],
|
|
},
|
|
include_package_data=True,
|
|
)
|