pum 0.10.0__tar.gz → 1.1.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.
- pum-1.1.0/.ci/setup_db.sh +17 -0
- pum-1.1.0/.github/dependabot.yml +20 -0
- pum-1.1.0/.github/workflows/deploy-to-pypi.yml +41 -0
- pum-1.1.0/.github/workflows/docs.yml +65 -0
- pum-1.1.0/.github/workflows/tests.yml +72 -0
- pum-1.1.0/.github/workflows/wheel.yml +42 -0
- pum-1.1.0/.github/workflows/windows-tests.yml +71 -0
- pum-1.1.0/.gitignore +13 -0
- pum-1.1.0/.pre-commit-config.yaml +39 -0
- pum-1.1.0/LICENSE +339 -0
- pum-1.1.0/PKG-INFO +61 -0
- pum-1.1.0/README.md +25 -0
- pum-1.1.0/docs/docs/api/api.md +11 -0
- pum-1.1.0/docs/docs/api/changelog.md +1 -0
- pum-1.1.0/docs/docs/api/dump_format.md +1 -0
- pum-1.1.0/docs/docs/api/dumper.md +1 -0
- pum-1.1.0/docs/docs/api/exceptions.md +2 -0
- pum-1.1.0/docs/docs/api/hook_base.md +2 -0
- pum-1.1.0/docs/docs/api/hook_handler.md +2 -0
- pum-1.1.0/docs/docs/api/parameter_definition.md +1 -0
- pum-1.1.0/docs/docs/api/parameter_type.md +1 -0
- pum-1.1.0/docs/docs/api/permission.md +1 -0
- pum-1.1.0/docs/docs/api/permission_type.md +1 -0
- pum-1.1.0/docs/docs/api/pum_config.md +1 -0
- pum-1.1.0/docs/docs/api/role.md +1 -0
- pum-1.1.0/docs/docs/api/role_manager.md +1 -0
- pum-1.1.0/docs/docs/api/schema_migrations.md +1 -0
- pum-1.1.0/docs/docs/api/sql_content.md +2 -0
- pum-1.1.0/docs/docs/api/upgrader.md +1 -0
- pum-1.1.0/docs/docs/assets/images/favicon.ico +0 -0
- pum-1.1.0/docs/docs/assets/images/pum-darkmode.png +0 -0
- pum-1.1.0/docs/docs/assets/images/pum.png +0 -0
- pum-1.1.0/docs/docs/cli/baseline.md +6 -0
- pum-1.1.0/docs/docs/cli/check.md +14 -0
- pum-1.1.0/docs/docs/cli/dump.md +11 -0
- pum-1.1.0/docs/docs/cli/info.md +4 -0
- pum-1.1.0/docs/docs/cli/install.md +10 -0
- pum-1.1.0/docs/docs/cli/restore.md +10 -0
- pum-1.1.0/docs/docs/cli/role.md +8 -0
- pum-1.1.0/docs/docs/cli/upgrade.md +8 -0
- pum-1.1.0/docs/docs/cli.md +25 -0
- pum-1.1.0/docs/docs/configuration/config_model.md +5 -0
- pum-1.1.0/docs/docs/configuration/configuration.md +26 -0
- pum-1.1.0/docs/docs/configuration/demo_data_model.md +3 -0
- pum-1.1.0/docs/docs/configuration/dependency_model.md +3 -0
- pum-1.1.0/docs/docs/configuration/hook_model.md +3 -0
- pum-1.1.0/docs/docs/configuration/migration_hooks_model.md +3 -0
- pum-1.1.0/docs/docs/configuration/parameter_definition_model.md +3 -0
- pum-1.1.0/docs/docs/configuration/permission_model.md +3 -0
- pum-1.1.0/docs/docs/configuration/pum_model.md +3 -0
- pum-1.1.0/docs/docs/configuration/role_model.md +3 -0
- pum-1.1.0/docs/docs/getting_started.md +56 -0
- pum-1.1.0/docs/docs/hooks.md +108 -0
- pum-1.1.0/docs/docs/index.md +20 -0
- pum-1.1.0/docs/docs/roles.md +70 -0
- pum-1.1.0/docs/mkdocs.yml +113 -0
- pum-1.1.0/docs/requirements.txt +5 -0
- pum-1.1.0/docs/update_cli_docs.py +52 -0
- pum-1.1.0/pum/__init__.py +29 -0
- pum-1.1.0/pum/changelog.py +111 -0
- {pum-0.10.0/pum/core → pum-1.1.0/pum}/checker.py +156 -141
- pum-1.1.0/pum/cli.py +402 -0
- pum-1.1.0/pum/conf/pum_config_example.yaml +19 -0
- pum-1.1.0/pum/config_model.py +183 -0
- pum-1.1.0/pum/dependency_handler.py +95 -0
- pum-1.1.0/pum/dumper.py +110 -0
- pum-1.1.0/pum/exceptions.py +51 -0
- pum-1.1.0/pum/hook.py +231 -0
- pum-1.1.0/pum/info.py +30 -0
- pum-1.1.0/pum/parameter.py +72 -0
- pum-1.1.0/pum/pum_config.py +295 -0
- pum-1.1.0/pum/role_manager.py +253 -0
- pum-1.1.0/pum/schema_migrations.py +306 -0
- pum-1.1.0/pum/sql_content.py +265 -0
- pum-1.1.0/pum/upgrader.py +188 -0
- pum-1.1.0/pum.egg-info/PKG-INFO +61 -0
- pum-1.1.0/pum.egg-info/SOURCES.txt +156 -0
- pum-1.1.0/pum.egg-info/entry_points.txt +2 -0
- pum-1.1.0/pum.egg-info/requires.txt +12 -0
- pum-1.1.0/pum.egg-info/top_level.txt +1 -0
- pum-1.1.0/pyproject.toml +46 -0
- pum-1.1.0/requirements/base.txt +4 -0
- pum-1.1.0/requirements/development.txt +12 -0
- pum-1.1.0/scripts/run_postgis.sh +21 -0
- pum-1.1.0/setup.cfg +4 -0
- pum-1.1.0/test/data/complex_files_content/changelogs/1.2.3/complex_files_content.sql +61 -0
- pum-1.1.0/test/data/custom_directory/.pum.yaml +1 -0
- pum-1.1.0/test/data/custom_directory/my_delta_directory/1.2.3/my_delta_directory.sql +9 -0
- pum-1.1.0/test/data/custom_migration_schema/.pum.yaml +3 -0
- pum-1.1.0/test/data/custom_migration_schema/changelogs/1.2.3/custom_migration_schema.sql +9 -0
- pum-1.1.0/test/data/demo_data/.pum.yaml +5 -0
- pum-1.1.0/test/data/demo_data/changelogs/1.2.3/single_changelog.sql +9 -0
- pum-1.1.0/test/data/demo_data/demo_data/demo_data.sql +8 -0
- pum-1.1.0/test/data/dependencies/.pum.yaml +17 -0
- pum-1.1.0/test/data/dependencies/changelogs/1.2.3/pre_post_python_parameters.sql +9 -0
- pum-1.1.0/test/data/dependencies/changelogs/1.2.4/rename_created_date.sql +2 -0
- pum-1.1.0/test/data/dependencies/post/create_schema.sql +2 -0
- pum-1.1.0/test/data/dependencies/post/create_view.py +22 -0
- pum-1.1.0/test/data/dependencies/pre/drop_view.sql +3 -0
- pum-1.1.0/test/data/invalid_changelog_commit/changelogs/1.2.3/invalid_changelog.sql +13 -0
- pum-1.1.0/test/data/invalid_changelog_search_path/changelogs/1.2.3/invalid_changelog.sql +2 -0
- pum-1.1.0/test/data/min_version/.pum.yaml +3 -0
- pum-1.1.0/test/data/min_version/changelogs/1.2.3/roles.sql +9 -0
- pum-1.1.0/test/data/multiple_changelogs/changelogs/1.2.3/multiple_changelogs.sql +9 -0
- pum-1.1.0/test/data/multiple_changelogs/changelogs/1.2.4/rename_created_date.sql +2 -0
- pum-1.1.0/test/data/multiple_changelogs/changelogs/1.3.0/add_created_by_column.sql +2 -0
- pum-1.1.0/test/data/multiple_changelogs/changelogs/2.0.0/create_second_table.sql +4 -0
- pum-1.1.0/test/data/multiple_changelogs/changelogs/2.0.0/create_third_table.sql +4 -0
- pum-1.1.0/test/data/parameters/.pum.yaml +16 -0
- pum-1.1.0/test/data/parameters/changelogs/1.2.3/parameters.sql +15 -0
- pum-1.1.0/test/data/pre_post_python/.pum.yaml +8 -0
- pum-1.1.0/test/data/pre_post_python/changelogs/1.2.3/pre_post_python.sql +9 -0
- pum-1.1.0/test/data/pre_post_python/changelogs/1.2.4/rename_created_date.sql +2 -0
- pum-1.1.0/test/data/pre_post_python/post/create_schema.sql +2 -0
- pum-1.1.0/test/data/pre_post_python/post/create_view.py +15 -0
- pum-1.1.0/test/data/pre_post_python/pre/drop_view.sql +3 -0
- pum-1.1.0/test/data/pre_post_python_local_import/.pum.yaml +8 -0
- pum-1.1.0/test/data/pre_post_python_local_import/changelogs/1.2.3/pre_post_python_local_import.sql +9 -0
- pum-1.1.0/test/data/pre_post_python_local_import/post/create_schema.sql +2 -0
- pum-1.1.0/test/data/pre_post_python_local_import/post/create_view.py +12 -0
- pum-1.1.0/test/data/pre_post_python_local_import/post/folder/my_module.py +8 -0
- pum-1.1.0/test/data/pre_post_python_local_import/pre/drop_view.sql +3 -0
- pum-1.1.0/test/data/pre_post_python_parameters/.pum.yaml +13 -0
- pum-1.1.0/test/data/pre_post_python_parameters/changelogs/1.2.3/pre_post_python_parameters.sql +9 -0
- pum-1.1.0/test/data/pre_post_python_parameters/changelogs/1.2.4/rename_created_date.sql +2 -0
- pum-1.1.0/test/data/pre_post_python_parameters/post/create_schema.sql +2 -0
- pum-1.1.0/test/data/pre_post_python_parameters/post/create_view.py +18 -0
- pum-1.1.0/test/data/pre_post_python_parameters/pre/drop_view.sql +3 -0
- pum-1.1.0/test/data/pre_post_python_parameters_broken/.pum.yaml +8 -0
- pum-1.1.0/test/data/pre_post_python_parameters_broken/changelogs/1.2.3/pre_post_python_parameters_broken.sql +9 -0
- pum-1.1.0/test/data/pre_post_python_parameters_broken/changelogs/1.2.4/rename_created_date.sql +2 -0
- pum-1.1.0/test/data/pre_post_python_parameters_broken/post/create_schema.sql +2 -0
- pum-1.1.0/test/data/pre_post_python_parameters_broken/post/create_view.py +24 -0
- pum-1.1.0/test/data/pre_post_python_parameters_broken/pre/drop_view.sql +3 -0
- pum-1.1.0/test/data/pre_post_sql_code/.pum.yaml +12 -0
- pum-1.1.0/test/data/pre_post_sql_code/changelogs/1.2.3/pre_post_sql_code.sql +9 -0
- pum-1.1.0/test/data/pre_post_sql_code/changelogs/1.2.4/rename_created_date.sql +2 -0
- pum-1.1.0/test/data/pre_post_sql_code/pre/drop_view.sql +0 -0
- pum-1.1.0/test/data/pre_post_sql_files/.pum.yaml +7 -0
- pum-1.1.0/test/data/pre_post_sql_files/changelogs/1.2.3/pre_post_sql_files.sql +9 -0
- pum-1.1.0/test/data/pre_post_sql_files/changelogs/1.2.4/rename_created_date.sql +2 -0
- pum-1.1.0/test/data/pre_post_sql_files/post/create_view.sql +7 -0
- pum-1.1.0/test/data/pre_post_sql_files/pre/drop_view.sql +3 -0
- pum-1.1.0/test/data/roles/.pum.yaml +16 -0
- pum-1.1.0/test/data/roles/changelogs/1.2.3/roles.sql +19 -0
- pum-1.1.0/test/data/single_changelog/changelogs/1.2.3/single_changelog.sql +9 -0
- pum-1.1.0/test/test_changelog.py +20 -0
- pum-0.10.0/test/test_checker.py → pum-1.1.0/test/test_checker.py.disabled +72 -54
- pum-1.1.0/test/test_config.py +147 -0
- pum-1.1.0/test/test_dumper.py +77 -0
- pum-1.1.0/test/test_pum.sh +30 -0
- pum-1.1.0/test/test_roles.py +103 -0
- pum-1.1.0/test/test_schema_migrations.py +81 -0
- pum-1.1.0/test/test_upgrader.py +408 -0
- pum-0.10.0/PKG-INFO +0 -19
- pum-0.10.0/README.md +0 -490
- pum-0.10.0/pum/__main__.py +0 -631
- pum-0.10.0/pum/core/deltapy.py +0 -83
- pum-0.10.0/pum/core/dumper.py +0 -81
- pum-0.10.0/pum/core/exceptions.py +0 -15
- pum-0.10.0/pum/core/upgrader.py +0 -596
- pum-0.10.0/pum/utils/utils.py +0 -54
- pum-0.10.0/pum.egg-info/PKG-INFO +0 -19
- pum-0.10.0/pum.egg-info/SOURCES.txt +0 -22
- pum-0.10.0/pum.egg-info/entry_points.txt +0 -3
- pum-0.10.0/pum.egg-info/requires.txt +0 -2
- pum-0.10.0/pum.egg-info/top_level.txt +0 -3
- pum-0.10.0/setup.cfg +0 -7
- pum-0.10.0/setup.py +0 -43
- pum-0.10.0/test/test_dumper.py +0 -111
- pum-0.10.0/test/test_upgrader.py +0 -196
- /pum-0.10.0/pum/__init__.py → /pum-1.1.0/docs/roles.md +0 -0
- {pum-0.10.0 → pum-1.1.0}/pum.egg-info/dependency_links.txt +0 -0
- {pum-0.10.0/pum/core → pum-1.1.0/test}/__init__.py +0 -0
- /pum-0.10.0/pum/utils/__init__.py → /pum-1.1.0/test/data/pre_post_sql_code/post/create_view.sql +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
export PGUSER=postgres
|
|
4
|
+
|
|
5
|
+
# determine the pg_service conf file location
|
|
6
|
+
if [ -z "$PGSYSCONFDIR" ]; then
|
|
7
|
+
PGSERVICE_FILE="$HOME/.pg_service.conf"
|
|
8
|
+
else
|
|
9
|
+
PGSERVICE_FILE="$PGSYSCONFDIR/pg_service.conf"
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
pgsrv="pum_test"
|
|
13
|
+
echo "Adding service ${pgsrv} to $PGSERVICE_FILE"
|
|
14
|
+
printf "[${pgsrv}]\nhost=localhost\ndbname=${pgsrv}\nuser=postgres\npassword=postgres\n\n" >> "$PGSERVICE_FILE"
|
|
15
|
+
|
|
16
|
+
psql -c "DROP DATABASE IF EXISTS ${pgsrv};" "service=${pgsrv} dbname=postgres"
|
|
17
|
+
psql -c "CREATE DATABASE ${pgsrv};" "service=${pgsrv} dbname=postgres"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: pip
|
|
4
|
+
directory: "/requirements"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: monthly
|
|
7
|
+
time: "04:00"
|
|
8
|
+
timezone: Europe/Paris
|
|
9
|
+
|
|
10
|
+
- package-ecosystem: pip
|
|
11
|
+
directory: "/docs"
|
|
12
|
+
schedule:
|
|
13
|
+
interval: monthly
|
|
14
|
+
time: "04:00"
|
|
15
|
+
timezone: Europe/Paris
|
|
16
|
+
|
|
17
|
+
- package-ecosystem: "github-actions"
|
|
18
|
+
directory: "/"
|
|
19
|
+
schedule:
|
|
20
|
+
interval: "monthly"
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: 🚀 Deploying to pypi
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "*"
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
workflow_call:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build-python-wheel:
|
|
12
|
+
name: "🐍 Python Wheel"
|
|
13
|
+
uses: ./.github/workflows/wheel.yml
|
|
14
|
+
secrets: inherit
|
|
15
|
+
|
|
16
|
+
release-pypi:
|
|
17
|
+
name: "🐍 Release on PyPI"
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
needs: [build-python-wheel]
|
|
20
|
+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
|
21
|
+
environment:
|
|
22
|
+
name: pypi
|
|
23
|
+
url: https://pypi.org/p/${{ github.event.repository.name }}
|
|
24
|
+
permissions:
|
|
25
|
+
id-token: write
|
|
26
|
+
contents: write
|
|
27
|
+
|
|
28
|
+
steps:
|
|
29
|
+
- name: Retrieve artifact from Python build
|
|
30
|
+
uses: actions/download-artifact@v4
|
|
31
|
+
with:
|
|
32
|
+
name: python_wheel
|
|
33
|
+
path: dist/
|
|
34
|
+
|
|
35
|
+
- name: upload release asset
|
|
36
|
+
env:
|
|
37
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
38
|
+
run: gh release upload --repo ${{ github.repository_owner }}/${{ github.event.repository.name }} ${{ github.ref_name }} "dist/${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz"
|
|
39
|
+
|
|
40
|
+
- name: Deploy to PyPI
|
|
41
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
name: "📚 Documentation Builder"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- docs
|
|
8
|
+
paths:
|
|
9
|
+
- .github/workflows/docs.yml
|
|
10
|
+
- pum/**/*.py
|
|
11
|
+
- docs/**/*
|
|
12
|
+
tags:
|
|
13
|
+
- "*"
|
|
14
|
+
|
|
15
|
+
pull_request:
|
|
16
|
+
branches:
|
|
17
|
+
- main
|
|
18
|
+
paths:
|
|
19
|
+
- .github/workflows/docs.yml
|
|
20
|
+
- pum/**/*.py
|
|
21
|
+
- docs/**/*
|
|
22
|
+
|
|
23
|
+
# Allow one concurrent deployment
|
|
24
|
+
concurrency:
|
|
25
|
+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
26
|
+
cancel-in-progress: true
|
|
27
|
+
|
|
28
|
+
jobs:
|
|
29
|
+
build-docs:
|
|
30
|
+
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
|
|
33
|
+
steps:
|
|
34
|
+
- name: Get source code
|
|
35
|
+
uses: actions/checkout@v4
|
|
36
|
+
|
|
37
|
+
- uses: actions/setup-python@v5
|
|
38
|
+
with:
|
|
39
|
+
python-version: '3.12'
|
|
40
|
+
|
|
41
|
+
- name: Install dependencies
|
|
42
|
+
run: |
|
|
43
|
+
python -m pip install -r requirements/base.txt
|
|
44
|
+
python -m pip install -r docs/requirements.txt
|
|
45
|
+
|
|
46
|
+
- name: Install pum
|
|
47
|
+
run: python -m pip install .
|
|
48
|
+
|
|
49
|
+
- name: Update CLI docs
|
|
50
|
+
run: ./docs/update_cli_docs.py
|
|
51
|
+
|
|
52
|
+
- name: Build documentation
|
|
53
|
+
run: mkdocs build -f docs/mkdocs.yml
|
|
54
|
+
|
|
55
|
+
- uses: actions/upload-artifact@v4
|
|
56
|
+
if: ${{ github.event_name == 'pull_request' }}
|
|
57
|
+
with:
|
|
58
|
+
name: docs
|
|
59
|
+
path: docs/site
|
|
60
|
+
if-no-files-found: error
|
|
61
|
+
|
|
62
|
+
- name: Deploy to GitHub Pages
|
|
63
|
+
if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name)
|
|
64
|
+
working-directory: docs
|
|
65
|
+
run: mkdocs gh-deploy --force
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
name: 🧪 Testing
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
name: Testing (py${{ matrix.python }}-pg${{ matrix.postgres }})
|
|
14
|
+
|
|
15
|
+
strategy:
|
|
16
|
+
fail-fast: false
|
|
17
|
+
matrix:
|
|
18
|
+
os:
|
|
19
|
+
- ubuntu-latest
|
|
20
|
+
python:
|
|
21
|
+
- "3.10"
|
|
22
|
+
postgres: # dockerhub tags
|
|
23
|
+
- "13-3.5"
|
|
24
|
+
|
|
25
|
+
runs-on: ${{ matrix.os }}
|
|
26
|
+
|
|
27
|
+
env:
|
|
28
|
+
PGSYSCONFDIR: .
|
|
29
|
+
|
|
30
|
+
services:
|
|
31
|
+
postgres:
|
|
32
|
+
image: postgis/postgis:${{ matrix.postgres }}
|
|
33
|
+
ports:
|
|
34
|
+
- 5432:5432
|
|
35
|
+
env:
|
|
36
|
+
POSTGRES_USER: postgres
|
|
37
|
+
POSTGRES_PASSWORD: postgres
|
|
38
|
+
# Set health checks to wait until postgres has started
|
|
39
|
+
options: >-
|
|
40
|
+
--health-cmd pg_isready
|
|
41
|
+
--health-interval 10s
|
|
42
|
+
--health-timeout 5s
|
|
43
|
+
--health-retries 5
|
|
44
|
+
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@v4
|
|
47
|
+
with:
|
|
48
|
+
fetch-tags: true
|
|
49
|
+
|
|
50
|
+
- name: Set up Python
|
|
51
|
+
uses: actions/setup-python@v5
|
|
52
|
+
with:
|
|
53
|
+
python-version: ${{ matrix.python }}
|
|
54
|
+
|
|
55
|
+
- name: Install dependencies
|
|
56
|
+
run: |
|
|
57
|
+
python -m pip install -r requirements/base.txt
|
|
58
|
+
python -m pip install -r requirements/development.txt
|
|
59
|
+
|
|
60
|
+
- name: Install pum
|
|
61
|
+
run: python -m pip install .
|
|
62
|
+
|
|
63
|
+
- name: Setup db
|
|
64
|
+
shell: bash
|
|
65
|
+
run: ./.ci/setup_db.sh
|
|
66
|
+
|
|
67
|
+
- name: Run base tests
|
|
68
|
+
run: nose2 -v
|
|
69
|
+
|
|
70
|
+
# - name: Run migrations tests
|
|
71
|
+
# shell: bash
|
|
72
|
+
# run: ./test/test_pum.sh
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: "🐍 Python Wheel"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
workflow_call:
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
build-wheel:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- name: Get source code
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: "3.10"
|
|
24
|
+
cache: "pip"
|
|
25
|
+
cache-dependency-path: "requirements/base.txt"
|
|
26
|
+
|
|
27
|
+
- name: Install project requirements
|
|
28
|
+
run: |
|
|
29
|
+
python -m pip install -U pip setuptools wheel
|
|
30
|
+
python -m pip install -U build
|
|
31
|
+
|
|
32
|
+
- name: Install project as a package
|
|
33
|
+
run: python -m pip install -e .
|
|
34
|
+
|
|
35
|
+
- name: Build a binary wheel and a source tarball
|
|
36
|
+
run: python -m build .
|
|
37
|
+
|
|
38
|
+
- uses: actions/upload-artifact@v4
|
|
39
|
+
with:
|
|
40
|
+
name: python_wheel
|
|
41
|
+
path: dist/*
|
|
42
|
+
if-no-files-found: error
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
name: 🪟 Winows Testing
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
build:
|
|
7
|
+
name: Testing Windows
|
|
8
|
+
|
|
9
|
+
strategy:
|
|
10
|
+
fail-fast: false
|
|
11
|
+
matrix:
|
|
12
|
+
os: [windows-latest]
|
|
13
|
+
pg_major: [13]
|
|
14
|
+
|
|
15
|
+
runs-on: ${{ matrix.os }}
|
|
16
|
+
|
|
17
|
+
env:
|
|
18
|
+
PGSYSCONFDIR: .
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Set up Python
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: "3.x"
|
|
27
|
+
|
|
28
|
+
# Adapted from https://github.com/npgsql/npgsql/actions/runs/33087254/workflow#L28-L66
|
|
29
|
+
# alternatively we could use postgres-windows docker images (stellirin/postgres-windows:9.6)
|
|
30
|
+
- name: Start PostgreSQL ${{ matrix.pg_major }} (Windows)
|
|
31
|
+
if: startsWith(matrix.os, 'windows')
|
|
32
|
+
run: |
|
|
33
|
+
# Find EnterpriseDB version number
|
|
34
|
+
EDB_VERSION=$(\
|
|
35
|
+
curl -Ls 'http://sbp.enterprisedb.com/applications.xml' |
|
|
36
|
+
sed -n "\#<id>postgresql_${{ matrix.pg_major }}</id>#{n;p;n;p;}" |
|
|
37
|
+
sed -n "\#<platform>windows-x64</platform>#{n;p;}" |
|
|
38
|
+
sed -E 's#.*<version>([^<]+)</version>#\1#')
|
|
39
|
+
# Install PostgreSQL
|
|
40
|
+
echo "Installing PostgreSQL (version: ${EDB_VERSION})"
|
|
41
|
+
curl -o pgsql.zip -L https://get.enterprisedb.com/postgresql/postgresql-${EDB_VERSION}-windows-x64-binaries.zip
|
|
42
|
+
unzip pgsql.zip -x 'pgsql/include/**' 'pgsql/doc/**' 'pgsql/pgAdmin 4/**' 'pgsql/StackBuilder/**'
|
|
43
|
+
# Start PostgreSQL
|
|
44
|
+
pgsql/bin/initdb -D pgsql/PGDATA -E UTF8 -U postgres
|
|
45
|
+
pgsql/bin/pg_ctl -D pgsql/PGDATA -l logfile start
|
|
46
|
+
shell: bash
|
|
47
|
+
|
|
48
|
+
- name: Install dependencies
|
|
49
|
+
run: |
|
|
50
|
+
python -m pip install -r requirements/base.txt
|
|
51
|
+
python -m pip install -r requirements/development.txt
|
|
52
|
+
|
|
53
|
+
- name: Install pum
|
|
54
|
+
run: python -m pip install .
|
|
55
|
+
|
|
56
|
+
# see https://github.community/t5/GitHub-Actions/Append-PATH-on-Windows/m-p/42873/highlight/true#M5155
|
|
57
|
+
- name: Add psql/bin path
|
|
58
|
+
env:
|
|
59
|
+
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
|
|
60
|
+
run: echo "##[add-path].\pgsql\bin"
|
|
61
|
+
|
|
62
|
+
- name: Setup db
|
|
63
|
+
shell: bash
|
|
64
|
+
run: ./.ci/setup_db.sh
|
|
65
|
+
|
|
66
|
+
- name: Run base tests
|
|
67
|
+
run: nose2 -v
|
|
68
|
+
|
|
69
|
+
# - name: Run migrations tests
|
|
70
|
+
# shell: bash
|
|
71
|
+
# run: ./test/test_pum.sh
|
pum-1.1.0/.gitignore
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
fail_fast: false
|
|
2
|
+
repos:
|
|
3
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
4
|
+
rev: v5.0.0
|
|
5
|
+
hooks:
|
|
6
|
+
- id: check-added-large-files
|
|
7
|
+
args: ["--maxkb=600"]
|
|
8
|
+
- id: check-case-conflict
|
|
9
|
+
- id: check-toml
|
|
10
|
+
- id: check-xml
|
|
11
|
+
- id: check-yaml
|
|
12
|
+
- id: detect-private-key
|
|
13
|
+
- id: end-of-file-fixer
|
|
14
|
+
- id: fix-byte-order-marker
|
|
15
|
+
- id: trailing-whitespace
|
|
16
|
+
args: [--markdown-linebreak-ext=md]
|
|
17
|
+
|
|
18
|
+
# Ruff: linter, import sorter, autoflake, pyupgrade replacement
|
|
19
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
20
|
+
rev: v0.11.8
|
|
21
|
+
hooks:
|
|
22
|
+
- id: ruff
|
|
23
|
+
args:
|
|
24
|
+
- --fix
|
|
25
|
+
- --target-version=py310
|
|
26
|
+
types_or:
|
|
27
|
+
- python
|
|
28
|
+
- pyi
|
|
29
|
+
- id: ruff-format
|
|
30
|
+
args:
|
|
31
|
+
- --line-length=100
|
|
32
|
+
- --target-version=py310
|
|
33
|
+
types_or:
|
|
34
|
+
- python
|
|
35
|
+
- pyi
|
|
36
|
+
|
|
37
|
+
ci:
|
|
38
|
+
autofix_prs: true
|
|
39
|
+
autoupdate_schedule: quarterly
|