sqlspec 0.1.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.

Potentially problematic release.


This version of sqlspec might be problematic. Click here for more details.

@@ -0,0 +1,33 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # folders
7
+ .auto_pytabs_cache/
8
+ .hypothesis/
9
+ .mypy_cache/
10
+ .pytest_cache/
11
+ .venv/
12
+ *.egg-info/
13
+ build/
14
+ dist/
15
+ results/
16
+ site/
17
+ target/
18
+ .idea/
19
+ .vscode/
20
+ .cursor/
21
+
22
+ # files
23
+ **/*.so
24
+ **/*.sqlite
25
+ **/*.sqlite*
26
+ *.iml
27
+ .coverage
28
+ .dmypy.json
29
+ .python-version
30
+ .ruff_cache
31
+ /docs/_build/
32
+ coverage.*
33
+ setup.py
@@ -0,0 +1,52 @@
1
+ default_language_version:
2
+ python: "3"
3
+ repos:
4
+ - repo: https://github.com/compilerla/conventional-pre-commit
5
+ rev: v3.6.0
6
+ hooks:
7
+ - id: conventional-pre-commit
8
+ stages: [commit-msg]
9
+ - repo: https://github.com/pre-commit/pre-commit-hooks
10
+ rev: v5.0.0
11
+ hooks:
12
+ - id: check-ast
13
+ - id: check-case-conflict
14
+ - id: check-toml
15
+ - id: debug-statements
16
+ - id: end-of-file-fixer
17
+ - id: mixed-line-ending
18
+ - id: trailing-whitespace
19
+ - repo: https://github.com/charliermarsh/ruff-pre-commit
20
+ rev: "v0.7.0"
21
+ hooks:
22
+ - id: ruff
23
+ args: ["--fix"]
24
+ - id: ruff-format
25
+ - repo: https://github.com/codespell-project/codespell
26
+ rev: v2.3.0
27
+ hooks:
28
+ - id: codespell
29
+ additional_dependencies:
30
+ - tomli
31
+ - repo: https://github.com/python-formate/flake8-dunder-all
32
+ rev: v0.4.1
33
+ hooks:
34
+ - id: ensure-dunder-all
35
+ exclude: "test*|tools"
36
+ args: ["--use-tuple"]
37
+ - repo: https://github.com/ariebovenberg/slotscheck
38
+ rev: v0.19.1
39
+ hooks:
40
+ - id: slotscheck
41
+ exclude: "docs|.github"
42
+ - repo: https://github.com/sphinx-contrib/sphinx-lint
43
+ rev: "v1.0.0"
44
+ hooks:
45
+ - id: sphinx-lint
46
+ - repo: local
47
+ hooks:
48
+ - id: pypi-readme
49
+ name: pypi-readme
50
+ language: python
51
+ entry: python tools/pypi_readme.py
52
+ types: [markdown]
@@ -0,0 +1,71 @@
1
+ Contribution guide
2
+ ==================
3
+
4
+ Setting up the environment
5
+ --------------------------
6
+
7
+ 1. Run ``make install-uv`` to install `uv <https://docs.astral.sh/uv/>`_ if not already installed
8
+ 1. Run ``make install`` to install all dependencies and pre-commit hooks
9
+
10
+
11
+ Code contributions
12
+ ------------------
13
+
14
+ Workflow
15
+ ++++++++
16
+
17
+ 1. `Fork <https://github.com/litestar-org/litestar-htmx/fork>`_ the `litestar-htmx repository <https://github.com/litestar-org/litestar-htmx>`_
18
+ 2. Clone your fork locally with git
19
+ 3. `Set up the environment <#setting-up-the-environment>`_
20
+ 4. Make your changes
21
+ 5. Run ``male lint`` to run linters and formatters. This step is optional and will be executed
22
+ automatically by git before you make a commit, but you may want to run it manually in order to apply fixes
23
+ 6. Commit your changes to git
24
+ 7. Push the changes to your fork
25
+ 8. Open a `pull request <https://docs.github.com/en/pull-requests>`_. Give the pull request a descriptive title
26
+ indicating what it changes. If it has a corresponding open issue, the issue number should be included in the title as
27
+ well. For example a pull request that fixes issue ``bug: Increased stack size making it impossible to find needle #100``
28
+ could be titled ``fix(#100): Make needles easier to find by applying fire to haystack``
29
+
30
+ .. tip:: Pull requests and commits all need to follow the
31
+ `Conventional Commit format <https://www.conventionalcommits.org>`_
32
+
33
+ Guidelines for writing code
34
+ ----------------------------
35
+
36
+ - All code should be fully `typed <https://peps.python.org/pep-0484/>`_. This is enforced via
37
+ `mypy <https://mypy.readthedocs.io/en/stable/>`_.
38
+ - All code should be tested. This is enforced via `pytest <https://docs.pytest.org/en/stable/>`_.
39
+ - All code should be properly formatted. This is enforced via `black <https://black.readthedocs.io/en/stable/>`_ and `Ruff <https://beta.ruff.rs/docs/>`_.
40
+
41
+ Writing and running tests
42
+ +++++++++++++++++++++++++
43
+
44
+ .. todo:: Write this section
45
+
46
+ Project documentation
47
+ ---------------------
48
+
49
+ The documentation is located in the ``/docs`` directory and is `ReST <https://docutils.sourceforge.io/rst.html>`_ and
50
+ `Sphinx <https://www.sphinx-doc.org/en/master/>`_. If you're unfamiliar with any of those,
51
+ `ReStructuredText primer <https://www.sphinx-doc.org/en/master/lib/usage/restructuredtext/basics.html>`_ and
52
+ `Sphinx quickstart <https://www.sphinx-doc.org/en/master/lib/usage/quickstart.html>`_ are recommended reads.
53
+
54
+ Running the docs locally
55
+ ++++++++++++++++++++++++
56
+
57
+ You can serve the documentation with ``make docs-serve``, or build them with ``make docs``.
58
+
59
+ Creating a new release
60
+ ----------------------
61
+
62
+ 1. Increment the version in `pyproject.toml <https://github.com/litestar-org/litestar-htmx/blob/main/pyproject.toml>`_.
63
+ .. note:: The version should follow `semantic versioning <https://semver.org/>`_ and `PEP 440 <https://www.python.org/dev/peps/pep-0440/>`_.
64
+ 2. `Draft a new release <https://github.com/litestar-org/litestar-htmx/releases/new>`_ on GitHub
65
+
66
+ * Use ``vMAJOR.MINOR.PATCH`` (e.g. ``v1.2.3``) as both the tag and release title
67
+ * Fill in the release description. You can use the "Generate release notes" function to get a draft for this
68
+ 3. Commit your changes and push to ``main``
69
+ 4. Publish the release
70
+ 5. Go to `Actions <https://github.com/litestar-org/litestar-htmx/actions>`_ and approve the release workflow
71
+ 6. Check that the workflow runs successfully
sqlspec-0.1.0/Makefile ADDED
@@ -0,0 +1,143 @@
1
+ SHELL := /bin/bash
2
+ # =============================================================================
3
+ # Variables
4
+ # =============================================================================
5
+
6
+ .DEFAULT_GOAL:=help
7
+ .ONESHELL:
8
+ .EXPORT_ALL_VARIABLES:
9
+
10
+
11
+ .PHONY: help
12
+ help: ## Display this help text for Makefile
13
+ @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
14
+
15
+ .PHONY: upgrade
16
+ upgrade: ## Upgrade all dependencies to the latest stable versions
17
+ @echo "=> Updating all dependencies"
18
+ @uv lock --upgrade
19
+ @echo "=> Dependencies Updated"
20
+ @uv run pre-commit autoupdate
21
+ @echo "=> Updated Pre-commit"
22
+
23
+ # =============================================================================
24
+ # Developer Utils
25
+ # =============================================================================
26
+ .PHONY: install-uv
27
+ install-uv: ## Install latest version of uv
28
+ @curl -LsSf https://astral.sh/uv/install.sh | sh
29
+
30
+ .PHONY: install
31
+ install: clean ## Install the project, dependencies, and pre-commit for local development
32
+ @uv sync --all-extras --dev
33
+ @echo "=> Install complete!"
34
+
35
+ .PHONY: clean
36
+ clean: ## Cleanup temporary build artifacts
37
+ @echo "=> Cleaning working directory"
38
+ @rm -rf .pytest_cache .ruff_cache .hypothesis build/ -rf dist/ .eggs/
39
+ @find . -name '*.egg-info' -exec rm -rf {} +
40
+ @find . -type f -name '*.egg' -exec rm -f {} +
41
+ @find . -name '*.pyc' -exec rm -f {} +
42
+ @find . -name '*.pyo' -exec rm -f {} +
43
+ @find . -name '*~' -exec rm -f {} +
44
+ @find . -name '__pycache__' -exec rm -rf {} +
45
+ @find . -name '.ipynb_checkpoints' -exec rm -rf {} +
46
+ @rm -rf .coverage coverage.xml coverage.json htmlcov/ .pytest_cache tests/.pytest_cache tests/**/.pytest_cache .mypy_cache
47
+ $(MAKE) docs-clean
48
+
49
+ .PHONY: destroy
50
+ destroy: ## Destroy the virtual environment
51
+ @rm -rf .venv
52
+
53
+ .PHONY: lock
54
+ lock: ## Rebuild lockfiles from scratch, updating all dependencies
55
+ @uv lock --upgrade
56
+
57
+ # =============================================================================
58
+ # Tests, Linting, Coverage
59
+ # =============================================================================
60
+ .PHONY: mypy
61
+ mypy: ## Run mypy
62
+ @echo "=> Running mypy"
63
+ @uv run dmypy run
64
+ @echo "=> mypy complete"
65
+
66
+ .PHONY: mypy-nocache
67
+ mypy-nocache: ## Run Mypy without cache
68
+ @echo "=> Running mypy without a cache"
69
+ @uv run mypy
70
+ @echo "=> mypy complete"
71
+
72
+ .PHONY: pyright
73
+ pyright: ## Run pyright
74
+ @echo "=> Running pyright"
75
+ @uv run pyright
76
+ @echo "=> pyright complete"
77
+
78
+ .PHONY: type-check
79
+ type-check: mypy pyright ## Run all type checking
80
+
81
+ .PHONY: pre-commit
82
+ pre-commit: ## Runs pre-commit hooks; includes ruff formatting and linting, codespell
83
+ @echo "=> Running pre-commit process"
84
+ @uv run pre-commit run --all-files
85
+ @echo "=> Pre-commit complete"
86
+
87
+ .PHONY: slotscheck
88
+ slotscheck: ## Run slotscheck
89
+ @echo "=> Running slotscheck"
90
+ @uv run slotscheck sqlspec/
91
+ @echo "=> slotscheck complete"
92
+
93
+ .PHONY: lint
94
+ lint: pre-commit type-check slotscheck ## Run all linting
95
+
96
+ .PHONY: coverage
97
+ coverage: ## Run the tests and generate coverage report
98
+ @echo "=> Running tests with coverage"
99
+ @uv run pytest tests --cov -n auto
100
+ @uv run coverage html
101
+ @uv run coverage xml
102
+ @echo "=> Coverage report generated"
103
+
104
+ .PHONY: test
105
+ test: ## Run the tests
106
+ @echo "=> Running test cases"
107
+ @uv run pytest tests
108
+ @echo "=> Tests complete"
109
+
110
+ .PHONY: test-examples
111
+ test-examples: ## Run the examples tests
112
+ @uv run pytest docs/examples
113
+
114
+ .PHONY: test-all
115
+ test-all: test test-examples ## Run all tests
116
+
117
+ .PHONY: check-all
118
+ check-all: lint test-all coverage ## Run all linting, tests, and coverage checks
119
+
120
+
121
+ # =============================================================================
122
+ # Docs
123
+ # =============================================================================
124
+ docs-clean: ## Dump the existing built docs
125
+ @echo "=> Cleaning documentation build assets"
126
+ @rm -rf docs/_build
127
+ @echo "=> Removed existing documentation build assets"
128
+
129
+ docs-serve: docs-clean ## Serve the docs locally
130
+ @echo "=> Serving documentation"
131
+ uv run sphinx-autobuild docs docs/_build/ -j auto --watch sqlspec --watch docs --watch tests --watch CONTRIBUTING.rst --port 8002
132
+
133
+ docs: docs-clean ## Dump the existing built docs and rebuild them
134
+ @echo "=> Building documentation"
135
+ @uv run sphinx-build -M html docs docs/_build/ -E -a -j auto -W --keep-going
136
+
137
+ .PHONY: docs-linkcheck
138
+ docs-linkcheck: ## Run the link check on the docs
139
+ @uv run sphinx-build -b linkcheck ./docs ./docs/_build -D linkcheck_ignore='http://.*','https://.*'
140
+
141
+ .PHONY: docs-linkcheck-full
142
+ docs-linkcheck-full: ## Run the full link check on the docs
143
+ @uv run sphinx-build -b linkcheck ./docs ./docs/_build -D linkcheck_anchors=0
sqlspec-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,25 @@
1
+ Metadata-Version: 2.3
2
+ Name: sqlspec
3
+ Version: 0.1.0
4
+ Summary: SQL Expiriments in Python
5
+ Author-email: Cody Fincher <cody@litestar.dev>
6
+ Maintainer-email: Litestar Developers <hello@litestar.dev>
7
+ Requires-Python: <4.0,>=3.9
8
+ Requires-Dist: eval-type-backport; python_version <= '3.9'
9
+ Requires-Dist: typing-extensions>=4.0.0
10
+ Description-Content-Type: text/markdown
11
+
12
+ <!-- markdownlint-disable -->
13
+ <p align="center">
14
+ <!-- github-banner-start -->
15
+ <img src="https://raw.githubusercontent.com/litestar-org/branding/main/assets/Branding%20-%20SVG%20-%20Transparent/Logo%20-%20Banner%20-%20Inline%20-%20Light.svg#gh-light-mode-only" alt="Litestar Logo - Light" width="100%" height="auto" />
16
+ <img src="https://raw.githubusercontent.com/litestar-org/branding/main/assets/Branding%20-%20SVG%20-%20Transparent/Logo%20-%20Banner%20-%20Inline%20-%20Dark.svg#gh-dark-mode-only" alt="Litestar Logo - Dark" width="100%" height="auto" />
17
+ <!-- github-banner-end -->
18
+
19
+ </p>
20
+ <div align="center">
21
+ <!-- markdownlint-restore -->
22
+
23
+ # SQLSpec
24
+
25
+ SQL Expiriments in Python
@@ -0,0 +1,14 @@
1
+ <!-- markdownlint-disable -->
2
+ <p align="center">
3
+ <!-- github-banner-start -->
4
+ <img src="https://raw.githubusercontent.com/litestar-org/branding/main/assets/Branding%20-%20SVG%20-%20Transparent/Logo%20-%20Banner%20-%20Inline%20-%20Light.svg#gh-light-mode-only" alt="Litestar Logo - Light" width="100%" height="auto" />
5
+ <img src="https://raw.githubusercontent.com/litestar-org/branding/main/assets/Branding%20-%20SVG%20-%20Transparent/Logo%20-%20Banner%20-%20Inline%20-%20Dark.svg#gh-dark-mode-only" alt="Litestar Logo - Dark" width="100%" height="auto" />
6
+ <!-- github-banner-end -->
7
+
8
+ </p>
9
+ <div align="center">
10
+ <!-- markdownlint-restore -->
11
+
12
+ # SQLSpec
13
+
14
+ SQL Expiriments in Python
@@ -0,0 +1,299 @@
1
+ [project]
2
+ authors = [{ name = "Cody Fincher", email = "cody@litestar.dev" }]
3
+ dependencies = [ "typing-extensions>=4.0.0",
4
+ "eval_type_backport; python_version <= \"3.9\"",]
5
+ description = "SQL Expiriments in Python"
6
+ maintainers = [
7
+ { name = "Litestar Developers", email = "hello@litestar.dev" },
8
+ ]
9
+ name = "sqlspec"
10
+ readme = "README.md"
11
+ requires-python = ">=3.9, <4.0"
12
+ version = "0.1.0"
13
+
14
+ [build-system]
15
+ build-backend = "hatchling.build"
16
+ requires = ["hatchling"]
17
+
18
+ [tool.hatch.build.targets.sdist]
19
+ dev-mode-dirs = ["."]
20
+ exclude = ["/.github", "/docs"]
21
+
22
+ [tool.hatch.metadata]
23
+ allow-direct-references = true
24
+
25
+ [dependency-groups]
26
+ dev = [
27
+ { include-group = "lint" },
28
+ { include-group = "doc" },
29
+ { include-group = "test" },
30
+ ]
31
+ doc = [
32
+ "auto-pytabs[sphinx]>=0.5.0",
33
+ "git-cliff>=2.6.1",
34
+ "litestar-sphinx-theme @ git+https://github.com/litestar-org/litestar-sphinx-theme.git@v3",
35
+ "sphinx>=7.0.0; python_version <= \"3.9\"",
36
+ "sphinx>=8.0.0; python_version >= \"3.10\"",
37
+ "sphinx-autobuild>=2021.3.14",
38
+ "sphinx-copybutton>=0.5.2",
39
+ "sphinx-click>=6.0.0",
40
+ "sphinx-design>=0.5.0",
41
+ "sphinxcontrib-mermaid>=0.9.2",
42
+ "sphinx-paramlinks>=0.6.0",
43
+ "sphinx-togglebutton>=0.3.2",
44
+ "sphinx-toolbox>=3.8.1",
45
+ ]
46
+ lint = [
47
+ "mypy>=1.13.0",
48
+ "pre-commit>=3.5.0",
49
+ "pyright>=1.1.386",
50
+ "ruff>=0.7.1",
51
+ "slotscheck>=0.16.5",
52
+ ]
53
+ test = [
54
+ "coverage>=7.6.1",
55
+ "pytest>=8.0.0",
56
+ "pytest-asyncio>=0.23.8",
57
+ "pytest-cov>=5.0.0",
58
+ "pytest-databases>=0.10.0",
59
+ "pytest-mock>=3.14.0",
60
+ "pytest-sugar>=1.0.0",
61
+ "pytest-xdist>=3.6.1",
62
+ ]
63
+
64
+ [tool.codespell]
65
+ ignore-words-list = "te"
66
+ skip = 'uv.lock'
67
+
68
+ [tool.coverage.run]
69
+ branch = true
70
+ concurrency = ["multiprocessing"]
71
+ disable_warnings = ["no-data-collected", "module-not-measured", "module-not-imported"]
72
+ omit = ["*/tests/*"]
73
+ parallel = true
74
+ plugins = ["covdefaults"]
75
+ source = ["sqlspec"]
76
+
77
+ [tool.coverage.report]
78
+ # Regexes for lines to exclude from consideration
79
+ exclude_lines = [
80
+ # Have to re-enable the standard pragma
81
+ "pragma: no cover",
82
+
83
+ # Don't complain about missing debug-only code:
84
+ "def __repr__",
85
+ "if self\\.debug",
86
+
87
+ # Don't complain if tests don't hit defensive assertion code:
88
+ "raise AssertionError",
89
+ "raise NotImplementedError",
90
+
91
+ # Don't complain if non-runnable code isn't run:
92
+ "if 0:",
93
+ "if __name__ == .__main__.:",
94
+ "if TYPE_CHECKING:",
95
+ 'class .*\bProtocol\):',
96
+ '@(abc\.)?abstractmethod',
97
+ ]
98
+
99
+ [tool.pytest.ini_options]
100
+ addopts = "-ra -q --doctest-glob='*.md' --strict-markers --strict-config"
101
+ testpaths = ["tests"]
102
+ xfail_strict = true
103
+
104
+ [tool.mypy]
105
+ packages = ["sqlspec", "tests"]
106
+ python_version = "3.9"
107
+
108
+ disallow_any_generics = false
109
+ disallow_untyped_decorators = true
110
+ enable_error_code = "ignore-without-code"
111
+ implicit_reexport = false
112
+ show_error_codes = true
113
+ strict = true
114
+ warn_redundant_casts = true
115
+ warn_return_any = true
116
+ warn_unreachable = true
117
+ warn_unused_configs = true
118
+ warn_unused_ignores = true
119
+
120
+ [tool.pyright]
121
+ disableBytesTypePromotions = true
122
+ exclude = ["tools", "docs"]
123
+ include = ["sqlspec", "tests"]
124
+ pythonVersion = "3.9"
125
+ reportUnnecessaryTypeIgnoreComments = true
126
+
127
+
128
+ [tool.slotscheck]
129
+ strict-imports = false
130
+
131
+ [tool.ruff]
132
+ lint.select = [
133
+ "A", # flake8-builtins
134
+ "B", # flake8-bugbear
135
+ "BLE", # flake8-blind-except
136
+ "C4", # flake8-comprehensions
137
+ "C90", # mccabe
138
+ "D", # pydocstyle
139
+ "DJ", # flake8-django
140
+ "DTZ", # flake8-datetimez
141
+ "E", # pycodestyle errors
142
+ "ERA", # eradicate
143
+ "EXE", # flake8-executable
144
+ "F", # pyflakes
145
+ "G", # flake8-logging-format
146
+ "I", # isort
147
+ "ICN", # flake8-import-conventions
148
+ "ISC", # flake8-implicit-str-concat
149
+ "N", # pep8-naming
150
+ "PIE", # flake8-pie
151
+ "PLC", # pylint - convention
152
+ "PLE", # pylint - error
153
+ "PLW", # pylint - warning
154
+ "PTH", # flake8-use-pathlib
155
+ "Q", # flake8-quotes
156
+ "RET", # flake8-return
157
+ "RUF", # Ruff-specific rules
158
+ "S", # flake8-bandit
159
+ "SIM", # flake8-simplify
160
+ "T10", # flake8-debugger
161
+ "T20", # flake8-print
162
+ "TCH", # flake8-type-checking
163
+ "TID", # flake8-tidy-imports
164
+ "UP", # pyupgrade
165
+ "W", # pycodestyle - warning
166
+ "YTT", # flake8-2020
167
+ ]
168
+
169
+ line-length = 120
170
+ lint.ignore = [
171
+ "A003", # flake8-builtins - class attribute {name} is shadowing a python builtin
172
+ "B010", # flake8-bugbear - do not call setattr with a constant attribute value
173
+ "D100", # pydocstyle - missing docstring in public module
174
+ "D101", # pydocstyle - missing docstring in public class
175
+ "D102", # pydocstyle - missing docstring in public method
176
+ "D103", # pydocstyle - missing docstring in public function
177
+ "D104", # pydocstyle - missing docstring in public package
178
+ "D105", # pydocstyle - missing docstring in magic method
179
+ "D106", # pydocstyle - missing docstring in public nested class
180
+ "D107", # pydocstyle - missing docstring in __init__
181
+ "D202", # pydocstyle - no blank lines allowed after function docstring
182
+ "D205", # pydocstyle - 1 blank line required between summary line and description
183
+ "D415", # pydocstyle - first line should end with a period, question mark, or exclamation point
184
+ "E501", # pycodestyle line too long, handled by ruff format
185
+ "PLW2901", # pylint - for loop variable overwritten by assignment target
186
+ "RUF012", # Ruff-specific rule - annotated with classvar
187
+ "ISC001", # Ruff formatter incompatible
188
+ ]
189
+ src = ["sqlspec", "tests", "docs/examples"]
190
+ target-version = "py39"
191
+
192
+ [tool.ruff.lint.pydocstyle]
193
+ convention = "google"
194
+
195
+ [tool.ruff.lint.mccabe]
196
+ max-complexity = 12
197
+
198
+ [tool.ruff.lint.pep8-naming]
199
+ classmethod-decorators = ["classmethod"]
200
+
201
+ [tool.ruff.lint.isort]
202
+ known-first-party = ["sqlspec", "tests"]
203
+
204
+ [tool.ruff.lint.per-file-ignores]
205
+ "docs/**/*.*" = ["S", "B", "DTZ", "A", "TCH", "ERA", "D", "RET", "PLW0127"]
206
+ "docs/examples/**" = ["T201"]
207
+ "tests/**/*.*" = [
208
+ "A",
209
+ "ARG",
210
+ "B",
211
+ "BLE",
212
+ "C901",
213
+ "D",
214
+ "DTZ",
215
+ "EM",
216
+ "FBT",
217
+ "G",
218
+ "N",
219
+ "PGH",
220
+ "PIE",
221
+ "PLR",
222
+ "PLW",
223
+ "PTH",
224
+ "RSE",
225
+ "S",
226
+ "S101",
227
+ "SIM",
228
+ "TCH",
229
+ "TRY",
230
+ ]
231
+ "tools/**/*.*" = ["D", "ARG", "EM", "TRY", "G", "FBT", "S603", "F811", "PLW0127"]
232
+ "tools/prepare_release.py" = ["S603", "S607"]
233
+
234
+ [tool.ruff.format]
235
+ docstring-code-format = true
236
+ docstring-code-line-length = 88
237
+
238
+ [tool.git-cliff.changelog]
239
+ body = """
240
+ {% if version %}\
241
+ `Release [v{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} <https://github.com/litestar-org/litestar-htmx/releases/tag/v{{ version | trim_start_matches(pat="v") }}>`_
242
+ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
243
+ * `See All commits in v{{ version | trim_start_matches(pat="v") }} <https://github.com/litestar-org/litestar-htmx/commits/v{{ version | trim_start_matches(pat="v") }}>`_
244
+ {% else %}\
245
+ [unreleased]
246
+ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
247
+ {% endif %}\
248
+ {% if previous %}\
249
+ {% if previous.commit_id %}
250
+ `{{ previous.commit_id | truncate(length=7, end="") }} <https://github.com/litestar-org/litestar-htmx/commit/{{ previous.commit_id }}>`_ ... \
251
+ `{{ commit_id | truncate(length=7, end="") }} <https://github.com/litestar-org/litestar-htmx/commit/{{ commit_id }}>`_ \
252
+ | `See diff for {{ version | trim_start_matches(pat="v") }} <https://github.com/litestar-org/litestar-htmx/compare/{{ previous.commit_id }}...{{ commit_id }}>`_
253
+ {% endif %}\
254
+ {% endif %}\
255
+ {% for group, commits in commits | group_by(attribute="group") %}
256
+ {{ group | upper_first }}
257
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
258
+ {% for commit in commits %}
259
+ * (`{{ commit.id | truncate(length=7, end="") }} <https://github.com/litestar-org/litestar-htmx/commit/{{ commit.id }}>`_) {% if commit.breaking %}[**breaking**] {% endif %} - {{ commit.message | upper_first }} ({{ commit.author.name }})\
260
+ {% for footer in commit.footers -%}
261
+ , {{ footer.token }}{{ footer.separator }}{{ footer.value }}\
262
+ {% endfor %}\
263
+ {% endfor %}
264
+ {% endfor %}\n
265
+ """
266
+ footer = """
267
+ Type Lens Changelog
268
+ """
269
+ header = """
270
+ =========
271
+ Changelog
272
+ =========\n
273
+ All commits to this project will be documented in this file.\n
274
+ """
275
+ trim = true
276
+
277
+ [tool.git-cliff.git]
278
+ commit_parsers = [
279
+ { message = "^feat", group = "Features" },
280
+ { message = "^fix", group = "Bug Fixes" },
281
+ { message = "^doc", group = "Documentation" },
282
+ { message = "^perf", group = "Performance" },
283
+ { message = "^refactor", group = "Refactor" },
284
+ { message = "^style", group = "Styling" },
285
+ { message = "^test", group = "Testing" },
286
+ { message = "^chore\\(release\\): prepare for", skip = true },
287
+ { message = "^chore", group = "Miscellaneous Tasks" },
288
+ { body = ".*security", group = "Security" },
289
+ ]
290
+ conventional_commits = true
291
+ filter_commits = false
292
+ filter_unconventional = true
293
+ ignore_tags = ""
294
+ protect_breaking_commits = false
295
+ skip_tags = "v0.1.0-beta.1"
296
+ sort_commits = "oldest"
297
+ split_commits = false
298
+ tag_pattern = "v[0-9]*"
299
+ topo_order = false
@@ -0,0 +1 @@
1
+ from __future__ import annotations
@@ -0,0 +1,18 @@
1
+ """Metadata for the Project."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from importlib.metadata import PackageNotFoundError, metadata, version
6
+
7
+ __all__ = ["__version__", "__project__"]
8
+
9
+ try:
10
+ __version__ = version("sqlspec")
11
+ """Version of the project."""
12
+ __project__ = metadata("sqlspec")["Name"]
13
+ """Name of the project."""
14
+ except PackageNotFoundError: # pragma: no cover
15
+ __version__ = "0.0.1"
16
+ __project__ = "SQLSpec"
17
+ finally:
18
+ del version, PackageNotFoundError, metadata
@@ -0,0 +1,24 @@
1
+ from typing import Any
2
+
3
+ __all__ = ("decode_json", "encode_json")
4
+
5
+ try:
6
+ from msgspec.json import Decoder, Encoder # pyright: ignore[reportMissingImports]
7
+
8
+ encoder, decoder = Encoder(), Decoder()
9
+ decode_json = decoder.decode
10
+
11
+ def encode_json(data: Any) -> str:
12
+ return encoder.encode(data).decode("utf-8")
13
+
14
+ except ImportError:
15
+ try:
16
+ from orjson import dumps as _encode_json # pyright: ignore[reportMissingImports]
17
+ from orjson import loads as decode_json # type: ignore[no-redef,assignment]
18
+
19
+ def encode_json(data: Any) -> str:
20
+ return _encode_json(data).decode("utf-8") # type: ignore[no-any-return]
21
+
22
+ except ImportError:
23
+ from json import dumps as encode_json # type: ignore[assignment]
24
+ from json import loads as decode_json # type: ignore[assignment]