File python-os-win.spec of Package python-os-win

#
# spec file for package python-os-win
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           python-os-win
Version:        5.9.0
Release:        0
Summary:        Hyper-V library for OpenStack projects
License:        Apache-2.0
Group:          Development/Languages/Python
URL:            https://docs.openstack.org/os-win
Source0:        https://files.pythonhosted.org/packages/source/o/os-win/os-win-%{version}.tar.gz
BuildRequires:  %{python_module Sphinx}
BuildRequires:  %{python_module ddt}
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module eventlet}
BuildRequires:  %{python_module oslo.concurrency}
BuildRequires:  %{python_module oslo.i18n}
BuildRequires:  %{python_module oslo.log}
BuildRequires:  %{python_module oslotest}
BuildRequires:  %{python_module pbr}
BuildRequires:  %{python_module six}
BuildRequires:  %{python_module stestr}
BuildRequires:  %{python_module testscenarios}
BuildRequires:  %{python_module testtools}
BuildRequires:  openstack-macros
Requires:       python-Babel
Requires:       python-eventlet
Requires:       python-oslo.concurrency
Requires:       python-oslo.config
Requires:       python-oslo.i18n
Requires:       python-oslo.log
Requires:       python-oslo.service
Requires:       python-oslo.utils
Requires:       python-pbr
Requires:       python-six
BuildArch:      noarch
%python_subpackages

%description
Library contains Windows / Hyper-V code commonly used in the OpenStack projects:
nova, cinder, networking-hyperv.

%package -n python3-os-win-doc
Summary:        Documentation for OpenStack Windows/Hyper-V Library
Group:          Documentation/HTML
BuildRequires:  python3-Sphinx
BuildRequires:  python3-openstackdocstheme

%description -n python3-os-win-doc
Documentation for the Hyper-V library.

%prep
%autosetup -n os-win-%{version}
%py_req_cleanup
# we don't want to run the hacking tests again (and don't want the needed deps)
rm -f os_win/tests/unit/test_hacking.py

%build
%{py3_build}

PBR_VERSION=%{version} %sphinx_build -b html doc/source doc/build/html
PBR_VERSION=%{version} %sphinx_build -b man doc/source doc/build/man
rm -rf doc/build/html/.{doctrees,buildinfo}
rm -rf doc/build/man/.{doctrees,buildinfo}

%install
%{py3_install}
install -p -D -m 644 doc/build/man/os-win.1 %{buildroot}/%{_mandir}/man1/os-win.1

%check
%{openstack_stestr_run}

%files %{python_files}
%doc README.rst ChangeLog
%license LICENSE
%{python3_sitelib}/os_win*
%{python3_sitelib}/*.egg-info
%{_mandir}/man1/os-win.1*

%files -n python3-os-win-doc
%doc doc/build/html
%license LICENSE

%changelog
openSUSE Build Service is sponsored by