python-sql 1.6.0__tar.gz → 1.7.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. {python_sql-1.6.0 → python_sql-1.7.0}/.gitlab-ci.yml +1 -1
  2. {python_sql-1.6.0 → python_sql-1.7.0}/.hgtags +1 -0
  3. {python_sql-1.6.0 → python_sql-1.7.0}/CHANGELOG +4 -0
  4. {python_sql-1.6.0 → python_sql-1.7.0}/PKG-INFO +2 -1
  5. {python_sql-1.6.0 → python_sql-1.7.0}/python_sql.egg-info/PKG-INFO +2 -1
  6. {python_sql-1.6.0 → python_sql-1.7.0}/setup.py +1 -0
  7. {python_sql-1.6.0 → python_sql-1.7.0}/sql/__init__.py +1 -1
  8. {python_sql-1.6.0 → python_sql-1.7.0}/sql/aggregate.py +16 -6
  9. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_aggregate.py +2 -2
  10. {python_sql-1.6.0 → python_sql-1.7.0}/tox.ini +1 -1
  11. {python_sql-1.6.0 → python_sql-1.7.0}/.flake8 +0 -0
  12. {python_sql-1.6.0 → python_sql-1.7.0}/.isort.cfg +0 -0
  13. {python_sql-1.6.0 → python_sql-1.7.0}/COPYRIGHT +0 -0
  14. {python_sql-1.6.0 → python_sql-1.7.0}/MANIFEST.in +0 -0
  15. {python_sql-1.6.0 → python_sql-1.7.0}/README.rst +0 -0
  16. {python_sql-1.6.0 → python_sql-1.7.0}/python_sql.egg-info/SOURCES.txt +0 -0
  17. {python_sql-1.6.0 → python_sql-1.7.0}/python_sql.egg-info/dependency_links.txt +0 -0
  18. {python_sql-1.6.0 → python_sql-1.7.0}/python_sql.egg-info/top_level.txt +0 -0
  19. {python_sql-1.6.0 → python_sql-1.7.0}/setup.cfg +0 -0
  20. {python_sql-1.6.0 → python_sql-1.7.0}/sql/conditionals.py +0 -0
  21. {python_sql-1.6.0 → python_sql-1.7.0}/sql/functions.py +0 -0
  22. {python_sql-1.6.0 → python_sql-1.7.0}/sql/operators.py +0 -0
  23. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/__init__.py +0 -0
  24. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_alias.py +0 -0
  25. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_as.py +0 -0
  26. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_cast.py +0 -0
  27. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_collate.py +0 -0
  28. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_column.py +0 -0
  29. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_combining_query.py +0 -0
  30. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_conditionals.py +0 -0
  31. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_delete.py +0 -0
  32. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_excluded.py +0 -0
  33. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_expression.py +0 -0
  34. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_flavor.py +0 -0
  35. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_for.py +0 -0
  36. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_from.py +0 -0
  37. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_from_item.py +0 -0
  38. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_functions.py +0 -0
  39. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_grouping.py +0 -0
  40. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_insert.py +0 -0
  41. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_join.py +0 -0
  42. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_lateral.py +0 -0
  43. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_literal.py +0 -0
  44. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_merge.py +0 -0
  45. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_operators.py +0 -0
  46. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_order.py +0 -0
  47. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_rollup.py +0 -0
  48. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_select.py +0 -0
  49. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_table.py +0 -0
  50. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_update.py +0 -0
  51. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_values.py +0 -0
  52. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_window.py +0 -0
  53. {python_sql-1.6.0 → python_sql-1.7.0}/sql/tests/test_with.py +0 -0
@@ -57,7 +57,7 @@ test-tox-python:
57
57
  - tox -e "py${PYTHON_VERSION/./}" -- -v --output-file junit.xml
58
58
  parallel:
59
59
  matrix:
60
- - PYTHON_VERSION: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
60
+ - PYTHON_VERSION: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
61
61
 
62
62
  test-tox-pypy:
63
63
  extends: .test-tox
@@ -21,3 +21,4 @@ fcb64787b51db2068061eb4aa13825abc1134916 1.4.2
21
21
  79a69b0bbbd35a8d95e1b754ed3feb03df23fb70 1.5.1
22
22
  41b0aaa68f5e5bab3889fa1ef57ef44c6c21cacf 1.5.2
23
23
  475502ba46eba3b7e141e8fbceaf495b545bcddb 1.6.0
24
+ 231ce10b975e41027c6121f9bb9033d786553b90 1.7.0
@@ -1,3 +1,7 @@
1
+ Version 1.7.0 - 2025-11-24
2
+ * Add support for Python 3.14
3
+ * Do not use parameters for COUNT(*)
4
+
1
5
  Version 1.6.0 - 2025-05-02
2
6
  * Fix position of order_by parameters in Select query
3
7
  * Add support for weak reference on SQL objects
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-sql
3
- Version: 1.6.0
3
+ Version: 1.7.0
4
4
  Summary: Library to write SQL queries
