From 386b42dfde2ddae9d415ca3603491788b94dec7633aa3c728220e6e535bdbc17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 3 May 2024 20:40:14 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main python-fields revision 2fe6a46f055ba690feddaf0d01fb4dab --- .gitattributes | 23 ++++++++++++++ fields-5.0.0.tar.gz | 3 ++ python-fields.changes | 74 +++++++++++++++++++++++++++++++++++++++++++ python-fields.spec | 70 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 170 insertions(+) create mode 100644 .gitattributes create mode 100644 fields-5.0.0.tar.gz create mode 100644 python-fields.changes create mode 100644 python-fields.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/fields-5.0.0.tar.gz b/fields-5.0.0.tar.gz new file mode 100644 index 0000000..301460d --- /dev/null +++ b/fields-5.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31d4aa03d8d44e35df13c431de35136997f047a924a597d84f7bc209e1be5727 +size 36232 diff --git a/python-fields.changes b/python-fields.changes new file mode 100644 index 0000000..856ed26 --- /dev/null +++ b/python-fields.changes @@ -0,0 +1,74 @@ +------------------------------------------------------------------- +Fri Apr 21 12:25:02 UTC 2023 - Dirk Müller + +- add sle15_python_module_pythons (jsc#PED-68) + +------------------------------------------------------------------- +Thu Apr 13 22:41:13 UTC 2023 - Matej Cepl + +- Make calling of %{sle15modernpython} optional. + +------------------------------------------------------------------- +Fri Jul 19 08:55:52 UTC 2019 - Tomáš Chvátal + +- Fix building with pytest4+ + +------------------------------------------------------------------- +Thu Mar 28 15:33:17 UTC 2019 - Tomáš Chvátal + +- Remove pytest-benchmark dependency to avoid buildcycle + +------------------------------------------------------------------- +Wed Feb 13 09:58:09 UTC 2019 - Tomáš Chvátal + +- Clean up with spec-cleaner +- Make sure the tests are not conditioned +- Use %license macro + +------------------------------------------------------------------- +Wed Oct 18 16:43:04 UTC 2017 - toddrme2178@gmail.com + +- Implement single-spec version +- Update to 5.0.0 + * See changelog at https://github.com/ionelmc/python-fields/blob/v5.0.0/CHANGELOG.rst + +------------------------------------------------------------------- +Thu Sep 3 14:29:19 UTC 2015 - toddrme2178@gmail.com + +- Update to 2.4.0 (2015-06-13) + * Similarly to ``fields.Fields``, added three new bases: + * ``fields.BareFields`` (implements ``__init__``). + * ``fields.ComparableMixin`` (implements ``__eq__``, ``__ne__``, ``__lt__``, ``__gt__``, ``__le__``, ``__ge__`` and ``__hash__``). + * ``fields.PrintableMixin`` (implements ``__repr__``). + * Improved reference section in the docs. + * Added ``fields.ConvertibleFields`` and ``fields.ConvertibleMixin``. They have two convenience properties: ``as_dict`` and `as_tuple``. +- Update to 2.3.0 (2015-01-20) + * Allowed overriding ``__slots__`` in ``SlotsFields`` subclasses. +- Update to 2.2.0 (2015-01-19) + * Added ``make_init_func`` as an optional argument to ``class_sealer``. Rename the ``__base__`` option to just ``base``. +- Update to 2.1.1 (2015-01-19) + * Removed bogus ``console_scripts`` entrypoint. +- Update to 2.1.0 (2015-01-09) + * Added ``SlotsFields`` (same as ``Fields`` but automatically adds ``__slots__`` for memory efficiency on CPython). + * Added support for default argument to Tuple. +- Update to 2.0.0 (2014-10-16) + * Made the __init__ in the FieldsBase way faster (used for ``fields.Fields``). + * Moved ``RegexValidate`` in ``fields.extras``. +- Update to 1.0.0 (2014-10-05) + * Lots of internal changes, the metaclass is not created in a closure anymore. No more closures. + * Added ``RegexValidate`` container creator (should be taken as an example on using the Factory metaclass). + * Added support for using multiple containers as baseclasses. + * Added a ``super()`` `sink` so that ``super().__init__(*args, **kwargs)`` always works. Everything inherits from a + baseclass that has an ``__init__`` that can take any argument (unlike ``object.__init__``). This allows for flexible + usage. + * Added validation so that you can't use conflicting field layout when using multiple containers as the baseclass. + * Changed the __init__ function in the class container so it works like a python function w.r.t. positional and keyword + arguments. Example: ``class MyContainer(Fields.a.b.c[1].d[2])`` will function the same way as ``def func(a, b, c=1, + d=2)`` would when arguments are passed in. You can now use ``MyContainer(1, 2, 3, 4)`` (everything positional) or + ``MyContainer(1, 2, 3, d=4)`` (mixed). + +------------------------------------------------------------------- +Wed Jul 30 06:42:12 UTC 2014 - toddrme2178@gmail.com + +- Initial version + diff --git a/python-fields.spec b/python-fields.spec new file mode 100644 index 0000000..8dfd89d --- /dev/null +++ b/python-fields.spec @@ -0,0 +1,70 @@ +# +# spec file for package python-fields +# +# 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/ +# + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%{?sle15_python_module_pythons} +Name: python-fields +Version: 5.0.0 +Release: 0 +Summary: Container class boilerplate killer +License: BSD-2-Clause +Group: Development/Languages/Python +URL: https://github.com/ionelmc/python-fields +Source: https://files.pythonhosted.org/packages/source/f/fields/fields-%{version}.tar.gz +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildArch: noarch +%python_subpackages + +%description +Container class boilerplate killer. +Features: + * Human-readable ``__repr__`` + * Complete set of comparison methods + * Keyword and positional argument support. Works like a normal class - you can override just about anything in the + subclass (eg: a custom ``__init__``). In contrast, `hynek/characteristic `_ + forces different call schematics and calls your ``__init__`` with different arguments. + +%prep +%setup -q -n fields-%{version} +# do not do benchmark tests, in virtual they don't make much sense and we +# avoid cycle with pytest-benchmark +sed -i -e '/--benchmark-disable/d' setup.cfg +# do not run doctests, needless dependencies pulled in that way +sed -i -e '/doctest/d' setup.cfg +sed -i -e 's/\[pytest\]/\[tools:pytest\]/g' setup.cfg +rm tests/test_perf.py + +%build +%python_build + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest + +%files %{python_files} +%license LICENSE +%doc AUTHORS.rst CHANGELOG.rst README.rst +%{python_sitelib}/* + +%changelog