forked from pool/python-immutabledict
* copy() (breaking change): remove the option to pass keyword
arguments (which were present as key/value pairs in the copy).
Now the method doesn't take any arguments (it behaves the same
as a normal dict).
* Python versions: drop Python 3.7 support
* Typing: fixes
- Make the key covariant. Thanks to @spacether for the PR #244
- Fix key/value typing missing for ImmutableOrderedDict
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-immutabledict?expand=0&rev=8
87 lines
2.9 KiB
RPMSpec
87 lines
2.9 KiB
RPMSpec
#
|
|
# spec file
|
|
#
|
|
# Copyright (c) 2023 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/
|
|
#
|
|
|
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
%if "%{flavor}" == "test"
|
|
%define psuffix -test
|
|
%bcond_without test
|
|
%else
|
|
%define psuffix %{nil}
|
|
%bcond_with test
|
|
%endif
|
|
%define short_name immutabledict
|
|
%{?sle15_python_module_pythons}
|
|
Name: python-%{short_name}%{psuffix}
|
|
Version: 3.0.0
|
|
Release: 0
|
|
Summary: Immutable wrapper around dictionaries (a fork of frozendict)
|
|
License: MIT
|
|
Group: Development/Languages/Python
|
|
URL: https://github.com/corenting/immutabledict
|
|
Source: https://files.pythonhosted.org/packages/source/i/immutabledict/immutabledict-%{version}.tar.gz
|
|
BuildRequires: %{python_module base >= 3.8}
|
|
BuildRequires: %{python_module pip}
|
|
BuildRequires: %{python_module poetry-core}
|
|
BuildRequires: %{python_module setuptools}
|
|
BuildRequires: %{python_module typing_extensions}
|
|
BuildRequires: %{python_module wheel}
|
|
%if %{with test}
|
|
BuildRequires: %{python_module pytest}
|
|
%endif
|
|
BuildRequires: fdupes
|
|
BuildRequires: python-rpm-macros
|
|
BuildArch: noarch
|
|
%if %{with test}
|
|
BuildRequires: %{python_module %{short_name} = %version}
|
|
%endif
|
|
%python_subpackages
|
|
|
|
%description
|
|
A fork of the original frozendict, an immutable wrapper around dictionaries. This library is a pure Python, MIT-licensed alternative to the new LGPL-3.0 licensed frozendict.
|
|
|
|
It implements the complete mapping interface and can be used as a drop-in replacement for dictionaries where immutability is desired. The immutabledict constructor mimics dict, and all of the expected interfaces (iter, len, repr, hash, getitem) are provided. Note that an immutabledict does not guarantee the immutability of its values, so the utility of hash method is restricted by usage.
|
|
|
|
The only difference is that the copy() method of immutable takes variable keyword arguments, which will be present as key/value pairs in the new, immutable copy.
|
|
|
|
%prep
|
|
%setup -q -n %{short_name}-%{version}
|
|
|
|
%build
|
|
%pyproject_wheel
|
|
|
|
%install
|
|
%if !%{with test}
|
|
%pyproject_install
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
%endif
|
|
|
|
%check
|
|
%if %{with test}
|
|
%pyunittest discover -v
|
|
%endif
|
|
|
|
%if !%{with test}
|
|
%files %{python_files}
|
|
%license LICENSE
|
|
%doc README.md
|
|
%{python_sitelib}/%{short_name}
|
|
%{python_sitelib}/%{short_name}-%{version}*-info
|
|
%endif
|
|
|
|
%changelog
|