build: the project as pyproject.toml, the build command build-mkp in scripts/ #9

Merged
dawid merged 1 commit from pyproject into main 2026-11-19 21:36:20 +00:00
Owner

The repository as a Python project, with the MKP's build as an entry point.

pyproject.toml replaces three files:

  • requirements-test.txt → the extra test (still pinned; Renovate's pep621 manager updates them).
  • pytest.ini → [tool.pytest.ini_options], plus pythonpath = ["scripts"] so that the tests import the build module also where the project is not installed.
  • .cz.toml → [tool.commitizen] with version_provider = "pep621": project.version is the one place of the version, the MKP's too. The release bot finds the config there and runs cz bump --version-files-only; tried with commitizen 4.19.4, it writes both project.version and the README's install commands.

build.py → scripts/build_mkp.py, installed as the command build-mkp (pip install -e .):

  • It reads the version from pyproject.toml; build-mkp --version prints it.
  • python3 scripts/build_mkp.py still works without installing.
  • Named build_mkp, not build: a top-level module build would shadow PyPA's build (python -m build) in the same venv.
  • It is installed editable so that it reads src/ and node_modules/ of the checkout.

CI

  • unit and integration: pip install -e '.[test]'; the MKP is built with .venv/bin/build-mkp.
  • release: installs the project alone (no test tools), checks the tag against build-mkp --version, builds with build-mkp.

Checked locally

  • The MKP is byte-identical to the one build.py on main builds.
  • 86 unit tests pass; the integration tests collect (42); packages.py --check 2.4 2.5 passes.
  • The integration tests themselves and the CI jobs were not run locally.
The repository as a Python project, with the MKP's build as an entry point. **pyproject.toml** replaces three files: - `requirements-test.txt` → the extra `test` (still pinned; Renovate's pep621 manager updates them). - `pytest.ini` → `[tool.pytest.ini_options]`, plus `pythonpath = ["scripts"]` so that the tests import the build module also where the project is not installed. - `.cz.toml` → `[tool.commitizen]` with `version_provider = "pep621"`: `project.version` is the one place of the version, the MKP's too. The release bot finds the config there and runs `cz bump --version-files-only`; tried with commitizen 4.19.4, it writes both `project.version` and the README's install commands. **build.py → scripts/build_mkp.py**, installed as the command `build-mkp` (`pip install -e .`): - It reads the version from `pyproject.toml`; `build-mkp --version` prints it. - `python3 scripts/build_mkp.py` still works without installing. - Named `build_mkp`, not `build`: a top-level module `build` would shadow PyPA's `build` (`python -m build`) in the same venv. - It is installed editable so that it reads `src/` and `node_modules/` of the checkout. **CI** - unit and integration: `pip install -e '.[test]'`; the MKP is built with `.venv/bin/build-mkp`. - release: installs the project alone (no test tools), checks the tag against `build-mkp --version`, builds with `build-mkp`. **Checked locally** - The MKP is byte-identical to the one `build.py` on main builds. - 86 unit tests pass; the integration tests collect (42); `packages.py --check 2.4 2.5` passes. - The integration tests themselves and the CI jobs were not run locally.
build: the project as pyproject.toml, the build command build-mkp in scripts/
Some checks failed
CI / unit (pull_request) Successful in 1m50s
CI / integration (Checkmk 2.4) (pull_request) Failing after 6m1s
CI / integration (Checkmk 2.5) (pull_request) Failing after 6m4s
CI / integration (update 2.4 to 2.5) (pull_request) Has been cancelled
CI / release (pull_request) Has been cancelled
f709aa27b1
- pyproject.toml holds the project's version (the MKP's too), the test tools as
  the extra "test", pytest's settings (was pytest.ini) and the release bot's
  (tool.commitizen, was .cz.toml; version_provider pep621).
- build.py is scripts/build_mkp.py, installed as the command build-mkp
  (pip install -e .); it reads the version from pyproject.toml and prints it
  with --version. Not "build": that would shadow PyPA's build in the venv.
- CI installs the project with its test tools (pip install -e '.[test]') and
  builds with build-mkp; the release job installs the project alone and checks
  the tag against build-mkp --version.
- The tests import build_mkp (pytest's pythonpath), packages.py from scripts/.
dawid merged commit 73ae8072e2 into main 2026-11-19 21:36:20 +00:00
dawid deleted branch pyproject 2026-11-19 21:36:20 +00:00

Tests of CI / unit: passed

86 passed, 0 failed, 0 skipped (86 tests, 55.6 s)

Of f709aa27b1, the run, updated by every run.

<!-- ci-report tests: CI-unit --> ### Tests of CI / unit: passed **86 passed, 0 failed, 0 skipped** (86 tests, 55.6 s) <sub>Of f709aa27b1, [the run](https://git.ciepiela.org/dawid/checkmk-bi-charts/actions/runs/22), updated by every run.</sub>

Tests of CI / integration (Checkmk 2.4): failed

17 passed, 1 failed, 0 skipped (18 tests, 304.8 s)

Failed tests

tests.integration.test_checkmk.test_page_draws_the_trees_in_a_browser[2.4-chromium-sankey]
…
.venv/lib/python3.12/site-packages/playwright/_impl/frame.py:1209: in wait_for_function
    result = await self._channel.waitForFunction(
.venv/lib/python3.12/site-packages/playwright/_impl/channel_owner.py:398: in _mapped
    return mapper(await awaitable)
                  ^^^^^^^^^^^^^^^
.venv/lib/python3.12/site-packages/playwright/_impl/channel_owner.py:387: in finish
    raise e from None
.venv/lib/python3.12/site-packages/playwright/_impl/channel_owner.py:352: in finish
    result = await zone.run_async(lambda: awaitable)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <playwright._impl.utils.zones.Zone object at 0x7f3898edd400>
func = <function ChannelOwner._wrap_api_call.<locals>.finish.<locals>.<lambda> at 0x7f3898f05080>

    async def run_async(self, func: Callable[[], Awaitable[R]]) -> R:
        # Python: run() of an async function. The coroutine runs when it is awaited,
        # so the zone must be current while it is awaited, not while it is created.
        token = _async_local_storage.set(self)
        try:
>           return await func()
                   ^^^^^^^^^^^^
E           playwright._impl._errors.TimeoutError: Page.wait_for_function: Timeout 60000ms exceeded.

.venv/lib/python3.12/site-packages/playwright/_impl/utils/zones.py:58: TimeoutError

Of f709aa27b1, the run, updated by every run.

<!-- ci-report tests: CI-integration-Checkmk-2.4- --> ### Tests of CI / integration (Checkmk 2.4): failed **17 passed, 1 failed, 0 skipped** (18 tests, 304.8 s) #### Failed tests <details><summary><code>tests.integration.test_checkmk.test_page_draws_the_trees_in_a_browser[2.4-chromium-sankey]</code></summary> ```text … .venv/lib/python3.12/site-packages/playwright/_impl/frame.py:1209: in wait_for_function result = await self._channel.waitForFunction( .venv/lib/python3.12/site-packages/playwright/_impl/channel_owner.py:398: in _mapped return mapper(await awaitable) ^^^^^^^^^^^^^^^ .venv/lib/python3.12/site-packages/playwright/_impl/channel_owner.py:387: in finish raise e from None .venv/lib/python3.12/site-packages/playwright/_impl/channel_owner.py:352: in finish result = await zone.run_async(lambda: awaitable) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <playwright._impl.utils.zones.Zone object at 0x7f3898edd400> func = <function ChannelOwner._wrap_api_call.<locals>.finish.<locals>.<lambda> at 0x7f3898f05080> async def run_async(self, func: Callable[[], Awaitable[R]]) -> R: # Python: run() of an async function. The coroutine runs when it is awaited, # so the zone must be current while it is awaited, not while it is created. token = _async_local_storage.set(self) try: > return await func() ^^^^^^^^^^^^ E playwright._impl._errors.TimeoutError: Page.wait_for_function: Timeout 60000ms exceeded. .venv/lib/python3.12/site-packages/playwright/_impl/utils/zones.py:58: TimeoutError ``` </details> <sub>Of f709aa27b1, [the run](https://git.ciepiela.org/dawid/checkmk-bi-charts/actions/runs/22), updated by every run.</sub>

Tests of CI / integration (Checkmk 2.5): failed

17 passed, 1 failed, 0 skipped (18 tests, 308.6 s)

Failed tests

tests.integration.test_checkmk.test_page_draws_the_trees_in_a_browser[2.5-chromium-sankey]
…
.venv/lib/python3.12/site-packages/playwright/_impl/frame.py:1209: in wait_for_function
    result = await self._channel.waitForFunction(
.venv/lib/python3.12/site-packages/playwright/_impl/channel_owner.py:398: in _mapped
    return mapper(await awaitable)
                  ^^^^^^^^^^^^^^^
.venv/lib/python3.12/site-packages/playwright/_impl/channel_owner.py:387: in finish
    raise e from None
.venv/lib/python3.12/site-packages/playwright/_impl/channel_owner.py:352: in finish
    result = await zone.run_async(lambda: awaitable)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <playwright._impl.utils.zones.Zone object at 0x732fae9714c0>
func = <function ChannelOwner._wrap_api_call.<locals>.finish.<locals>.<lambda> at 0x732fae981080>

    async def run_async(self, func: Callable[[], Awaitable[R]]) -> R:
        # Python: run() of an async function. The coroutine runs when it is awaited,
        # so the zone must be current while it is awaited, not while it is created.
        token = _async_local_storage.set(self)
        try:
>           return await func()
                   ^^^^^^^^^^^^
E           playwright._impl._errors.TimeoutError: Page.wait_for_function: Timeout 60000ms exceeded.

.venv/lib/python3.12/site-packages/playwright/_impl/utils/zones.py:58: TimeoutError

Of f709aa27b1, the run, updated by every run.

<!-- ci-report tests: CI-integration-Checkmk-2.5- --> ### Tests of CI / integration (Checkmk 2.5): failed **17 passed, 1 failed, 0 skipped** (18 tests, 308.6 s) #### Failed tests <details><summary><code>tests.integration.test_checkmk.test_page_draws_the_trees_in_a_browser[2.5-chromium-sankey]</code></summary> ```text … .venv/lib/python3.12/site-packages/playwright/_impl/frame.py:1209: in wait_for_function result = await self._channel.waitForFunction( .venv/lib/python3.12/site-packages/playwright/_impl/channel_owner.py:398: in _mapped return mapper(await awaitable) ^^^^^^^^^^^^^^^ .venv/lib/python3.12/site-packages/playwright/_impl/channel_owner.py:387: in finish raise e from None .venv/lib/python3.12/site-packages/playwright/_impl/channel_owner.py:352: in finish result = await zone.run_async(lambda: awaitable) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <playwright._impl.utils.zones.Zone object at 0x732fae9714c0> func = <function ChannelOwner._wrap_api_call.<locals>.finish.<locals>.<lambda> at 0x732fae981080> async def run_async(self, func: Callable[[], Awaitable[R]]) -> R: # Python: run() of an async function. The coroutine runs when it is awaited, # so the zone must be current while it is awaited, not while it is created. token = _async_local_storage.set(self) try: > return await func() ^^^^^^^^^^^^ E playwright._impl._errors.TimeoutError: Page.wait_for_function: Timeout 60000ms exceeded. .venv/lib/python3.12/site-packages/playwright/_impl/utils/zones.py:58: TimeoutError ``` </details> <sub>Of f709aa27b1, [the run](https://git.ciepiela.org/dawid/checkmk-bi-charts/actions/runs/22), updated by every run.</sub>

Tests of CI / integration (update 2.4 to 2.5): passed

6 passed, 0 failed, 0 skipped (6 tests, 400.0 s)

Of f709aa27b1, the run, updated by every run.

<!-- ci-report tests: CI-integration-update-2.4-to-2.5- --> ### Tests of CI / integration (update 2.4 to 2.5): passed **6 passed, 0 failed, 0 skipped** (6 tests, 400.0 s) <sub>Of f709aa27b1, [the run](https://git.ciepiela.org/dawid/checkmk-bi-charts/actions/runs/22), updated by every run.</sub>
Sign in to join this conversation.
No description provided.