15
0
Files
python-injector/python-injector.spec
Matej Cepl ed27f0f27f - Update to 0.19.0:
- Added the license to the source distribution, thanks to
    Joshua Adelman
  - Added Python 3.9 and 3.10 support, this includes fixing
    Python 3.10 compatibility, thanks to Torge Matthies
  - Improved the documentation, thanks to Takahiro Kojima
  - Improved the source distribution so that it can be used to
    build and install wheels, thanks to Janusz Skonieczny
  - Added requirements files for easier development, thanks to
    Greg Eremeev
  - Removed Python 3.5 support
  - Fixed a bug where only one of multiple NoInject annotations
    was interpreted

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-injector?expand=0&rev=15
2021-12-31 13:05:40 +00:00

75 lines
2.4 KiB
RPMSpec

#
# spec file for package python-injector
#
# Copyright (c) 2021 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 skip_python2 1
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-injector
Version: 0.19.0
Release: 0
Summary: Python dependency injection framework, inspired by Guice
License: BSD-3-Clause
URL: https://github.com/alecthomas/injector
Source: https://github.com/alecthomas/injector/archive/%{version}.tar.gz
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module typing_extensions >= 3.7.4}
BuildRequires: %{pythons}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: ((python3-dataclasses and python3-base < 3.7) or (python36-dataclasses and python36-base))
Requires: python
Requires: (python-typing_extensions if python-base < 3.8)
BuildArch: noarch
%python_subpackages
%description
Dependency injection as a formal pattern is less useful in Python than
in other languages, primarily due to its support for keyword
arguments, the ease with which objects can be mocked, and its dynamic
nature.
That said, a framework for assisting in this process can remove a lot
of boiler-plate from larger applications. That's where Injector can
help. It automatically and transitively provides keyword arguments
with their values. As an added benefit, Injector encourages nicely
compartmentalised code through the use of Module s.
While being inspired by Guice, it does not slavishly replicate its
API. Providing a Pythonic API trumps faithfulness.
%prep
%setup -q -n injector-%{version}
rm pytest.ini
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%pytest
%files %{python_files}
%license COPYING
%doc README.md
%{python_sitelib}/*
%changelog