Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,35 @@ jobs:
run: uv sync --dev

- name: Run tests
run: uv run mypy pytest_sqlalchemy.py tests
run: uv run mypy src tests

formatting:
runs-on: ubuntu-latest
steps:
- uses: cjw296/python-action/check-formatting@v1

build-and-inspect-package:
needs:
- tests
- coverage
- typing
- formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hynek/build-and-inspect-python-package@v2

check-package:
needs:
- build-and-inspect-package
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.9"
- "3.13"
steps:
- uses: cjw296/python-action/check-distributions@v1
with:
package: pytest_sqlalchemy
python-version: ${{ matrix.python-version }}
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Release"

on:
workflow_run:
workflows: [Continuous Integration]
types: [completed]
branches: [main]

jobs:
check:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
outputs:
tag: ${{ steps.carthorse.outputs.tag }}
steps:
- uses: cjw296/python-action/carthorse@main
id: carthorse
with:
check: "true"
tag-format: '{version}'

release:
runs-on: ubuntu-latest
needs: check
if: ${{ needs.check.outputs.tag != '' }}
permissions:
contents: write
id-token: write
steps:
- name: Show tag
run: echo "${{ toJson(needs.check.carthorse.outputs) }}"
shell: bash

- name: Download packages from CI run
uses: dawidd6/action-download-artifact@v9
with:
run_id: ${{ github.event.workflow_run.id }}
name: Packages
path: dist

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

- uses: cjw296/python-action/carthorse@main
with:
tag-format: '{version}'
21 changes: 21 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Changes
-------

0.2.1 (13.03.2018)
~~~~~~~~~~~~~~~~~~

* Fix behaviour under multiprocessing by recreating :class:`~sqlalchemy.engine.Engine` instance.

0.2.0 (22.02.2018)
~~~~~~~~~~~~~~~~~~
Feature release. Thanks to Sebastian Buczyński.

* Added option to create the database on each run by using ``sqlalchemy-utils``.

* Added option to run tests on multiple dynamically created databases
(``pytest-xdist``) like ``pytest-django`` does.

0.1.1 (22.09.2017)
~~~~~~~~~~~~~~~~~~

Initial release.
11 changes: 0 additions & 11 deletions HISTORY.rst

This file was deleted.

2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Or override the ``sqlalchemy_connect_url`` fixture on your ``conftest.py`` file:
return 'postgresql://scott:tiger@localhost:5432/mydatabase'

Development
----------
-----------

To get going, in a checkout:

Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

intersphinx_mapping = {
'python': ('http://docs.python.org', None),
'sqlalchemy': ('https://docs.sqlalchemy.org/en/20', None),
}

project = 'pytest-sqlalchemy'
Expand Down
2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.. include:: ../README.rst

.. include:: ../CHANGELOG.rst
16 changes: 10 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pytest-sqlalchemy"
version = "0.2.0"
version = "0.2.1"
description = "pytest plugin with sqlalchemy related fixtures"
authors = [
{ name = "Torsten Irländer", email = "torsten.irlaender@googlemail.com" }
Expand Down Expand Up @@ -40,13 +40,17 @@ docs = [
]

[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.coverage.run]
source = ["pytest_sqlalchemy", "tests"]
parallel = true

[tool.hatch.build.targets.sdist]
# paranoidly only include the package in the sdist: https://github.com/pypa/hatch/issues/304
packages = ["src/pytest_sqlalchemy"]

[tool.mypy]
disallow_untyped_defs = true
disallow_incomplete_defs = true
Expand All @@ -55,11 +59,11 @@ disallow_incomplete_defs = true
module = "sqlalchemy_utils.*"
ignore_missing_imports = true

[tool.pytest.ini_options]
norecursedirs = ["tests/examples"]

[tool.ruff]
line-length = 100

[tool.ruff.format]
quote-style = "preserve"

[tool.pytest.ini_options]
norecursedirs = ["tests/examples"]
File renamed without changes.
Empty file added src/pytest_sqlalchemy/py.typed
Empty file.