Skip to content

Commit d5f71b1

Browse files
authored
Merge pull request #9 from bdowning/github-actions
GitHub actions
2 parents 1ce1750 + 32d5502 commit d5f71b1

9 files changed

Lines changed: 1008 additions & 903 deletions

File tree

.bumpversion.cfg

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
[bumpversion]
2-
current_version = 0.3.16
2+
current_version = 0.4.0-alpha-1
3+
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(-(?P<release>.*)-(?P<build>\d+))?
4+
serialize =
5+
{major}.{minor}.{patch}-{release}-{build}
6+
{major}.{minor}.{patch}
37
commit = True
48

59
[bumpversion:file:pyproject.toml]
10+
11+
[bumpversion:part:release]
12+
first_value = regular
13+
optional_value = regular
14+
values =
15+
alpha
16+
beta
17+
rc
18+
test
19+
regular

.circleci/config.yml

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

.github/workflows/publish.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v**'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
env:
12+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }}
13+
steps:
14+
- uses: actions/checkout@v4
15+
- run: pipx install poetry
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.12'
19+
cache: poetry
20+
- run: poetry build
21+
- run: poetry publish

.github/workflows/test.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
8+
jobs:
9+
test:
10+
strategy:
11+
matrix:
12+
python-version:
13+
- '3.9'
14+
- '3.10'
15+
- '3.11'
16+
- '3.12'
17+
runs-on: ubuntu-latest
18+
services:
19+
postgres:
20+
image: postgres:16
21+
ports:
22+
- 5432:5432
23+
env:
24+
POSTGRES_PASSWORD: password
25+
env:
26+
PGPORT: 5432
27+
steps:
28+
- uses: actions/checkout@v4
29+
- run: pipx install poetry
30+
- uses: actions/setup-python@v5
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
cache: poetry
34+
- run: poetry install
35+
- run: poetry run flake8 sql_athame tests
36+
- run: poetry run mypy sql_athame/**.py tests/**.py
37+
if: success() || failure()
38+
- run: poetry run black --check sql_athame tests
39+
if: success() || failure()
40+
- run: poetry run isort --check-only sql_athame/**.py tests/**.py
41+
if: success() || failure()
42+
- run: poetry run pytest
43+
if: success() || failure()

poetry.lock

Lines changed: 888 additions & 786 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "sql-athame"
3-
version = "0.3.16"
3+
version = "0.4.0-alpha-1"
44
description = "Python tool for slicing and dicing SQL"
55
authors = ["Brian Downing <bdowning@lavos.net>"]
66
license = "MIT"
@@ -12,12 +12,12 @@ repository = "https://github.com/bdowning/sql-athame"
1212
asyncpg = ["asyncpg"]
1313

1414
[tool.poetry.dependencies]
15-
python = "^3.7"
15+
python = "^3.9"
1616
asyncpg = { version = "*", optional = true }
1717
typing-extensions = "*"
1818

1919
[tool.poetry.dev-dependencies]
20-
black = {version = "*", allow-prereleases = true}
20+
black = "*"
2121
isort = "*"
2222
pytest = "*"
2323
mypy = "*"

setup.cfg

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,14 @@ ignore_missing_imports = True
3333

3434
[flake8]
3535
ignore =
36-
E501, # max line length
37-
W503, # line break before binary operator; fights with black
36+
# max line length
37+
E501,
38+
# multiple statements on one line (def); fights with black
39+
E704,
40+
# line break before binary operator; fights with black
41+
W503,
3842

3943
[coverage:run]
4044
include =
41-
sql_athame/**py
42-
tests/**py
45+
sql_athame/**/*.py
46+
tests/**/*.py

sql_athame/base.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,12 @@ def fill(self, **kwargs: Any) -> "Fragment":
106106
@overload
107107
def prep_query(
108108
self, allow_slots: Literal[True]
109-
) -> Tuple[str, List[Union[Placeholder, Slot]]]:
110-
... # pragma: no cover
109+
) -> Tuple[str, List[Union[Placeholder, Slot]]]: ... # pragma: no cover
111110

112111
@overload
113112
def prep_query(
114113
self, allow_slots: Literal[False] = False
115-
) -> Tuple[str, List[Placeholder]]:
116-
... # pragma: no cover
114+
) -> Tuple[str, List[Placeholder]]: ... # pragma: no cover
117115

118116
def prep_query(self, allow_slots: bool = False) -> Tuple[str, List[Any]]:
119117
parts: List[FlatPart] = []
@@ -228,38 +226,32 @@ def identifier(name: str, prefix: Optional[str] = None) -> Fragment:
228226
return lit(f"{quote_identifier(name)}")
229227

230228
@overload
231-
def all(self, parts: Iterable[Fragment]) -> Fragment:
232-
... # pragma: no cover
229+
def all(self, parts: Iterable[Fragment]) -> Fragment: ... # pragma: no cover
233230

234231
@overload
235-
def all(self, *parts: Fragment) -> Fragment:
236-
... # pragma: no cover
232+
def all(self, *parts: Fragment) -> Fragment: ... # pragma: no cover
237233

238234
def all(self, *parts) -> Fragment: # type: ignore
239235
if parts and not isinstance(parts[0], Fragment):
240236
parts = parts[0]
241237
return any_all(list(parts), "AND", "TRUE")
242238

243239
@overload
244-
def any(self, parts: Iterable[Fragment]) -> Fragment:
245-
... # pragma: no cover
240+
def any(self, parts: Iterable[Fragment]) -> Fragment: ... # pragma: no cover
246241

247242
@overload
248-
def any(self, *parts: Fragment) -> Fragment:
249-
... # pragma: no cover
243+
def any(self, *parts: Fragment) -> Fragment: ... # pragma: no cover
250244

251245
def any(self, *parts) -> Fragment: # type: ignore
252246
if parts and not isinstance(parts[0], Fragment):
253247
parts = parts[0]
254248
return any_all(list(parts), "OR", "FALSE")
255249

256250
@overload
257-
def list(self, parts: Iterable[Fragment]) -> Fragment:
258-
... # pragma: no cover
251+
def list(self, parts: Iterable[Fragment]) -> Fragment: ... # pragma: no cover
259252

260253
@overload
261-
def list(self, *parts: Fragment) -> Fragment:
262-
... # pragma: no cover
254+
def list(self, *parts: Fragment) -> Fragment: ... # pragma: no cover
263255

264256
def list(self, *parts) -> Fragment: # type: ignore
265257
if parts and not isinstance(parts[0], Fragment):

0 commit comments

Comments
 (0)