File python313-pipx.spec of Package python313-pipx
#
# spec file for package python313-pipx
#
# 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 pythons python313
Name: python313-pipx
Version: 1.7.1
Release: 0
Summary: Install and Run Python Applications in Isolated Environments
License: MIT
URL: https://github.com/pypa/pipx
Source: pipx-%{version}.tar.gz
BuildRequires: %{python_module hatchling >= 1.18}
BuildRequires: %{python_module pip}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires(post): update-alternatives
Requires(postun): update-alternatives
Requires: python313 >= 3.8
Requires: python313-argcomplete >= 1.9.4
Requires: python313-packaging >= 20
Requires: python313-platformdirs >= 2.1
Requires: python313-userpath >= 1.6
Requires: (python-tomli if python-base < 3.11)
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module argcomplete >= 1.9.4}
BuildRequires: %{python_module packaging >= 20}
BuildRequires: %{python_module platformdirs >= 2.1}
BuildRequires: %{python_module userpath >= 1.6}
# /SECTION
%python_subpackages
%description
Install and Run Python Applications in Isolated Environments
%prep
%autosetup -p1 -n pipx-%{version}
# Remove hatch-vcs dependency
sed -i "/vcs/d" pyproject.toml
sed -z 's/dynamic = \[\n "version",\n]/version = "%{version}"/' -i pyproject.toml
# version.py file generated by hatch-vcs
echo "__version__ = version = '%{version}'" > src/pipx/version.py
echo "__version_tuple__ = version_tuple = tuple(int(i) for i in version.split('.'))" >> src/pipx/version.py
rm -rf .gitignore
%build
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/pipx
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%post
%python_install_alternative pipx
%postun
%python_uninstall_alternative pipx
%files %{python_files}
%doc docs/CHANGELOG.md docs/README.md
%license LICENSE
%python_alternative %{_bindir}/pipx
%{python_sitelib}/pipx
%{python_sitelib}/pipx-%{version}.dist-info
%changelog