pum 0.9.14__tar.gz → 1.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.
Files changed (167) hide show
  1. pum-1.0.0/.ci/setup_db.sh +17 -0
  2. pum-1.0.0/.github/dependabot.yml +20 -0
  3. pum-1.0.0/.github/workflows/deploy-to-pypi.yml +41 -0
  4. pum-1.0.0/.github/workflows/docs.yml +65 -0
  5. pum-1.0.0/.github/workflows/tests.yml +73 -0
  6. pum-1.0.0/.github/workflows/wheel.yml +42 -0
  7. pum-1.0.0/.github/workflows/windows-tests.yml +72 -0
  8. pum-1.0.0/.gitignore +13 -0
  9. pum-1.0.0/.pre-commit-config.yaml +39 -0
  10. pum-1.0.0/LICENSE +339 -0
  11. pum-1.0.0/PKG-INFO +61 -0
  12. pum-1.0.0/README.md +25 -0
  13. pum-1.0.0/docs/create_cli_help.py +52 -0
  14. pum-1.0.0/docs/docs/api/api.md +11 -0
  15. pum-1.0.0/docs/docs/api/changelog.md +1 -0
  16. pum-1.0.0/docs/docs/api/dump_format.md +1 -0
  17. pum-1.0.0/docs/docs/api/dumper.md +1 -0
  18. pum-1.0.0/docs/docs/api/exceptions.md +2 -0
  19. pum-1.0.0/docs/docs/api/hook_base.md +2 -0
  20. pum-1.0.0/docs/docs/api/hook_handler.md +2 -0
  21. pum-1.0.0/docs/docs/api/parameter_definition.md +1 -0
  22. pum-1.0.0/docs/docs/api/parameter_type.md +1 -0
  23. pum-1.0.0/docs/docs/api/permission.md +1 -0
  24. pum-1.0.0/docs/docs/api/permission_type.md +1 -0
  25. pum-1.0.0/docs/docs/api/pum_config.md +1 -0
  26. pum-1.0.0/docs/docs/api/role.md +1 -0
  27. pum-1.0.0/docs/docs/api/role_manager.md +1 -0
  28. pum-1.0.0/docs/docs/api/schema_migrations.md +1 -0
  29. pum-1.0.0/docs/docs/api/sql_content.md +2 -0
  30. pum-1.0.0/docs/docs/api/upgrader.md +1 -0
  31. pum-1.0.0/docs/docs/assets/images/favicon.ico +0 -0
  32. pum-1.0.0/docs/docs/assets/images/pum-darkmode.png +0 -0
  33. pum-1.0.0/docs/docs/assets/images/pum.png +0 -0
  34. pum-1.0.0/docs/docs/cli/baseline.md +6 -0
  35. pum-1.0.0/docs/docs/cli/check.md +14 -0
  36. pum-1.0.0/docs/docs/cli/dump.md +11 -0
  37. pum-1.0.0/docs/docs/cli/info.md +4 -0
  38. pum-1.0.0/docs/docs/cli/install.md +10 -0
  39. pum-1.0.0/docs/docs/cli/restore.md +10 -0
  40. pum-1.0.0/docs/docs/cli/role.md +8 -0
  41. pum-1.0.0/docs/docs/cli/upgrade.md +8 -0
  42. pum-1.0.0/docs/docs/cli.md +25 -0
  43. pum-1.0.0/docs/docs/configuration/config_model.md +5 -0
  44. pum-1.0.0/docs/docs/configuration/configuration.md +26 -0
  45. pum-1.0.0/docs/docs/configuration/demo_data_model.md +3 -0
  46. pum-1.0.0/docs/docs/configuration/hook_model.md +3 -0
  47. pum-1.0.0/docs/docs/configuration/migration_hooks_model.md +3 -0
  48. pum-1.0.0/docs/docs/configuration/parameter_definition_model.md +3 -0
  49. pum-1.0.0/docs/docs/configuration/permission_model.md +3 -0
  50. pum-1.0.0/docs/docs/configuration/pum_model.md +3 -0
  51. pum-1.0.0/docs/docs/configuration/role_model.md +3 -0
  52. pum-1.0.0/docs/docs/getting_started.md +56 -0
  53. pum-1.0.0/docs/docs/hooks.md +108 -0
  54. pum-1.0.0/docs/docs/index.md +20 -0
  55. pum-1.0.0/docs/docs/roles.md +70 -0
  56. pum-1.0.0/docs/mkdocs.yml +112 -0
  57. pum-1.0.0/docs/requirements.txt +5 -0
  58. pum-1.0.0/pum/__init__.py +27 -0
  59. pum-1.0.0/pum/changelog.py +111 -0
  60. {pum-0.9.14/pum/core → pum-1.0.0/pum}/checker.py +174 -152
  61. pum-1.0.0/pum/cli.py +402 -0
  62. pum-1.0.0/pum/conf/pum_config_example.yaml +19 -0
  63. pum-1.0.0/pum/config_model.py +152 -0
  64. pum-1.0.0/pum/dumper.py +110 -0
  65. pum-1.0.0/pum/exceptions.py +47 -0
  66. pum-1.0.0/pum/hook.py +231 -0
  67. pum-1.0.0/pum/info.py +30 -0
  68. pum-1.0.0/pum/parameter.py +72 -0
  69. pum-1.0.0/pum/pum_config.py +231 -0
  70. pum-1.0.0/pum/role_manager.py +253 -0
  71. pum-1.0.0/pum/schema_migrations.py +306 -0
  72. pum-1.0.0/pum/sql_content.py +265 -0
  73. pum-1.0.0/pum/upgrader.py +188 -0
  74. pum-1.0.0/pum.egg-info/PKG-INFO +61 -0
  75. pum-1.0.0/pum.egg-info/SOURCES.txt +148 -0
  76. pum-1.0.0/pum.egg-info/entry_points.txt +2 -0
  77. pum-1.0.0/pum.egg-info/requires.txt +12 -0
  78. pum-1.0.0/pum.egg-info/top_level.txt +1 -0
  79. pum-1.0.0/pyproject.toml +46 -0
  80. pum-1.0.0/requirements/base.txt +4 -0
  81. pum-1.0.0/requirements/development.txt +12 -0
  82. pum-1.0.0/scripts/run_postgis.sh +21 -0
  83. pum-1.0.0/setup.cfg +4 -0
  84. pum-1.0.0/test/data/complex_files_content/changelogs/1.2.3/complex_files_content.sql +61 -0
  85. pum-1.0.0/test/data/custom_directory/.pum.yaml +1 -0
  86. pum-1.0.0/test/data/custom_directory/my_delta_directory/1.2.3/my_delta_directory.sql +9 -0
  87. pum-1.0.0/test/data/custom_migration_schema/.pum.yaml +3 -0
  88. pum-1.0.0/test/data/custom_migration_schema/changelogs/1.2.3/custom_migration_schema.sql +9 -0
  89. pum-1.0.0/test/data/demo_data/.pum.yaml +5 -0
  90. pum-1.0.0/test/data/demo_data/changelogs/1.2.3/single_changelog.sql +9 -0
  91. pum-1.0.0/test/data/demo_data/demo_data/demo_data.sql +8 -0
  92. pum-1.0.0/test/data/invalid_changelog_commit/changelogs/1.2.3/invalid_changelog.sql +13 -0
  93. pum-1.0.0/test/data/invalid_changelog_search_path/changelogs/1.2.3/invalid_changelog.sql +2 -0
  94. pum-1.0.0/test/data/min_version/.pum.yaml +3 -0
  95. pum-1.0.0/test/data/min_version/changelogs/1.2.3/roles.sql +9 -0
  96. pum-1.0.0/test/data/multiple_changelogs/changelogs/1.2.3/multiple_changelogs.sql +9 -0
  97. pum-1.0.0/test/data/multiple_changelogs/changelogs/1.2.4/rename_created_date.sql +2 -0
  98. pum-1.0.0/test/data/multiple_changelogs/changelogs/1.3.0/add_created_by_column.sql +2 -0
  99. pum-1.0.0/test/data/multiple_changelogs/changelogs/2.0.0/create_second_table.sql +4 -0
  100. pum-1.0.0/test/data/multiple_changelogs/changelogs/2.0.0/create_third_table.sql +4 -0
  101. pum-1.0.0/test/data/parameters/.pum.yaml +16 -0
  102. pum-1.0.0/test/data/parameters/changelogs/1.2.3/parameters.sql +15 -0
  103. pum-1.0.0/test/data/pre_post_python/.pum.yaml +8 -0
  104. pum-1.0.0/test/data/pre_post_python/changelogs/1.2.3/pre_post_python.sql +9 -0
  105. pum-1.0.0/test/data/pre_post_python/changelogs/1.2.4/rename_created_date.sql +2 -0
  106. pum-1.0.0/test/data/pre_post_python/post/create_schema.sql +2 -0
  107. pum-1.0.0/test/data/pre_post_python/post/create_view.py +21 -0
  108. pum-1.0.0/test/data/pre_post_python/pre/drop_view.sql +3 -0
  109. pum-1.0.0/test/data/pre_post_python_local_import/.pum.yaml +8 -0
  110. pum-1.0.0/test/data/pre_post_python_local_import/changelogs/1.2.3/pre_post_python_local_import.sql +9 -0
  111. pum-1.0.0/test/data/pre_post_python_local_import/post/create_schema.sql +2 -0
  112. pum-1.0.0/test/data/pre_post_python_local_import/post/create_view.py +18 -0
  113. pum-1.0.0/test/data/pre_post_python_local_import/post/folder/my_module.py +8 -0
  114. pum-1.0.0/test/data/pre_post_python_local_import/pre/drop_view.sql +3 -0
  115. pum-1.0.0/test/data/pre_post_python_parameters/.pum.yaml +14 -0
  116. pum-1.0.0/test/data/pre_post_python_parameters/changelogs/1.2.3/pre_post_python_parameters.sql +9 -0
  117. pum-1.0.0/test/data/pre_post_python_parameters/changelogs/1.2.4/rename_created_date.sql +2 -0
  118. pum-1.0.0/test/data/pre_post_python_parameters/post/create_schema.sql +2 -0
  119. pum-1.0.0/test/data/pre_post_python_parameters/post/create_view.py +24 -0
  120. pum-1.0.0/test/data/pre_post_python_parameters/pre/drop_view.sql +3 -0
  121. pum-1.0.0/test/data/pre_post_python_parameters_broken/.pum.yaml +8 -0
  122. pum-1.0.0/test/data/pre_post_python_parameters_broken/changelogs/1.2.3/pre_post_python_parameters_broken.sql +9 -0
  123. pum-1.0.0/test/data/pre_post_python_parameters_broken/changelogs/1.2.4/rename_created_date.sql +2 -0
  124. pum-1.0.0/test/data/pre_post_python_parameters_broken/post/create_schema.sql +2 -0
  125. pum-1.0.0/test/data/pre_post_python_parameters_broken/post/create_view.py +29 -0
  126. pum-1.0.0/test/data/pre_post_python_parameters_broken/pre/drop_view.sql +3 -0
  127. pum-1.0.0/test/data/pre_post_sql_code/.pum.yaml +12 -0
  128. pum-1.0.0/test/data/pre_post_sql_code/changelogs/1.2.3/pre_post_sql_code.sql +9 -0
  129. pum-1.0.0/test/data/pre_post_sql_code/changelogs/1.2.4/rename_created_date.sql +2 -0
  130. pum-1.0.0/test/data/pre_post_sql_code/pre/drop_view.sql +0 -0
  131. pum-1.0.0/test/data/pre_post_sql_files/.pum.yaml +7 -0
  132. pum-1.0.0/test/data/pre_post_sql_files/changelogs/1.2.3/pre_post_sql_files.sql +9 -0
  133. pum-1.0.0/test/data/pre_post_sql_files/changelogs/1.2.4/rename_created_date.sql +2 -0
  134. pum-1.0.0/test/data/pre_post_sql_files/post/create_view.sql +7 -0
  135. pum-1.0.0/test/data/pre_post_sql_files/pre/drop_view.sql +3 -0
  136. pum-1.0.0/test/data/roles/.pum.yaml +16 -0
  137. pum-1.0.0/test/data/roles/changelogs/1.2.3/roles.sql +19 -0
  138. pum-1.0.0/test/data/single_changelog/changelogs/1.2.3/single_changelog.sql +9 -0
  139. pum-1.0.0/test/test_changelog.py +20 -0
  140. pum-0.9.14/test/test_checker.py → pum-1.0.0/test/test_checker.py.disabled +72 -54
  141. pum-1.0.0/test/test_config.py +147 -0
  142. pum-1.0.0/test/test_dumper.py +77 -0
  143. pum-1.0.0/test/test_pum.sh +30 -0
  144. pum-1.0.0/test/test_roles.py +103 -0
  145. pum-1.0.0/test/test_schema_migrations.py +81 -0
  146. pum-1.0.0/test/test_upgrader.py +395 -0
  147. pum-0.9.14/PKG-INFO +0 -19
  148. pum-0.9.14/README.md +0 -487
  149. pum-0.9.14/pum/__main__.py +0 -628
  150. pum-0.9.14/pum/core/deltapy.py +0 -83
  151. pum-0.9.14/pum/core/dumper.py +0 -81
  152. pum-0.9.14/pum/core/exceptions.py +0 -15
  153. pum-0.9.14/pum/core/upgrader.py +0 -596
  154. pum-0.9.14/pum/utils/utils.py +0 -54
  155. pum-0.9.14/pum.egg-info/PKG-INFO +0 -19
  156. pum-0.9.14/pum.egg-info/SOURCES.txt +0 -22
  157. pum-0.9.14/pum.egg-info/entry_points.txt +0 -3
  158. pum-0.9.14/pum.egg-info/requires.txt +0 -2
  159. pum-0.9.14/pum.egg-info/top_level.txt +0 -3
  160. pum-0.9.14/setup.cfg +0 -7
  161. pum-0.9.14/setup.py +0 -43
  162. pum-0.9.14/test/test_dumper.py +0 -111
  163. pum-0.9.14/test/test_upgrader.py +0 -196
  164. /pum-0.9.14/pum/__init__.py → /pum-1.0.0/docs/roles.md +0 -0
  165. {pum-0.9.14 → pum-1.0.0}/pum.egg-info/dependency_links.txt +0 -0
  166. {pum-0.9.14/pum/core → pum-1.0.0/test}/__init__.py +0 -0
  167. /pum-0.9.14/pum/utils/__init__.py → /pum-1.0.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,73 @@
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
+ python -m pip install git+https://github.com/opengisch/pirogue.git@v3#egg=pirogue
60
+
61
+ - name: Install pum
62
+ run: python -m pip install .
63
+
64
+ - name: Setup db
65
+ shell: bash
66
+ run: ./.ci/setup_db.sh
67
+
68
+ - name: Run base tests
69
+ run: nose2 -v
70
+
71
+ # - name: Run migrations tests
72
+ # shell: bash
73
+ # 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,72 @@
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
+ python -m pip install git+https://github.com/opengisch/pirogue.git@v3#egg=pirogue
53
+
54
+ - name: Install pum
55
+ run: python -m pip install .
56
+
57
+ # see https://github.community/t5/GitHub-Actions/Append-PATH-on-Windows/m-p/42873/highlight/true#M5155
58
+ - name: Add psql/bin path
59
+ env:
60
+ ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
61
+ run: echo "##[add-path].\pgsql\bin"
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
pum-1.0.0/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ docs/site
2
+ build/
3
+ __pycache__/
4
+ .idea
5
+ .vscode
6
+ *.egg-info
7
+ *.py[cod]
8
+ *$py.class
9
+ *.pyc
10
+ venv
11
+ .python-version
12
+ dist/
13
+ .DS_Store
@@ -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