Skip to content

Commit cc85d40

Browse files
Remnants
1 parent 8957a51 commit cc85d40

3 files changed

Lines changed: 22 additions & 38 deletions

File tree

MANIFEST.in

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

22
include README.md
3-
recursive-include misty/mstplib Makefile *.c *.h
4-
# If you vendor bacnet-stack under misty/, include it too:
5-
recursive-include misty/bacnet-stack-0.8.4 *.*
3+
recursive-include src Makefile *.c *.h
4+
recursive-include third_party/bacnet-stack-0.8.4 *.*
65

build_snap

Lines changed: 0 additions & 7 deletions
This file was deleted.

setup.py

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
12
# setup.py
2-
import sys, subprocess, shutil
3+
import subprocess, shutil
34
from pathlib import Path
45
from setuptools import setup
56
from setuptools.command.build_py import build_py as _build_py
@@ -8,56 +9,47 @@
89
class BinaryDistWheel(bdist_wheel):
910
def finalize_options(self):
1011
super().finalize_options()
11-
self.root_is_pure = False # wheel is platform-specific
12+
self.root_is_pure = False # platform-specific wheel
1213

1314
class build_py(_build_py):
1415
def run(self):
16+
# Build python modules into build_lib first
1517
super().run()
1618

17-
project_root = Path(__file__).resolve().parent
18-
mstplib_dir = project_root / "misty" / "mstplib"
19-
if not (mstplib_dir / "Makefile").exists():
20-
raise RuntimeError(f"Makefile not found in {mstplib_dir}")
21-
22-
# 1) Compile using your Makefile target
23-
print(f"[misty] make clean_build in {mstplib_dir}")
24-
subprocess.check_call(["make", "clean_build"], cwd=str(mstplib_dir))
19+
root = Path(__file__).resolve().parent
20+
src_dir = root / "src" # <-- your flat C src dir
21+
so_path = src_dir / "build" / "libmstp_agent.so"
2522

26-
# 2) We build a single canonical filename on all platforms
27-
found = mstplib_dir / "libmstp_agent.so"
28-
if not found.exists():
29-
raise RuntimeError("Expected misty/mstplib/libmstp_agent.so after build")
23+
# Compile the shared library into src/build/
24+
print(f"[misty] make clean_build in {src_dir}")
25+
subprocess.check_call(["make", "clean_build"], cwd=str(src_dir))
3026

27+
if not so_path.exists():
28+
raise RuntimeError(f"Expected {so_path} after build")
3129

32-
# 3) Copy into the built package so it lands in the wheel
30+
# Copy the .so into the package in the build tree so it lands in the wheel
3331
pkg_out = Path(self.build_lib) / "misty" / "mstplib"
3432
pkg_out.mkdir(parents=True, exist_ok=True)
35-
shutil.copy2(found, pkg_out / found.name)
36-
print(f"[misty] bundled {found.name} -> {pkg_out}")
37-
33+
shutil.copy2(so_path, pkg_out / "libmstp_agent.so")
34+
print(f"[misty] bundled libmstp_agent.so -> {pkg_out}")
3835

3936
def setup_packages():
4037
setup(
4138
name="misty",
42-
version="0.0.15", # bump
39+
version="0.0.16", # bump when publishing
4340
description="MSTP support for bacpypes",
44-
long_description=(
45-
"The misty package helps build bacpypes Applications that work on MS/TP Networks. "
46-
"BIP (BACnet/IP) applications can be easily ported to use misty."
47-
),
41+
long_description="The misty package helps build bacpypes Applications that work on MS/TP Networks.",
4842
license="GNU General Public License v2.0",
4943
author="Riptide, Inc",
5044
author_email="raghavan@riptideio.com",
5145
url="https://github.com/riptideio/misty",
5246
packages=["misty", "misty.mstplib"],
5347
package_dir={"misty": "misty"},
5448
cmdclass={"bdist_wheel": BinaryDistWheel, "build_py": build_py},
49+
include_package_data=False, # MANIFEST.in will NOT affect wheel contents
50+
# package_data not required because we copy the .so into build_lib above
5551
install_requires=["bacpypes>=0.18.0", "six>=1.15.0"],
56-
scripts=[],
57-
58-
include_package_data=False, # MANIFEST.in will NOT affect the wheel
59-
package_data={"misty": ["mstplib/libmstp_agent.so"]},
60-
zip_safe=False
52+
zip_safe=False,
6153
)
6254

6355
if __name__ == "__main__":

0 commit comments

Comments
 (0)