File python-python-ulid.spec of Package python-ulid

#
# spec file for package python-python-ulid
#
# Copyright (c) 2025, Martin Hauke <mardnh@gmx.de>
#
# 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/
#


Name:           python-python-ulid
Version:        3.0.0
Release:        0
Summary:        Universally unique lexicographically sortable identifier
License:        MIT
URL:            https://python-ulid.readthedocs.io/en/latest/
#Git-Clone:     https://github.com/mdomke/python-ulid.git
Source:         https://files.pythonhosted.org/packages/source/p/python-ulid/python_ulid-%{version}.tar.gz
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module hatch-fancy-pypi-readme}
BuildRequires:  %{python_module hatch-vcs}
BuildRequires:  %{python_module hatchling}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module freezegun}
BuildRequires:  %{python_module pydantic >= 2.0}
BuildRequires:  fdupes
Requires(post): update-alternatives
Requires(postun):update-alternatives
BuildArch:      noarch
%python_subpackages

%description
A ULID is a universally unique lexicographically sortable identifier.

It is
 * 128-bit compatible with UUID.
 * 1.21e+24 unique ULIDs per millisecond.
 * Lexicographically sortable.
 * Canonically encoded as a 26 character string, as opposed to
   the 36 character UUID.
 * Uses Crockford's base32 for better efficiency and readability
   (5 bits per character).
 * Case insensitive.
 * No special characters (URL safe).

%prep
%autosetup -p1 -n python_ulid-%{version}

%build
%pyproject_wheel

%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/ulid
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%check
%pytest

%post
%python_install_alternative ulid

%postun
%python_uninstall_alternative ulid

%files %{python_files}
%python_alternative %{_bindir}/ulid
%{python_sitelib}/ulid
%{python_sitelib}/python_ulid-%{version}.dist-info

%changelog
openSUSE Build Service is sponsored by