File size: 525 Bytes
981aa5d
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import tomllib
from pathlib import Path


def test_gui_dependency_is_optional_for_dev_installs():
    data = tomllib.loads(Path("pyproject.toml").read_text(encoding="utf-8"))

    project = data["project"]
    dependencies = project.get("dependencies", [])
    optional = project.get("optional-dependencies", {})

    assert all(not dep.startswith("PyGObject") for dep in dependencies)
    assert any(dep.startswith("PyGObject") for dep in optional["gui"])
    assert any(dep.startswith("pytest") for dep in optional["dev"])