File python-osrf_pycommon.spec of Package osrf_pycommon
#
# spec file for package python-osrf_pycommon
#
# Copyright (c) 2026 SUSE LLC
#
# 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/
#
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%global srcname osrf_pycommon
Name: python-%{srcname}
Version: 2.1.7
Release: 0
Summary: OSRF Common Python modules,
License: Apache-2.0
URL: https://github.com/osrf/osrf_pycommon
Group: Development/Languages/Python
Source: https://github.com/osrf/osrf_pycommon/archive/refs/tags/%{srcname}-%{version}.tar.gz
BuildRequires: python-rpm-macros
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module pip}
# Needed for %%check
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module empy}
BuildRequires: %{python_module distlib}
BuildRequires: %{python_module flake8}
BuildRequires: %{python_module flake8-blind-except}
BuildRequires: %{python_module flake8-builtins}
BuildRequires: %{python_module flake8-class-newline}
BuildRequires: %{python_module flake8-comprehensions}
BuildRequires: %{python_module flake8-deprecated}
BuildRequires: %{python_module flake8-docstrings}
BuildRequires: %{python_module flake8-import-order}
BuildRequires: %{python_module flake8-quotes}
BuildRequires: %{python_module pep8-naming}
BuildRequires: %{python_module pylint}
# END Needed for %%check
BuildRequires: fdupes
BuildRequires: alts
BuildRequires: %{python_module Sphinx}
Requires: %{srcname}-common
BuildArch: noarch
%python_subpackages
%description
Commonly needed Python modules, used by Python software developed at OSRF.
%package -n %{srcname}-common
Summary: Common files for %{name}
%description -n %{srcname}-common
Common files used by the '%{srcname}' python modules
%prep
%setup -q -n %{srcname}-%{version}
%build
%pyproject_wheel
# Future project: build docs
#%%make_build -C docs html man SPHINXBUILD=sphinx-build-%%{python3_version}
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# Removing code format test
rm tests/test_code_format.py
%pytest tests
%files -n %{srcname}-common
%{_datadir}/ament_index/
%{_datadir}/osrf_pycommon/
%files %{python_files}
%license LICENSE
%doc README.md
%{python_sitelib}/osrf_pycommon/
%{python_sitelib}/osrf_pycommon-%{version}*-info/
%changelog