File: test_issue335_support_cmake_source_dir.py

package info (click to toggle)
scikit-build 0.18.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,792 kB
  • sloc: python: 5,258; cpp: 284; makefile: 171; f90: 12; sh: 7
file content (34 lines) | stat: -rw-r--r-- 1,108 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from __future__ import annotations

import glob

from . import _tmpdir, execute_setup_py, initialize_git_repo_and_commit, prepare_project
from .pytest_helpers import check_wheel_content


def test_bdist_wheel_command():
    project = "issue-335-support-cmake-source-dir"

    expected_content = [
        "hello/__init__.py",
        "hello/swig_mwe.py",
        "hello/_swig_mwe.pyd",
        "hello-1.2.3.data/data/bin/hello",
        "hello-1.2.3.data/data/lib/static/libbar.a",
        "hello-1.2.3.data/data/lib/static/libfoo.a",
        "hello-1.2.3.data/data/include/bar.h",
        "hello-1.2.3.data/data/include/foo.h",
    ]

    expected_distribution_name = "hello-1.2.3"

    tmp_dir = _tmpdir("test_bdist_wheel_command")
    prepare_project(project, tmp_dir)
    initialize_git_repo_and_commit(tmp_dir, verbose=True)

    relative_setup_path = "wrapping/python/"

    with execute_setup_py(tmp_dir.join(relative_setup_path), ["bdist_wheel"]):
        whls = glob.glob("dist/*.whl")
        assert len(whls) == 1
        check_wheel_content(whls[0], expected_distribution_name, expected_content)