5
5
  Home-page: https://pypi.org/project/python-sql/
6
6
  Download-URL: https://downloads.tryton.org/python-sql/
@@ -25,6 +25,7 @@ Classifier: Programming Language :: Python :: 3.10
25
25
  Classifier: Programming Language :: Python :: 3.11
26
26
  Classifier: Programming Language :: Python :: 3.12
27
27
  Classifier: Programming Language :: Python :: 3.13
28
+ Classifier: Programming Language :: Python :: 3.14
28
29
  Classifier: Topic :: Database
29
30
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
30
31
  Requires-Python: >=3.5
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-sql
3
- Version: 1.6.0
3
+ Version: 1.7.0
4
4
  Summary: Library to write SQL queries
5
5
  Home-page: https://pypi.org/project/python-sql/
6
6
  Download-URL: https://downloads.tryton.org/python-sql/
@@ -25,6 +25,7 @@ Classifier: Programming Language :: Python :: 3.10
25
25
  Classifier: Programming Language :: Python :: 3.11
26
26
  Classifier: Programming Language :: Python :: 3.12
27
27
  Classifier: Programming Language :: Python :: 3.13
28
+ Classifier: Programming Language :: Python :: 3.14
28
29
  Classifier: Topic :: Database
29
30
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
30
31
  Requires-Python: >=3.5
@@ -49,6 +49,7 @@ setup(name='python-sql',
49
49
  'Programming Language :: Python :: 3.11',
50
50
  'Programming Language :: Python :: 3.12',
51
51
  'Programming Language :: Python :: 3.13',
52
+ 'Programming Language :: Python :: 3.14',
52
53
  'Topic :: Database',
53
54
  'Topic :: Software Development :: Libraries :: Python Modules',
54
55
  ],
@@ -7,7 +7,7 @@ from collections import defaultdict
7
7
  from itertools import chain
8
8
  from threading import current_thread, local
9
9
 
10
- __version__ = '1.6.0'
10
+ __version__ = '1.7.0'
11
11
  __all__ = [
12
12
  'Flavor', 'Table', 'Values', 'Literal', 'Column', 'Grouping', 'Conflict',
13
13
  'Matched', 'MatchedUpdate', 'MatchedDelete',
@@ -4,7 +4,6 @@ from sql import Expression, Flavor, Literal, Window
4
4
 
5
5
  __all__ = ['Avg', 'BitAnd', 'BitOr', 'BoolAnd', 'BoolOr', 'Count', 'Every',
6
6
  'Max', 'Min', 'Stddev', 'Sum', 'Variance']
7
- _sentinel = object()
8
7
 
9
8
 
10
9
  class Aggregate(Expression):
@@ -169,20 +168,31 @@ class BoolOr(Aggregate):
169
168
  _sql = 'BOOL_OR'
170
169
 
171
170
 
171
+ class _Star(Expression):
172
+ __slots__ = ()
173
+
174
+ def __str__(self):
175
+ return '*'
176
+
177
+ @property
178
+ def params(self):
179
+ return ()
180
+
181
+
172
182
  class Count(Aggregate):
173
183
  __slots__ = ()
174
184
  _sql = 'COUNT'
175
185
 
176
- def __init__(self, expression=_sentinel, **kwargs):
177
- if expression is _sentinel:
178
- expression = Literal('*')
186
+ def __init__(self, expression=_Star(), **kwargs):
179
187
  super().__init__(expression, **kwargs)
180
188
 
181
189
  @property
182
190
  def _case_expression(self):
183
191
  expression = super(Count, self)._case_expression
184
- if (isinstance(self.expression, Literal)
185
- and expression.value == '*'):
192
+ if (isinstance(self.expression, _Star)
193
+ # Keep testing Literal('*') for backward compatibility
194
+ or (isinstance(self.expression, Literal)
195
+ and expression.value == '*')):
186
196
  expression = Literal(1)
187
197
  return expression
188
198
 
@@ -42,8 +42,8 @@ class TestAggregate(unittest.TestCase):
42
42
 
43
43
  def test_count_without_expression(self):
44
44
  count = Count()
45
- self.assertEqual(str(count), 'COUNT(%s)')
46
- self.assertEqual(count.params, ('*',))
45
+ self.assertEqual(str(count), 'COUNT(*)')
46
+ self.assertEqual(count.params, ())
47
47
 
48
48
  def test_order_by_one_column(self):
49
49
  avg = Avg(self.table.a, order_by=self.table.b)
@@ -4,7 +4,7 @@
4
4
  # and then run "tox" from this directory.
5
5
 
6
6
  [tox]
7
- envlist = py35, py36, py37, py38, py39, py310, py311, py312, py313, pypy3
7
+ envlist = py35, py36, py37, py38, py39, py310, py311, py312, py313, py314, pypy3
8
8
 
9
9
  [testenv]
10
10
  usedevelop = true
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes