commit d650f168498a6dfbf8c783bd5536893f6ff500e1f8e7f8ebbb03d7ff74c121c4 Author: Dirk Mueller Date: Mon Aug 19 07:44:02 2024 +0000 - update to 0.5.1: * New "compact" option for formatter. If set, the formatter tries to produce a more compact output by avoiding some line breaks * The strip comments filter was a bit greedy and removed too much whitespace (issue772). Note: In some cases you might want to add `strip_whitespace=True` where you previously used just `strip_comments=True`. `strip_comments` did some of the work that `strip_whitespace` should do. * Fix error when splitting statements that contain multiple CASE clauses within a BEGIN block (issue784). * Fix whitespace removal with nested expressions (issue782). * Fix parsing and formatting of ORDER clauses containing NULLS FIRST or NULLS LAST (issue532). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sqlparse?expand=0&rev=38 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/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/python-sqlparse.changes b/python-sqlparse.changes new file mode 100644 index 0000000..77ab9eb --- /dev/null +++ b/python-sqlparse.changes @@ -0,0 +1,291 @@ +------------------------------------------------------------------- +Mon Aug 19 07:42:50 UTC 2024 - Dirk Müller + +- update to 0.5.1: + * New "compact" option for formatter. If set, the formatter + tries to produce a more compact output by avoiding some line + breaks + * The strip comments filter was a bit greedy and removed too + much whitespace (issue772). Note: In some cases you might want + to add `strip_whitespace=True` where you previously used just + `strip_comments=True`. `strip_comments` did some of the + work that `strip_whitespace` should do. + * Fix error when splitting statements that contain multiple + CASE clauses within a BEGIN block (issue784). + * Fix whitespace removal with nested expressions (issue782). + * Fix parsing and formatting of ORDER clauses containing NULLS + FIRST or NULLS LAST (issue532). + +------------------------------------------------------------------- +Tue May 7 02:21:45 UTC 2024 - Steve Kowalik + +- Update to 0.5.0: + * Notable Changes + + Drop support for Python 3.5, 3.6, and 3.7. + + Python 3.12 is now supported. + + IMPORTANT: Fixes a potential denial of service attack (DOS) due to + recursion error for deeply nested statements. + (CVE-2024-2430, bsc#1223603) + * Enhancements: + + Splitting statements now allows to remove the semicolon at the end. + Some database backends love statements without semicolon. + + Support TypedLiterals in get_parameters. + + Improve splitting of Transact SQL when using GO keyword. + + Support for some JSON operators. + + Improve formatting of statements containing JSON operators. + + Support for BigQuery and Snowflake keywords. + + Support parsing of OVER clause. + * Bug Fixes + + Ignore dunder attributes when creating Tokens. + + Allow operators to precede dollar-quoted strings. + + Fix parsing of nested order clauses. + + Thread-safe initialization of Lexer class. + + Classify TRUNCATE as DDL and GRANT/REVOKE as DCL keywords. + + Fix parsing of PRIMARY KEY. + * Other + + Optimize performance of matching function. + +------------------------------------------------------------------- +Mon Feb 26 20:15:41 UTC 2024 - Robert Schweikert + +- Version update in SLE 15 SP4 and later (jsc#PED-6697) + +------------------------------------------------------------------- +Fri Jun 9 11:45:02 UTC 2023 - ecsos + +- Add %{?sle15_python_module_pythons} + +------------------------------------------------------------------- +Thu May 25 16:21:05 UTC 2023 - Matej Cepl + +- Update to 0.4.4: + * IMPORTANT: This release fixes a security vulnerability in + the parser where a regular expression vulnerable to ReDOS + (Regular Expression Denial of Service) was used. See the + security advisory for details (CVE-2023-30608, bsc#1210617, + https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-rrm6-wvj7-cwh2) + The vulnerability was discovered by @erik-krogh from GitHub + Security Lab (GHSL). Thanks for reporting! + * Revert a change from 0.4.0 that changed IN to be a comparison + (issue694). The primary expectation is that IN is treated as + a keyword and not as a comparison operator. That also follows + the definition of reserved keywords for the major SQL syntax + definitions. + * Fix regular expressions for string parsing. + * sqlparse now uses pyproject.toml instead of setup.cfg + (issue685). + +------------------------------------------------------------------- +Mon Oct 3 16:01:20 UTC 2022 - Dirk Müller + +- update to 0.4.3: + * Add support for DIV operator. + * Add support for additional SPARK keywords. + * Avoid tokens copy. + * Add REGEXP as a comparision. + * Add DISTINCTROW keyword for MS Access. + * Improve parsing of CREATE TABLE AS SELECT. + * Fix spelling of INDICATOR keyword. + * Fix formatting error in EXTRACT function. + * Fix bad parsing of create table statements that use lower case. + * Handle backtick as valid quote char. + * Allow any unicode character as valid identifier name. + +------------------------------------------------------------------- +Fri Oct 1 12:42:17 UTC 2021 - Johannes Grassler + +- update to 0.4.2 (bsc#1190741, CVE-2021-32839): + * This release fixes a security vulnerability in the strip + comments filter. + * Add ELSIF as keyword (issue584). + * Add CONFLICT and ON_ERROR_STOP keywords. + * Fix parsing of backticks (issue588). + * Fix parsing of scientific number (issue399). + +------------------------------------------------------------------- +Thu Jan 28 08:27:49 UTC 2021 - Antonio Larrosa + +- Disable building a python2 flavor so we can build the package + for Leap/SLE. + +------------------------------------------------------------------- +Thu Nov 26 08:42:20 UTC 2020 - Dirk Mueller + +- update to 0.4.1: + * Python 3.9 support + * Remove support for end-of-life Python 2.7 and 3.4. Python 3.5+ is now + required. + * Remaining strings that only consist of whitespaces are not treated as + statements anymore. Code that ignored the last element from + sqlparse.split() should be updated accordingly since that function + now doesn't return an empty string as the last element in some + cases (issue496). +- remove non-upstream stdout-encoding-set.patch patch + +------------------------------------------------------------------- +Tue Mar 24 02:45:39 UTC 2020 - Steve Kowalik + +- Add stdout-encoding-set.patch to use sys.stdout.reconfigure() if + the stream is an instance of TextIOWrapper to support a pytest change. + +------------------------------------------------------------------- +Mon Mar 9 16:22:39 UTC 2020 - Dirk Mueller + +- update to v0.3.1: + * Add HQL keywords (pr475, by matwalk). + * Add support for time zone casts (issue489). + * Enhance formatting of AS keyword (issue507, by john-bodley). + * Stabilize grouping engine when parsing invalid SQL statements. + * Fix splitting of SQL with multiple statements inside + parentheses (issue485, pr486 by win39). + * Correctly identify NULLS FIRST / NULLS LAST as keywords (issue487). + * Fix splitting of SQL statements that contain dollar signs in + identifiers (issue491). + * Remove support for parsing double slash comments introduced in + 0.3.0 (issue456) as it had some side-effects with other dialects and + doesn't seem to be widely used (issue476). + * Restrict detection of alias names to objects that acutally could + have an alias (issue455, adopted some parts of pr509 by john-bodley). + * Fix parsing of date/time literals (issue438, by vashek). + * Fix initialization of TokenList (issue499, pr505 by john-bodley). + * Fix parsing of LIKE (issue493, pr525 by dbczumar). + * Improve parsing of identifiers (pr527 by liulk). + +------------------------------------------------------------------- +Wed Apr 17 12:00:12 UTC 2019 - Tomáš Chvátal + +- Use %pytest macro + +------------------------------------------------------------------- +Tue Mar 12 01:49:22 UTC 2019 - John Vandenberg + +- Move fdupes from %check to %install +- Update to v0.3.0 + * Remove support for Python 3.3. + * New formatting option "--indent_after_first" + * New formatting option "--indent_columns" + * Add UPSERT keyword + * Strip multiple whitespace within parentheses + * Support double slash (//) comments + * Support for Calcite temporal keywords + * Fix occasional IndexError + * Fix incorrect splitting of strings containing new lines + * Fix reindent issue for parenthesis + * Fix from( parsing issue + * Fix for get_real_name() to return correct name + * Wrap function params when wrap_after is set + * Fix parsing of "WHEN name" clauses + * Add missing EXPLAIN keyword + * Fix issue with strip_comments causing a syntax error + * Fix formatting on INSERT which caused staircase effect on values + * Avoid formatting of psql commands + * Unify handling of GROUP BY/ORDER BY + * Remove unnecessary compat shim for bytes + +------------------------------------------------------------------- +Thu Aug 23 06:31:42 UTC 2018 - alarrosa@suse.com + +- Update to 0.2.4: + * Add more keywords for MySQL table options (pr328, pr333, by phdru). + * Add more PL/pgSQL keywords (pr357, by Demetrio92). + * Improve parsing of floats (pr330, by atronah). + * Fix parsing of MySQL table names starting with digits (issue337). + * Fix detection of identifiers using comparisons (issue327). + * Fix parsing of UNION ALL after WHERE (issue349). + * Fix handling of semicolon in assignments (issue359, issue358). +- Use fdupes and %license +- Remove shebangs from non-executable python files + +------------------------------------------------------------------- +Wed Jul 12 05:40:09 UTC 2017 - tbechtold@suse.com + +- update to 0.2.3: + * New command line option "--encoding" (by twang2218, pr317). + * Support CONCURRENTLY keyword (issue322, by rowanseymour). + * Fix some edge-cases when parsing invalid SQL statements. + * Fix indentation of LIMIT (by romainr, issue320). + * Fix parsing of INTO keyword (issue324). + * Several improvements regarding encodings. + * Add comma_first option: When splitting list "comma first" notation + is used (issue141). + * Fix parsing of incomplete AS (issue284, by vmuriart). + * Fix parsing of Oracle names containing dollars (issue291). + * Fix parsing of UNION ALL (issue294). + * Fix grouping of identifiers containing typecasts (issue297). + * Add Changelog to sdist again (issue302). + * `is_whitespace` and `is_group` changed into properties +- convert to singlespec + +------------------------------------------------------------------- +Tue Nov 15 10:13:47 UTC 2016 - dmueller@suse.com + +- update to 0.2.1 + +------------------------------------------------------------------- +Wed May 13 16:39:54 UTC 2015 - benoit.monin@gmx.fr + +- update to version 0.1.15: + * Fix a regression for identifiers with square brackets notation + (issue153, by darikg). + * Add missing SQL types (issue154, issue155, issue156, by + jukebox). + * Fix parsing of multi-line comments (issue172, by JacekPliszka). + * Fix parsing of escaped backslashes (issue174, by caseyching). + * Fix parsing of identifiers starting with underscore (issue175). + * Fix misinterpretation of IN keyword (issue183). + * Improve formatting of HAVING statements. + * Improve parsing of inline comments (issue163). + * Group comments to parent object (issue128, issue160). + * Add double precision builtin (issue169, by darikg). + * Add support for square bracket array indexing (issue170, + issue176, issue177 by darikg). + * Improve grouping of aliased elements (issue167, by darikg). + * Support comments starting with '#' character (issue178). +- additional changes from version 0.1.14: + * Floats in UPDATE statements are now handled correctly + (issue145). + * Properly handle string literals in comparisons (issue148, + change proposed by aadis). + * Fix indentation when using tabs (issue146). + * Improved formatting in list when newlines precede commas + (issue140). +- additional changes from version 0.1.13: + * Fix a regression in handling of NULL keywords introduced in + 0.1.12. +- additional changes from version 0.1.12: + * Fix handling of NULL keywords in aliased identifiers. + * Fix SerializerUnicode to split unquoted newlines (issue131, by + Michael Schuller). + * Fix handling of modulo operators without spaces (by gavinwahl). + * Improve parsing of identifier lists containing placeholders. + * Speed up query parsing of unquoted lines (by Michael Schuller). +- additional changes from version 0.1.11: + * Fix incorrect parsing of string literals containing line breaks + (issue118). + * Fix typo in keywords, add MERGE, COLLECT keywords + (issue122/124, by Cristian Orellana). + * Improve parsing of string literals in columns. + * Fix parsing and formatting of statements containing EXCEPT + keyword. + * Fix Function.get_parameters() (issue126/127, by spigwitmer). + * Classify DML keywords (issue116, by Victor Hahn). + * Add missing FOREACH keyword. + * Grouping of BEGIN/END blocks. + * Python 2.5 isn't automatically tested anymore, neither Travis + nor Tox still support it out of the box. + +------------------------------------------------------------------- +Sat Nov 08 20:20:00 UTC 2014 - Led + +- fix bashism in pre script + +------------------------------------------------------------------- +Fri Nov 15 12:18:02 UTC 2013 - speilicke@suse.com + +- Only ghost /etc/alternatives on 12.3 or newer + +------------------------------------------------------------------- +Fri Nov 8 07:52:44 UTC 2013 - speilicke@suse.com + +- Initial version + diff --git a/python-sqlparse.spec b/python-sqlparse.spec new file mode 100644 index 0000000..6c036aa --- /dev/null +++ b/python-sqlparse.spec @@ -0,0 +1,72 @@ +# +# spec file for package python-sqlparse +# +# Copyright (c) 2024 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-sqlparse +Version: 0.5.1 +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 +Requires(post): update-alternatives +Requires(postun): update-alternatives +BuildArch: noarch +%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 + +%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 diff --git a/sqlparse-0.5.0.tar.gz b/sqlparse-0.5.0.tar.gz new file mode 100644 index 0000000..bd3992f --- /dev/null +++ b/sqlparse-0.5.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:714d0a4932c059d16189f58ef5411ec2287a4360f17cdd0edd2d09d4c5087c93 +size 83475 diff --git a/sqlparse-0.5.1.tar.gz b/sqlparse-0.5.1.tar.gz new file mode 100644 index 0000000..c9fbf7f --- /dev/null +++ b/sqlparse-0.5.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb6b4df465655ef332548e24f08e205afc81b9ab86cb1c45657a7ff173a3a00e +size 84502