Files
SmartThings-Local/pyproject.toml
T
Jack Nagy 3fdc735141 feat(packaging): nest protocol/ + ocf/ under smartthings_local, add PyPI packaging
Nest the two library packages under a single import namespace so they
can ship as one distribution:

  protocol/ -> smartthings_local/protocol/
  ocf/      -> smartthings_local/ocf/   (git mv, history preserved)

- Rewrite all imports protocol.* -> smartthings_local.protocol.*,
  ocf.* -> smartthings_local.ocf.* across the ocf modules, mqtt_demo/
  (bridge, descriptor, samples), and tests.
- Add pyproject.toml: dist name `smartthings-local`, hatch-vcs versioning
  from v* tags, wheel ships only smartthings_local/.
- Add .github/workflows/publish.yml: build + PyPI Trusted Publishing on
  v* tags (OIDC, no stored token).
- Force-include protocol/ocf_root_ca.pem via [tool.hatch.build] artifacts:
  it is tracked but matches .gitignore's *.pem, so hatchling's VCS file
  selection would drop it — and dtls_session.py loads it at runtime.
- Update mqtt_demo Dockerfile COPY and deploy.sh tar allowlist to the
  single smartthings_local/ package.
- .gitignore: build artifacts (_version.py, dist/, *.egg-info/).

Validated: pytest tests/ (11 passed), python -m build produces sdist +
wheel with the pem bundled, fresh pip install resolves all nested imports
with the pem readable from site-packages.
2026-07-06 20:29:19 +01:00

65 lines
1.9 KiB
TOML

[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "smartthings-local"
dynamic = ["version"]
description = "Local CoAP-over-DTLS (OCF) transport + polling layer for Samsung SmartThings appliances"
readme = "README.md"
requires-python = ">=3.11"
license = "MIT"
license-files = ["LICENSE"]
authors = [{ name = "Jack Nagy" }]
keywords = ["smartthings", "samsung", "ocf", "coap", "dtls", "home-assistant", "iot"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Topic :: Home Automation",
"Topic :: System :: Networking",
"Programming Language :: Python :: 3",
]
dependencies = [
"cbor2>=5.6",
"pyOpenSSL>=23.0",
]
[project.urls]
Homepage = "https://github.com/QuiteYellow/SmartThings-Local"
Repository = "https://github.com/QuiteYellow/SmartThings-Local"
Issues = "https://github.com/QuiteYellow/SmartThings-Local/issues"
[project.optional-dependencies]
dev = ["pytest>=8.0"]
[tool.hatch.version]
source = "vcs"
# Derive the version from git tags of the form v1.2.3.
[tool.hatch.version.raw-options]
version_scheme = "no-guess-dev"
[tool.hatch.build.hooks.vcs]
version-file = "smartthings_local/_version.py"
# ocf_root_ca.pem is tracked, but the repo .gitignore's `*.pem` rule makes
# hatchling's VCS-based file selection drop it. It's loaded at runtime by
# protocol/dtls_session.py (load_verify_locations), so force it into every
# build target (wheel + sdist).
[tool.hatch.build]
artifacts = ["smartthings_local/protocol/ocf_root_ca.pem"]
[tool.hatch.build.targets.wheel]
# Ship only the library; the mqtt_demo/, tests/, and setup_cert.py stay
# in-repo and are not part of the distributable package.
packages = ["smartthings_local"]
[tool.hatch.build.targets.sdist]
include = [
"smartthings_local",
"tests",
"README.md",
"LICENSE",
"pyproject.toml",
]