15
0
Files
python-sqlparse/python-sqlparse.spec

86 lines
2.4 KiB
RPMSpec
Raw Normal View History

- update to 0.5.5: * Fix DoS protection to raise SQLParseError instead of silently returning None * when grouping limits are exceeded (issue827). * Fix splitting of BEGIN TRANSACTION statements (issue826). * Add support for Python 3.14. * Add type annotations to top-level API functions and include py.typed marker for PEP 561 compliance, enabling type checking with mypy and other tools * Add pre-commit hook support. sqlparse can now be used as a pre-commit hook to automatically format SQL files. The CLI now supports multiple files and an `--in-place` flag for in-place editing (issue537). * Add `ATTACH` and `DETACH` to PostgreSQL keywords (pr808). * Add `INTERSECT` to close keywords in WHERE clause (pr820). * Support `REGEXP BINARY` comparison operator (pr817). * Add additional protection against denial of service attacks when parsing very large lists of tuples. This enhances the existing recursion protections with configurable limits for token processing to prevent DoS through algorithmic complexity attacks. The new limits * MAX_GROUPING_TOKENS=10000) can be adjusted or disabled (by setting to None) if needed for legitimate large SQL statements. * Remove shebang from cli.py and remove executable flag * Fix strip_comments not removing all comments when input contains only comments (issue801, pr803 by stropysh). * Fix splitting statements with IF EXISTS/IF NOT EXISTS inside BEGIN...END blocks (issue812). * Fix splitting on semicolons inside BEGIN...END blocks (issue809). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sqlparse?expand=0&rev=44
2026-01-27 16:07:26 +00:00
#
# spec file for package python-sqlparse
#
# 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/
#
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%{?sle15_python_module_pythons}
Name: python-sqlparse
Version: 0.5.5
Release: 0
Summary: Non-validating SQL parser
License: BSD-3-Clause
URL: https://github.com/andialbrecht/sqlparse
Source: https://files.pythonhosted.org/packages/source/s/sqlparse/sqlparse-%{version}.tar.gz
BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module hatchling}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildArch: noarch
%if %{with libalternatives}
BuildRequires: alts
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun): update-alternatives
%endif
%python_subpackages
%description
sqlparse is a non-validating SQL parser module. It provides support for
parsing, splitting and formatting SQL statements.
%prep
%setup -q -n sqlparse-%{version}
sed -i -e '1{\,^#!%{_bindir}/env python,d}' sqlparse/__main__.py sqlparse/cli.py
chmod -x sqlparse/cli.py
%build
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/sqlformat
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%post
%python_install_alternative sqlformat
%postun
%python_uninstall_alternative sqlformat
%pre
%python_libalternatives_reset_alternative sqlformat
%check
%pytest
%files %{python_files}
%doc AUTHORS README.rst
%license LICENSE
%python_alternative %{_bindir}/sqlformat
%{python_sitelib}/sqlparse
%{python_sitelib}/sqlparse-%{version}.dist-info
%changelog