* Fix support for Annotated fields with Pydantic 2.12+.
* Drop support for Pydantic v1.
* Drop support for Python 3.8.
* Fix alias support for Pydantic v2.
* Fix RuntimeError: dictionary changed size during iteration in
sqlmodel_update().
* Add PEP-639 license metadata.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sqlmodel?expand=0&rev=12
91 lines
2.7 KiB
RPMSpec
91 lines
2.7 KiB
RPMSpec
#
|
|
# spec file for package python-sqlmodel
|
|
#
|
|
# Copyright (c) 2026 SUSE LLC and contributors
|
|
#
|
|
# 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
|
|
%{?sle15_python_module_pythons}
|
|
Name: python-sqlmodel%{psuffix}
|
|
Version: 0.0.34
|
|
Release: 0
|
|
Summary: SQL databases in Python, designed for simplicity, compatibility, and robustness
|
|
License: MIT
|
|
URL: https://github.com/fastapi/sqlmodel
|
|
Source: https://files.pythonhosted.org/packages/source/s/sqlmodel/sqlmodel-%{version}.tar.gz
|
|
BuildRequires: %{python_module base >= 3.9}
|
|
BuildRequires: %{python_module pdm-backend}
|
|
BuildRequires: %{python_module pip}
|
|
BuildRequires: fdupes
|
|
BuildRequires: python-rpm-macros
|
|
Requires: python-SQLAlchemy >= 2.0.14
|
|
Requires: python-pydantic >= 2.11.0
|
|
BuildArch: noarch
|
|
# SECTION test requirements
|
|
%if %{with test}
|
|
BuildRequires: %{python_module Jinja2}
|
|
BuildRequires: %{python_module black}
|
|
BuildRequires: %{python_module dirty-equals}
|
|
BuildRequires: %{python_module fastapi}
|
|
BuildRequires: %{python_module httpx}
|
|
BuildRequires: %{python_module pytest-cov}
|
|
BuildRequires: %{python_module pytest}
|
|
BuildRequires: %{python_module sqlmodel = %{version}}
|
|
%endif
|
|
# /SECTION
|
|
%python_subpackages
|
|
|
|
%description
|
|
SQLModel is a library for interacting with SQL databases from Python code,
|
|
with Python objects. It is designed to be intuitive, easy to use, highly
|
|
compatible, and robust. SQLModel is based on Python type annotations, and
|
|
powered by Pydantic and SQLAlchemy.
|
|
|
|
%prep
|
|
%autosetup -p1 -n sqlmodel-%{version}
|
|
|
|
%build
|
|
%pyproject_wheel
|
|
|
|
%install
|
|
%if !%{with test}
|
|
%pyproject_install
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
%endif
|
|
|
|
%check
|
|
%if %{with test}
|
|
export PYTHONPATH=$(pwd):$PYTHONPATH
|
|
# coverage appears to not a write a file/can't be found
|
|
%pytest -v tests -k 'not (test_create_db_and_table and tutorial001)'
|
|
%endif
|
|
|
|
%if !%{with test}
|
|
%files %{python_files}
|
|
%doc README.md
|
|
%license LICENSE
|
|
%{python_sitelib}/sqlmodel
|
|
%{python_sitelib}/sqlmodel-%{version}.dist-info
|
|
%endif
|
|
|
|
%changelog
|