pytest-databases 0.1.0__tar.gz → 0.2.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 (28) hide show
  1. {pytest_databases-0.1.0 → pytest_databases-0.2.0}/LICENSE +1 -1
  2. pytest_databases-0.2.0/PKG-INFO +119 -0
  3. pytest_databases-0.2.0/README.md +79 -0
  4. {pytest_databases-0.1.0 → pytest_databases-0.2.0}/pyproject.toml +50 -31
  5. pytest_databases-0.2.0/pytest_databases/__init__.py +21 -0
  6. pytest_databases-0.2.0/pytest_databases/__metadata__.py +39 -0
  7. {pytest_databases-0.1.0 → pytest_databases-0.2.0}/pytest_databases/docker/__init__.py +23 -3
  8. pytest_databases-0.2.0/pytest_databases/docker/cockroachdb.py +56 -0
  9. {pytest_databases-0.1.0 → pytest_databases-0.2.0}/pytest_databases/docker/docker-compose.yml +22 -2
  10. pytest_databases-0.2.0/pytest_databases/docker/dragonfly.py +53 -0
  11. pytest_databases-0.2.0/pytest_databases/docker/keydb.py +53 -0
  12. {pytest_databases-0.1.0 → pytest_databases-0.2.0}/pytest_databases/docker/mariadb.py +23 -3
  13. {pytest_databases-0.1.0 → pytest_databases-0.2.0}/pytest_databases/docker/mssql.py +23 -3
  14. {pytest_databases-0.1.0 → pytest_databases-0.2.0}/pytest_databases/docker/mysql.py +23 -3
  15. {pytest_databases-0.1.0 → pytest_databases-0.2.0}/pytest_databases/docker/oracle.py +23 -3
  16. {pytest_databases-0.1.0 → pytest_databases-0.2.0}/pytest_databases/docker/postgres.py +23 -3
  17. pytest_databases-0.2.0/pytest_databases/docker/redis.py +53 -0
  18. {pytest_databases-0.1.0 → pytest_databases-0.2.0}/pytest_databases/docker/spanner.py +23 -3
  19. {pytest_databases-0.1.0 → pytest_databases-0.2.0}/pytest_databases/helpers.py +23 -0
  20. pytest_databases-0.2.0/setup.py +55 -0
  21. pytest_databases-0.1.0/PKG-INFO +0 -102
  22. pytest_databases-0.1.0/README.md +0 -64
  23. pytest_databases-0.1.0/pytest_databases/__init__.py +0 -3
  24. pytest_databases-0.1.0/pytest_databases/__metadata__.py +0 -19
  25. pytest_databases-0.1.0/pytest_databases/docker/cockroachdb.py +0 -36
  26. pytest_databases-0.1.0/setup.py +0 -52
  27. {pytest_databases-0.1.0 → pytest_databases-0.2.0}/.gitignore +0 -0
  28. {pytest_databases-0.1.0 → pytest_databases-0.2.0}/pytest_databases/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 Jolt
