15
0
Files
python-confusable-homoglyphs/python-confusable-homoglyphs.spec

73 lines
2.4 KiB
RPMSpec
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#
# spec file for package python-confusable-homoglyphs
#
# Copyright (c) 2025 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/
#
%bcond_without libalternatives
%{?sle15_python_module_pythons}
Name: python-confusable-homoglyphs
Version: 3.3.1
Release: 0
Summary: Detector for confusable use of Unicode homoglyphs
License: MIT
URL: https://sr.ht/~valhalla/confusable_homoglyphs/
Source: https://files.pythonhosted.org/packages/source/c/confusable_homoglyphs/confusable_homoglyphs-%{version}.tar.gz
BuildRequires: %{python_module click}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: alts
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: alts
Requires: python-click
BuildArch: noarch
%python_subpackages
%description
A Python module to detect Unicode homoglyphs and homograph attacks.
Homoglyphs are characters that may appear the same but have different
codepoints, meaning or representation, for example U+0041 LATIN
CAPITAL LETTER A ('A') vs. U+0391 GREEK CAPITAL LETTER ALPHA, 'Α'.
%prep
%autosetup -p1 -n confusable_homoglyphs-%{version}
%build
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/confusable_homoglyphs
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# temporarily disable CLI tests, broken with (exactly) click 8.2.1 https://github.com/pallets/click/issues/2939
rm tests/test_cli.py
%pyunittest discover -v tests/
%pre
%python_libalternatives_reset_alternative confusable_homoglyphs
%files %{python_files}
%doc README.rst
%license LICENSE
%{python_sitelib}/confusable_homoglyphs
%{python_sitelib}/confusable_homoglyphs-%{version}.dist-info
%python_alternative %{_bindir}/confusable_homoglyphs
%changelog