papilio-db 6.0.0__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.
- papilio_db-6.0.0/.github/workflows/ci.yml +285 -0
- papilio_db-6.0.0/.github/workflows/sqlalchemy-live.yml +82 -0
- papilio_db-6.0.0/.github/workflows/tortoise-live.yml +101 -0
- papilio_db-6.0.0/.gitignore +8 -0
- papilio_db-6.0.0/CAPABILITIES.md +26 -0
- papilio_db-6.0.0/CHANGELOG.md +25 -0
- papilio_db-6.0.0/CONTRIBUTING.md +103 -0
- papilio_db-6.0.0/LICENSE +21 -0
- papilio_db-6.0.0/PKG-INFO +235 -0
- papilio_db-6.0.0/README.fa.md +189 -0
- papilio_db-6.0.0/README.md +189 -0
- papilio_db-6.0.0/assets/logo-dark.webp +0 -0
- papilio_db-6.0.0/assets/logo-light.webp +0 -0
- papilio_db-6.0.0/docs/README.md +152 -0
- papilio_db-6.0.0/docs/databases.md +235 -0
- papilio_db-6.0.0/docs/discovery.md +67 -0
- papilio_db-6.0.0/docs/migrations.md +220 -0
- papilio_db-6.0.0/docs/oxyde.md +211 -0
- papilio_db-6.0.0/docs/sqlalchemy.md +244 -0
- papilio_db-6.0.0/docs/tortoise.md +226 -0
- papilio_db-6.0.0/papilio_db/__init__.py +1 -0
- papilio_db-6.0.0/papilio_db/_internal/__init__.py +0 -0
- papilio_db-6.0.0/papilio_db/_internal/_diagnostics.py +77 -0
- papilio_db-6.0.0/papilio_db/_internal/dialects/__init__.py +0 -0
- papilio_db-6.0.0/papilio_db/_internal/dialects/mariadb.py +11 -0
- papilio_db-6.0.0/papilio_db/_internal/dialects/mssql.py +102 -0
- papilio_db-6.0.0/papilio_db/_internal/dialects/mysql.py +137 -0
- papilio_db-6.0.0/papilio_db/_internal/dialects/oracle.py +170 -0
- papilio_db-6.0.0/papilio_db/_internal/dialects/postgresql.py +55 -0
- papilio_db-6.0.0/papilio_db/_internal/dialects/sqlite.py +74 -0
- papilio_db-6.0.0/papilio_db/_internal/discovery.py +129 -0
- papilio_db-6.0.0/papilio_db/oxyde/__init__.py +13 -0
- papilio_db-6.0.0/papilio_db/oxyde/_internal/__init__.py +0 -0
- papilio_db-6.0.0/papilio_db/oxyde/_internal/_exceptions.py +56 -0
- papilio_db-6.0.0/papilio_db/oxyde/_internal/_native.py +25 -0
- papilio_db-6.0.0/papilio_db/oxyde/dishka/__init__.py +3 -0
- papilio_db-6.0.0/papilio_db/oxyde/dishka/_native.py +11 -0
- papilio_db-6.0.0/papilio_db/oxyde/dishka/_provider.py +14 -0
- papilio_db-6.0.0/papilio_db/oxyde/migrations/__init__.py +13 -0
- papilio_db-6.0.0/papilio_db/oxyde/migrations/_native.py +13 -0
- papilio_db-6.0.0/papilio_db/oxyde/orm/__init__.py +41 -0
- papilio_db-6.0.0/papilio_db/oxyde/orm/_native.py +41 -0
- papilio_db-6.0.0/papilio_db/oxyde/pool/__init__.py +4 -0
- papilio_db-6.0.0/papilio_db/oxyde/pool/_lifecycle.py +40 -0
- papilio_db-6.0.0/papilio_db/oxyde/pool/_native.py +4 -0
- papilio_db-6.0.0/papilio_db/oxyde/transactions/__init__.py +10 -0
- papilio_db-6.0.0/papilio_db/oxyde/transactions/_atomic.py +40 -0
- papilio_db-6.0.0/papilio_db/oxyde/transactions/_native.py +22 -0
- papilio_db-6.0.0/papilio_db/py.typed +0 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/__init__.py +30 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/_internal/__init__.py +0 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/_internal/_exceptions.py +151 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/_internal/_native.py +67 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/_internal/_options.py +27 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/_internal/_session.py +32 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/_internal/queries.py +51 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/__init__.py +0 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/geo/__init__.py +12 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/geo/_columns.py +27 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/geo/_native.py +11 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/mariadb/__init__.py +3 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/mariadb/geo.py +3 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/mssql/__init__.py +4 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/mssql/_columns.py +34 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/mssql/_native.py +3 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/mssql/geo.py +3 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/mysql/__init__.py +5 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/mysql/_columns.py +88 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/mysql/_native.py +3 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/mysql/_queries.py +23 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/mysql/geo.py +3 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/oracle/__init__.py +4 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/oracle/_columns.py +31 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/oracle/_native.py +5 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/oracle/vector.py +22 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/postgresql/__init__.py +15 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/postgresql/_columns.py +79 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/postgresql/_id_repo.py +7 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/postgresql/_native.py +3 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/postgresql/_queries.py +52 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/postgresql/_repo.py +53 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/postgresql/ext/__init__.py +3 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/postgresql/ext/_create.py +28 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/postgresql/ext/_native.py +14 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/postgresql/ext/permuteseq.py +37 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/postgresql/geo.py +19 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/postgresql/vector/__init__.py +12 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/postgresql/vector/_columns.py +14 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/postgresql/vector/_native.py +18 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/sqlite/__init__.py +7 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/sqlite/_columns.py +13 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/sqlite/_geo_native.py +10 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/sqlite/_native.py +5 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/sqlite/_queries.py +33 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/sqlite/geo.py +32 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dialects/sqlite/json.py +18 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dishka/__init__.py +23 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dishka/_handler.py +38 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dishka/_native.py +31 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dishka/_provider.py +58 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/dishka/_session.py +80 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/engine/__init__.py +38 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/engine/_engine.py +52 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/engine/_lifecycle.py +40 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/engine/_native.py +42 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/migrations/__init__.py +25 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/migrations/_discovery.py +57 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/migrations/_env.py +63 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/migrations/_native.py +74 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/migrations/dialects/__init__.py +3 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/migrations/dialects/_configure.py +18 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/migrations/dialects/mariadb/__init__.py +3 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/migrations/dialects/mssql/__init__.py +3 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/migrations/dialects/mssql/_options.py +48 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/migrations/dialects/mysql/__init__.py +3 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/migrations/dialects/mysql/_options.py +47 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/migrations/dialects/postgresql/__init__.py +3 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/migrations/dialects/postgresql/_extensions.py +145 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/migrations/dialects/postgresql/_options.py +60 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/migrations/dialects/sqlite/__init__.py +3 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/migrations/dialects/sqlite/_options.py +7 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/orm/__init__.py +31 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/orm/_column_type.py +45 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/orm/_discovery.py +33 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/orm/_model.py +55 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/orm/_native.py +41 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/orm/_options.py +33 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/orm/col.py +279 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/repos/__init__.py +17 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/repos/_base.py +34 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/repos/_id.py +84 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/repos/_model.py +54 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/repos/_query.py +8 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/repos/_returning.py +59 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/transactions/__init__.py +4 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/transactions/_atomic.py +43 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/transactions/_binding.py +35 -0
- papilio_db-6.0.0/papilio_db/sqlalchemy/transactions/_native.py +13 -0
- papilio_db-6.0.0/papilio_db/tools/__init__.py +0 -0
- papilio_db-6.0.0/papilio_db/tools/discovery.py +3 -0
- papilio_db-6.0.0/papilio_db/tools/exceptions.py +163 -0
- papilio_db-6.0.0/papilio_db/tortoise/__init__.py +3 -0
- papilio_db-6.0.0/papilio_db/tortoise/_internal/__init__.py +1 -0
- papilio_db-6.0.0/papilio_db/tortoise/_internal/_exceptions.py +132 -0
- papilio_db-6.0.0/papilio_db/tortoise/_internal/_native.py +23 -0
- papilio_db-6.0.0/papilio_db/tortoise/context/__init__.py +14 -0
- papilio_db-6.0.0/papilio_db/tortoise/context/_connection.py +11 -0
- papilio_db-6.0.0/papilio_db/tortoise/context/_lifecycle.py +33 -0
- papilio_db-6.0.0/papilio_db/tortoise/context/_native.py +37 -0
- papilio_db-6.0.0/papilio_db/tortoise/context/_probes.py +37 -0
- papilio_db-6.0.0/papilio_db/tortoise/dialects/__init__.py +1 -0
- papilio_db-6.0.0/papilio_db/tortoise/dialects/_native.py +37 -0
- papilio_db-6.0.0/papilio_db/tortoise/dialects/_returning.py +24 -0
- papilio_db-6.0.0/papilio_db/tortoise/dialects/mariadb/__init__.py +6 -0
- papilio_db-6.0.0/papilio_db/tortoise/dialects/mariadb/_queries.py +18 -0
- papilio_db-6.0.0/papilio_db/tortoise/dialects/mssql/__init__.py +4 -0
- papilio_db-6.0.0/papilio_db/tortoise/dialects/mysql/__init__.py +6 -0
- papilio_db-6.0.0/papilio_db/tortoise/dialects/mysql/_native.py +4 -0
- papilio_db-6.0.0/papilio_db/tortoise/dialects/mysql/_queries.py +11 -0
- papilio_db-6.0.0/papilio_db/tortoise/dialects/mysql/col.py +3 -0
- papilio_db-6.0.0/papilio_db/tortoise/dialects/oracle/__init__.py +5 -0
- papilio_db-6.0.0/papilio_db/tortoise/dialects/oracle/_migration.py +53 -0
- papilio_db-6.0.0/papilio_db/tortoise/dialects/oracle/_native.py +5 -0
- papilio_db-6.0.0/papilio_db/tortoise/dialects/postgresql/__init__.py +6 -0
- papilio_db-6.0.0/papilio_db/tortoise/dialects/postgresql/_native.py +4 -0
- papilio_db-6.0.0/papilio_db/tortoise/dialects/postgresql/col.py +4 -0
- papilio_db-6.0.0/papilio_db/tortoise/dialects/sqlite/__init__.py +5 -0
- papilio_db-6.0.0/papilio_db/tortoise/dishka/__init__.py +3 -0
- papilio_db-6.0.0/papilio_db/tortoise/dishka/_native.py +11 -0
- papilio_db-6.0.0/papilio_db/tortoise/dishka/_provider.py +16 -0
- papilio_db-6.0.0/papilio_db/tortoise/migrations/__init__.py +49 -0
- papilio_db-6.0.0/papilio_db/tortoise/migrations/_native.py +47 -0
- papilio_db-6.0.0/papilio_db/tortoise/orm/__init__.py +4 -0
- papilio_db-6.0.0/papilio_db/tortoise/orm/_native.py +6 -0
- papilio_db-6.0.0/papilio_db/tortoise/orm/col.py +42 -0
- papilio_db-6.0.0/papilio_db/tortoise/repos/__init__.py +6 -0
- papilio_db-6.0.0/papilio_db/tortoise/repos/_model.py +104 -0
- papilio_db-6.0.0/papilio_db/tortoise/repos/_native.py +22 -0
- papilio_db-6.0.0/papilio_db/tortoise/repos/_query.py +8 -0
- papilio_db-6.0.0/papilio_db/tortoise/transactions/__init__.py +3 -0
- papilio_db-6.0.0/papilio_db/tortoise/transactions/_atomic.py +44 -0
- papilio_db-6.0.0/papilio_db/tortoise/transactions/_native.py +5 -0
- papilio_db-6.0.0/pyproject.toml +91 -0
- papilio_db-6.0.0/scripts/release-notes.sh +28 -0
- papilio_db-6.0.0/tests/__init__.py +0 -0
- papilio_db-6.0.0/tests/integration/__init__.py +0 -0
- papilio_db-6.0.0/tests/integration/oxyde/__init__.py +0 -0
- papilio_db-6.0.0/tests/integration/oxyde/conftest.py +15 -0
- papilio_db-6.0.0/tests/integration/oxyde/test_dishka.py +24 -0
- papilio_db-6.0.0/tests/integration/oxyde/test_migrations.py +107 -0
- papilio_db-6.0.0/tests/integration/oxyde/test_orm.py +147 -0
- papilio_db-6.0.0/tests/integration/oxyde/test_pool.py +108 -0
- papilio_db-6.0.0/tests/integration/sqlalchemy/__init__.py +0 -0
- papilio_db-6.0.0/tests/integration/sqlalchemy/permuteseq.Dockerfile +17 -0
- papilio_db-6.0.0/tests/integration/sqlalchemy/run_live_migrations.sh +107 -0
- papilio_db-6.0.0/tests/integration/sqlalchemy/test_discovery.py +72 -0
- papilio_db-6.0.0/tests/integration/sqlalchemy/test_dishka.py +78 -0
- papilio_db-6.0.0/tests/integration/sqlalchemy/test_engine.py +77 -0
- papilio_db-6.0.0/tests/integration/sqlalchemy/test_exceptions.py +137 -0
- papilio_db-6.0.0/tests/integration/sqlalchemy/test_ext.py +105 -0
- papilio_db-6.0.0/tests/integration/sqlalchemy/test_migrations.py +366 -0
- papilio_db-6.0.0/tests/integration/sqlalchemy/test_orm.py +296 -0
- papilio_db-6.0.0/tests/integration/sqlalchemy/test_relationships.py +132 -0
- papilio_db-6.0.0/tests/integration/sqlalchemy/test_repos.py +126 -0
- papilio_db-6.0.0/tests/integration/sqlalchemy/test_session.py +146 -0
- papilio_db-6.0.0/tests/integration/sqlalchemy/test_transactions.py +271 -0
- papilio_db-6.0.0/tests/integration/tortoise/__init__.py +0 -0
- papilio_db-6.0.0/tests/integration/tortoise/conftest.py +20 -0
- papilio_db-6.0.0/tests/integration/tortoise/run_live.sh +87 -0
- papilio_db-6.0.0/tests/integration/tortoise/test_context.py +188 -0
- papilio_db-6.0.0/tests/integration/tortoise/test_dialects.py +91 -0
- papilio_db-6.0.0/tests/integration/tortoise/test_dishka.py +34 -0
- papilio_db-6.0.0/tests/integration/tortoise/test_migrations.py +122 -0
- papilio_db-6.0.0/tests/integration/tortoise/test_repos.py +132 -0
- papilio_db-6.0.0/tests/integration/tortoise/test_transactions.py +83 -0
- papilio_db-6.0.0/tests/packaging/__init__.py +0 -0
- papilio_db-6.0.0/tests/packaging/test_installed_package.py +30 -0
- papilio_db-6.0.0/tests/packaging/test_release_metadata.py +13 -0
- papilio_db-6.0.0/tests/unit/__init__.py +0 -0
- papilio_db-6.0.0/tests/unit/test_discovery.py +58 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
live:
|
|
9
|
+
description: Run every live database job
|
|
10
|
+
type: boolean
|
|
11
|
+
default: false
|
|
12
|
+
publish:
|
|
13
|
+
description: Publish the verified tag to PyPI and GitHub Releases
|
|
14
|
+
type: boolean
|
|
15
|
+
default: false
|
|
16
|
+
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
|
|
20
|
+
concurrency:
|
|
21
|
+
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.publish && 'publish' || 'verify' }}
|
|
22
|
+
cancel-in-progress: ${{ !inputs.publish }}
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
package:
|
|
26
|
+
name: Build and verify distributions
|
|
27
|
+
runs-on: ubuntu-24.04
|
|
28
|
+
timeout-minutes: 10
|
|
29
|
+
steps:
|
|
30
|
+
- name: Require a tag when publishing
|
|
31
|
+
if: inputs.publish && github.ref_type != 'tag'
|
|
32
|
+
run: |
|
|
33
|
+
echo '::error::Select a version tag to publish.'
|
|
34
|
+
exit 1
|
|
35
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
|
36
|
+
with:
|
|
37
|
+
persist-credentials: false
|
|
38
|
+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
|
|
39
|
+
with:
|
|
40
|
+
python-version: '3.13'
|
|
41
|
+
cache: pip
|
|
42
|
+
cache-dependency-path: pyproject.toml
|
|
43
|
+
- name: Build the wheel and source distribution
|
|
44
|
+
run: |
|
|
45
|
+
python -m pip install --upgrade 'pip>=25.1'
|
|
46
|
+
python -m pip install --group build
|
|
47
|
+
python -m build
|
|
48
|
+
python -m twine check --strict dist/*
|
|
49
|
+
- name: Check tagged release notes from the source distribution
|
|
50
|
+
if: github.ref_type == 'tag'
|
|
51
|
+
run: bash scripts/release-notes.sh "$GITHUB_REF_NAME" > release-notes.md
|
|
52
|
+
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
|
|
53
|
+
if: github.ref_type == 'tag'
|
|
54
|
+
with:
|
|
55
|
+
name: release-notes
|
|
56
|
+
path: release-notes.md
|
|
57
|
+
if-no-files-found: error
|
|
58
|
+
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
|
|
59
|
+
with:
|
|
60
|
+
name: distributions
|
|
61
|
+
path: dist/
|
|
62
|
+
if-no-files-found: error
|
|
63
|
+
|
|
64
|
+
quality:
|
|
65
|
+
name: Style and types
|
|
66
|
+
runs-on: ubuntu-24.04
|
|
67
|
+
timeout-minutes: 10
|
|
68
|
+
steps:
|
|
69
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
|
70
|
+
with:
|
|
71
|
+
persist-credentials: false
|
|
72
|
+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
|
|
73
|
+
with:
|
|
74
|
+
python-version: '3.13'
|
|
75
|
+
cache: pip
|
|
76
|
+
cache-dependency-path: pyproject.toml
|
|
77
|
+
- name: Check style and types
|
|
78
|
+
run: |
|
|
79
|
+
python -m pip install --upgrade 'pip>=25.1'
|
|
80
|
+
python -m pip install --group dev
|
|
81
|
+
python -m ruff check .
|
|
82
|
+
python -m ruff format --check .
|
|
83
|
+
python -m pyright
|
|
84
|
+
|
|
85
|
+
installed-package:
|
|
86
|
+
name: ${{ matrix.profile }} on Python ${{ matrix.python-version }}
|
|
87
|
+
needs: package
|
|
88
|
+
runs-on: ubuntu-24.04
|
|
89
|
+
timeout-minutes: 15
|
|
90
|
+
strategy:
|
|
91
|
+
fail-fast: false
|
|
92
|
+
matrix:
|
|
93
|
+
python-version: ['3.13', '3.14']
|
|
94
|
+
profile: [base, full]
|
|
95
|
+
include:
|
|
96
|
+
- python-version: '3.13'
|
|
97
|
+
profile: sqlalchemy
|
|
98
|
+
module: papilio_db.sqlalchemy
|
|
99
|
+
- python-version: '3.13'
|
|
100
|
+
profile: sqlalchemy-alembic
|
|
101
|
+
module: papilio_db.sqlalchemy.migrations
|
|
102
|
+
- python-version: '3.13'
|
|
103
|
+
profile: sqlalchemy-dishka
|
|
104
|
+
module: papilio_db.sqlalchemy.dishka
|
|
105
|
+
- python-version: '3.13'
|
|
106
|
+
profile: sqlalchemy-geo
|
|
107
|
+
module: papilio_db.sqlalchemy.dialects.postgresql.geo
|
|
108
|
+
- python-version: '3.13'
|
|
109
|
+
profile: sqlalchemy-pgvector
|
|
110
|
+
module: papilio_db.sqlalchemy.dialects.postgresql.vector
|
|
111
|
+
- python-version: '3.13'
|
|
112
|
+
profile: tortoise
|
|
113
|
+
module: papilio_db.tortoise
|
|
114
|
+
- python-version: '3.13'
|
|
115
|
+
profile: tortoise-dishka
|
|
116
|
+
module: papilio_db.tortoise.dishka
|
|
117
|
+
- python-version: '3.13'
|
|
118
|
+
profile: oxyde
|
|
119
|
+
module: papilio_db.oxyde
|
|
120
|
+
- python-version: '3.13'
|
|
121
|
+
profile: oxyde-dishka
|
|
122
|
+
module: papilio_db.oxyde.dishka
|
|
123
|
+
steps:
|
|
124
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
|
125
|
+
with:
|
|
126
|
+
persist-credentials: false
|
|
127
|
+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
|
|
128
|
+
with:
|
|
129
|
+
python-version: ${{ matrix.python-version }}
|
|
130
|
+
cache: pip
|
|
131
|
+
cache-dependency-path: pyproject.toml
|
|
132
|
+
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
|
|
133
|
+
with:
|
|
134
|
+
name: distributions
|
|
135
|
+
path: ${{ runner.temp }}/dist
|
|
136
|
+
- name: Verify the installed wheel outside the checkout
|
|
137
|
+
working-directory: ${{ runner.temp }}
|
|
138
|
+
env:
|
|
139
|
+
PROFILE: ${{ matrix.profile }}
|
|
140
|
+
PROFILE_MODULE: ${{ matrix.module }}
|
|
141
|
+
run: |
|
|
142
|
+
wheels=(dist/*.whl)
|
|
143
|
+
tests=("$GITHUB_WORKSPACE/tests/packaging")
|
|
144
|
+
package="${wheels[0]}"
|
|
145
|
+
drivers=()
|
|
146
|
+
case "$PROFILE" in
|
|
147
|
+
base) ;;
|
|
148
|
+
full)
|
|
149
|
+
package="$package[sqlalchemy-alembic,sqlalchemy-dishka,sqlalchemy-geo,sqlalchemy-pgvector,tortoise-dishka,oxyde-dishka]"
|
|
150
|
+
drivers=('aiosqlite>=0.20,<1')
|
|
151
|
+
tests=("$GITHUB_WORKSPACE/tests")
|
|
152
|
+
;;
|
|
153
|
+
*) package="$package[$PROFILE]" ;;
|
|
154
|
+
esac
|
|
155
|
+
python -m pip install "$package" 'pytest>=9,<10' "${drivers[@]}"
|
|
156
|
+
python -m pip check
|
|
157
|
+
if [[ -n "$PROFILE_MODULE" ]]; then
|
|
158
|
+
python -I -c 'from importlib import import_module; from sys import argv; import_module(argv[1])' "$PROFILE_MODULE"
|
|
159
|
+
fi
|
|
160
|
+
python -I -m pytest --import-mode=importlib "${tests[@]}"
|
|
161
|
+
|
|
162
|
+
oxyde-live:
|
|
163
|
+
name: Oxyde on live databases
|
|
164
|
+
needs: package
|
|
165
|
+
runs-on: ubuntu-24.04
|
|
166
|
+
timeout-minutes: 10
|
|
167
|
+
services:
|
|
168
|
+
postgres:
|
|
169
|
+
image: postgres:17-bookworm
|
|
170
|
+
env:
|
|
171
|
+
POSTGRES_USER: papilio
|
|
172
|
+
POSTGRES_PASSWORD: papilio-test
|
|
173
|
+
POSTGRES_DB: papilio
|
|
174
|
+
ports:
|
|
175
|
+
- 5432/tcp
|
|
176
|
+
options: >-
|
|
177
|
+
--health-cmd "pg_isready -h 127.0.0.1 -U papilio -d papilio"
|
|
178
|
+
--health-interval 2s --health-timeout 2s --health-retries 30
|
|
179
|
+
mysql:
|
|
180
|
+
image: mysql:8.4
|
|
181
|
+
env:
|
|
182
|
+
MYSQL_ROOT_PASSWORD: papilio-root
|
|
183
|
+
MYSQL_USER: papilio
|
|
184
|
+
MYSQL_PASSWORD: papilio-test
|
|
185
|
+
MYSQL_DATABASE: papilio
|
|
186
|
+
ports:
|
|
187
|
+
- 3306/tcp
|
|
188
|
+
options: >-
|
|
189
|
+
--health-cmd "mysql --protocol=tcp -h 127.0.0.1 -upapilio -ppapilio-test papilio -e 'SELECT 1'"
|
|
190
|
+
--health-interval 2s --health-timeout 2s --health-retries 30
|
|
191
|
+
steps:
|
|
192
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
|
193
|
+
with:
|
|
194
|
+
persist-credentials: false
|
|
195
|
+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
|
|
196
|
+
with:
|
|
197
|
+
python-version: '3.13'
|
|
198
|
+
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
|
|
199
|
+
with:
|
|
200
|
+
name: distributions
|
|
201
|
+
path: ${{ runner.temp }}/dist
|
|
202
|
+
- name: Verify queries, transactions, and migrations from the wheel
|
|
203
|
+
working-directory: ${{ runner.temp }}
|
|
204
|
+
env:
|
|
205
|
+
PAPILIO_TEST_OXYDE_POSTGRESQL_URL: postgresql://papilio:papilio-test@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/papilio
|
|
206
|
+
PAPILIO_TEST_OXYDE_MYSQL_URL: mysql://papilio:papilio-test@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/papilio
|
|
207
|
+
run: |
|
|
208
|
+
wheels=(dist/*.whl)
|
|
209
|
+
python -m pip install "${wheels[0]}[oxyde-dishka]" 'pytest>=9,<10'
|
|
210
|
+
python -I -m pytest --import-mode=importlib "$GITHUB_WORKSPACE/tests/integration/oxyde"
|
|
211
|
+
|
|
212
|
+
sqlalchemy-live:
|
|
213
|
+
if: github.ref_type == 'tag' || inputs.live
|
|
214
|
+
needs: package
|
|
215
|
+
uses: ./.github/workflows/sqlalchemy-live.yml
|
|
216
|
+
with:
|
|
217
|
+
distributions: distributions
|
|
218
|
+
|
|
219
|
+
tortoise-live:
|
|
220
|
+
if: github.ref_type == 'tag' || inputs.live
|
|
221
|
+
needs: package
|
|
222
|
+
uses: ./.github/workflows/tortoise-live.yml
|
|
223
|
+
with:
|
|
224
|
+
distributions: distributions
|
|
225
|
+
|
|
226
|
+
publish-package:
|
|
227
|
+
name: Publish to PyPI
|
|
228
|
+
if: github.event_name == 'workflow_dispatch' && github.ref_type == 'tag' && inputs.publish
|
|
229
|
+
needs: [quality, installed-package, oxyde-live, sqlalchemy-live, tortoise-live]
|
|
230
|
+
runs-on: ubuntu-24.04
|
|
231
|
+
timeout-minutes: 10
|
|
232
|
+
environment:
|
|
233
|
+
name: pypi
|
|
234
|
+
url: https://pypi.org/project/papilio-db/
|
|
235
|
+
permissions:
|
|
236
|
+
id-token: write
|
|
237
|
+
steps:
|
|
238
|
+
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
|
|
239
|
+
with:
|
|
240
|
+
name: distributions
|
|
241
|
+
path: dist/
|
|
242
|
+
- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # release/v1
|
|
243
|
+
|
|
244
|
+
github-release:
|
|
245
|
+
name: Create GitHub release
|
|
246
|
+
needs: publish-package
|
|
247
|
+
runs-on: ubuntu-24.04
|
|
248
|
+
timeout-minutes: 10
|
|
249
|
+
permissions:
|
|
250
|
+
contents: write
|
|
251
|
+
steps:
|
|
252
|
+
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
|
|
253
|
+
with:
|
|
254
|
+
name: distributions
|
|
255
|
+
path: dist/
|
|
256
|
+
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
|
|
257
|
+
with:
|
|
258
|
+
name: release-notes
|
|
259
|
+
- name: Publish release notes and distributions
|
|
260
|
+
env:
|
|
261
|
+
GH_TOKEN: ${{ github.token }}
|
|
262
|
+
run: |
|
|
263
|
+
flags=()
|
|
264
|
+
if [[ "$GITHUB_REF_NAME" =~ (a|b|rc|\.dev)[0-9]+ ]]; then
|
|
265
|
+
flags+=(--prerelease)
|
|
266
|
+
fi
|
|
267
|
+
gh release create "$GITHUB_REF_NAME" dist/* --repo "$GITHUB_REPOSITORY" \
|
|
268
|
+
--verify-tag --title "$GITHUB_REF_NAME" --notes-file release-notes.md "${flags[@]}"
|
|
269
|
+
|
|
270
|
+
notify-release:
|
|
271
|
+
name: Announce the release on Telegram
|
|
272
|
+
needs: github-release
|
|
273
|
+
runs-on: ubuntu-24.04
|
|
274
|
+
timeout-minutes: 10
|
|
275
|
+
steps:
|
|
276
|
+
- name: Require the release channel
|
|
277
|
+
env:
|
|
278
|
+
TELEGRAM_CHANNEL: ${{ vars.TELEGRAM_CHANNEL }}
|
|
279
|
+
run: test -n "$TELEGRAM_CHANNEL"
|
|
280
|
+
- uses: amupouya/papilio-relay@fbd9c6fabd7ddfabe0fcd93158a1e2480f57a961
|
|
281
|
+
with:
|
|
282
|
+
release-tag: ${{ github.ref_name }}
|
|
283
|
+
bot-token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
|
|
284
|
+
channel: ${{ vars.TELEGRAM_CHANNEL }}
|
|
285
|
+
projects: ${{ vars.PAPILIO_RELAY_PROJECTS }}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
name: SQLAlchemy live migrations
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
workflow_call:
|
|
6
|
+
inputs:
|
|
7
|
+
distributions:
|
|
8
|
+
description: Distributions artifact built by CI
|
|
9
|
+
type: string
|
|
10
|
+
required: true
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
migrations:
|
|
17
|
+
name: ${{ matrix.target }} migrations
|
|
18
|
+
runs-on: ubuntu-24.04
|
|
19
|
+
timeout-minutes: 20
|
|
20
|
+
strategy:
|
|
21
|
+
fail-fast: false
|
|
22
|
+
matrix:
|
|
23
|
+
include:
|
|
24
|
+
- target: sqlite
|
|
25
|
+
driver: aiosqlite
|
|
26
|
+
- target: postgresql
|
|
27
|
+
driver: asyncpg
|
|
28
|
+
- target: mysql
|
|
29
|
+
driver: asyncmy
|
|
30
|
+
- target: mariadb
|
|
31
|
+
driver: asyncmy
|
|
32
|
+
- target: mssql
|
|
33
|
+
driver: aioodbc
|
|
34
|
+
- target: oracle
|
|
35
|
+
driver: oracledb
|
|
36
|
+
- target: vector
|
|
37
|
+
driver: asyncpg
|
|
38
|
+
- target: postgis
|
|
39
|
+
driver: asyncpg
|
|
40
|
+
- target: permuteseq
|
|
41
|
+
driver: asyncpg
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
|
44
|
+
with:
|
|
45
|
+
persist-credentials: false
|
|
46
|
+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
|
|
47
|
+
with:
|
|
48
|
+
python-version: '3.13'
|
|
49
|
+
- name: Install SQL Server ODBC driver
|
|
50
|
+
if: matrix.target == 'mssql'
|
|
51
|
+
run: |
|
|
52
|
+
if ! odbcinst -q -d -n 'ODBC Driver 18 for SQL Server'; then
|
|
53
|
+
package="$RUNNER_TEMP/packages-microsoft-prod.deb"
|
|
54
|
+
curl --fail --silent --show-error --location \
|
|
55
|
+
https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb \
|
|
56
|
+
--output "$package"
|
|
57
|
+
sudo dpkg -i "$package"
|
|
58
|
+
sudo apt-get update
|
|
59
|
+
sudo env ACCEPT_EULA=Y apt-get install -y --no-install-recommends msodbcsql18
|
|
60
|
+
fi
|
|
61
|
+
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
|
|
62
|
+
if: inputs.distributions != ''
|
|
63
|
+
with:
|
|
64
|
+
name: ${{ inputs.distributions }}
|
|
65
|
+
path: ${{ runner.temp }}/wheels
|
|
66
|
+
- name: Build the wheel for a standalone run
|
|
67
|
+
if: inputs.distributions == ''
|
|
68
|
+
run: |
|
|
69
|
+
python -m pip install 'build>=1.2,<2'
|
|
70
|
+
python -m build --wheel --outdir "$RUNNER_TEMP/wheels"
|
|
71
|
+
- name: Install the wheel and async driver
|
|
72
|
+
env:
|
|
73
|
+
DB_DRIVER: ${{ matrix.driver }}
|
|
74
|
+
run: |
|
|
75
|
+
wheels=("$RUNNER_TEMP"/wheels/*.whl)
|
|
76
|
+
python -m pip install \
|
|
77
|
+
"${wheels[0]}[sqlalchemy-alembic,sqlalchemy-geo,sqlalchemy-pgvector]" \
|
|
78
|
+
'pytest>=9,<10' "$DB_DRIVER"
|
|
79
|
+
- name: Apply generated migrations to a disposable database
|
|
80
|
+
env:
|
|
81
|
+
DB_TARGET: ${{ matrix.target }}
|
|
82
|
+
run: bash tests/integration/sqlalchemy/run_live_migrations.sh "$DB_TARGET"
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
name: Tortoise live databases
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
workflow_call:
|
|
6
|
+
inputs:
|
|
7
|
+
distributions:
|
|
8
|
+
description: Distributions artifact built by CI
|
|
9
|
+
type: string
|
|
10
|
+
required: true
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
databases:
|
|
17
|
+
name: ${{ matrix.backend }} Tortoise
|
|
18
|
+
runs-on: ubuntu-24.04
|
|
19
|
+
timeout-minutes: 20
|
|
20
|
+
strategy:
|
|
21
|
+
fail-fast: false
|
|
22
|
+
matrix:
|
|
23
|
+
include:
|
|
24
|
+
- backend: sqlite
|
|
25
|
+
driver: aiosqlite
|
|
26
|
+
- backend: postgresql
|
|
27
|
+
driver: asyncpg
|
|
28
|
+
- backend: mysql
|
|
29
|
+
driver: asyncmy
|
|
30
|
+
- backend: mariadb
|
|
31
|
+
driver: asyncmy
|
|
32
|
+
- backend: mssql
|
|
33
|
+
driver: 'asyncodbc>=0.1.1,<1'
|
|
34
|
+
- backend: oracle
|
|
35
|
+
driver: 'asyncodbc>=0.1.1,<1'
|
|
36
|
+
steps:
|
|
37
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
|
38
|
+
with:
|
|
39
|
+
persist-credentials: false
|
|
40
|
+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
|
|
41
|
+
with:
|
|
42
|
+
python-version: '3.13'
|
|
43
|
+
- name: Install SQL Server ODBC driver
|
|
44
|
+
if: matrix.backend == 'mssql'
|
|
45
|
+
run: |
|
|
46
|
+
if ! odbcinst -q -d -n 'ODBC Driver 18 for SQL Server'; then
|
|
47
|
+
package="$RUNNER_TEMP/packages-microsoft-prod.deb"
|
|
48
|
+
curl --fail --silent --show-error --location \
|
|
49
|
+
https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb \
|
|
50
|
+
--output "$package"
|
|
51
|
+
sudo dpkg -i "$package"
|
|
52
|
+
sudo apt-get update
|
|
53
|
+
sudo env ACCEPT_EULA=Y apt-get install -y --no-install-recommends msodbcsql18
|
|
54
|
+
fi
|
|
55
|
+
- name: Install Oracle Instant Client and ODBC driver
|
|
56
|
+
if: matrix.backend == 'oracle'
|
|
57
|
+
run: |
|
|
58
|
+
sudo apt-get update
|
|
59
|
+
sudo apt-get install -y --no-install-recommends libodbc2 libodbcinst2 libaio1t64
|
|
60
|
+
cd "$RUNNER_TEMP"
|
|
61
|
+
url=https://download.oracle.com/otn_software/linux/instantclient/1927000
|
|
62
|
+
curl --fail --silent --show-error --location --retry 3 \
|
|
63
|
+
"$url/instantclient-basiclite-linux.x64-19.27.0.0.0dbru.zip" --output basic.zip
|
|
64
|
+
curl --fail --silent --show-error --location --retry 3 \
|
|
65
|
+
"$url/instantclient-odbc-linux.x64-19.27.0.0.0dbru.zip" --output odbc.zip
|
|
66
|
+
sha256sum --check <<'HASHES'
|
|
67
|
+
d3afba50f0bd272f86c09befa450fcc4426d1c3f88fa70c9a30a233df942ea11 basic.zip
|
|
68
|
+
49d26cc183f12d8f8e9f1c936f6250c4800f12eb28d61d756b0a6809ac484a50 odbc.zip
|
|
69
|
+
HASHES
|
|
70
|
+
unzip -oq basic.zip
|
|
71
|
+
unzip -oq odbc.zip
|
|
72
|
+
client="$RUNNER_TEMP/instantclient_19_27"
|
|
73
|
+
ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 "$client/libaio.so.1"
|
|
74
|
+
printf '[Oracle Instant Client]\nDriver=%s/libsqora.so.19.1\n' "$client" > odbcinst.ini
|
|
75
|
+
{
|
|
76
|
+
printf 'TORTOISE_ORACLE_ODBC_DRIVER=Oracle Instant Client\n'
|
|
77
|
+
printf 'ODBCSYSINI=%s\n' "$RUNNER_TEMP"
|
|
78
|
+
printf 'LD_LIBRARY_PATH=%s\n' "$client"
|
|
79
|
+
} >> "$GITHUB_ENV"
|
|
80
|
+
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
|
|
81
|
+
if: inputs.distributions != ''
|
|
82
|
+
with:
|
|
83
|
+
name: ${{ inputs.distributions }}
|
|
84
|
+
path: ${{ runner.temp }}/wheels
|
|
85
|
+
- name: Build the wheel for a standalone run
|
|
86
|
+
if: inputs.distributions == ''
|
|
87
|
+
run: |
|
|
88
|
+
python -m pip install 'build>=1.2,<2'
|
|
89
|
+
python -m build --wheel --outdir "$RUNNER_TEMP/wheels"
|
|
90
|
+
- name: Install the wheel and async driver
|
|
91
|
+
env:
|
|
92
|
+
DB_DRIVER: ${{ matrix.driver }}
|
|
93
|
+
run: |
|
|
94
|
+
wheels=("$RUNNER_TEMP"/wheels/*.whl)
|
|
95
|
+
python -m pip install "${wheels[0]}[tortoise-dishka]" 'pytest>=9,<10' "$DB_DRIVER"
|
|
96
|
+
- name: Run repositories, transactions, and migrations
|
|
97
|
+
env:
|
|
98
|
+
DB_BACKEND: ${{ matrix.backend }}
|
|
99
|
+
run: |
|
|
100
|
+
cd "$RUNNER_TEMP"
|
|
101
|
+
bash "$GITHUB_WORKSPACE/tests/integration/tortoise/run_live.sh" "$DB_BACKEND"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Papilio DB capabilities
|
|
2
|
+
|
|
3
|
+
Papilio DB covers relational database access for modular Python applications.
|
|
4
|
+
SQLAlchemy is the first integration. Applications choose the backend, driver,
|
|
5
|
+
model fields, and transaction boundaries.
|
|
6
|
+
|
|
7
|
+
| Area | Available in the SQLAlchemy integration |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Engines and pools | Create or reuse a native engine, configure pools, and dispose resources the application owns. |
|
|
10
|
+
| Sessions and transactions | Use native async sessions, shared atomic blocks, and explicit savepoints. |
|
|
11
|
+
| Models and schema | Declare typed common or dialect-specific columns, foreign keys, relationships, and loader options. |
|
|
12
|
+
| Statements and repositories | Run native statements, use model-based writes and typed reads, and compose single-row and batch operations through a caller-owned session. |
|
|
13
|
+
| Dialect helpers | Use database-specific column types and statement builders. PostgreSQL and SQLite repositories can return affected models. |
|
|
14
|
+
| Migrations | Use Alembic commands with async drivers and generate PostgreSQL extension prerequisites. [Migration guide](docs/migrations.md) |
|
|
15
|
+
| Optional integrations | Use Dishka providers, spatial columns, or PostgreSQL vector columns through the corresponding extra. |
|
|
16
|
+
|
|
17
|
+
Tortoise is available through an independent extra. Use native typed models,
|
|
18
|
+
querysets and repositories on an application-owned context. The integration
|
|
19
|
+
also offers transaction joining, optional Dishka injection, structured
|
|
20
|
+
database errors, and native migration tooling. [Tortoise guide](docs/tortoise.md)
|
|
21
|
+
|
|
22
|
+
The experimental Oxyde integration provides native typed models and queries, application-owned named pools,
|
|
23
|
+
atomic blocks, and migrations on PostgreSQL, SQLite, and MySQL. Install its
|
|
24
|
+
Dishka provider separately. [Oxyde guide](docs/oxyde.md)
|
|
25
|
+
|
|
26
|
+
[Installation and quickstart](docs/README.md)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 6.0.0
|
|
4
|
+
|
|
5
|
+
This is the first standalone release of Papilio DB. Install `papilio-db`
|
|
6
|
+
with your integration extra and import it as `papilio_db`.
|
|
7
|
+
|
|
8
|
+
- Package the relational database integration independently as `papilio-db`,
|
|
9
|
+
with typed public imports under `papilio_db`.
|
|
10
|
+
- Include SQLAlchemy engines, sessions, transactions, typed models and
|
|
11
|
+
relationships, and repository helpers, with optional Dishka, spatial,
|
|
12
|
+
and PostgreSQL vector integrations.
|
|
13
|
+
- Use PascalCase for common and dialect column types, including `Json`,
|
|
14
|
+
`Jsonb`, and `VarChar`. Use a `Sql` prefix for exact SQL types that share
|
|
15
|
+
a name with a generic column helper, such as `SqlChar` and `SqlUuid`.
|
|
16
|
+
- Add async Alembic migrations with the `papilio-alembic` command and optional
|
|
17
|
+
SQLAlchemy model discovery from Python modules, packages, files, or directories.
|
|
18
|
+
- Add Tortoise models, native queries, repositories, transactions, migrations,
|
|
19
|
+
and optional Dishka on six database engines.
|
|
20
|
+
- Add experimental Oxyde support for PostgreSQL, SQLite, and MySQL with named
|
|
21
|
+
pools, native models and queries, transaction joining, and Dishka. See
|
|
22
|
+
the [guide](https://github.com/amupouya/papilio-db/blob/v6.0.0/docs/oxyde.md)
|
|
23
|
+
for known upstream write and migration limitations.
|
|
24
|
+
- Add a learning guide, executable examples, and live database checks for
|
|
25
|
+
tagged releases.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Contributing to Papilio DB
|
|
2
|
+
|
|
3
|
+
Pick a capability and agree on the caller, public imports, resource ownership
|
|
4
|
+
and acceptance checks before implementing it. The [capability inventory](CAPABILITIES.md)
|
|
5
|
+
lists the scope of the rebuild.
|
|
6
|
+
|
|
7
|
+
Use a virtual environment with Python 3.13 or later and pip 25.1 or later.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
python -m pip install --group dev -e .
|
|
11
|
+
python -m ruff check .
|
|
12
|
+
python -m ruff format --check .
|
|
13
|
+
python -m pyright
|
|
14
|
+
python -m pytest
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Match test paths to the capability under test. Use `tests/unit` for isolated
|
|
18
|
+
behavior, `tests/integration` for real services and resources, and
|
|
19
|
+
`tests/packaging` for distributions and public imports. Include `__init__.py`
|
|
20
|
+
in test packages. Document each capability when its public example passes from
|
|
21
|
+
an installed wheel.
|
|
22
|
+
|
|
23
|
+
## Build and check the package
|
|
24
|
+
|
|
25
|
+
Run the distribution checks from the repository root.
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
python -m build
|
|
29
|
+
python -m twine check --strict dist/*
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The [CI workflow](.github/workflows/ci.yml) tests the installed wheel on
|
|
33
|
+
Python 3.13 and 3.14. Packaging tests check public imports and the typing marker
|
|
34
|
+
in an isolated process.
|
|
35
|
+
|
|
36
|
+
Run the [SQLAlchemy live migrations workflow](.github/workflows/sqlalchemy-live.yml)
|
|
37
|
+
manually to exercise generated revisions on the six database engines and the
|
|
38
|
+
pgvector, PostGIS, and permuteseq PostgreSQL images. The same runner works
|
|
39
|
+
locally with Docker and the database's async driver installed.
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
python -m pip install '.[sqlalchemy-alembic,sqlalchemy-geo,sqlalchemy-pgvector]' pytest asyncpg
|
|
43
|
+
bash tests/integration/sqlalchemy/run_live_migrations.sh postgresql
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The runner starts and removes its own container. For `mssql`, install the
|
|
47
|
+
Microsoft ODBC Driver 18 and `aioodbc` on the host. For `permuteseq`, the
|
|
48
|
+
runner builds the extension image from the pinned PGXN archive.
|
|
49
|
+
|
|
50
|
+
Run the [Tortoise live workflow](.github/workflows/tortoise-live.yml) for the
|
|
51
|
+
six native Tortoise backends. Its local runner uses a disposable database for
|
|
52
|
+
each invocation.
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
python -m pip install '.[tortoise-dishka]' pytest asyncpg
|
|
56
|
+
bash tests/integration/tortoise/run_live.sh postgresql
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Install `asyncmy` for MySQL or MariaDB, or `asyncodbc` and the matching system
|
|
60
|
+
ODBC driver for SQL Server and Oracle. Set `TORTOISE_ORACLE_ODBC_DRIVER` to the
|
|
61
|
+
registered Oracle driver name. The SQL Server runner defaults to Microsoft
|
|
62
|
+
ODBC Driver 18.
|
|
63
|
+
|
|
64
|
+
Oxyde tests run against an isolated SQLite file by default. To include
|
|
65
|
+
PostgreSQL and MySQL, point the test suite at disposable databases.
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
export PAPILIO_TEST_OXYDE_POSTGRESQL_URL='postgresql://user:password@localhost/papilio_test'
|
|
69
|
+
export PAPILIO_TEST_OXYDE_MYSQL_URL='mysql://user:password@localhost/papilio_test'
|
|
70
|
+
python -m pytest tests/integration/oxyde
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The package version comes from `pyproject.toml`. When it changes, update both
|
|
74
|
+
READMEs and the changelog.
|
|
75
|
+
|
|
76
|
+
## Release a verified tag
|
|
77
|
+
|
|
78
|
+
The [CI workflow](.github/workflows/ci.yml) builds the wheel and source
|
|
79
|
+
distribution once. It checks the base package, each extra on its own, and
|
|
80
|
+
the combined installation outside the checkout. PostgreSQL and MySQL run as
|
|
81
|
+
live services for the Oxyde suite. The SQLAlchemy and Tortoise live matrices
|
|
82
|
+
run on tags and when **Run every live database job** is selected in CI.
|
|
83
|
+
|
|
84
|
+
1. Prepare the approved version in `pyproject.toml`, both READMEs, and
|
|
85
|
+
`CHANGELOG.md`. Push and verify the release commit, then push its matching
|
|
86
|
+
version tag. Tag CI checks the changelog packaged in the source distribution
|
|
87
|
+
and runs the full live matrices against the wheel built in the same run.
|
|
88
|
+
2. Before the first upload, create the `pypi` GitHub environment and configure
|
|
89
|
+
a pending PyPI Trusted Publisher for project `papilio-db`, owner
|
|
90
|
+
`amupouya`, repository `papilio-db`, workflow `ci.yml`, and environment
|
|
91
|
+
`pypi`. [PyPI setup](https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/)
|
|
92
|
+
3. Configure `TELEGRAM_CHANNEL` as `@papilio_framework` and set
|
|
93
|
+
`TELEGRAM_BOT_TOKEN` for Papilio Relay. If an announcement project
|
|
94
|
+
map is configured in `PAPILIO_RELAY_PROJECTS`, include
|
|
95
|
+
`amupouya/papilio-db` in it.
|
|
96
|
+
4. After tag CI passes, select that tag in **Actions → CI → Run workflow**
|
|
97
|
+
and enable **Publish**. The workflow verifies the distributions, uploads
|
|
98
|
+
them to PyPI, creates the GitHub release, then announces it on Telegram.
|
|
99
|
+
5. Install the published package from PyPI in a fresh environment and run
|
|
100
|
+
the [quickstart](docs/README.md).
|
|
101
|
+
|
|
102
|
+
If GitHub Releases or Telegram fails after the PyPI upload, rerun the failed
|
|
103
|
+
jobs in that workflow run so they reuse the verified artifacts.
|
papilio_db-6.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 عمو پویا
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|