Skip to content

Commit 4915b2a

Browse files
authored
Merge pull request #18 from cjw296/release
Remaining stuff to be able to release
2 parents e9d33fb + cbd0908 commit 4915b2a

File tree

10 files changed

+108
-19
lines changed

10 files changed

+108
-19
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,35 @@ jobs:
137137
run: uv sync --dev
138138

139139
- name: Run tests
140-
run: uv run mypy pytest_sqlalchemy.py tests
140+
run: uv run mypy src tests
141141

142142
formatting:
143143
runs-on: ubuntu-latest
144144
steps:
145145
- uses: cjw296/python-action/check-formatting@v1
146+
147+
build-and-inspect-package:
148+
needs:
149+
- tests
150+
- coverage
151+
- typing
152+
- formatting
153+
runs-on: ubuntu-latest
154+
steps:
155+
- uses: actions/checkout@v4
156+
- uses: hynek/build-and-inspect-python-package@v2
157+
158+
check-package:
159+
needs:
160+
- build-and-inspect-package
161+
runs-on: ubuntu-latest
162+
strategy:
163+
matrix:
164+
python-version:
165+
- "3.9"
166+
- "3.13"
167+
steps:
168+
- uses: cjw296/python-action/check-distributions@v1
169+
with:
170+
package: pytest_sqlalchemy
171+
python-version: ${{ matrix.python-version }}

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: "Release"
2+
3+
on:
4+
workflow_run:
5+
workflows: [Continuous Integration]
6+
types: [completed]
7+
branches: [main]
8+
9+
jobs:
10+
check:
11+
runs-on: ubuntu-latest
12+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
13+
outputs:
14+
tag: ${{ steps.carthorse.outputs.tag }}
15+
steps:
16+
- uses: cjw296/python-action/carthorse@main
17+
id: carthorse
18+
with:
19+
check: "true"
20+
tag-format: '{version}'
21+
22+
release:
23+
runs-on: ubuntu-latest
24+
needs: check
25+
if: ${{ needs.check.outputs.tag != '' }}
26+
permissions:
27+
contents: write
28+
id-token: write
29+
steps:
30+
- name: Show tag
31+
run: echo "${{ toJson(needs.check.carthorse.outputs) }}"
32+
shell: bash
33+
34+
- name: Download packages from CI run
35+
uses: dawidd6/action-download-artifact@v9
36+
with:
37+
run_id: ${{ github.event.workflow_run.id }}
38+
name: Packages
39+
path: dist
40+
41+
- name: Publish package distributions to PyPI
42+
uses: pypa/gh-action-pypi-publish@release/v1
43+
44+
- uses: cjw296/python-action/carthorse@main
45+
with:
46+
tag-format: '{version}'

CHANGELOG.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Changes
2+
-------
3+
4+
0.2.1 (13.03.2018)
5+
~~~~~~~~~~~~~~~~~~
6+
7+
* Fix behaviour under multiprocessing by recreating :class:`~sqlalchemy.engine.Engine` instance.
8+
9+
0.2.0 (22.02.2018)
10+
~~~~~~~~~~~~~~~~~~
11+
Feature release. Thanks to Sebastian Buczyński.
12+
13+
* Added option to create the database on each run by using ``sqlalchemy-utils``.
14+
15+
* Added option to run tests on multiple dynamically created databases
16+
(``pytest-xdist``) like ``pytest-django`` does.
17+
18+
0.1.1 (22.09.2017)
19+
~~~~~~~~~~~~~~~~~~
20+
21+
Initial release.

HISTORY.rst

Lines changed: 0 additions & 11 deletions
This file was deleted.

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Or override the ``sqlalchemy_connect_url`` fixture on your ``conftest.py`` file:
7575
return 'postgresql://scott:tiger@localhost:5432/mydatabase'
7676
7777
Development
78-
----------
78+
-----------
7979

8080
To get going, in a checkout:
8181

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
intersphinx_mapping = {
99
'python': ('http://docs.python.org', None),
10+
'sqlalchemy': ('https://docs.sqlalchemy.org/en/20', None),
1011
}
1112

1213
project = 'pytest-sqlalchemy'

docs/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
.. include:: ../README.rst
2+
3+
.. include:: ../CHANGELOG.rst

pyproject.toml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pytest-sqlalchemy"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
description = "pytest plugin with sqlalchemy related fixtures"
55
authors = [
66
{ name = "Torsten Irländer", email = "torsten.irlaender@googlemail.com" }
@@ -40,13 +40,17 @@ docs = [
4040
]
4141

4242
[build-system]
43-
requires = ["setuptools>=61.0"]
44-
build-backend = "setuptools.build_meta"
43+
requires = ["hatchling"]
44+
build-backend = "hatchling.build"
4545

4646
[tool.coverage.run]
4747
source = ["pytest_sqlalchemy", "tests"]
4848
parallel = true
4949

50+
[tool.hatch.build.targets.sdist]
51+
# paranoidly only include the package in the sdist: https://github.com/pypa/hatch/issues/304
52+
packages = ["src/pytest_sqlalchemy"]
53+
5054
[tool.mypy]
5155
disallow_untyped_defs = true
5256
disallow_incomplete_defs = true
@@ -55,11 +59,11 @@ disallow_incomplete_defs = true
5559
module = "sqlalchemy_utils.*"
5660
ignore_missing_imports = true
5761

62+
[tool.pytest.ini_options]
63+
norecursedirs = ["tests/examples"]
64+
5865
[tool.ruff]
5966
line-length = 100
6067

6168
[tool.ruff.format]
6269
quote-style = "preserve"
63-
64-
[tool.pytest.ini_options]
65-
norecursedirs = ["tests/examples"]

src/pytest_sqlalchemy/py.typed

Whitespace-only changes.

0 commit comments

Comments
 (0)