File python-awesomeversion.spec of Package python-awesomeversion
#
# spec file for package python-awesomeversion
#
# 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/
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%define pname python-awesomeversion
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: %{pname}%{psuffix}
Version: 25.8.0
Release: 0
Summary: Python library for managing version numbers
License: MIT
Group: Development/Languages/Python
URL: https://github.com/ludeeus/awesomeversion
Source0: %{pname}-%{version}.tar.xz
BuildArch: noarch
BuildRequires: %{python_module hatchling}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module poetry}
%if %{with test}
BuildRequires: %{python_module pytest-codspeed}
BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module pytest-snapshot}
BuildRequires: %{python_module pytest-timeout}
BuildRequires: %{python_module pytest}
%endif
BuildRequires: fdupes
BuildRequires: python-rpm-macros
%python_subpackages
%description
One version package to rule them all, One version package to find them, One version package to bring them all, and in the darkness bind them.
Make anything a version object, and compare against a vast section of other version formats.
%prep
%setup -q -n %{pname}-%{version}
%build
%pyproject_wheel
%install
%if !%{with test}
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%if %{with test}
%check
%pytest
%endif
%if !%{with test}
%files %python_files
%defattr(-,root,root,-)
%{python_sitelib}/*
%doc README.md
%license LICENCE.md
%endif
%changelog