build: keep the package version in tradingagents.__version__

- pyproject reads the version from tradingagents/__init__.py, so a source checkout, an editable install and a wheel report the same one
- the SEC EDGAR User-Agent names tradingagents.__version__
This commit is contained in:
Yijia-Xiao
2026-09-24 19:38:41 +00:00
parent 45391d0962
commit d91d1f4cb4
5 changed files with 33 additions and 24 deletions
+18
View File
@@ -0,0 +1,18 @@
"""The package version has one source, tradingagents.__version__, which the build reads."""
import re
from pathlib import Path
import pytest
import tradingagents
PYPROJECT = (Path(__file__).resolve().parents[1] / "pyproject.toml").read_text(encoding="utf-8")
@pytest.mark.unit
def test_the_build_reads_the_version_from_the_package():
assert re.search(r'^dynamic = \["version"\]', PYPROJECT, re.M)
assert 'version = {attr = "tradingagents.__version__"}' in PYPROJECT
assert not re.search(r'^version = "', PYPROJECT, re.M)
assert re.fullmatch(r"\d+\.\d+\.\d+(\.dev\d+|rc\d+)?", tradingagents.__version__)