Skip to content

Commit 924724a

Browse files
committed
Set up monorepo structure for Aurora DSQL ORM adapters
- Consolidate GitHub workflows to root .github/workflows/ - Update pyproject.toml files: - Switch to explicit versioning (removed hatch-vcs) - Update repository URLs to point to monorepo - Add root README with package overview and installation instructions - Add design document documenting architecture decisions Package versions preserved for backwards compatibility: - aurora-dsql-sqlalchemy: 1.1.0 - aurora-dsql-tortoise-orm: 0.1.1 Release process: tag with python/<package>/vX.Y.Z to trigger PyPI publish
1 parent c2b7217 commit 924724a

24 files changed

Lines changed: 435 additions & 574 deletions
File renamed without changes.
File renamed without changes.
Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,106 @@
1-
name: SQLAlchemy Dialect integration tests
1+
name: SQLAlchemy CI
22

33
permissions: {}
44

55
on:
66
push:
77
branches: [main]
8+
paths:
9+
- 'python/sqlalchemy/**'
10+
- '.github/workflows/python-sqlalchemy-ci.yml'
11+
- '.github/workflows/dsql-cluster-*.yml'
812
pull_request:
913
branches: [main]
14+
paths:
15+
- 'python/sqlalchemy/**'
16+
- '.github/workflows/python-sqlalchemy-ci.yml'
17+
- '.github/workflows/dsql-cluster-*.yml'
1018
workflow_dispatch:
1119

20+
defaults:
21+
run:
22+
working-directory: python/sqlalchemy
23+
1224
jobs:
25+
lint:
26+
name: Lint
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: astral-sh/setup-uv@v5
31+
with:
32+
python-version: "3.12"
33+
- name: Install dependencies
34+
run: uv sync
35+
- name: Run ruff
36+
run: uv run ruff check .
37+
- name: Run pyright
38+
run: uv run pyright
39+
1340
create-cluster:
41+
needs: lint
1442
uses: ./.github/workflows/dsql-cluster-create.yml
1543
with:
1644
workflow_name: sqlalchemy-dialect
1745
secrets:
1846
AWS_IAM_ROLE: ${{ secrets.PYTHON_IAM_ROLE }}
1947
permissions:
20-
id-token: write # required by aws-actions/configure-aws-credentials
48+
id-token: write
2149

22-
dialect-test:
50+
test:
2351
needs: create-cluster
2452
runs-on: ubuntu-latest
2553
strategy:
26-
max-parallel: 1 # limit to 1 since we have 1 dsql cluster
54+
max-parallel: 1
2755
matrix:
28-
# Run test for every python version we intend to support.
2956
version: ["3.10", "3.11", "3.12", "3.13"]
3057
driver: ["psycopg2", "psycopg"]
3158
permissions:
32-
id-token: write # required by aws-actions/configure-aws-credentials
59+
id-token: write
3360
env:
3461
SSL_CERT_FILE: /tmp/AmazonRootCA1.pem
3562

3663
steps:
37-
- name: Checkout code
38-
uses: actions/checkout@v6
64+
- uses: actions/checkout@v4
3965

4066
- name: Configure AWS Credentials
41-
uses: aws-actions/configure-aws-credentials@v5
67+
uses: aws-actions/configure-aws-credentials@v4
4268
with:
4369
role-to-assume: ${{ secrets.PYTHON_IAM_ROLE }}
4470
aws-region: ${{ needs.create-cluster.outputs.region }}
4571

46-
- name: Setup uv
47-
uses: astral-sh/setup-uv@v7
72+
- uses: astral-sh/setup-uv@v5
4873
with:
4974
python-version: ${{ matrix.version }}
75+
5076
- name: Install dependencies
5177
run: uv sync
5278

5379
- name: Download Amazon Root Cert for SSL
5480
run: wget -O "$SSL_CERT_FILE" https://www.amazontrust.com/repository/AmazonRootCA1.pem
5581

56-
- name: Run integration tests for SQL Alchemy
82+
- name: Run integration tests
5783
env:
5884
CLUSTER_ENDPOINT: ${{ needs.create-cluster.outputs.cluster-endpoint }}
5985
CLUSTER_USER: admin
6086
DRIVER: ${{ matrix.driver }}
61-
run: |
62-
echo "$GITHUB_WORKSPACE" >> "$GITHUB_PATH"
63-
uv run pytest -v test/
87+
run: uv run pytest -v test/
6488

65-
- name: Run integration tests for SQL Alchemy Pet Clinic Example
89+
- name: Run Pet Clinic example tests
6690
env:
6791
CLUSTER_ENDPOINT: ${{ needs.create-cluster.outputs.cluster-endpoint }}
6892
CLUSTER_USER: admin
6993
DRIVER: ${{ matrix.driver }}
70-
run: |
71-
echo "$GITHUB_WORKSPACE" >> "$GITHUB_PATH"
72-
uv run pytest -v examples/pet-clinic-app/test/
94+
run: uv run pytest -v examples/pet-clinic-app/test/
7395

7496
delete-cluster:
7597
if: always() && needs.create-cluster.result == 'success'
76-
needs: [create-cluster, dialect-test]
98+
needs: [create-cluster, test]
7799
uses: ./.github/workflows/dsql-cluster-delete.yml
78100
with:
79101
cluster-id: ${{ needs.create-cluster.outputs.cluster-id }}
80102
region: ${{ needs.create-cluster.outputs.region }}
81103
secrets:
82104
AWS_IAM_ROLE: ${{ secrets.PYTHON_IAM_ROLE }}
83105
permissions:
84-
id-token: write # required by aws-actions/configure-aws-credentials
106+
id-token: write
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Release SQLAlchemy
2+
3+
permissions: {}
4+
5+
on:
6+
push:
7+
tags:
8+
- 'python/sqlalchemy/v*'
9+
10+
defaults:
11+
run:
12+
working-directory: python/sqlalchemy
13+
14+
jobs:
15+
build:
16+
name: Build distribution
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
persist-credentials: false
22+
23+
- uses: astral-sh/setup-uv@v5
24+
25+
- name: Build distribution packages
26+
run: uv build
27+
28+
- uses: actions/upload-artifact@v4
29+
with:
30+
name: python-sqlalchemy-dist
31+
path: python/sqlalchemy/dist/
32+
33+
publish-to-pypi:
34+
name: Publish to PyPI
35+
needs: build
36+
runs-on: ubuntu-latest
37+
environment:
38+
name: pypi
39+
url: https://pypi.org/p/aurora-dsql-sqlalchemy
40+
permissions:
41+
id-token: write
42+
43+
steps:
44+
- uses: actions/download-artifact@v4
45+
with:
46+
name: python-sqlalchemy-dist
47+
path: dist/
48+
49+
- uses: pypa/gh-action-pypi-publish@release/v1
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Tortoise ORM CI
2+
3+
permissions: {}
4+
5+
on:
6+
push:
7+
branches: [main]
8+
paths:
9+
- 'python/tortoise-orm/**'
10+
- '.github/workflows/python-tortoise-ci.yml'
11+
- '.github/workflows/dsql-cluster-*.yml'
12+
pull_request:
13+
branches: [main]
14+
paths:
15+
- 'python/tortoise-orm/**'
16+
- '.github/workflows/python-tortoise-ci.yml'
17+
- '.github/workflows/dsql-cluster-*.yml'
18+
workflow_dispatch:
19+
20+
defaults:
21+
run:
22+
working-directory: python/tortoise-orm
23+
24+
jobs:
25+
lint:
26+
name: Lint
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: astral-sh/setup-uv@v5
31+
with:
32+
python-version: "3.12"
33+
- name: Install dependencies
34+
run: uv sync
35+
- name: Run ruff
36+
run: uv run ruff check .
37+
- name: Run pyright
38+
run: uv run pyright
39+
40+
unit-tests:
41+
name: Unit Tests (Python ${{ matrix.python-version }})
42+
needs: lint
43+
runs-on: ubuntu-latest
44+
strategy:
45+
matrix:
46+
python-version: ["3.10", "3.11", "3.12", "3.13"]
47+
steps:
48+
- uses: actions/checkout@v4
49+
- uses: astral-sh/setup-uv@v5
50+
- run: uv python install ${{ matrix.python-version }}
51+
- run: uv sync
52+
- run: uv run unit
53+
54+
create-cluster:
55+
needs: unit-tests
56+
uses: ./.github/workflows/dsql-cluster-create.yml
57+
with:
58+
workflow_name: tortoise-orm
59+
secrets:
60+
AWS_IAM_ROLE: ${{ secrets.PYTHON_IAM_ROLE }}
61+
permissions:
62+
id-token: write
63+
64+
integration-tests:
65+
name: Integration Tests (Python ${{ matrix.python-version }})
66+
needs: create-cluster
67+
runs-on: ubuntu-latest
68+
permissions:
69+
id-token: write
70+
strategy:
71+
max-parallel: 1
72+
fail-fast: true
73+
matrix:
74+
python-version: ["3.10", "3.11", "3.12", "3.13"]
75+
76+
steps:
77+
- uses: actions/checkout@v4
78+
- uses: astral-sh/setup-uv@v5
79+
- run: uv python install ${{ matrix.python-version }}
80+
- run: uv sync
81+
82+
- name: Configure AWS Credentials
83+
uses: aws-actions/configure-aws-credentials@v4
84+
with:
85+
role-to-assume: ${{ secrets.PYTHON_IAM_ROLE }}
86+
aws-region: ${{ needs.create-cluster.outputs.region }}
87+
88+
- name: Run integration tests
89+
env:
90+
CLUSTER_ENDPOINT: ${{ needs.create-cluster.outputs.cluster-endpoint }}
91+
run: uv run integration
92+
93+
delete-cluster:
94+
if: always() && needs.create-cluster.result == 'success'
95+
needs: [create-cluster, integration-tests]
96+
uses: ./.github/workflows/dsql-cluster-delete.yml
97+
with:
98+
cluster-id: ${{ needs.create-cluster.outputs.cluster-id }}
99+
region: ${{ needs.create-cluster.outputs.region }}
100+
secrets:
101+
AWS_IAM_ROLE: ${{ secrets.PYTHON_IAM_ROLE }}
102+
permissions:
103+
id-token: write
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Release Tortoise ORM
2+
3+
permissions: {}
4+
5+
on:
6+
push:
7+
tags:
8+
- 'python/tortoise-orm/v*'
9+
10+
defaults:
11+
run:
12+
working-directory: python/tortoise-orm
13+
14+
jobs:
15+
build:
16+
name: Build distribution
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
persist-credentials: false
22+
23+
- uses: astral-sh/setup-uv@v5
24+
25+
- name: Build distribution packages
26+
run: uv build
27+
28+
- uses: actions/upload-artifact@v4
29+
with:
30+
name: python-tortoise-dist
31+
path: python/tortoise-orm/dist/
32+
33+
publish-to-testpypi:
34+
name: Publish to TestPyPI
35+
needs: build
36+
runs-on: ubuntu-latest
37+
environment:
38+
name: testpypi
39+
url: https://test.pypi.org/p/aurora-dsql-tortoise-orm
40+
permissions:
41+
id-token: write
42+
43+
steps:
44+
- uses: actions/download-artifact@v4
45+
with:
46+
name: python-tortoise-dist
47+
path: dist/
48+
49+
- uses: pypa/gh-action-pypi-publish@release/v1
50+
with:
51+
repository-url: https://test.pypi.org/legacy/
52+
53+
publish-to-pypi:
54+
name: Publish to PyPI
55+
needs: publish-to-testpypi
56+
runs-on: ubuntu-latest
57+
environment:
58+
name: pypi
59+
url: https://pypi.org/p/aurora-dsql-tortoise-orm
60+
permissions:
61+
id-token: write
62+
63+
steps:
64+
- uses: actions/download-artifact@v4
65+
with:
66+
name: python-tortoise-dist
67+
path: dist/
68+
69+
- uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)