3
+ Copyright (c) 2024 Litestar
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,119 @@
1
+ Metadata-Version: 2.1
2
+ Name: pytest-databases
3
+ Version: 0.2.0
4
+ Summary: Reusable database fixtures for any and all databases.
5
+ Project-URL: Documentation, https://github.com/litestar-org/pytest-databases#readme
6
+ Project-URL: Issues, https://github.com/litestar-org/pytest-databases/issues
7
+ Project-URL: Source, https://github.com/litestar-org/pytest-databases
8
+ Author-email: Cody Fincher <cody.fincher@gmail.com>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: bigquery,cockroachdb,database,duckdb,migration,mssql,mysql,oracle,postgres,redis,spanner
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: Implementation :: CPython
20
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
21
+ Requires-Python: >=3.8
22
+ Requires-Dist: pytest
23
+ Provides-Extra: cockroachdb
24
+ Requires-Dist: psycopg; extra == 'cockroachdb'
25
+ Provides-Extra: mssql
26
+ Requires-Dist: aioodbc; extra == 'mssql'
27
+ Provides-Extra: mysql
28
+ Requires-Dist: asyncmy>=0.2.9; extra == 'mysql'
29
+ Provides-Extra: oracle
30
+ Requires-Dist: oracledb; extra == 'oracle'
31
+ Provides-Extra: postgres
32
+ Requires-Dist: asyncpg>=0.29.0; extra == 'postgres'
33
+ Provides-Extra: redis
34
+ Requires-Dist: redis; extra == 'redis'
35
+ Provides-Extra: spanner
36
+ Requires-Dist: google-cloud-spanner; extra == 'spanner'
37
+ Provides-Extra: sqlite
38
+ Requires-Dist: aiosqlite; extra == 'sqlite'
39
+ Description-Content-Type: text/markdown
40
+
41
+ # pytest-databases
42
+
43
+ Reusable test fixtures for any and all databases.
44
+
45
+ <!-- markdownlint-disable -->
46
+ <p align="center">
47
+ <!-- github-banner-start -->
48
+ <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" />
49
+ <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" />
50
+ <!-- github-banner-end -->
51
+ </p>
52
+ <!-- markdownlint-restore -->
53
+ <div align="center">
54
+
55
+ <!-- prettier-ignore-start -->
56
+
57
+ | Project | | Status |
58
+ |-----------|:----|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
59
+ | CI/CD | | [![Latest Release](https://github.com/litestar-org/pytest-databases/actions/workflows/publish.yml/badge.svg)](https://github.com/litestar-org/pytest-databases/actions/workflows/publish.yml) [![ci](https://github.com/litestar-org/pytest-databases/actions/workflows/ci.yml/badge.svg)](https://github.com/litestar-org/pytest-databases/actions/workflows/ci.yml) [![Documentation Building](https://github.com/litestar-org/pytest-databases/actions/workflows/docs.yml/badge.svg?branch=main)](https://github.com/litestar-org/pytest-databases/actions/workflows/docs.yml) |
60
+ | Quality | | [![Coverage](https://codecov.io/github/litestar-org/pytest-databases/graph/badge.svg?token=vKez4Pycrc)](https://codecov.io/github/litestar-org/pytest-databases) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) |
61
+ | Package | | [![PyPI - Version](https://img.shields.io/pypi/v/litestar?labelColor=202235&color=edb641&logo=python&logoColor=edb641)](https://badge.fury.io/py/litestar) ![PyPI - Support Python Versions](https://img.shields.io/pypi/pyversions/litestar?labelColor=202235&color=edb641&logo=python&logoColor=edb641) ![Starlite PyPI - Downloads](https://img.shields.io/pypi/dm/starlite?logo=python&label=starlite%20downloads&labelColor=202235&color=edb641&logoColor=edb641) ![Litestar PyPI - Downloads](https://img.shields.io/pypi/dm/litestar?logo=python&label=litestar%20downloads&labelColor=202235&color=edb641&logoColor=edb641) |
62
+ | Community | | [![Reddit](https://img.shields.io/reddit/subreddit-subscribers/litestarapi?label=r%2FLitestar&logo=reddit&labelColor=202235&color=edb641&logoColor=edb641)](https://reddit.com/r/litestarapi) [![Discord](https://img.shields.io/discord/919193495116337154?labelColor=202235&color=edb641&label=chat%20on%20discord&logo=discord&logoColor=edb641)](https://discord.gg/litestar-919193495116337154) [![Matrix](https://img.shields.io/badge/chat%20on%20Matrix-bridged-202235?labelColor=202235&color=edb641&logo=matrix&logoColor=edb641)](https://matrix.to/#/#litestar:matrix.org) [![Medium](https://img.shields.io/badge/Medium-202235?labelColor=202235&color=edb641&logo=medium&logoColor=edb641)](https://blog.litestar.dev) [![Twitter](https://img.shields.io/twitter/follow/LitestarAPI?labelColor=202235&color=edb641&logo=twitter&logoColor=edb641&style=flat)](https://twitter.com/LitestarAPI) [![Blog](https://img.shields.io/badge/Blog-litestar.dev-202235?logo=blogger&labelColor=202235&color=edb641&logoColor=edb641)](https://blog.litestar.dev) |
63
+ | Meta | | [![Litestar Project](https://img.shields.io/badge/Litestar%20Org-%E2%AD%90%20Litestar-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://github.com/litestar-org/pytest-databases) [![types - Mypy](https://img.shields.io/badge/types-Mypy-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://github.com/python/mypy) [![License - MIT](https://img.shields.io/badge/license-MIT-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://spdx.org/licenses/) [![Litestar Sponsors](https://img.shields.io/badge/Sponsor-%E2%9D%A4-%23edb641.svg?&logo=github&logoColor=edb641&labelColor=202235)](https://github.com/sponsors/litestar-org) [![linting - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json&labelColor=202235)](https://github.com/astral-sh/ruff) [![code style - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/format.json&labelColor=202235)](https://github.com/psf/black)|
64
+
65
+ <!-- prettier-ignore-end -->
66
+ </div>
67
+
68
+ > [!WARNING] > **Pre-Release Alpha Stage**
69
+ >
70
+ > Please note that pytest-databases is currently in a pre-release alpha stage of development. This means the library is still under
71
+ > active development, and its API is subject to change. We encourage developers to experiment with pytest-databases and provide
72
+ > feedback, but we recommend against using it in production environments until a stable release is available.`
73
+
74
+ ## About
75
+
76
+ The `pytest-databases` library aims to make testing with a database as simple as possible.
77
+ It is designed to offer pre-configured testing setups for many different types and versions of databases.
78
+
79
+ ## Features
80
+
81
+ `pytest-databases` currently utilizes `docker compose` (or the legacy `docker-compose`) commands to manage the startup and shutdown of each database service. The following databases are currently available:
82
+
83
+ - **Postgres**: Version 12, 13, 14, 15, and 16 are available
84
+ - **MySQL**: Version 5.6, 5.7 and 8 are available
85
+ - **Oracle**: Version 18c XE and 23C Free are available
86
+ - **SQL Server**: Version 2022 is available
87
+ - **Spanner**: The latest cloud-emulator from Google is available
88
+ - **Cockroach**: Version 23.1-latest is available
89
+ - **Redis**: Latest server
90
+ - **Dragonfly**: Latest server
91
+ - **KeyDB**: Latest server
92
+
93
+ ## Contributing
94
+
95
+ All [Litestar][litestar-org] projects will always be a community-centered, available for contributions of any size.
96
+
97
+ Before contributing, please review the [contribution guide][contributing].
98
+
99
+ If you have any questions, reach out to us on [Discord][discord], our org-wide [GitHub discussions][litestar-discussions] page,
100
+ or the [project-specific GitHub discussions page][project-discussions].
101
+
102
+ <hr>
103
+
104
+ <!-- markdownlint-disable -->
105
+ <p align="center">
106
+ <!-- github-banner-start -->
107
+ <img src="https://raw.githubusercontent.com/litestar-org/meta/2901c9c5c5895a83fbfa56944c33bca287f88d42/branding/SVG%20-%20Transparent/logo-full-wide.svg" alt="Litestar Logo - Light" width="20%" height="auto" />
108
+ <br>A <a href="https://github.com/litestar-org">Litestar Organization</a> Project
109
+ <!-- github-banner-end -->
110
+ </p>
111
+
112
+ [litestar-org]: https://github.com/litestar-org
113
+ [contributing]: https://docs.pytest-databases.litestar.dev/latest/contribution-guide.html
114
+ [discord]: https://discord.gg/litestar-919193495116337154
115
+ [litestar-discussions]: https://github.com/orgs/litestar-org/discussions
116
+ [project-discussions]: https://github.com/litestar-org/pytest-databases/discussions
117
+ [project-docs]: https://docs.pytest-databases.litestar.dev
118
+ [install-guide]: https://docs.pytest-databases.litestar.dev/latest/#installation
119
+ [newrepo]: https://github.com/organizations/litestar-org/repositories/new?template=pytest-databases
@@ -0,0 +1,79 @@
1
+ # pytest-databases
2
+
3
+ Reusable test fixtures for any and all databases.
4
+
5
+ <!-- markdownlint-disable -->
6
+ <p align="center">
7
+ <!-- github-banner-start -->
8
+ <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" />
9
+ <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" />
10
+ <!-- github-banner-end -->
11
+ </p>
12
+ <!-- markdownlint-restore -->
13
+ <div align="center">
14
+
15
+ <!-- prettier-ignore-start -->
16
+
17
+ | Project | | Status |
18
+ |-----------|:----|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
19
+ | CI/CD | | [![Latest Release](https://github.com/litestar-org/pytest-databases/actions/workflows/publish.yml/badge.svg)](https://github.com/litestar-org/pytest-databases/actions/workflows/publish.yml) [![ci](https://github.com/litestar-org/pytest-databases/actions/workflows/ci.yml/badge.svg)](https://github.com/litestar-org/pytest-databases/actions/workflows/ci.yml) [![Documentation Building](https://github.com/litestar-org/pytest-databases/actions/workflows/docs.yml/badge.svg?branch=main)](https://github.com/litestar-org/pytest-databases/actions/workflows/docs.yml) |
20
+ | Quality | | [![Coverage](https://codecov.io/github/litestar-org/pytest-databases/graph/badge.svg?token=vKez4Pycrc)](https://codecov.io/github/litestar-org/pytest-databases) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) |
21
+ | Package | | [![PyPI - Version](https://img.shields.io/pypi/v/litestar?labelColor=202235&color=edb641&logo=python&logoColor=edb641)](https://badge.fury.io/py/litestar) ![PyPI - Support Python Versions](https://img.shields.io/pypi/pyversions/litestar?labelColor=202235&color=edb641&logo=python&logoColor=edb641) ![Starlite PyPI - Downloads](https://img.shields.io/pypi/dm/starlite?logo=python&label=starlite%20downloads&labelColor=202235&color=edb641&logoColor=edb641) ![Litestar PyPI - Downloads](https://img.shields.io/pypi/dm/litestar?logo=python&label=litestar%20downloads&labelColor=202235&color=edb641&logoColor=edb641) |
22
+ | Community | | [![Reddit](https://img.shields.io/reddit/subreddit-subscribers/litestarapi?label=r%2FLitestar&logo=reddit&labelColor=202235&color=edb641&logoColor=edb641)](https://reddit.com/r/litestarapi) [![Discord](https://img.shields.io/discord/919193495116337154?labelColor=202235&color=edb641&label=chat%20on%20discord&logo=discord&logoColor=edb641)](https://discord.gg/litestar-919193495116337154) [![Matrix](https://img.shields.io/badge/chat%20on%20Matrix-bridged-202235?labelColor=202235&color=edb641&logo=matrix&logoColor=edb641)](https://matrix.to/#/#litestar:matrix.org) [![Medium](https://img.shields.io/badge/Medium-202235?labelColor=202235&color=edb641&logo=medium&logoColor=edb641)](https://blog.litestar.dev) [![Twitter](https://img.shields.io/twitter/follow/LitestarAPI?labelColor=202235&color=edb641&logo=twitter&logoColor=edb641&style=flat)](https://twitter.com/LitestarAPI) [![Blog](https://img.shields.io/badge/Blog-litestar.dev-202235?logo=blogger&labelColor=202235&color=edb641&logoColor=edb641)](https://blog.litestar.dev) |
23
+ | Meta | | [![Litestar Project](https://img.shields.io/badge/Litestar%20Org-%E2%AD%90%20Litestar-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://github.com/litestar-org/pytest-databases) [![types - Mypy](https://img.shields.io/badge/types-Mypy-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://github.com/python/mypy) [![License - MIT](https://img.shields.io/badge/license-MIT-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://spdx.org/licenses/) [![Litestar Sponsors](https://img.shields.io/badge/Sponsor-%E2%9D%A4-%23edb641.svg?&logo=github&logoColor=edb641&labelColor=202235)](https://github.com/sponsors/litestar-org) [![linting - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json&labelColor=202235)](https://github.com/astral-sh/ruff) [![code style - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/format.json&labelColor=202235)](https://github.com/psf/black)|
24
+
25
+ <!-- prettier-ignore-end -->
26
+ </div>
27
+
28
+ > [!WARNING] > **Pre-Release Alpha Stage**
29
+ >
30
+ > Please note that pytest-databases is currently in a pre-release alpha stage of development. This means the library is still under
31
+ > active development, and its API is subject to change. We encourage developers to experiment with pytest-databases and provide
32
+ > feedback, but we recommend against using it in production environments until a stable release is available.`
33
+
34
+ ## About
35
+
36
+ The `pytest-databases` library aims to make testing with a database as simple as possible.
37
+ It is designed to offer pre-configured testing setups for many different types and versions of databases.
38
+
39
+ ## Features
40
+
41
+ `pytest-databases` currently utilizes `docker compose` (or the legacy `docker-compose`) commands to manage the startup and shutdown of each database service. The following databases are currently available:
42
+
43
+ - **Postgres**: Version 12, 13, 14, 15, and 16 are available
44
+ - **MySQL**: Version 5.6, 5.7 and 8 are available
45
+ - **Oracle**: Version 18c XE and 23C Free are available
46
+ - **SQL Server**: Version 2022 is available
47
+ - **Spanner**: The latest cloud-emulator from Google is available
48
+ - **Cockroach**: Version 23.1-latest is available
49
+ - **Redis**: Latest server
50
+ - **Dragonfly**: Latest server
51
+ - **KeyDB**: Latest server
52
+
53
+ ## Contributing
54
+
55
+ All [Litestar][litestar-org] projects will always be a community-centered, available for contributions of any size.
56
+
57
+ Before contributing, please review the [contribution guide][contributing].
58
+
59
+ If you have any questions, reach out to us on [Discord][discord], our org-wide [GitHub discussions][litestar-discussions] page,
60
+ or the [project-specific GitHub discussions page][project-discussions].
61
+
62
+ <hr>
63
+
64
+ <!-- markdownlint-disable -->
65
+ <p align="center">
66
+ <!-- github-banner-start -->
67
+ <img src="https://raw.githubusercontent.com/litestar-org/meta/2901c9c5c5895a83fbfa56944c33bca287f88d42/branding/SVG%20-%20Transparent/logo-full-wide.svg" alt="Litestar Logo - Light" width="20%" height="auto" />
68
+ <br>A <a href="https://github.com/litestar-org">Litestar Organization</a> Project
69
+ <!-- github-banner-end -->
70
+ </p>
71
+
72
+ [litestar-org]: https://github.com/litestar-org
73
+ [contributing]: https://docs.pytest-databases.litestar.dev/latest/contribution-guide.html
74
+ [discord]: https://discord.gg/litestar-919193495116337154
75
+ [litestar-discussions]: https://github.com/orgs/litestar-org/discussions
76
+ [project-discussions]: https://github.com/litestar-org/pytest-databases/discussions
77
+ [project-docs]: https://docs.pytest-databases.litestar.dev
78
+ [install-guide]: https://docs.pytest-databases.litestar.dev/latest/#installation
79
+ [newrepo]: https://github.com/organizations/litestar-org/repositories/new?template=pytest-databases
@@ -12,7 +12,7 @@ license = "MIT"
12
12
  name = "pytest-databases"
13
13
  readme = "README.md"
14
14
  requires-python = ">=3.8"
15
- version = "0.1.0"
15
+ version = "0.2.0"
16
16
  #
17
17
  authors = [{ name = "Cody Fincher", email = "cody.fincher@gmail.com" }]
18
18
  keywords = [
@@ -26,6 +26,7 @@ keywords = [
26
26
  "bigquery",
27
27
  "spanner",
28
28
  "cockroachdb",
29
+ "redis",
29
30
  ]
30
31
  # options under https://pypi.org/classifiers/
31
32
  classifiers = [
@@ -43,9 +44,9 @@ classifiers = [
43
44
  dependencies = ["pytest"]
44
45
 
45
46
  [project.urls]
46
- Documentation = "https://github.com/jolt-org/pytest-databases#readme"
47
- Issues = "https://github.com/jolt-org/pytest-databases/issues"
48
- Source = "https://github.com/jolt-org/pytest-databases"
47
+ Documentation = "https://github.com/litestar-org/pytest-databases#readme"
48
+ Issues = "https://github.com/litestar-org/pytest-databases/issues"
49
+ Source = "https://github.com/litestar-org/pytest-databases"
49
50
 
50
51
  [project.optional-dependencies]
51
52
  cockroachdb = ["psycopg"]
@@ -53,6 +54,7 @@ mssql = ["aioodbc"]
53
54
  mysql = ["asyncmy>=0.2.9"]
54
55
  oracle = ["oracledb"]
55
56
  postgres = ["asyncpg>=0.29.0"]
57
+ redis = ["redis"]
56
58
  spanner = ["google-cloud-spanner"]
57
59
  sqlite = ["aiosqlite"]
58
60
 
@@ -65,6 +67,7 @@ allow-direct-references = true
65
67
 
66
68
  [tool.hatch.build]
67
69
  dev-mode-dirs = ["src/"]
70
+ include = ["src/pytest_databases/**/*.yml"]
68
71
  packages = ["src/pytest_databases"]
69
72
  sources = ["src"]
70
73
 
@@ -78,25 +81,25 @@ packages = ["src/pytest_databases"]
78
81
  [tool.git-cliff.changelog]
79
82
  body = """
80
83
  {% if version %}\
81
- `Release [v{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} <https://github.com/jolt-org/pytest-databases/releases/tag/v{{ version | trim_start_matches(pat="v") }}>`_
84
+ `Release [v{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} <https://github.com/litestar-org/pytest-databases/releases/tag/v{{ version | trim_start_matches(pat="v") }}>`_
82
85
  ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
83
- * `See All commits in v{{ version | trim_start_matches(pat="v") }} <https://github.com/jolt-org/pytest-databases/commits/v{{ version | trim_start_matches(pat="v") }}>`_
86
+ * `See All commits in v{{ version | trim_start_matches(pat="v") }} <https://github.com/litestar-org/pytest-databases/commits/v{{ version | trim_start_matches(pat="v") }}>`_
84
87
  {% else %}\
85
88
  [unreleased]
86
89
  ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
87
90
  {% endif %}\
88
91
  {% if previous %}\
89
92
  {% if previous.commit_id %}
90
- `{{ previous.commit_id | truncate(length=7, end="") }} <https://github.com/jolt-org/pytest-databases/commit/{{ previous.commit_id }}>`_ ... \
91
- `{{ commit_id | truncate(length=7, end="") }} <https://github.com/jolt-org/pytest-databases/commit/{{ commit_id }}>`_ \
92
- | `See diff for {{ version | trim_start_matches(pat="v") }} <https://github.com/jolt-org/pytest-databases/compare/{{ previous.commit_id }}...{{ commit_id }}>`_
93
+ `{{ previous.commit_id | truncate(length=7, end="") }} <https://github.com/litestar-org/pytest-databases/commit/{{ previous.commit_id }}>`_ ... \
94
+ `{{ commit_id | truncate(length=7, end="") }} <https://github.com/litestar-org/pytest-databases/commit/{{ commit_id }}>`_ \
95
+ | `See diff for {{ version | trim_start_matches(pat="v") }} <https://github.com/litestar-org/pytest-databases/compare/{{ previous.commit_id }}...{{ commit_id }}>`_
93
96
  {% endif %}\
94
97
  {% endif %}\
95
98
  {% for group, commits in commits | group_by(attribute="group") %}
96
99
  {{ group | upper_first }}
97
100
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
98
101
  {% for commit in commits %}
99
- * (`{{ commit.id | truncate(length=7, end="") }} <https://github.com/jolt-org/pytest-databases/commit/{{ commit.id }}>`_) {% if commit.breaking %}[**breaking**] {% endif %} - {{ commit.message | upper_first }} ({{ commit.author.name }})\
102
+ * (`{{ commit.id | truncate(length=7, end="") }} <https://github.com/litestar-org/pytest-databases/commit/{{ commit.id }}>`_) {% if commit.breaking %}[**breaking**] {% endif %} - {{ commit.message | upper_first }} ({{ commit.author.name }})\
100
103
  {% for footer in commit.footers -%}
101
104
  , {{ footer.token }}{{ footer.separator }}{{ footer.value }}\
102
105
  {% endfor %}\
@@ -171,8 +174,9 @@ extra-dependencies = [
171
174
  "pytest-vcr",
172
175
  "pytest-sugar",
173
176
  "pytest-click",
177
+ "pytest-xdist",
174
178
  ]
175
- features = ["oracle", "mysql", "mssql", "postgres", "spanner", "cockroachdb", "spanner"]
179
+ features = ["oracle", "mysql", "mssql", "postgres", "spanner", "cockroachdb", "spanner", "redis"]
176
180
  template = "default"
177
181
  type = "virtual"
178
182
 
@@ -211,12 +215,14 @@ extra-dependencies = [
211
215
  "sphinx>=7.1.2",
212
216
  "sphinx-autobuild>=2021.3.14",
213
217
  "sphinx-copybutton>=0.5.2",
214
- "shibuya==2023.10.26",
218
+ "litestar-sphinx-theme @ git+https://github.com/litestar-org/litestar-sphinx-theme.git",
215
219
  "sphinx-click>=5.0.1",
216
220
  "sphinx-toolbox>=3.5.0",
217
221
  "sphinx-design>=0.5.0",
222
+ "sphinxcontrib-mermaid>=0.9.2",
223
+ "auto-pytabs[sphinx]>=0.4.0",
218
224
  ]
219
- features = ["oracle", "mysql", "mssql", "postgres", "spanner", "cockroachdb", "spanner"]
225
+ features = ["oracle", "mysql", "mssql", "postgres", "spanner", "cockroachdb", "spanner", "redis"]
220
226
  lock-filename = "requirements/requirements-docs.txt"
221
227
  pip-compile-constraint = "default"
222
228
  python = "3.11"
@@ -237,6 +243,29 @@ build-check = ["build", "validate"]
237
243
 
238
244
  [tool.hatch.envs.local]
239
245
  extra-dependencies = [
246
+ # tests
247
+ "nodeenv",
248
+ # required test dependencies
249
+ "cython",
250
+ "anyio",
251
+ "coverage[toml]>=6.2",
252
+ "pytest",
253
+ "pytest-cov",
254
+ "pytest-mock",
255
+ "pytest-vcr",
256
+ "pytest-sugar",
257
+ "pytest-click",
258
+ "pytest-xdist",
259
+ # Plugins
260
+ "sphinx>=7.1.2",
261
+ "sphinx-autobuild>=2021.3.14",
262
+ "sphinx-copybutton>=0.5.2",
263
+ "litestar-sphinx-theme @ git+https://github.com/litestar-org/litestar-sphinx-theme.git",
264
+ "sphinx-click>=5.0.1",
265
+ "sphinx-toolbox>=3.5.0",
266
+ "sphinx-design>=0.5.0",
267
+ "sphinxcontrib-mermaid>=0.9.2",
268
+ "auto-pytabs[sphinx]>=0.4.0",
240
269
  # cli databasae brwoser
241
270
  "harlequin",
242
271
  # linting
@@ -251,8 +280,10 @@ extra-dependencies = [
251
280
  "types-decorator",
252
281
  "types-pyyaml",
253
282
  "asyncpg-stubs",
283
+ "types-docutils",
284
+ "types-redis",
254
285
  ]
255
- features = ["oracle", "mysql", "mssql", "postgres", "cockroachdb", "spanner"]
286
+ features = ["oracle", "mysql", "mssql", "postgres", "cockroachdb", "spanner", "redis"]
256
287
  lock-filename = "requirements/requirements-dev.txt"
257
288
  path = ".venv/"
258
289
  pip-compile-constraint = "docs"
@@ -277,8 +308,10 @@ extra-dependencies = [
277
308
  "types-decorator",
278
309
  "types-pyyaml",
279
310
  "asyncpg-stubs",
311
+ "types-docutils",
312
+ "types-redis",
280
313
  ]
281
- features = ["oracle", "mysql", "mssql", "postgres", "spanner", "cockroachdb"]
314
+ features = ["oracle", "mysql", "mssql", "postgres", "spanner", "cockroachdb", "redis"]
282
315
  python = "3.11"
283
316
  template = "docs"
284
317
 
@@ -331,22 +364,8 @@ warn_unused_ignores = false
331
364
  disable_error_code = ["arg-type"]
332
365
  disallow_untyped_calls = false
333
366
  disallow_untyped_decorators = false
334
- module = ["aisoql.*"]
335
-
336
- [[tool.mypy.overrides]]
337
- disallow_untyped_calls = false
338
- disallow_untyped_defs = false
339
- module = [
340
- "pytest_databases.lib.db.adapters.*",
341
- "pytest_databases.lib.db.adapters",
342
- "pytest_databases.lib.db.base",
343
- "pytest_databases.lib.db",
344
- ]
345
- warn_unused_ignores = false
367
+ module = ["docutils.nodes.*"]
346
368
 
347
- [[tool.mypy.overrides]]
348
- ignore_missing_imports = true
349
- module = ["sqlalchemy.*", "nodeenv"]
350
369
 
351
370
  [tool.ruff]
352
371
  exclude = [
@@ -484,7 +503,7 @@ ban-relative-imports = "all"
484
503
  # copyright
485
504
  # Enable once this is released: https://github.com/astral-sh/ruff/issues/10021
486
505
  # Ruff v0.3.4 has not included this release yet
487
- "**/*.py" = ["CPY001"]
506
+ # "**/*.py" = ["CPY001"]
488
507
 
489
508
  [tool.ruff.lint.mccabe]
490
509
  max-complexity = 12
@@ -0,0 +1,21 @@
1
+ # MIT License
2
+
3
+ # Copyright (c) 2024 Litestar
4
+
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
@@ -0,0 +1,39 @@
1
+ # MIT License
2
+
3
+ # Copyright (c) 2024 Litestar
4
+
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+
24
+ from __future__ import annotations
25
+
26
+ from importlib.metadata import PackageNotFoundError, metadata, version
27
+
28
+ __all__ = ("__project__", "__version__")
29
+
30
+ try:
31
+ __version__ = version("pytest-databases")
32
+ """Version of the project."""
33
+ __project__ = metadata("pytest-databases")["Name"]
34
+ """Name of the project."""
35
+ except PackageNotFoundError: # pragma: no cover
36
+ __version__ = "0.0.0"
37
+ __project__ = "pytest-databases"
38
+ finally:
39
+ del version, PackageNotFoundError, metadata
@@ -1,6 +1,26 @@
1
- # SPDX-FileCopyrightText: 2023-present Jolt
2
- #
3
- # SPDX-License-Identifier: MIT
1
+ # MIT License
2
+
3
+ # Copyright (c) 2024 Litestar
4
+
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+
4
24
  from __future__ import annotations
5
25
 
6
26
  import asyncio
@@ -0,0 +1,56 @@
1
+ # MIT License
2
+
3
+ # Copyright (c) 2024 Litestar
4
+
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+
24
+ from __future__ import annotations
25
+
26
+ from typing import TYPE_CHECKING
27
+
28
+ import psycopg
29
+ import pytest
30
+
31
+ if TYPE_CHECKING:
32
+ from pytest_databases.docker import DockerServiceRegistry
33
+
34
+
35
+ async def cockroachdb_responsive(host: str, port: int, database: str, driver_opts: dict[str, str]) -> bool:
36
+ opts = "&".join(f"{k}={v}" for k, v in driver_opts.items()) if driver_opts else ""
37
+ try:
38
+ with psycopg.connect(f"postgresql://root@{host}:{port}/{database}?{opts}") as conn, conn.cursor() as cursor:
39
+ cursor.execute("select 1 as is_available")
40
+ resp = cursor.fetchone()
41
+ return resp[0] if resp is not None else 0 == 1 # noqa: PLR0133
42
+ except Exception: # noqa: BLE001
43
+ return False
44
+
45
+
46
+ @pytest.fixture()
47
+ async def cockroachdb_service(docker_services: DockerServiceRegistry) -> None:
48
+ await docker_services.start(
49
+ "cockroachdb",
50
+ timeout=60,
51
+ pause=1,
52
+ check=cockroachdb_responsive,
53
+ port=26257,
54
+ database="defaultdb",
55
+ driver_opts={"sslmode": "disable"},
56
+ )
@@ -1,5 +1,3 @@
1
- version: "3"
2
-
3
1
  services:
4
2
  postgres12:
5
3
  networks:
@@ -158,6 +156,28 @@ services:
158
156
  interval: 3s
159
157
  timeout: 3s
160
158
  retries: 5
159
+ redis:
160
+ image: redis
161
+ ports:
162
+ - "6397:6379"
163
+ keydb:
164
+ image: eqalpha/keydb
165
+ ports:
166
+ - "6396:6379"
167
+ dragonfly:
168
+ image: "docker.dragonflydb.io/dragonflydb/dragonfly"
169
+ ulimits:
170
+ memlock: -1
171
+ ports:
172
+ - "6398:6379"
173
+ # For better performance, consider `host` mode instead `port` to avoid docker NAT.
174
+ # `host` mode is NOT currently supported in Swarm Mode.
175
+ # https://docs.docker.com/compose/compose-file/compose-file-v3/#network_mode
176
+ # network_mode: "host"
177
+ volumes:
178
+ - dragonflydata:/data
161
179
  networks:
162
180
  default:
163
181
  driver: bridge
182
+ volumes:
183
+ dragonflydata: