pytest-databases 0.1.0__tar.gz → 0.2.1__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.
- pytest_databases-0.2.1/.pre-commit-config.yaml +31 -0
- pytest_databases-0.2.1/.sourcery.yaml +42 -0
- pytest_databases-0.2.1/.vscode/settings.json +96 -0
- pytest_databases-0.2.1/CODEOWNERS +7 -0
- pytest_databases-0.2.1/CONTRIBUTING.rst +80 -0
- {pytest_databases-0.1.0 → pytest_databases-0.2.1}/LICENSE +1 -1
- pytest_databases-0.2.1/Makefile +116 -0
- pytest_databases-0.2.1/PKG-INFO +123 -0
- pytest_databases-0.2.1/README.md +79 -0
- {pytest_databases-0.1.0 → pytest_databases-0.2.1}/pyproject.toml +110 -102
- pytest_databases-0.2.1/requirements/requirements-dev.txt +443 -0
- pytest_databases-0.2.1/requirements/requirements-docs.txt +318 -0
- pytest_databases-0.2.1/requirements/requirements.txt +13 -0
- pytest_databases-0.2.1/scripts/__init__.py +21 -0
- pytest_databases-0.2.1/scripts/build_docs.py +77 -0
- pytest_databases-0.2.1/scripts/convert_docs.sh +7 -0
- pytest_databases-0.2.1/sonar-project.properties +15 -0
- pytest_databases-0.2.1/src/pytest_databases/__init__.py +21 -0
- pytest_databases-0.2.1/src/pytest_databases/__metadata__.py +39 -0
- {pytest_databases-0.1.0 → pytest_databases-0.2.1/src}/pytest_databases/docker/__init__.py +23 -3
- pytest_databases-0.2.1/src/pytest_databases/docker/cockroachdb.py +56 -0
- {pytest_databases-0.1.0 → pytest_databases-0.2.1/src}/pytest_databases/docker/docker-compose.yml +22 -2
- pytest_databases-0.2.1/src/pytest_databases/docker/dragonfly.py +53 -0
- pytest_databases-0.2.1/src/pytest_databases/docker/keydb.py +53 -0
- {pytest_databases-0.1.0 → pytest_databases-0.2.1/src}/pytest_databases/docker/mariadb.py +23 -3
- {pytest_databases-0.1.0 → pytest_databases-0.2.1/src}/pytest_databases/docker/mssql.py +23 -3
- {pytest_databases-0.1.0 → pytest_databases-0.2.1/src}/pytest_databases/docker/mysql.py +23 -3
- {pytest_databases-0.1.0 → pytest_databases-0.2.1/src}/pytest_databases/docker/oracle.py +23 -3
- {pytest_databases-0.1.0 → pytest_databases-0.2.1/src}/pytest_databases/docker/postgres.py +23 -3
- pytest_databases-0.2.1/src/pytest_databases/docker/redis.py +53 -0
- {pytest_databases-0.1.0 → pytest_databases-0.2.1/src}/pytest_databases/docker/spanner.py +23 -3
- {pytest_databases-0.1.0 → pytest_databases-0.2.1/src}/pytest_databases/helpers.py +23 -0
- pytest_databases-0.2.1/tests/__init__.py +21 -0
- pytest_databases-0.2.1/tests/conftest.py +40 -0
- pytest_databases-0.2.1/tests/docker/__init__.py +21 -0
- pytest_databases-0.2.1/tests/docker/test_cockroachdb.py +30 -0
- pytest_databases-0.2.1/tests/docker/test_dragonfly.py +51 -0
- pytest_databases-0.2.1/tests/docker/test_keydb.py +51 -0
- pytest_databases-0.2.1/tests/docker/test_mssql.py +30 -0
- pytest_databases-0.2.1/tests/docker/test_mysql.py +30 -0
- pytest_databases-0.2.1/tests/docker/test_oracle.py +105 -0
- pytest_databases-0.2.1/tests/docker/test_postgres.py +25 -0
- pytest_databases-0.2.1/tests/docker/test_redis.py +51 -0
- pytest_databases-0.2.1/tests/docker/test_spanner.py +25 -0
- pytest_databases-0.1.0/PKG-INFO +0 -102
- pytest_databases-0.1.0/README.md +0 -64
- pytest_databases-0.1.0/pytest_databases/__init__.py +0 -3
- pytest_databases-0.1.0/pytest_databases/__metadata__.py +0 -19
- pytest_databases-0.1.0/pytest_databases/docker/cockroachdb.py +0 -36
- pytest_databases-0.1.0/setup.py +0 -52
- {pytest_databases-0.1.0 → pytest_databases-0.2.1}/.gitignore +0 -0
- {pytest_databases-0.1.0 → pytest_databases-0.2.1/src}/pytest_databases/py.typed +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
exclude: "^docs/conf.py"
|
|
2
|
+
|
|
3
|
+
repos:
|
|
4
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
5
|
+
rev: v4.5.0
|
|
6
|
+
hooks:
|
|
7
|
+
- id: trailing-whitespace
|
|
8
|
+
- id: check-added-large-files
|
|
9
|
+
- id: check-ast
|
|
10
|
+
- id: check-json
|
|
11
|
+
- id: check-merge-conflict
|
|
12
|
+
- id: check-xml
|
|
13
|
+
- id: check-yaml
|
|
14
|
+
args: ["--unsafe"] # needed for !! tags in mkdocs.yml
|
|
15
|
+
- id: debug-statements
|
|
16
|
+
- id: end-of-file-fixer
|
|
17
|
+
- id: mixed-line-ending
|
|
18
|
+
args: ["--fix=auto"] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows
|
|
19
|
+
|
|
20
|
+
# Ruff replaces black, flake8, autoflake and isort
|
|
21
|
+
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
|
22
|
+
rev: "v0.3.5" # make sure this is always consistent with hatch configs
|
|
23
|
+
hooks:
|
|
24
|
+
- id: ruff
|
|
25
|
+
args: [--config, ./pyproject.toml]
|
|
26
|
+
|
|
27
|
+
- repo: https://github.com/pre-commit/mirrors-prettier
|
|
28
|
+
rev: v4.0.0-alpha.8
|
|
29
|
+
hooks:
|
|
30
|
+
- id: prettier
|
|
31
|
+
exclude: templates|migrations|scripts|docs|dist|.venv|public
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
ignore:
|
|
2
|
+
- .tox/
|
|
3
|
+
- .venv/
|
|
4
|
+
- dist/
|
|
5
|
+
- docs/_build/
|
|
6
|
+
- docs/_static/
|
|
7
|
+
- node_modules/
|
|
8
|
+
- vendor/
|
|
9
|
+
- venv/
|
|
10
|
+
|
|
11
|
+
rule_settings:
|
|
12
|
+
enable: [default]
|
|
13
|
+
disable: [dont-import-test-modules]
|
|
14
|
+
rule_types:
|
|
15
|
+
- refactoring
|
|
16
|
+
- suggestion
|
|
17
|
+
- comment
|
|
18
|
+
python_version: "3.8"
|
|
19
|
+
|
|
20
|
+
rules: []
|
|
21
|
+
|
|
22
|
+
metrics:
|
|
23
|
+
quality_threshold: 25.0
|
|
24
|
+
|
|
25
|
+
github:
|
|
26
|
+
ignore_labels:
|
|
27
|
+
- sourcery-ignore
|
|
28
|
+
- docs
|
|
29
|
+
labels:
|
|
30
|
+
- build-ignore
|
|
31
|
+
request_review:
|
|
32
|
+
origin: owner
|
|
33
|
+
forked: author
|
|
34
|
+
sourcery_branch: sourcery/{base_branch}
|
|
35
|
+
|
|
36
|
+
clone_detection:
|
|
37
|
+
min_lines: 3
|
|
38
|
+
min_duplicates: 2
|
|
39
|
+
identical_clones_only: false
|
|
40
|
+
|
|
41
|
+
proxy:
|
|
42
|
+
no_ssl_verify: false
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files.exclude": {
|
|
3
|
+
"**/._*": true,
|
|
4
|
+
"**/*.pyc": {
|
|
5
|
+
"when": "$(basename).py"
|
|
6
|
+
},
|
|
7
|
+
".coverage.*": true,
|
|
8
|
+
".mypy_cache": true,
|
|
9
|
+
"**/__pycache__": true,
|
|
10
|
+
".venv": true,
|
|
11
|
+
".direnv": true,
|
|
12
|
+
".idea": true,
|
|
13
|
+
".run": true,
|
|
14
|
+
".pytest_cache": true,
|
|
15
|
+
".cache": true,
|
|
16
|
+
".dist": true,
|
|
17
|
+
"**/.pytest_cache": true,
|
|
18
|
+
"site": true,
|
|
19
|
+
".angular": true,
|
|
20
|
+
".ruff_cache": true,
|
|
21
|
+
".astro": true,
|
|
22
|
+
".unasyncd_cache": true,
|
|
23
|
+
".coverage": true,
|
|
24
|
+
"node_modules": true,
|
|
25
|
+
".terraform": true
|
|
26
|
+
},
|
|
27
|
+
"ruff.format.args": ["--config=${workspaceFolder}/pyproject.toml"],
|
|
28
|
+
"ruff.lint.run": "onType",
|
|
29
|
+
"ruff.lint.args": ["--config=${workspaceFolder}/pyproject.toml"],
|
|
30
|
+
"mypy-type-checker.importStrategy": "fromEnvironment",
|
|
31
|
+
"pylint.importStrategy": "fromEnvironment",
|
|
32
|
+
"python.autoComplete.extraPaths": ["${workspaceFolder}/src"],
|
|
33
|
+
"python.terminal.activateEnvInCurrentTerminal": true,
|
|
34
|
+
"python.terminal.executeInFileDir": true,
|
|
35
|
+
"python.testing.pytestEnabled": true,
|
|
36
|
+
"autoDocstring.guessTypes": false,
|
|
37
|
+
"python.analysis.autoImportCompletions": true,
|
|
38
|
+
"python.analysis.autoFormatStrings": true,
|
|
39
|
+
"python.analysis.extraPaths": ["${workspaceFolder}/src"],
|
|
40
|
+
"editor.formatOnSave": true,
|
|
41
|
+
"notebook.formatOnSave.enabled": true,
|
|
42
|
+
"black-formatter.args": ["--line-length=120"],
|
|
43
|
+
"evenBetterToml.formatter.reorderKeys": true,
|
|
44
|
+
"evenBetterToml.formatter.trailingNewline": true,
|
|
45
|
+
"evenBetterToml.formatter.columnWidth": 120,
|
|
46
|
+
"evenBetterToml.formatter.arrayAutoCollapse": true,
|
|
47
|
+
"python.globalModuleInstallation": false,
|
|
48
|
+
"python.testing.unittestEnabled": false,
|
|
49
|
+
"editor.codeActionsOnSave": {
|
|
50
|
+
"source.fixAll.ruff": "explicit",
|
|
51
|
+
"source.organizeImports.ruff": "explicit"
|
|
52
|
+
},
|
|
53
|
+
"[python]": {
|
|
54
|
+
"editor.formatOnSave": true,
|
|
55
|
+
"editor.formatOnSaveMode": "file",
|
|
56
|
+
"editor.insertSpaces": true,
|
|
57
|
+
"editor.tabSize": 4,
|
|
58
|
+
"editor.trimAutoWhitespace": true,
|
|
59
|
+
"editor.defaultFormatter": "charliermarsh.ruff",
|
|
60
|
+
"editor.codeActionsOnSave": {
|
|
61
|
+
"source.fixAll": "explicit",
|
|
62
|
+
"source.organizeImports": "explicit"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"python.analysis.fixAll": [
|
|
66
|
+
"source.unusedImports",
|
|
67
|
+
"source.convertImportFormat"
|
|
68
|
+
],
|
|
69
|
+
"sqltools.disableReleaseNotifications": true,
|
|
70
|
+
"sqltools.disableNodeDetectNotifications": true,
|
|
71
|
+
"cloudcode.duetAI.enable": true,
|
|
72
|
+
"cloudcode.compute.sshInternalIp": true,
|
|
73
|
+
"python.testing.pytestArgs": ["tests"],
|
|
74
|
+
"markdownlint.run": "onSave",
|
|
75
|
+
"markdownlint.config": {
|
|
76
|
+
"default": true,
|
|
77
|
+
"MD046": {
|
|
78
|
+
"style": "fenced"
|
|
79
|
+
},
|
|
80
|
+
"MD007": {
|
|
81
|
+
"indent": 4
|
|
82
|
+
},
|
|
83
|
+
"no-hard-tabs": false
|
|
84
|
+
},
|
|
85
|
+
"yaml.schemas": {
|
|
86
|
+
"https://squidfunk.github.io/mkdocs-material/schema.json": "mkdocs.yml"
|
|
87
|
+
},
|
|
88
|
+
"yaml.customTags": [
|
|
89
|
+
"!ENV scalar",
|
|
90
|
+
"!ENV sequence",
|
|
91
|
+
"!relative scalar",
|
|
92
|
+
"tag:yaml.org,2002:python/name:material.extensions.emoji.to_svg",
|
|
93
|
+
"tag:yaml.org,2002:python/name:material.extensions.emoji.twemoji",
|
|
94
|
+
"tag:yaml.org,2002:python/name:pymdownx.superfences.fence_code_format"
|
|
95
|
+
]
|
|
96
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Code owner settings for `litestar-org`
|
|
2
|
+
# @maintainers should be assigned to all reviews.
|
|
3
|
+
# Most specific assignment takes precedence though, so if you add a more specific thing than the `*` glob, you must also add @maintainers
|
|
4
|
+
# For more info about code owners see https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-file-example
|
|
5
|
+
|
|
6
|
+
# Global Assignment
|
|
7
|
+
* @litestar-org/maintainers @litestar-org/members
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
Contribution guide
|
|
2
|
+
==================
|
|
3
|
+
|
|
4
|
+
Setting up the environment
|
|
5
|
+
--------------------------
|
|
6
|
+
|
|
7
|
+
1. Install `PDM <https://pdm.fming.dev/latest/>`_
|
|
8
|
+
2. Run ``pdm install -G:all`` to create a `virtual environment <https://docs.python.org/3/tutorial/venv.html>`_ and install
|
|
9
|
+
the dependencies
|
|
10
|
+
3. If you're working on the documentation and need to build it locally, install the extra dependencies with ``pdm install -G:docs``
|
|
11
|
+
4. Install `pre-commit <https://pre-commit.com/>`_
|
|
12
|
+
5. Run ``pre-commit install`` to install pre-commit hooks
|
|
13
|
+
|
|
14
|
+
Code contributions
|
|
15
|
+
------------------
|
|
16
|
+
|
|
17
|
+
Workflow
|
|
18
|
+
++++++++
|
|
19
|
+
|
|
20
|
+
1. `Fork <https://github.com/litestar-org/pytest-databases/fork>`_ the `Pytest Database Alchemy repository <https://github.com/litestar-org/pytest-databases>`_
|
|
21
|
+
2. Clone your fork locally with git
|
|
22
|
+
3. `Set up the environment <#setting-up-the-environment>`_
|
|
23
|
+
4. Make your changes
|
|
24
|
+
5. (Optional) Run ``pre-commit run --all-files`` to run linters and formatters. This step is optional and will be executed
|
|
25
|
+
automatically by git before you make a commit, but you may want to run it manually in order to apply fixes
|
|
26
|
+
6. Commit your changes to git
|
|
27
|
+
7. Push the changes to your fork
|
|
28
|
+
8. Open a `pull request <https://docs.github.com/en/pull-requests>`_. Give the pull request a descriptive title
|
|
29
|
+
indicating what it changes. If it has a corresponding open issue, the issue number should be included in the title as
|
|
30
|
+
well. For example a pull request that fixes issue ``bug: Increased stack size making it impossible to find needle #100``
|
|
31
|
+
could be titled ``fix(#100): Make needles easier to find by applying fire to haystack``
|
|
32
|
+
|
|
33
|
+
.. tip:: Pull requests and commits all need to follow the
|
|
34
|
+
`Conventional Commit format <https://www.conventionalcommits.org>`_
|
|
35
|
+
|
|
36
|
+
.. note:: To run the integration tests locally, you will need the `ODBC Driver for SQL Server <https://learn.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server?view=sql-server-ver16>`_, one option is using `unixODBC <https://www.unixodbc.org/>`_.
|
|
37
|
+
|
|
38
|
+
Guidelines for writing code
|
|
39
|
+
----------------------------
|
|
40
|
+
|
|
41
|
+
- All code should be fully `typed <https://peps.python.org/pep-0484/>`_. This is enforced via
|
|
42
|
+
`mypy <https://mypy.readthedocs.io/en/stable/>`_.
|
|
43
|
+
- All code should be tested. This is enforced via `pytest <https://docs.pytest.org/en/stable/>`_.
|
|
44
|
+
- All code should be properly formatted. This is enforced via `black <https://black.readthedocs.io/en/stable/>`_ and `Ruff <https://beta.ruff.rs/docs/>`_.
|
|
45
|
+
|
|
46
|
+
Writing and running tests
|
|
47
|
+
+++++++++++++++++++++++++
|
|
48
|
+
|
|
49
|
+
.. todo:: Write this section
|
|
50
|
+
|
|
51
|
+
Project documentation
|
|
52
|
+
---------------------
|
|
53
|
+
|
|
54
|
+
The documentation is located in the ``/docs`` directory and is `ReST <https://docutils.sourceforge.io/rst.html>`_ and
|
|
55
|
+
`Sphinx <https://www.sphinx-doc.org/en/master/>`_. If you're unfamiliar with any of those,
|
|
56
|
+
`ReStructuredText primer <https://www.sphinx-doc.org/en/master/lib/usage/restructuredtext/basics.html>`_ and
|
|
57
|
+
`Sphinx quickstart <https://www.sphinx-doc.org/en/master/lib/usage/quickstart.html>`_ are recommended reads.
|
|
58
|
+
|
|
59
|
+
Running the docs locally
|
|
60
|
+
++++++++++++++++++++++++
|
|
61
|
+
|
|
62
|
+
To run or build the docs locally, you need to first install the required dependencies:
|
|
63
|
+
|
|
64
|
+
``pdm install -G:docs``
|
|
65
|
+
|
|
66
|
+
Then you can serve the documentation with ``make docs-serve``, or build them with ``make docs``.
|
|
67
|
+
|
|
68
|
+
Creating a new release
|
|
69
|
+
----------------------
|
|
70
|
+
|
|
71
|
+
1. Increment the version in `pyproject.toml <https://github.com/litestar-org/pytest-databases/blob/main/pyproject.toml>`_.
|
|
72
|
+
.. note:: The version should follow `semantic versioning <https://semver.org/>`_ and `PEP 440 <https://www.python.org/dev/peps/pep-0440/>`_.
|
|
73
|
+
2. `Draft a new release <https://github.com/litestar-org/pytest-databases/releases/new>`_ on GitHub
|
|
74
|
+
|
|
75
|
+
* Use ``vMAJOR.MINOR.PATCH`` (e.g. ``v1.2.3``) as both the tag and release title
|
|
76
|
+
* Fill in the release description. You can use the "Generate release notes" function to get a draft for this
|
|
77
|
+
3. Commit your changes and push to ``main``
|
|
78
|
+
4. Publish the release
|
|
79
|
+
5. Go to `Actions <https://github.com/litestar-org/pytest-databases/actions>`_ and approve the release workflow
|
|
80
|
+
6. Check that the workflow runs successfully
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
.DEFAULT_GOAL:=help
|
|
2
|
+
.ONESHELL:
|
|
3
|
+
ENV_PREFIX =.venv/bin/
|
|
4
|
+
VENV_EXISTS = $(shell python3 -c "if __import__('pathlib').Path('.venv/bin/activate').exists(): print('yes')")
|
|
5
|
+
BUILD_DIR =dist
|
|
6
|
+
SRC_DIR =src
|
|
7
|
+
BASE_DIR =$(shell pwd)
|
|
8
|
+
|
|
9
|
+
.EXPORT_ALL_VARIABLES:
|
|
10
|
+
|
|
11
|
+
ifndef VERBOSE
|
|
12
|
+
.SILENT:
|
|
13
|
+
endif
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
help: ## Display this help
|
|
17
|
+
@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)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
# =============================================================================
|
|
21
|
+
# Developer Utils
|
|
22
|
+
# =============================================================================
|
|
23
|
+
install-pipx: ## Install pipx
|
|
24
|
+
@python3 -m pip install --upgrade --user pipx
|
|
25
|
+
|
|
26
|
+
install-hatch: ## Install Hatch, UV, and Ruff
|
|
27
|
+
@pipx install hatch --force
|
|
28
|
+
@pipx inject hatch ruff uv hatch-pip-compile hatch-vcs hatch-mypyc mypy --include-deps --include-apps --force
|
|
29
|
+
|
|
30
|
+
configure-hatch: ## Configure Hatch defaults
|
|
31
|
+
@hatch config set dirs.env.virtual .direnv
|
|
32
|
+
@hatch config set dirs.env.pip-compile .direnv
|
|
33
|
+
|
|
34
|
+
upgrade-hatch: ## Update Hatch, UV, and Ruff
|
|
35
|
+
@pipx upgrade hatch --include-injected
|
|
36
|
+
|
|
37
|
+
install: ## Install the project and all dependencies
|
|
38
|
+
@if [ "$(VENV_EXISTS)" ]; then echo "=> Removing existing virtual environment"; $(MAKE) destroy-venv; fi
|
|
39
|
+
@$(MAKE) clean
|
|
40
|
+
@if ! pipx --version > /dev/null; then echo '=> Installing `pipx`'; $(MAKE) install-pipx ; fi
|
|
41
|
+
@if ! hatch --version > /dev/null; then echo '=> Installing `hatch` with `pipx`'; $(MAKE) install-hatch ; fi
|
|
42
|
+
@if ! hatch-pip-compile --version > /dev/null; then echo '=> Updating `hatch` and installing plugins'; $(MAKE) upgrade-hatch ; fi
|
|
43
|
+
@echo "=> Creating Python environments..."
|
|
44
|
+
@$(MAKE) configure-hatch
|
|
45
|
+
@hatch env create local
|
|
46
|
+
@echo "=> Install complete! Note: If you want to re-install re-run 'make install'"
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
.PHONY: upgrade
|
|
50
|
+
upgrade: ## Upgrade all dependencies to the latest stable versions
|
|
51
|
+
@echo "=> Updating all dependencies"
|
|
52
|
+
@hatch-pip-compile --upgrade --all
|
|
53
|
+
@echo "=> Python Dependencies Updated"
|
|
54
|
+
@hatch run lint:pre-commit autoupdate
|
|
55
|
+
@echo "=> Updated Pre-commit"
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
.PHONY: clean
|
|
59
|
+
clean: ## remove all build, testing, and static documentation files
|
|
60
|
+
@echo "=> Cleaning working directory"
|
|
61
|
+
@rm -rf .pytest_cache .ruff_cache .hypothesis build/ dist/ .eggs/ .coverage coverage.xml coverage.json htmlcov/ .mypy_cache
|
|
62
|
+
@find . -name '*.egg-info' -exec rm -rf {} +
|
|
63
|
+
@find . -name '*.egg' -exec rm -f {} +
|
|
64
|
+
@find . -name '*.pyc' -exec rm -f {} +
|
|
65
|
+
@find . -name '*.pyo' -exec rm -f {} +
|
|
66
|
+
@find . -name '*~' -exec rm -f {} +
|
|
67
|
+
@find . -name '__pycache__' -exec rm -rf {} +
|
|
68
|
+
@find . -name '.pytest_cache' -exec rm -rf {} +
|
|
69
|
+
@find . -name '.ipynb_checkpoints' -exec rm -rf {} +
|
|
70
|
+
@echo "=> Source cleaned successfully"
|
|
71
|
+
|
|
72
|
+
deep-clean: clean destroy-venv ## Clean everything up
|
|
73
|
+
@hatch python remove all
|
|
74
|
+
@echo "=> Hatch environments pruned and python installations trimmed"
|
|
75
|
+
@uv cache clean
|
|
76
|
+
@echo "=> UV Cache cleaned successfully"
|
|
77
|
+
|
|
78
|
+
destroy-venv: ## Destroy the virtual environment
|
|
79
|
+
@hatch env prune
|
|
80
|
+
@hatch env remove lint
|
|
81
|
+
@rm -Rf .venv
|
|
82
|
+
@rm -Rf .direnv
|
|
83
|
+
|
|
84
|
+
.PHONY: build
|
|
85
|
+
build: clean ## Build and package the collectors
|
|
86
|
+
@echo "=> Building package..."
|
|
87
|
+
@hatch build
|
|
88
|
+
@echo "=> Package build complete..."
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
###############
|
|
92
|
+
# docs #
|
|
93
|
+
###############
|
|
94
|
+
.PHONY: serve-docs
|
|
95
|
+
serve-docs: ## Serve HTML documentation
|
|
96
|
+
@hatch run docs:serve
|
|
97
|
+
|
|
98
|
+
.PHONY: docs
|
|
99
|
+
docs: ## generate HTML documentation and serve it to the browser
|
|
100
|
+
@hatch run docs:build
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
# =============================================================================
|
|
104
|
+
# Tests, Linting, Coverage
|
|
105
|
+
# =============================================================================
|
|
106
|
+
.PHONY: lint
|
|
107
|
+
lint: ## Runs pre-commit hooks; includes ruff linting, codespell, black
|
|
108
|
+
@echo "=> Running pre-commit process"
|
|
109
|
+
@hatch run lint:fix
|
|
110
|
+
@echo "=> Pre-commit complete"
|
|
111
|
+
|
|
112
|
+
.PHONY: test
|
|
113
|
+
test: ## Run the tests
|
|
114
|
+
@echo "=> Running test cases"
|
|
115
|
+
@hatch run test:cov
|
|
116
|
+
@echo "=> Tests complete"
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: pytest-databases
|
|
3
|
+
Version: 0.2.1
|
|
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: dragonfly
|
|
26
|
+
Requires-Dist: redis; extra == 'dragonfly'
|
|
27
|
+
Provides-Extra: keydb
|
|
28
|
+
Requires-Dist: redis; extra == 'keydb'
|
|
29
|
+
Provides-Extra: mssql
|
|
30
|
+
Requires-Dist: aioodbc; extra == 'mssql'
|
|
31
|
+
Provides-Extra: mysql
|
|
32
|
+
Requires-Dist: asyncmy>=0.2.9; extra == 'mysql'
|
|
33
|
+
Provides-Extra: oracle
|
|
34
|
+
Requires-Dist: oracledb; extra == 'oracle'
|
|
35
|
+
Provides-Extra: postgres
|
|
36
|
+
Requires-Dist: asyncpg>=0.29.0; extra == 'postgres'
|
|
37
|
+
Provides-Extra: redis
|
|
38
|
+
Requires-Dist: redis; extra == 'redis'
|
|
39
|
+
Provides-Extra: spanner
|
|
40
|
+
Requires-Dist: google-cloud-spanner; extra == 'spanner'
|
|
41
|
+
Provides-Extra: sqlite
|
|
42
|
+
Requires-Dist: aiosqlite; extra == 'sqlite'
|
|
43
|
+
Description-Content-Type: text/markdown
|
|
44
|
+
|
|
45
|
+
# pytest-databases
|
|
46
|
+
|
|
47
|
+
Reusable test fixtures for any and all databases.
|
|
48
|
+
|
|
49
|
+
<!-- markdownlint-disable -->
|
|
50
|
+
<p align="center">
|
|
51
|
+
<!-- github-banner-start -->
|
|
52
|
+
<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" />
|
|
53
|
+
<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" />
|
|
54
|
+
<!-- github-banner-end -->
|
|
55
|
+
</p>
|
|
56
|
+
<!-- markdownlint-restore -->
|
|
57
|
+
<div align="center">
|
|
58
|
+
|
|
59
|
+
<!-- prettier-ignore-start -->
|
|
60
|
+
|
|
61
|
+
| Project | | Status |
|
|
62
|
+
|-----------|:----|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
63
|
+
| CI/CD | | [](https://github.com/litestar-org/pytest-databases/actions/workflows/publish.yml) [](https://github.com/litestar-org/pytest-databases/actions/workflows/ci.yml) [](https://github.com/litestar-org/pytest-databases/actions/workflows/docs.yml) |
|
|
64
|
+
| Quality | | [](https://codecov.io/github/litestar-org/pytest-databases) [](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) [](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) [](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) [](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) |
|
|
65
|
+
| Package | | [](https://badge.fury.io/py/litestar)    |
|
|
66
|
+
| Community | | [](https://reddit.com/r/litestarapi) [](https://discord.gg/litestar-919193495116337154) [](https://matrix.to/#/#litestar:matrix.org) [](https://blog.litestar.dev) [](https://twitter.com/LitestarAPI) [](https://blog.litestar.dev) |
|
|
67
|
+
| Meta | | [](https://github.com/litestar-org/pytest-databases) [](https://github.com/python/mypy) [](https://spdx.org/licenses/) [](https://github.com/sponsors/litestar-org) [](https://github.com/astral-sh/ruff) [](https://github.com/psf/black)|
|
|
68
|
+
|
|
69
|
+
<!-- prettier-ignore-end -->
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
> [!WARNING] > **Pre-Release Alpha Stage**
|
|
73
|
+
>
|
|
74
|
+
> Please note that pytest-databases is currently in a pre-release alpha stage of development. This means the library is still under
|
|
75
|
+
> active development, and its API is subject to change. We encourage developers to experiment with pytest-databases and provide
|
|
76
|
+
> feedback, but we recommend against using it in production environments until a stable release is available.`
|
|
77
|
+
|
|
78
|
+
## About
|
|
79
|
+
|
|
80
|
+
The `pytest-databases` library aims to make testing with a database as simple as possible.
|
|
81
|
+
It is designed to offer pre-configured testing setups for many different types and versions of databases.
|
|
82
|
+
|
|
83
|
+
## Features
|
|
84
|
+
|
|
85
|
+
`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:
|
|
86
|
+
|
|
87
|
+
- **Postgres**: Version 12, 13, 14, 15, and 16 are available
|
|
88
|
+
- **MySQL**: Version 5.6, 5.7 and 8 are available
|
|
89
|
+
- **Oracle**: Version 18c XE and 23C Free are available
|
|
90
|
+
- **SQL Server**: Version 2022 is available
|
|
91
|
+
- **Spanner**: The latest cloud-emulator from Google is available
|
|
92
|
+
- **Cockroach**: Version 23.1-latest is available
|
|
93
|
+
- **Redis**: Latest server
|
|
94
|
+
- **Dragonfly**: Latest server
|
|
95
|
+
- **KeyDB**: Latest server
|
|
96
|
+
|
|
97
|
+
## Contributing
|
|
98
|
+
|
|
99
|
+
All [Litestar][litestar-org] projects will always be a community-centered, available for contributions of any size.
|
|
100
|
+
|
|
101
|
+
Before contributing, please review the [contribution guide][contributing].
|
|
102
|
+
|
|
103
|
+
If you have any questions, reach out to us on [Discord][discord], our org-wide [GitHub discussions][litestar-discussions] page,
|
|
104
|
+
or the [project-specific GitHub discussions page][project-discussions].
|
|
105
|
+
|
|
106
|
+
<hr>
|
|
107
|
+
|
|
108
|
+
<!-- markdownlint-disable -->
|
|
109
|
+
<p align="center">
|
|
110
|
+
<!-- github-banner-start -->
|
|
111
|
+
<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" />
|
|
112
|
+
<br>A <a href="https://github.com/litestar-org">Litestar Organization</a> Project
|
|
113
|
+
<!-- github-banner-end -->
|
|
114
|
+
</p>
|
|
115
|
+
|
|
116
|
+
[litestar-org]: https://github.com/litestar-org
|
|
117
|
+
[contributing]: https://docs.pytest-databases.litestar.dev/latest/contribution-guide.html
|
|
118
|
+
[discord]: https://discord.gg/litestar-919193495116337154
|
|
119
|
+
[litestar-discussions]: https://github.com/orgs/litestar-org/discussions
|
|
120
|
+
[project-discussions]: https://github.com/litestar-org/pytest-databases/discussions
|
|
121
|
+
[project-docs]: https://docs.pytest-databases.litestar.dev
|
|
122
|
+
[install-guide]: https://docs.pytest-databases.litestar.dev/latest/#installation
|
|
123
|
+
[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 | | [](https://github.com/litestar-org/pytest-databases/actions/workflows/publish.yml) [](https://github.com/litestar-org/pytest-databases/actions/workflows/ci.yml) [](https://github.com/litestar-org/pytest-databases/actions/workflows/docs.yml) |
|
|
20
|
+
| Quality | | [](https://codecov.io/github/litestar-org/pytest-databases) [](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) [](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) [](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) [](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) |
|
|
21
|
+
| Package | | [](https://badge.fury.io/py/litestar)    |
|
|
22
|
+
| Community | | [](https://reddit.com/r/litestarapi) [](https://discord.gg/litestar-919193495116337154) [](https://matrix.to/#/#litestar:matrix.org) [](https://blog.litestar.dev) [](https://twitter.com/LitestarAPI) [](https://blog.litestar.dev) |
|
|
23
|
+
| Meta | | [](https://github.com/litestar-org/pytest-databases) [](https://github.com/python/mypy) [](https://spdx.org/licenses/) [](https://github.com/sponsors/litestar-org) [](https://github.com/astral-sh/ruff) [](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
|