django-cte 1.3.3__tar.gz → 1.3.3.dev20250526204410__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.
@@ -1,13 +1,11 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: django-cte
3
- Version: 1.3.3
3
+ Version: 1.3.3.dev20250526204410
4
4
  Summary: Common Table Expressions (CTE) for Django
5
- Home-page: https://github.com/dimagi/django-cte
6
- Maintainer: Daniel Miller
7
- Maintainer-email: millerdev@gmail.com
8
- License: BSD License
9
- Platform: UNKNOWN
10
- Classifier: Development Status :: 3 - Alpha
5
+ Author-email: Daniel Miller <millerdev@gmail.com>
6
+ Requires-Python: >= 3.9
7
+ Description-Content-Type: text/markdown
8
+ Classifier: Development Status :: 5 - Production/Stable
11
9
  Classifier: Environment :: Web Environment
12
10
  Classifier: Framework :: Django
13
11
  Classifier: Intended Audience :: Developers
@@ -15,21 +13,21 @@ Classifier: License :: OSI Approved :: BSD License
15
13
  Classifier: Operating System :: OS Independent
16
14
  Classifier: Programming Language :: Python
17
15
  Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.8
19
16
  Classifier: Programming Language :: Python :: 3.9
20
17
  Classifier: Programming Language :: Python :: 3.10
21
18
  Classifier: Programming Language :: Python :: 3.11
22
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
23
21
  Classifier: Framework :: Django
24
- Classifier: Framework :: Django :: 3
25
- Classifier: Framework :: Django :: 3.2
26
22
  Classifier: Framework :: Django :: 4
27
- Classifier: Framework :: Django :: 4.0
28
- Classifier: Framework :: Django :: 4.1
29
23
  Classifier: Framework :: Django :: 4.2
24
+ Classifier: Framework :: Django :: 5
25
+ Classifier: Framework :: Django :: 5.0
26
+ Classifier: Framework :: Django :: 5.1
30
27
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
31
- Description-Content-Type: text/markdown
32
28
  License-File: LICENSE
29
+ Requires-Dist: django
30
+ Project-URL: Home, https://github.com/dimagi/django-cte
33
31
 
34
32
  # Common Table Expressions with Django
35
33
 
@@ -52,25 +50,35 @@ to use Common Table Expressions with the Django ORM.
52
50
 
53
51
  ```
54
52
  cd django-cte
55
- mkvirtualenv cte # or however you choose to setup your environment
56
- pip install django pynose flake8
57
-
58
- nosetests
59
- flake8 --config=setup.cfg
53
+ uv sync
54
+
55
+ pytest
56
+ ruff check
57
+
58
+ # To run tests against postgres
59
+ psql -U username -h localhost -p 5432 -c 'create database django_cte;'
60
+ export PG_DB_SETTINGS='{
61
+ "ENGINE":"django.db.backends.postgresql_psycopg2",
62
+ "NAME":"django_cte",
63
+ "USER":"username",
64
+ "PASSWORD":"password",
65
+ "HOST":"localhost",
66
+ "PORT":"5432"}'
67
+
68
+ # WARNING pytest will delete the test_django_cte database if it exists!
69
+ DB_SETTINGS="$PG_DB_SETTINGS" pytest
60
70
  ```
61
71
 
62
72
  All feature and bug contributions are expected to be covered by tests.
63
73
 
64
74
 
65
- ## Uploading to PyPI
75
+ ## Publishing a new verison to PyPI
66
76
 
67
- Package and upload the generated files.
77
+ Push a new tag to Github using the format vX.Y.Z where X.Y.Z matches the version
78
+ in [`__init__.py`](django_cte/__init__.py).
68
79
 
69
- ```
70
- pip install -r pkg-requires.txt
71
-
72
- python setup.py sdist bdist_wheel
73
- twine upload dist/*
74
- ```
80
+ A new version is published to https://test.pypi.org/p/django-cte on every
81
+ push to the *main* branch.
75
82
 
83
+ Publishing is automated with [Github Actions](.github/workflows/pypi.yml).
76
84
 
@@ -0,0 +1,52 @@
1
+ # Common Table Expressions with Django
2
+
3
+ [![Build Status](https://github.com/dimagi/django-cte/actions/workflows/tests.yml/badge.svg)](https://github.com/dimagi/django-cte/actions/workflows/tests.yml)
4
+ [![PyPI version](https://badge.fury.io/py/django-cte.svg)](https://badge.fury.io/py/django-cte)
5
+
6
+ ## Installation
7
+ ```
8
+ pip install django-cte
9
+ ```
10
+
11
+
12
+ ## Documentation
13
+
14
+ The [django-cte documentation](https://dimagi.github.io/django-cte/) shows how
15
+ to use Common Table Expressions with the Django ORM.
16
+
17
+
18
+ ## Running tests
19
+
20
+ ```
21
+ cd django-cte
22
+ uv sync
23
+
24
+ pytest
25
+ ruff check
26
+
27
+ # To run tests against postgres
28
+ psql -U username -h localhost -p 5432 -c 'create database django_cte;'
29
+ export PG_DB_SETTINGS='{
30
+ "ENGINE":"django.db.backends.postgresql_psycopg2",
31
+ "NAME":"django_cte",
32
+ "USER":"username",
33
+ "PASSWORD":"password",
34
+ "HOST":"localhost",
35
+ "PORT":"5432"}'
36
+
37
+ # WARNING pytest will delete the test_django_cte database if it exists!
38
+ DB_SETTINGS="$PG_DB_SETTINGS" pytest
39
+ ```
40
+
41
+ All feature and bug contributions are expected to be covered by tests.
42
+
43
+
44
+ ## Publishing a new verison to PyPI
45
+
46
+ Push a new tag to Github using the format vX.Y.Z where X.Y.Z matches the version
47
+ in [`__init__.py`](django_cte/__init__.py).
48
+
49
+ A new version is published to https://test.pypi.org/p/django-cte on every
50
+ push to the *main* branch.
51
+
52
+ Publishing is automated with [Github Actions](.github/workflows/pypi.yml).
@@ -0,0 +1,3 @@
1
+ from .cte import CTEManager, CTEQuerySet, With # noqa
2
+
3
+ __version__ = "1.3.3.dev20250526204410"
@@ -1,6 +1,3 @@
1
- from __future__ import absolute_import
2
- from __future__ import unicode_literals
3
-
4
1
  from django.db.models import Manager
5
2
  from django.db.models.query import Q, QuerySet, ValuesIterable
6
3
  from django.db.models.sql.datastructures import BaseTable
@@ -1,5 +1,3 @@
1
- from __future__ import absolute_import
2
- from __future__ import unicode_literals
3
1
  from django.db.models.sql.constants import INNER
4
2
 
5
3
 
@@ -1,6 +1,3 @@
1
- from __future__ import absolute_import
2
- from __future__ import unicode_literals
3
-
4
1
  import weakref
5
2
 
6
3
  from django.db.models.expressions import Col, Expression
@@ -1,6 +1,3 @@
1
- from __future__ import absolute_import
2
- from __future__ import unicode_literals
3
-
4
1
  import django
5
2
  from django.core.exceptions import EmptyResultSet
6
3
  from django.db import connections
@@ -71,7 +68,7 @@ class CTECompiler(object):
71
68
 
72
69
  @classmethod
73
70
  def generate_sql(cls, connection, query, as_sql):
74
- if query.combinator:
71
+ if not query._with_ctes:
75
72
  return as_sql()
76
73
 
77
74
  ctes = []
@@ -1,7 +1,3 @@
1
- from __future__ import absolute_import
2
- from __future__ import unicode_literals
3
-
4
-
5
1
  def raw_cte_sql(sql, params, refs):
6
2
  """Raw CTE SQL
7
3
 
@@ -0,0 +1,51 @@
1
+ [project]
2
+ name = "django-cte"
3
+ description = "Common Table Expressions (CTE) for Django"
4
+ authors = [{name = "Daniel Miller", email = "millerdev@gmail.com"}]
5
+ license = {file = "LICENSE"}
6
+ readme = {file = "README.md", content-type = "text/markdown"}
7
+ dynamic = ["version"]
8
+ requires-python = ">= 3.9"
9
+ classifiers = [
10
+ "Development Status :: 5 - Production/Stable",
11
+ 'Environment :: Web Environment',
12
+ 'Framework :: Django',
13
+ 'Intended Audience :: Developers',
14
+ 'License :: OSI Approved :: BSD License',
15
+ 'Operating System :: OS Independent',
16
+ 'Programming Language :: Python',
17
+ 'Programming Language :: Python :: 3',
18
+ 'Programming Language :: Python :: 3.9',
19
+ 'Programming Language :: Python :: 3.10',
20
+ 'Programming Language :: Python :: 3.11',
21
+ 'Programming Language :: Python :: 3.12',
22
+ 'Programming Language :: Python :: 3.13',
23
+ 'Framework :: Django',
24
+ 'Framework :: Django :: 4',
25
+ 'Framework :: Django :: 4.2',
26
+ 'Framework :: Django :: 5',
27
+ 'Framework :: Django :: 5.0',
28
+ 'Framework :: Django :: 5.1',
29
+ 'Topic :: Software Development :: Libraries :: Python Modules',
30
+ ]
31
+ dependencies = ["django"]
32
+
33
+ [dependency-groups]
34
+ dev = [
35
+ "psycopg2-binary",
36
+ "pytest-unmagic",
37
+ "ruff",
38
+ ]
39
+
40
+ [project.urls]
41
+ Home = "https://github.com/dimagi/django-cte"
42
+
43
+ [build-system]
44
+ requires = ["flit_core >=3.2,<4"]
45
+ build-backend = "flit_core.buildapi"
46
+
47
+ [tool.flit.module]
48
+ name = "django_cte"
49
+
50
+ [tool.distutils.bdist_wheel]
51
+ universal = true
@@ -1,41 +0,0 @@
1
- # Common Table Expressions with Django
2
-
3
- [![Build Status](https://github.com/dimagi/django-cte/actions/workflows/tests.yml/badge.svg)](https://github.com/dimagi/django-cte/actions/workflows/tests.yml)
4
- [![PyPI version](https://badge.fury.io/py/django-cte.svg)](https://badge.fury.io/py/django-cte)
5
-
6
- ## Installation
7
- ```
8
- pip install django-cte
9
- ```
10
-
11
-
12
- ## Documentation
13
-
14
- The [django-cte documentation](https://dimagi.github.io/django-cte/) shows how
15
- to use Common Table Expressions with the Django ORM.
16
-
17
-
18
- ## Running tests
19
-
20
- ```
21
- cd django-cte
22
- mkvirtualenv cte # or however you choose to setup your environment
23
- pip install django pynose flake8
24
-
25
- nosetests
26
- flake8 --config=setup.cfg
27
- ```
28
-
29
- All feature and bug contributions are expected to be covered by tests.
30
-
31
-
32
- ## Uploading to PyPI
33
-
34
- Package and upload the generated files.
35
-
36
- ```
37
- pip install -r pkg-requires.txt
38
-
39
- python setup.py sdist bdist_wheel
40
- twine upload dist/*
41
- ```
@@ -1,6 +0,0 @@
1
- from __future__ import absolute_import
2
- from __future__ import unicode_literals
3
-
4
- from .cte import CTEManager, CTEQuerySet, With # noqa
5
-
6
- __version__ = "1.3.3"
@@ -1,76 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: django-cte
3
- Version: 1.3.3
4
- Summary: Common Table Expressions (CTE) for Django
5
- Home-page: https://github.com/dimagi/django-cte
6
- Maintainer: Daniel Miller
7
- Maintainer-email: millerdev@gmail.com
8
- License: BSD License
9
- Platform: UNKNOWN
10
- Classifier: Development Status :: 3 - Alpha
11
- Classifier: Environment :: Web Environment
12
- Classifier: Framework :: Django
13
- Classifier: Intended Audience :: Developers
14
- Classifier: License :: OSI Approved :: BSD License
15
- Classifier: Operating System :: OS Independent
16
- Classifier: Programming Language :: Python
17
- Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.8
19
- Classifier: Programming Language :: Python :: 3.9
20
- Classifier: Programming Language :: Python :: 3.10
21
- Classifier: Programming Language :: Python :: 3.11
22
- Classifier: Programming Language :: Python :: 3.12
23
- Classifier: Framework :: Django
24
- Classifier: Framework :: Django :: 3
25
- Classifier: Framework :: Django :: 3.2
26
- Classifier: Framework :: Django :: 4
27
- Classifier: Framework :: Django :: 4.0
28
- Classifier: Framework :: Django :: 4.1
29
- Classifier: Framework :: Django :: 4.2
30
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
31
- Description-Content-Type: text/markdown
32
- License-File: LICENSE
33
-
34
- # Common Table Expressions with Django
35
-
36
- [![Build Status](https://github.com/dimagi/django-cte/actions/workflows/tests.yml/badge.svg)](https://github.com/dimagi/django-cte/actions/workflows/tests.yml)
37
- [![PyPI version](https://badge.fury.io/py/django-cte.svg)](https://badge.fury.io/py/django-cte)
38
-
39
- ## Installation
40
- ```
41
- pip install django-cte
42
- ```
43
-
44
-
45
- ## Documentation
46
-
47
- The [django-cte documentation](https://dimagi.github.io/django-cte/) shows how
48
- to use Common Table Expressions with the Django ORM.
49
-
50
-
51
- ## Running tests
52
-
53
- ```
54
- cd django-cte
55
- mkvirtualenv cte # or however you choose to setup your environment
56
- pip install django pynose flake8
57
-
58
- nosetests
59
- flake8 --config=setup.cfg
60
- ```
61
-
62
- All feature and bug contributions are expected to be covered by tests.
63
-
64
-
65
- ## Uploading to PyPI
66
-
67
- Package and upload the generated files.
68
-
69
- ```
70
- pip install -r pkg-requires.txt
71
-
72
- python setup.py sdist bdist_wheel
73
- twine upload dist/*
74
- ```
75
-
76
-
@@ -1,15 +0,0 @@
1
- LICENSE
2
- README.md
3
- setup.cfg
4
- setup.py
5
- django_cte/__init__.py
6
- django_cte/cte.py
7
- django_cte/expressions.py
8
- django_cte/join.py
9
- django_cte/meta.py
10
- django_cte/query.py
11
- django_cte/raw.py
12
- django_cte.egg-info/PKG-INFO
13
- django_cte.egg-info/SOURCES.txt
14
- django_cte.egg-info/dependency_links.txt
15
- django_cte.egg-info/top_level.txt
@@ -1 +0,0 @@
1
- django_cte
@@ -1,13 +0,0 @@
1
- [bdist_wheel]
2
- universal = 1
3
-
4
- [metadata]
5
- license_file = LICENSE
6
-
7
- [flake8]
8
- exclude = ./build
9
-
10
- [egg_info]
11
- tag_build =
12
- tag_date = 0
13
-
django-cte-1.3.3/setup.py DELETED
@@ -1,59 +0,0 @@
1
- from __future__ import absolute_import
2
- from __future__ import unicode_literals
3
-
4
- import os
5
- import re
6
- from io import open
7
-
8
- from setuptools import find_packages, setup
9
-
10
-
11
- def get_version(filename):
12
- path = os.path.join(os.path.dirname(__file__), filename)
13
- with open(path, encoding="utf-8") as handle:
14
- content = handle.read()
15
- return re.search(r'__version__ = "([^"]+)"', content).group(1)
16
-
17
-
18
- def read_md(filename):
19
- path = os.path.join(os.path.dirname(__file__), filename)
20
- with open(path, encoding='utf-8') as handle:
21
- return handle.read()
22
-
23
-
24
- setup(
25
- name='django-cte',
26
- version=get_version('django_cte/__init__.py'),
27
- description='Common Table Expressions (CTE) for Django',
28
- long_description=read_md('README.md'),
29
- long_description_content_type='text/markdown',
30
- maintainer='Daniel Miller',
31
- maintainer_email='millerdev@gmail.com',
32
- url='https://github.com/dimagi/django-cte',
33
- license='BSD License',
34
- packages=find_packages(exclude=['tests']),
35
- include_package_data=True,
36
- classifiers=[
37
- 'Development Status :: 3 - Alpha',
38
- 'Environment :: Web Environment',
39
- 'Framework :: Django',
40
- 'Intended Audience :: Developers',
41
- 'License :: OSI Approved :: BSD License',
42
- 'Operating System :: OS Independent',
43
- 'Programming Language :: Python',
44
- 'Programming Language :: Python :: 3',
45
- 'Programming Language :: Python :: 3.8',
46
- 'Programming Language :: Python :: 3.9',
47
- 'Programming Language :: Python :: 3.10',
48
- 'Programming Language :: Python :: 3.11',
49
- 'Programming Language :: Python :: 3.12',
50
- 'Framework :: Django',
51
- 'Framework :: Django :: 3',
52
- 'Framework :: Django :: 3.2',
53
- 'Framework :: Django :: 4',
54
- 'Framework :: Django :: 4.0',
55
- 'Framework :: Django :: 4.1',
56
- 'Framework :: Django :: 4.2',
57
- 'Topic :: Software Development :: Libraries :: Python Modules',
58
- ],
59
- )