diff --git a/integration-tests/tests/python-wheels/test_yscope_clp_core/__init__.py b/integration-tests/tests/python-wheels/test_yscope_clp_core/__init__.py new file mode 100644 index 0000000000..d222e209eb --- /dev/null +++ b/integration-tests/tests/python-wheels/test_yscope_clp_core/__init__.py @@ -0,0 +1 @@ +"""Integration tests for the CLP core python binding library.""" diff --git a/integration-tests/tests/python-wheels/test_yscope_clp_core/test_yscope_clp_core.py b/integration-tests/tests/python-wheels/test_yscope_clp_core/test_yscope_clp_core.py new file mode 100644 index 0000000000..545e94d58b --- /dev/null +++ b/integration-tests/tests/python-wheels/test_yscope_clp_core/test_yscope_clp_core.py @@ -0,0 +1,11 @@ +"""Integration tests for the CLP core python binding library.""" + +import inspect + +from yscope_clp_core import clp_s + + +def test_docstring_access() -> None: + """Verify that `yscope_clp_core` is accessible by inspecting its API docstring.""" + doc = inspect.getdoc(clp_s) + assert doc is not None diff --git a/python-wheels/yscope-clp-core/yscope_clp_core/py.typed b/python-wheels/yscope-clp-core/yscope_clp_core/py.typed new file mode 100644 index 0000000000..e69de29bb2 diff --git a/taskfile.yaml b/taskfile.yaml index 3f4dbc9135..4f951a2f81 100644 --- a/taskfile.yaml +++ b/taskfile.yaml @@ -601,18 +601,29 @@ tasks: python-wheels-yscope-clp-core: vars: TMP_DIR: "{{.G_BUILD_DIR}}/tmp-{{.TASK}}" + WITH_CORE: "{{if eq \"false\" .WITH_CORE}}false{{else}}true{{end}}" dir: "{{.G_PYTHON_WHEELS_YSCOPE_CLP_CORE_DIR}}" - deps: ["core"] cmds: - "mkdir -p '{{.TMP_DIR}}'" - defer: "rm -rf '{{.TMP_DIR}}'" + # Set up final build directory + - "mkdir -p '{{.G_PYTHON_WHEELS_BUILD_DIR}}'" + - "rm -rf '{{.G_PYTHON_WHEELS_BUILD_DIR}}'/yscope_clp_core-*.whl" + # Build the wheel into the temporary directory - |- - export YSCOPE_CLP_CORE_CLP_S_EXE="{{.G_CORE_COMPONENT_BUILD_DIR}}/clp-s" + {{- if eq "true" .WITH_CORE}} + task core + export YSCOPE_CLP_CORE_CLP_S_EXE="{{.G_CORE_COMPONENT_BUILD_DIR}}/clp-s" + {{- end}} uv run --no-cache python3 -m build --wheel --outdir "{{.TMP_DIR}}" - # Repair the wheel and place it in the final build directory. + # Repair the wheel and place it in the final build directory - |- - uv run --no-cache \ - auditwheel repair "{{.TMP_DIR}}"/*.whl --wheel-dir "{{.G_PYTHON_WHEELS_BUILD_DIR}}" + {{- if eq "true" .WITH_CORE}} + uv run --no-cache \ + auditwheel repair "{{.TMP_DIR}}"/*.whl --wheel-dir "{{.G_PYTHON_WHEELS_BUILD_DIR}}" + {{- else}} + cp "{{.TMP_DIR}}"/*.whl "{{.G_PYTHON_WHEELS_BUILD_DIR}}" + {{- end}} diff --git a/taskfiles/lint.yaml b/taskfiles/lint.yaml index 9613c84e1d..e9c93b1f4d 100644 --- a/taskfiles/lint.yaml +++ b/taskfiles/lint.yaml @@ -785,7 +785,11 @@ tasks: - "{{.G_COMPONENTS_DIR}}/job-orchestration" requires: vars: ["RUFF_CHECK_FLAGS", "RUFF_FORMAT_FLAGS"] - deps: ["venv"] + deps: + - task: "venv" + - task: ":tests:integration:install-python-wheels-yscope-clp-core" + vars: + WITH_CORE: "false" cmds: - for: var: "UV_PYTHON_PROJECTS_IGNORE_ERRORS" diff --git a/taskfiles/tests/integration.yaml b/taskfiles/tests/integration.yaml index 0bfe35e0c7..c4bcacfb64 100644 --- a/taskfiles/tests/integration.yaml +++ b/taskfiles/tests/integration.yaml @@ -36,3 +36,26 @@ tasks: dir: "{{.G_INTEGRATION_TESTS_DIR}}" deps: ["::package"] cmd: "uv run pytest -m package" + + install-python-wheels-yscope-clp-core: + internal: true + vars: + WITH_CORE: "{{if eq \"false\" .WITH_CORE}}false{{else}}true{{end}}" + dir: "{{.G_INTEGRATION_TESTS_DIR}}" + deps: + - task: "::python-wheels-yscope-clp-core" + vars: + WITH_CORE: "{{.WITH_CORE}}" + cmd: |- + uv venv --allow-existing + uv pip install --force-reinstall "{{.G_PYTHON_WHEELS_BUILD_DIR}}"/yscope_clp_core-*.whl + + python-wheels-yscope-clp-core: + env: + CLP_BUILD_DIR: "{{.G_BUILD_DIR}}" + dir: "{{.G_INTEGRATION_TESTS_DIR}}" + deps: + - task: "install-python-wheels-yscope-clp-core" + vars: + WITH_CORE: "true" + cmd: "uv run pytest -m yscope_clp_core"