File python-textual.spec of Package python-textual

#
# spec file for package python-textual
#
# Copyright (c) 2024 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/
#

%define textual_version 0.76.0
%define dev_version 1.5.1
Name:           python-textual
Version:        %{textual_version}
Release:        0
Summary:        TUI framework for Python
License:        MIT
URL:            https://github.com/Textualize/textual
Source:         https://files.pythonhosted.org/packages/source/t/textual/textual-%{textual_version}.tar.gz
Source1:        https://files.pythonhosted.org/packages/source/t/textual_dev/textual_dev-%{dev_version}.tar.gz
BuildRequires:  %{python_module aiohttp}
BuildRequires:  %{python_module click}
BuildRequires:  %{python_module linkify-it-py}
BuildRequires:  %{python_module markdown-it-py}
BuildRequires:  %{python_module msgpack}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module poetry}
BuildRequires:  %{python_module pytest-aiohttp}
BuildRequires:  %{python_module pytest-asyncio}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module rich}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module time-machine}
BuildRequires:  %{python_module tree-sitter}
BuildRequires:  %{python_module typing-extensions}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Requires:       python-linkify-it-py
Requires:       python-markdown-it-py
Requires:       python-rich
Requires:       python-typing-extensions
BuildArch:      noarch
%python_subpackages

%description
Textual is a Python framework for creating interactive applications
that run in your terminal.

It adds interactivity to Rich with a Python API inspired by modern
web development.

On modern terminal software (installed by default on most systems),
Textual apps can use 16.7 million colors with mouse support and
smooth flicker-free animation. A layout engine and re-usable
components make it possible to build apps that resemble the desktop
and web experience.

%package dev
Summary:        Development tools for the Textual TUI framework
Version:        %{dev_version}
Requires:       %{name} = %{textual_version}
Requires:       python-aiohttp
Requires:       python-click
Requires:       python-msgpack
Requires:       python-typing-extensions
Requires(post): update-alternatives
Requires(postun): update-alternatives

%description dev
This package contains development tools for Textual, such as the
'textual' command line utility.

%files %{python_files dev}
%license textual_dev-%{dev_version}/LICENSE
%doc textual_dev-%{dev_version}/README.md
%python_alternative %{_bindir}/textual
%{python_sitelib}/textual_dev
%{python_sitelib}/textual_dev-%{dev_version}*-info

%prep
%setup -q -n textual-%{textual_version}
tar -xf %{SOURCE1}

%build
%pyproject_wheel

cd textual_dev-%{dev_version}
%pyproject_wheel

%install
%pyproject_install

cd textual_dev-%{dev_version}
%pyproject_install
%python_clone -a %{buildroot}/%{_bindir}/textual

%python_expand %fdupes %{buildroot}%{$python_sitelib}

#%%check
#%%pytest
#cd textual_dev-%%{dev_version}
#%%pytest

%post dev
%python_install_alternative textual

%postun dev
%python_uninstall_alternative textual

%files %{python_files}
%license LICENSE
%doc README.md
%{python_sitelib}/textual
%{python_sitelib}/textual-%{textual_version}*-info

%changelog
openSUSE Build Service is sponsored by