diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..537172b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,32 @@ +# Changelog + +All notable changes to **ecu-framework** are documented in this file. + +The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +The single source of truth for the current version is `[project.version]` in +`pyproject.toml`; at runtime it is exposed as `ecu_framework.__version__`. + +## [Unreleased] + +### Added +- `pyproject.toml` — the framework is now `pip install -e .`-able. +- Top-level `ecu_framework.__version__` is read from installed package metadata + via `importlib.metadata`, with a `"0.0.0+local"` fallback for source checkouts + that have not been `pip install`-ed. + +### Removed +- Per-subpackage `__version__` strings on `lin`, `power`, `flashing`. Versioning + is centralized on the distribution; subpackages no longer carry their own. + +## [0.1.0] - 2026-05-14 + +Initial tagged baseline. The framework already supports: + +- LIN abstraction (`LinInterface`, `LinFrame`) with mock, MUM, and deprecated BabyLIN adapters +- Owon PSU control with cross-platform serial-port resolution +- UDS-over-LIN flashing scaffold (`HexFlasher`) +- Pytest plugin: requirement traceability, HTML report metadata, CI summary +- LDF parsing helpers and generated per-frame `pack`/`unpack` APIs +- Raspberry Pi deployment recipe and a Docker image for mock-only CI diff --git a/ecu_framework/__init__.py b/ecu_framework/__init__.py index 3fa41f5..24d7698 100644 --- a/ecu_framework/__init__.py +++ b/ecu_framework/__init__.py @@ -4,12 +4,24 @@ ECU Tests framework package. Provides: - config: YAML configuration loader and types - lin: LIN interface abstraction and adapters (mock, MUM, and the deprecated BabyLIN) +- power: Owon PSU control and cross-platform serial-port resolution +- flashing: UDS-over-LIN ECU programming scaffold (HexFlasher) Package version is exposed as __version__. """ __all__ = [ "config", "lin", + "power", + "flashing", ] -__version__ = "0.1.0" +from importlib.metadata import PackageNotFoundError, version as _pkg_version + +try: + __version__ = _pkg_version("ecu-framework") +except PackageNotFoundError: + # Running from a source checkout without `pip install -e .` + __version__ = "0.0.0+local" + +del PackageNotFoundError, _pkg_version diff --git a/ecu_framework/lin/__init__.py b/ecu_framework/lin/__init__.py index 46dd9c6..98fee04 100644 --- a/ecu_framework/lin/__init__.py +++ b/ecu_framework/lin/__init__.py @@ -18,4 +18,4 @@ __all__ = [ "LinInterface", "LinFrame", "MockBabyLinInterface", -] +] \ No newline at end of file diff --git a/ecu_framework/power/__init__.py b/ecu_framework/power/__init__.py index fb1756e..361ca96 100644 --- a/ecu_framework/power/__init__.py +++ b/ecu_framework/power/__init__.py @@ -27,4 +27,4 @@ __all__ = [ "resolve_port", "windows_com_to_linux", "linux_serial_to_windows", -] +] \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..3053390 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,71 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "ecu-framework" +version = "0.1.0" +description = "ECU testing framework: LIN abstraction (mock / MUM / BabyLIN), Owon PSU control, UDS-over-LIN flashing scaffold, and pytest plugins." +readme = "README.md" +requires-python = ">=3.10" +authors = [ + { name = "Mohamed Elsabagh" , email = "mohamed.elsabagh@teqanylogix.com" }, + { name = "Samer Boules" , email = "samer.boules@teqanylogix.com" }, + { name = "Hosam-Eldin Mosatafa", email = "hosam-eldin.mostafa@teqanylogix.com" }, +] +keywords = ["ecu", "lin", "automotive", "testing", "pytest", "mum", "babylin"] +classifiers = [ + "Development Status :: 3 - Alpha", + "Framework :: Pytest", + "Intended Audience :: Developers", + "Operating System :: POSIX :: Linux", + "Operating System :: Microsoft :: Windows", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Software Development :: Testing", +] + +# Core runtime deps. Hardware-only deps (Melexis pylin / pymumclient, +# BabyLIN SDK) are intentionally NOT listed — those install paths are +# documented separately and are not needed for mock-only usage. +dependencies = [ + "pyyaml>=6,<7", + "pyserial>=3,<4", + "ldfparser>=0.26,<1", + "colorlog>=6,<7", + "typing-extensions>=4.12,<5", + "intelhex>=2.1", +] + +[project.optional-dependencies] +# Testing extras — install with: pip install -e ".[test]" +test = [ + "pytest>=8,<9", + "pytest-xdist>=3.6,<4", + "pytest-html>=4,<5", + "pytest-cov>=5,<6", +] +# Pull in the transitive deps the Melexis stack (pylin / pymumclient) needs. +# The Melexis wheels themselves come from the bundled tarball, not PyPI. +melexis-transitive = [ + "six>=1.16,<2", + "pyparsing>=3.0.9,<3.1", + "natsort>=7.1.0", + "pygdbmi>=0.9,<0.10", + "crcmod>=1.7", + "packaging>=20.3", + "zeroconf>=0.37.0", +] + +[tool.hatch.build.targets.wheel] +packages = ["ecu_framework"] + +[tool.hatch.build.targets.sdist] +include = [ + "/ecu_framework", + "/README.md", + "/CHANGELOG.md", + "/requirements.txt", +]