%global _empty_manifest_terminate_build 0
Name:		python-xvfbwrapper
Version:	0.2.29
Release:	1
Summary:	run headless display inside X virtual framebuffer (Xvfb)
License:	MIT
URL:		https://github.com/cgoldberg/xvfbwrapper
Source0:	https://files.pythonhosted.org/packages/6f/b8/ff7f535ce45dd1cb1c871cb01d6e7df5d31acba58a399c732528722008f4/xvfbwrapper-0.2.29.tar.gz
BuildArch:	noarch

Obsoletes:	%{name}-help < %{version}-%{release}

%description
run headless display inside X virtual framebuffer (Xvfb)

%package -n python3-xvfbwrapper
Summary:	run headless display inside X virtual framebuffer (Xvfb)
Provides:	python-xvfbwrapper
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
BuildRequires:	python3-wheel
BuildRequires:	python3-pytest
BuildRequires:	python3-psutil
BuildRequires:	xorg-x11-server-Xvfb
%description -n python3-xvfbwrapper
run headless display inside X virtual framebuffer (Xvfb)

%prep
%autosetup -n xvfbwrapper-%{version} -p1
# 老版 setuptools(<77) 不支持 PEP 639 的 SPDX 字符串 license,改回 PEP 621 table 形式
sed -i -E 's/^license = "([^"]+)"/license = {text = "\1"}/' pyproject.toml
# pyproject.toml 版本无关规范化
# openEuler 构建根 --no-build-isolation,元数据由其自带 setuptools 解析(版本随快照漂移),
# 将上游新式字段改写为各版本通用旧式写法,避免旧 setuptools 校验失败导致构建中断。
sed -i -e 's/^license = "\(.*\)"/license = { text = "\1" }/' \
       -e '/^license-files = /d' pyproject.toml

%build
%pyproject_build

%install
%pyproject_install

%check
export PYTHONPATH=%{buildroot}%{python3_sitelib}
pytest -k "not test_start_with_specific_display"

%files -n python3-xvfbwrapper
%doc README.md
%{python3_sitelib}/*

%changelog
* Fri Jul 24 2026 peiliya <peiliya@kylinos.cn> - 0.2.29-1
- Update to 0.2.29

* Wed Jul 22 2026 peiliya <peiliya@kylinos.cn> - 0.2.28-1
- Update to 0.2.28

* Fri Jul 10 2026 lilu_ll <lilu@kylinos.cn> - 0.2.27-1
- Update package to version 0.2.27
  * Use TextIO for type annotation
  * Impove xvfbwrapper.py typing

* Fri Feb 27 2026 YangengLiu <dev01202@linx-info.com> - 0.2.21-1
- update version to 0.2.21
  * Ensure Xvfb procs are cleaned up in tests using psutil
  * Add test coverage
  * set_xdg_session_type arg and update tests
  * Add support for extra Xvfb args and add type hints

* Wed Jan 07 2026 YangengLiu <dev01202@linx-info.com> - 0.2.17-1
- update version to 0.2.17
  * Error if can't find or write to temp dir
  * Better error if /tmp isn't writeable
  * Add more lint rules and fix violations.
  * Use contextlib.supress

* Thu Nov 06 2025 zhangxiaolu <zhangxiaolu@kylinos.cn> - 0.2.15-1
- update to version 0.2.15

* Mon Sep 15 2025 xiejing <xiejing@kylinos.cn> - 0.2.14-1
- Update to 0.2.14:
  * Fix linting options
  * Change testenv name
  * Update bools in tox.ini
  * Add black workaround for linting

* Wed Aug 13 2025 yaoxin <1024769339@qq.com> - 0.2.13-1
- Update to 0.2.13:
  * Fix regression. Always look in /tmp for display files
  * Remove recursive from autoflake configuration
  * Drop Python 3.8 support
  * Fix KeyError in stop() if DISPLAY was never set after failed start
  * Remove --check option from black
  * Don't inherit from object in Xvfb class

* Sun May 23 2021 Python_Bot <Python_Bot@openeuler.org> - 0.2.9-1
- Package Spec generated