1
0
python-factory_boy/python-factory_boy.spec

72 lines
2.1 KiB
RPMSpec
Raw Permalink Normal View History

#
# spec file for package python-factory_boy
#
# 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/
#
%{?sle15_python_module_pythons}
Name: python-factory_boy
Accepting request 1124433 from home:ecsos:python - Update to 3.3.0 * New: - :issue:`366`: Add :class:`factory.django.Password` to generate Django :class:`~django.contrib.auth.models.User` passwords. - :issue:`304`: Add :attr:`~factory.alchemy.SQLAlchemyOptions.sqlalchemy_session_factory` to dynamically create sessions for use by the :class:`~factory.alchemy.SQLAlchemyModelFactory`. - Add support for Django 4.0 - Add support for Django 4.1 - Add support for Python 3.10 - Add support for Python 3.11 * Bugfix: - Make :meth:`~factory.django.mute_signals` mute signals during post-generation. - :issue:`775`: Change the signature for :meth:`~factory.alchemy.SQLAlchemyModelFactory._save` and :meth:`~factory.alchemy.SQLAlchemyModelFactory._get_or_create` to avoid argument names clashes with a field named session. * Deprecated: - :class:`~factory.django.DjangoModelFactory` will stop issuing a second call to :meth:`~django.db.models.Model.save` on the created instance when :ref:`post-generation-hooks` return a value. - To help with the transition, :class:`factory.django.DjangoModelFactory._after_postgeneration` raises a :class:`DeprecationWarning` when calling :meth:`~django.db.models.Model.save`. Inspect your :class:`~factory.django.DjangoModelFactory` subclasses: + If the :meth:`~django.db.models.Model.save` call is not needed after :class:`~factory.PostGeneration`, set :attr:`factory.django.DjangoOptions.skip_postgeneration_save` to True in the factory meta. + Otherwise, the instance has been modified by :class:`~factory.PostGeneration` hooks and needs to be :meth:`~django.db.models.Model.save`d. Either: - call :meth:`django.db.models.Model.save` in the :class:`~factory.PostGeneration` hook that modifies the instance, or - override :class:`~factory.django.DjangoModelFactory._after_postgeneration` to :meth:`~django.db.models.Model.save` the instance. * Removed: - Drop support for Django 2.2 - Drop support for Django 3.0 - Drop support for Django 3.1 - Drop support for Python 3.6 - Drop support for Python 3.7 - Drop tests-skip-django-py36.patch because new version need python >= 3.7. OBS-URL: https://build.opensuse.org/request/show/1124433 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-factory_boy?expand=0&rev=30
2023-11-11 17:08:21 +01:00
Version: 3.3.0
Release: 0
Accepting request 839483 from home:jayvdb:branches:devel:languages:python - Use PyPI tarball and revise test runner to python -m unittest - Update to v3.1.0 * Allow all types of declarations in :class:`factory.Faker` calls enables references to other faker-defined attributes. - from v3.0.1 * Fix `import factory; factory.django.DjangoModelFactory` and similar calls. - from v3.0.0 * Removed alias + `from factory import DjangoModelFactory` to `from factory.django import DjangoModelFactory` + `from factory import MogoFactory` to `from factory.mogo import MogoFactory` + `from factory.fuzzy import get_random_state` to `from factory.random import get_random_state` + `from factory.fuzzy import set_random_state` to `from factory.random import set_random_state` + `from factory.fuzzy import reseed_random` to `from factory.random import reseed_random` * Drop support for Python 2 and 3.4 * Drop support for Django 2.0 and 2.1 * Remove deprecated `force_flush` from `SQLAlchemyModelFactory` Use `sqlalchemy_session_persistence = "flush"` instead * Drop deprecated `attributes()` from `factory.Factory`; use `make_factory(dict, FactoryClass._meta.pre_declarations)` * Drop deprecated `declarations()` from `factory.Factory`; use `FactoryClass._meta.pre_declarations` instead * Drop `factory.compat` module * Add support for Python 3.8 * Add support for Django 2.2 and 3.0 * Report misconfiguration when `Factory` is used as the `Factory.model` for another `Factory` * Allow configuring the color palette of `factory.django.ImageField` * `get_random_state()` now represents the state of Faker and `factory_boy` fuzzy attributes * Add SQLAlchemy ``get_or_create`` support * Display a developer-friendly error message when providing a model instead of a factory in a `factory.declarations.SubFactory` class * Fix issue with SubFactory not preserving signal muting behaviour of the used factory * Fix issue with overriding params in a Trait * Limit ``get_or_create`` behavior to fields specified in `django_get_or_create` * Re-raise `~django.db.IntegrityError` when `django_get_or_create` with multiple fields fails to lookup model using user provided keyword arguments * TypeError masked by __repr__ AttributeError when initializing `Maybe` with inconsistent phases OBS-URL: https://build.opensuse.org/request/show/839483 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-factory_boy?expand=0&rev=19
2020-10-05 08:39:55 +02:00
Summary: Python test fixtures
License: MIT
URL: https://github.com/rbarrois/factory_boy
Accepting request 839483 from home:jayvdb:branches:devel:languages:python - Use PyPI tarball and revise test runner to python -m unittest - Update to v3.1.0 * Allow all types of declarations in :class:`factory.Faker` calls enables references to other faker-defined attributes. - from v3.0.1 * Fix `import factory; factory.django.DjangoModelFactory` and similar calls. - from v3.0.0 * Removed alias + `from factory import DjangoModelFactory` to `from factory.django import DjangoModelFactory` + `from factory import MogoFactory` to `from factory.mogo import MogoFactory` + `from factory.fuzzy import get_random_state` to `from factory.random import get_random_state` + `from factory.fuzzy import set_random_state` to `from factory.random import set_random_state` + `from factory.fuzzy import reseed_random` to `from factory.random import reseed_random` * Drop support for Python 2 and 3.4 * Drop support for Django 2.0 and 2.1 * Remove deprecated `force_flush` from `SQLAlchemyModelFactory` Use `sqlalchemy_session_persistence = "flush"` instead * Drop deprecated `attributes()` from `factory.Factory`; use `make_factory(dict, FactoryClass._meta.pre_declarations)` * Drop deprecated `declarations()` from `factory.Factory`; use `FactoryClass._meta.pre_declarations` instead * Drop `factory.compat` module * Add support for Python 3.8 * Add support for Django 2.2 and 3.0 * Report misconfiguration when `Factory` is used as the `Factory.model` for another `Factory` * Allow configuring the color palette of `factory.django.ImageField` * `get_random_state()` now represents the state of Faker and `factory_boy` fuzzy attributes * Add SQLAlchemy ``get_or_create`` support * Display a developer-friendly error message when providing a model instead of a factory in a `factory.declarations.SubFactory` class * Fix issue with SubFactory not preserving signal muting behaviour of the used factory * Fix issue with overriding params in a Trait * Limit ``get_or_create`` behavior to fields specified in `django_get_or_create` * Re-raise `~django.db.IntegrityError` when `django_get_or_create` with multiple fields fails to lookup model using user provided keyword arguments * TypeError masked by __repr__ AttributeError when initializing `Maybe` with inconsistent phases OBS-URL: https://build.opensuse.org/request/show/839483 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-factory_boy?expand=0&rev=19
2020-10-05 08:39:55 +02:00
Source: https://files.pythonhosted.org/packages/source/f/factory_boy/factory_boy-%{version}.tar.gz
BuildRequires: %{python_module Faker >= 0.7.0}
BuildRequires: %{python_module Pillow}
Accepting request 1124433 from home:ecsos:python - Update to 3.3.0 * New: - :issue:`366`: Add :class:`factory.django.Password` to generate Django :class:`~django.contrib.auth.models.User` passwords. - :issue:`304`: Add :attr:`~factory.alchemy.SQLAlchemyOptions.sqlalchemy_session_factory` to dynamically create sessions for use by the :class:`~factory.alchemy.SQLAlchemyModelFactory`. - Add support for Django 4.0 - Add support for Django 4.1 - Add support for Python 3.10 - Add support for Python 3.11 * Bugfix: - Make :meth:`~factory.django.mute_signals` mute signals during post-generation. - :issue:`775`: Change the signature for :meth:`~factory.alchemy.SQLAlchemyModelFactory._save` and :meth:`~factory.alchemy.SQLAlchemyModelFactory._get_or_create` to avoid argument names clashes with a field named session. * Deprecated: - :class:`~factory.django.DjangoModelFactory` will stop issuing a second call to :meth:`~django.db.models.Model.save` on the created instance when :ref:`post-generation-hooks` return a value. - To help with the transition, :class:`factory.django.DjangoModelFactory._after_postgeneration` raises a :class:`DeprecationWarning` when calling :meth:`~django.db.models.Model.save`. Inspect your :class:`~factory.django.DjangoModelFactory` subclasses: + If the :meth:`~django.db.models.Model.save` call is not needed after :class:`~factory.PostGeneration`, set :attr:`factory.django.DjangoOptions.skip_postgeneration_save` to True in the factory meta. + Otherwise, the instance has been modified by :class:`~factory.PostGeneration` hooks and needs to be :meth:`~django.db.models.Model.save`d. Either: - call :meth:`django.db.models.Model.save` in the :class:`~factory.PostGeneration` hook that modifies the instance, or - override :class:`~factory.django.DjangoModelFactory._after_postgeneration` to :meth:`~django.db.models.Model.save` the instance. * Removed: - Drop support for Django 2.2 - Drop support for Django 3.0 - Drop support for Django 3.1 - Drop support for Python 3.6 - Drop support for Python 3.7 - Drop tests-skip-django-py36.patch because new version need python >= 3.7. OBS-URL: https://build.opensuse.org/request/show/1124433 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-factory_boy?expand=0&rev=30
2023-11-11 17:08:21 +01:00
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module setuptools >= 0.8}
BuildRequires: %{python_module typing_extensions}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
%if 0%{suse_version} >= 1550
BuildRequires: %{python_module Django}
%endif
Requires: python-Faker >= 0.7.0
BuildArch: noarch
%python_subpackages
%description
A test fixtures replacement based on thoughtbot's factory_girl for Ruby.
%prep
%autosetup -p1 -n factory_boy-%{version}
# needs running mongo
rm tests/test_mongoengine.py
sed -i -e '/test_mongoengine/d' tests/__init__.py
# sqlalchemy hickups a lot
rm tests/test_alchemy.py
sed -i -e '/test_alchemy/d' tests/__init__.py
Accepting request 1124433 from home:ecsos:python - Update to 3.3.0 * New: - :issue:`366`: Add :class:`factory.django.Password` to generate Django :class:`~django.contrib.auth.models.User` passwords. - :issue:`304`: Add :attr:`~factory.alchemy.SQLAlchemyOptions.sqlalchemy_session_factory` to dynamically create sessions for use by the :class:`~factory.alchemy.SQLAlchemyModelFactory`. - Add support for Django 4.0 - Add support for Django 4.1 - Add support for Python 3.10 - Add support for Python 3.11 * Bugfix: - Make :meth:`~factory.django.mute_signals` mute signals during post-generation. - :issue:`775`: Change the signature for :meth:`~factory.alchemy.SQLAlchemyModelFactory._save` and :meth:`~factory.alchemy.SQLAlchemyModelFactory._get_or_create` to avoid argument names clashes with a field named session. * Deprecated: - :class:`~factory.django.DjangoModelFactory` will stop issuing a second call to :meth:`~django.db.models.Model.save` on the created instance when :ref:`post-generation-hooks` return a value. - To help with the transition, :class:`factory.django.DjangoModelFactory._after_postgeneration` raises a :class:`DeprecationWarning` when calling :meth:`~django.db.models.Model.save`. Inspect your :class:`~factory.django.DjangoModelFactory` subclasses: + If the :meth:`~django.db.models.Model.save` call is not needed after :class:`~factory.PostGeneration`, set :attr:`factory.django.DjangoOptions.skip_postgeneration_save` to True in the factory meta. + Otherwise, the instance has been modified by :class:`~factory.PostGeneration` hooks and needs to be :meth:`~django.db.models.Model.save`d. Either: - call :meth:`django.db.models.Model.save` in the :class:`~factory.PostGeneration` hook that modifies the instance, or - override :class:`~factory.django.DjangoModelFactory._after_postgeneration` to :meth:`~django.db.models.Model.save` the instance. * Removed: - Drop support for Django 2.2 - Drop support for Django 3.0 - Drop support for Django 3.1 - Drop support for Python 3.6 - Drop support for Python 3.7 - Drop tests-skip-django-py36.patch because new version need python >= 3.7. OBS-URL: https://build.opensuse.org/request/show/1124433 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-factory_boy?expand=0&rev=30
2023-11-11 17:08:21 +01:00
# Fix wrong version
sed -i -e 's|"3.2.1.dev0"|"3.3.0"|g' tests/test_version.py
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%pyunittest -v
%files %{python_files}
%license LICENSE
%doc README.rst
%{python_sitelib}/factory
%{python_sitelib}/factory_boy-%{version}*-info
%changelog