morpheus-neo4j 0.1.2__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 (53) hide show
  1. morpheus_neo4j-0.1.2/.github/workflows/ci.yml +173 -0
  2. morpheus_neo4j-0.1.2/.github/workflows/publish.yml +50 -0
  3. morpheus_neo4j-0.1.2/.github/workflows/release-please.yml +35 -0
  4. morpheus_neo4j-0.1.2/.gitignore +12 -0
  5. morpheus_neo4j-0.1.2/.python-version +1 -0
  6. morpheus_neo4j-0.1.2/.release-please-manifest.json +3 -0
  7. morpheus_neo4j-0.1.2/CHANGELOG.md +56 -0
  8. morpheus_neo4j-0.1.2/LICENSE +21 -0
  9. morpheus_neo4j-0.1.2/Makefile +66 -0
  10. morpheus_neo4j-0.1.2/PKG-INFO +698 -0
  11. morpheus_neo4j-0.1.2/README.md +671 -0
  12. morpheus_neo4j-0.1.2/main.py +6 -0
  13. morpheus_neo4j-0.1.2/morpheus/__init__.py +3 -0
  14. morpheus_neo4j-0.1.2/morpheus/cli/__init__.py +0 -0
  15. morpheus_neo4j-0.1.2/morpheus/cli/commands/__init__.py +0 -0
  16. morpheus_neo4j-0.1.2/morpheus/cli/commands/create.py +270 -0
  17. morpheus_neo4j-0.1.2/morpheus/cli/commands/dag.py +201 -0
  18. morpheus_neo4j-0.1.2/morpheus/cli/commands/downgrade.py +220 -0
  19. morpheus_neo4j-0.1.2/morpheus/cli/commands/init.py +74 -0
  20. morpheus_neo4j-0.1.2/morpheus/cli/commands/status.py +300 -0
  21. morpheus_neo4j-0.1.2/morpheus/cli/commands/upgrade.py +346 -0
  22. morpheus_neo4j-0.1.2/morpheus/cli/main.py +63 -0
  23. morpheus_neo4j-0.1.2/morpheus/cli/utils.py +34 -0
  24. morpheus_neo4j-0.1.2/morpheus/config/__init__.py +0 -0
  25. morpheus_neo4j-0.1.2/morpheus/config/config.py +130 -0
  26. morpheus_neo4j-0.1.2/morpheus/core/__init__.py +0 -0
  27. morpheus_neo4j-0.1.2/morpheus/core/dag_resolver.py +310 -0
  28. morpheus_neo4j-0.1.2/morpheus/core/executor.py +421 -0
  29. morpheus_neo4j-0.1.2/morpheus/errors/__init__.py +15 -0
  30. morpheus_neo4j-0.1.2/morpheus/errors/base.py +28 -0
  31. morpheus_neo4j-0.1.2/morpheus/errors/documentation.py +39 -0
  32. morpheus_neo4j-0.1.2/morpheus/errors/migration_errors.py +169 -0
  33. morpheus_neo4j-0.1.2/morpheus/models/__init__.py +0 -0
  34. morpheus_neo4j-0.1.2/morpheus/models/migration.py +273 -0
  35. morpheus_neo4j-0.1.2/morpheus/models/migration_status.py +27 -0
  36. morpheus_neo4j-0.1.2/morpheus/models/priority.py +52 -0
  37. morpheus_neo4j-0.1.2/morpheus/templates/migration.mako +103 -0
  38. morpheus_neo4j-0.1.2/morpheus/validation/__init__.py +0 -0
  39. morpheus_neo4j-0.1.2/pyproject.toml +105 -0
  40. morpheus_neo4j-0.1.2/release-please-config.json +25 -0
  41. morpheus_neo4j-0.1.2/tests/__init__.py +0 -0
  42. morpheus_neo4j-0.1.2/tests/integration/__init__.py +0 -0
  43. morpheus_neo4j-0.1.2/tests/integration/test_executor_integration.py +324 -0
  44. morpheus_neo4j-0.1.2/tests/unit/__init__.py +0 -0
  45. morpheus_neo4j-0.1.2/tests/unit/test_config.py +313 -0
  46. morpheus_neo4j-0.1.2/tests/unit/test_config_comprehensive.py +620 -0
  47. morpheus_neo4j-0.1.2/tests/unit/test_dag_resolver.py +777 -0
  48. morpheus_neo4j-0.1.2/tests/unit/test_error_resolver.py +259 -0
  49. morpheus_neo4j-0.1.2/tests/unit/test_executor.py +1125 -0
  50. morpheus_neo4j-0.1.2/tests/unit/test_migration.py +943 -0
  51. morpheus_neo4j-0.1.2/tests/unit/test_priority.py +94 -0
  52. morpheus_neo4j-0.1.2/tests/unit/test_upgrade_command.py +383 -0
  53. morpheus_neo4j-0.1.2/uv.lock +639 -0
@@ -0,0 +1,173 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ lint:
11
+ name: Lint & Format Check
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Checkout code
15
+ uses: actions/checkout@v4
16
+
17
+ - name: Install uv
18
+ uses: astral-sh/setup-uv@v4
19
+ with:
20
+ version: "latest"
21
+ enable-cache: true
22
+
23
+ - name: Set up Python
24
+ run: uv python install 3.12
25
+
26
+ - name: Install dependencies
27
+ run: uv sync --all-extras
28
+
29
+ - name: Run ruff linting
30
+ run: uv run ruff check morpheus tests
31
+
32
+ - name: Run ruff formatting check
33
+ run: uv run ruff format --check morpheus tests
34
+
35
+ typecheck:
36
+ name: Type Check
37
+ runs-on: ubuntu-latest
38
+ steps:
39
+ - name: Checkout code
40
+ uses: actions/checkout@v4
41
+
42
+ - name: Install uv
43
+ uses: astral-sh/setup-uv@v4
44
+ with:
45
+ version: "latest"
46
+ enable-cache: true
47
+
48
+ - name: Set up Python
49
+ run: uv python install 3.12
50
+
51
+ - name: Install dependencies
52
+ run: uv sync --all-extras
53
+
54
+ - name: Run type checking
55
+ run: uv run ty check
56
+
57
+ test:
58
+ name: Test Suite
59
+ runs-on: ubuntu-latest
60
+ strategy:
61
+ matrix:
62
+ python-version: ["3.12"]
63
+ steps:
64
+ - name: Checkout code
65
+ uses: actions/checkout@v4
66
+
67
+ - name: Install uv
68
+ uses: astral-sh/setup-uv@v4
69
+ with:
70
+ version: "latest"
71
+ enable-cache: true
72
+
73
+ - name: Set up Python
74
+ run: uv python install ${{ matrix.python-version }}
75
+
76
+ - name: Install dependencies (including testcontainers)
77
+ run: uv sync --all-extras --group dev
78
+
79
+ - name: Run tests (unit + integration with testcontainers)
80
+ run: uv run pytest tests/ -v
81
+
82
+ install-test:
83
+ name: Source Installation Test
84
+ runs-on: ubuntu-latest
85
+ strategy:
86
+ matrix:
87
+ python-version: ["3.12"]
88
+ steps:
89
+ - name: Checkout code
90
+ uses: actions/checkout@v4
91
+
92
+ - name: Install uv
93
+ uses: astral-sh/setup-uv@v4
94
+ with:
95
+ version: "latest"
96
+ enable-cache: true
97
+
98
+ - name: Set up Python
99
+ run: uv python install ${{ matrix.python-version }}
100
+
101
+ - name: Test direct installation from source
102
+ run: |
103
+ uv venv install-test
104
+ source install-test/bin/activate
105
+ pip install .
106
+ morpheus --help
107
+
108
+ - name: Test editable installation
109
+ run: |
110
+ uv venv editable-test
111
+ source editable-test/bin/activate
112
+ pip install -e .
113
+ morpheus --help
114
+
115
+ - name: Test installation with dev extras
116
+ run: |
117
+ uv venv extras-test
118
+ source extras-test/bin/activate
119
+ pip install ".[dev]"
120
+ morpheus --help
121
+
122
+ build:
123
+ name: Build & Package Test
124
+ runs-on: ubuntu-latest
125
+ needs: [lint, typecheck, test]
126
+ strategy:
127
+ matrix:
128
+ python-version: ["3.12"]
129
+ steps:
130
+ - name: Checkout code
131
+ uses: actions/checkout@v4
132
+
133
+ - name: Install uv
134
+ uses: astral-sh/setup-uv@v4
135
+ with:
136
+ version: "latest"
137
+ enable-cache: true
138
+
139
+ - name: Set up Python
140
+ run: uv python install ${{ matrix.python-version }}
141
+
142
+ - name: Install dependencies
143
+ run: uv sync
144
+
145
+ - name: Build package
146
+ run: uv build
147
+
148
+ - name: Check package contents
149
+ run: |
150
+ ls -la dist/
151
+ uv run python -m tarfile -l dist/*.tar.gz
152
+ uv run python -m zipfile -l dist/*.whl
153
+
154
+ - name: Test installation from wheel
155
+ run: |
156
+ uv venv test-env
157
+ source test-env/bin/activate
158
+ pip install dist/*.whl
159
+ morpheus --help
160
+
161
+ - name: Test installation from source distribution
162
+ run: |
163
+ uv venv test-src-env
164
+ source test-src-env/bin/activate
165
+ pip install dist/*.tar.gz
166
+ morpheus --help
167
+
168
+ - name: Upload build artifacts
169
+ uses: actions/upload-artifact@v4
170
+ with:
171
+ name: dist-${{ matrix.python-version }}
172
+ path: dist/
173
+ retention-days: 7
@@ -0,0 +1,50 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ release_created:
7
+ required: true
8
+ type: boolean
9
+ tag_name:
10
+ required: true
11
+ type: string
12
+ release:
13
+ types: [published]
14
+ workflow_dispatch:
15
+
16
+ jobs:
17
+ publish:
18
+ runs-on: ubuntu-latest
19
+ if: inputs.release_created || github.event_name == 'release' || github.event_name == 'workflow_dispatch'
20
+ permissions:
21
+ id-token: write
22
+ contents: read
23
+
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+
27
+ - name: Install uv
28
+ uses: astral-sh/setup-uv@v4
29
+ with:
30
+ version: "latest"
31
+
32
+ - name: Set up Python
33
+ run: uv python install
34
+
35
+ - name: Install dependencies (including testcontainers)
36
+ run: uv sync --all-extras --group dev
37
+
38
+ - name: Run tests (including integration tests with testcontainers)
39
+ run: uv run pytest tests/ -v
40
+
41
+ - name: Build package
42
+ run: uv build
43
+
44
+ - name: Publish to PyPI
45
+ env:
46
+ TWINE_USERNAME: __token__
47
+ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
48
+ run: |
49
+ uv tool install twine
50
+ uv tool run twine upload dist/*
@@ -0,0 +1,35 @@
1
+ name: Release Please
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ permissions:
9
+ contents: write
10
+ pull-requests: write
11
+ id-token: write
12
+ issues: write
13
+
14
+ jobs:
15
+ release-please:
16
+ runs-on: ubuntu-latest
17
+ outputs:
18
+ release_created: ${{ steps.release.outputs.release_created }}
19
+ tag_name: ${{ steps.release.outputs.tag_name }}
20
+ steps:
21
+ - uses: googleapis/release-please-action@v4
22
+ id: release
23
+ with:
24
+ release-type: python
25
+ package-name: morpheus-neo4j
26
+ token: ${{ secrets.GITHUB_TOKEN }}
27
+
28
+ publish:
29
+ needs: release-please
30
+ if: needs.release-please.outputs.release_created
31
+ uses: ./.github/workflows/publish.yml
32
+ with:
33
+ release_created: true
34
+ tag_name: ${{ needs.release-please.outputs.tag_name }}
35
+ secrets: inherit
@@ -0,0 +1,12 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
11
+
12
+ migrations
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.1.2"
3
+ }
@@ -0,0 +1,56 @@
1
+ # Changelog
2
+
3
+ ## [0.1.2](https://github.com/AZX-PBC/morpheus/compare/v0.1.1...v0.1.2) (2025-08-20)
4
+
5
+
6
+ ### Documentation
7
+
8
+ * Update README to clarify migration directory structure and configuration syntax ([62ed798](https://github.com/AZX-PBC/morpheus/commit/62ed798e505ef9b6a6bcb2fa3a8045986c25bca4))
9
+
10
+ ## [0.1.1](https://github.com/AZX-PBC/morpheus/compare/v0.1.0...v0.1.1) (2025-08-20)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * Set release_created to true in publish job for consistent behavior ([ba118d9](https://github.com/AZX-PBC/morpheus/commit/ba118d95dd17d0e4dba4dc77289d25df0aa8b596))
16
+
17
+ ## 0.1.0 (2025-08-20)
18
+
19
+
20
+ ### Features
21
+
22
+ * Add .gitignore to exclude Python-generated files and virtual environments ([bb84de8](https://github.com/AZX-PBC/morpheus/commit/bb84de848ffbfe6767a230fd3d9790bfa300a0ed))
23
+ * Add backward compatibility for dependencies and implement migration description retrieval ([0d1c17d](https://github.com/AZX-PBC/morpheus/commit/0d1c17d5da81479b619d287ccdbcdf00dec81311))
24
+ * Add confirmation skip option to upgrade command ([7ced68e](https://github.com/AZX-PBC/morpheus/commit/7ced68eefbad180fde7ee37c8e52fcebd5064ac3))
25
+ * Add environment variable support for configuration loading and enhance test coverage ([5275a60](https://github.com/AZX-PBC/morpheus/commit/5275a60fd9eab9b046a41f5b5b8871d77feae1f9))
26
+ * Add id-token permission for release workflow ([5771812](https://github.com/AZX-PBC/morpheus/commit/577181226b04e2ef99d91925a54f5ddc71396ca0))
27
+ * add pytestcov ([389fc12](https://github.com/AZX-PBC/morpheus/commit/389fc12d80963a18b7ed2dc5d5c6a0a817a8541e))
28
+ * Add textual format option for DAG visualization and implement interactive viewer ([9eb129b](https://github.com/AZX-PBC/morpheus/commit/9eb129bdb90f8ffb8be11e5025d4b59366ca2d96))
29
+ * Enhance error handling and messaging for migration failures ([712a83d](https://github.com/AZX-PBC/morpheus/commit/712a83d4d7b42fb285d2400ff32b8bf01efb576e))
30
+ * Enhance init_command to support interactive directory selection ([4cbfbc1](https://github.com/AZX-PBC/morpheus/commit/4cbfbc152a4ac82f4cc9a083b35aa77984626ed8))
31
+ * Enhance Makefile with additional test targets and cleanup commands ([9a1f41b](https://github.com/AZX-PBC/morpheus/commit/9a1f41ba1e742666f164bd5c422421dda516febc))
32
+ * Enhance migration status retrieval with error handling and warning checks for missing Migration label ([b6d47df](https://github.com/AZX-PBC/morpheus/commit/b6d47df06131b7941d5f753454706ae3faf86275))
33
+ * Enhance upgrade command with CI mode for detailed status messages on migration failures ([3ceeac1](https://github.com/AZX-PBC/morpheus/commit/3ceeac1a75c891239cd674e93066831e73aabed6))
34
+ * Implement enhanced error handling for migration failures with detailed guidance ([63f3a39](https://github.com/AZX-PBC/morpheus/commit/63f3a398615a00b11ed85e2948520d7e95dfb8d0))
35
+ * Implement failfast option for upgrade command and enhance migration skipping logic ([b1a3fba](https://github.com/AZX-PBC/morpheus/commit/b1a3fba4dd6efc4e407850f0c9a559fcc29858a6))
36
+ * Implement resolve_migrations_dir utility function and update migration directory resolution in commands ([9bc3e4e](https://github.com/AZX-PBC/morpheus/commit/9bc3e4e209db6deebc2f28beb093fc357b6502e9))
37
+ * Improve migration status command with handling for uninitialized tracking and warning display ([b711efc](https://github.com/AZX-PBC/morpheus/commit/b711efc5a0ba5880ba352dd68c4972a8b12904d3))
38
+ * Integrate MigrationStatus enumeration across migration commands and update status handling ([1d65515](https://github.com/AZX-PBC/morpheus/commit/1d65515507a9eb3c83b81bdef9d28a2fb3899460))
39
+ * Introduce MigrationStatus enumeration and update MigrationExecutor to use it ([79c7579](https://github.com/AZX-PBC/morpheus/commit/79c7579dd3d78f16b6242275d5fde9c52a6a1cea))
40
+ * **migration:** Refactor migration system to support class-based migrations ([750ecf0](https://github.com/AZX-PBC/morpheus/commit/750ecf0df640c9c34e9a7bef55546e8821f1c33e))
41
+ * Refactor project structure to support morpheus-neo4j package and update related configurations ([#3](https://github.com/AZX-PBC/morpheus/issues/3)) ([5048903](https://github.com/AZX-PBC/morpheus/commit/5048903c5ec89d6f7aeee56ff0bc34e06d44f8ed))
42
+ * Rename configuration file to morpheus-config.yml and update related references ([1dc9df8](https://github.com/AZX-PBC/morpheus/commit/1dc9df80c61fad023fee1943218eaa7f7ff03d75))
43
+ * Update Config class to support environment variables in YAML configuration ([5895541](https://github.com/AZX-PBC/morpheus/commit/5895541fcca653363a9a4330fcf576fb799150b0))
44
+ * Update configuration and initialization to support environment variables in YAML ([1446002](https://github.com/AZX-PBC/morpheus/commit/14460028d8f4baeb111f3adb310b1e8431ad93f2))
45
+
46
+
47
+ ### Bug Fixes
48
+
49
+ * Correct dependency direction in DAGResolver and related tests ([1edfed6](https://github.com/AZX-PBC/morpheus/commit/1edfed64f4a145b3b65899b515596574675413b8))
50
+ * Handle migration status update failure gracefully in execute_single_migration ([ce4cc15](https://github.com/AZX-PBC/morpheus/commit/ce4cc15e3ea97997f2fa52ce3ca3dd26396e1bec))
51
+
52
+
53
+ ### Documentation
54
+
55
+ * Add comprehensive README documentation for Morpheus migration system ([#1](https://github.com/AZX-PBC/morpheus/issues/1)) ([7858e83](https://github.com/AZX-PBC/morpheus/commit/7858e837bccd013fb4e225e6bb7ef728990c4460))
56
+ * Add MIT License file to the repository ([aef36af](https://github.com/AZX-PBC/morpheus/commit/aef36af43e55b181655281d33873fb177ee03818))
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 morpheus contributors
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.
@@ -0,0 +1,66 @@
1
+ .PHONY: help install test test-unit test-integration coverage lint format check all clean
2
+
3
+ help: ## Show this help
4
+ @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
5
+
6
+ install: ## Install dependencies
7
+ uv sync --extra dev
8
+
9
+ test: ## Run all tests (unit + integration with testcontainers)
10
+ uv run pytest tests/ -v
11
+
12
+ test-unit: ## Run unit tests only (fast, no Docker required)
13
+ uv run pytest tests/ -v -m "not integration"
14
+
15
+ test-integration: ## Run integration tests only (requires Docker)
16
+ uv run pytest tests/integration/ -v
17
+
18
+ coverage: ## Run tests with coverage report
19
+ uv run pytest tests/ --cov=morpheus --cov-report=term-missing --cov-report=html
20
+
21
+ lint: ## Run linting (check only)
22
+ uv run ruff check morpheus tests
23
+
24
+ format: ## Format code
25
+ uv run ruff format morpheus tests
26
+
27
+ check: ## Run linting and formatting check
28
+ uv run ruff check morpheus tests
29
+ uv run ruff format --check morpheus tests
30
+
31
+ typecheck: ## Run type checking with ty
32
+ uv run ty check
33
+
34
+ fix: ## Fix linting issues automatically
35
+ uv run ruff check --fix morpheus tests
36
+ uv run ruff format morpheus tests
37
+
38
+ all: install lint test ## Install deps, lint, and test
39
+
40
+ clean: ## Clean build artifacts
41
+ rm -rf .pytest_cache
42
+ rm -rf .ruff_cache
43
+ rm -rf htmlcov
44
+ rm -rf .coverage
45
+ find . -type d -name "__pycache__" -exec rm -rf {} +
46
+ find . -name "*.pyc" -delete
47
+
48
+ dev-setup: ## Set up development environment
49
+ uv sync --extra dev
50
+ @echo "Development environment ready!"
51
+ @echo "Run 'make help' to see available commands"
52
+
53
+ ci: ## Run CI checks (lint + typecheck + all tests)
54
+ uv run ruff check morpheus tests
55
+ uv run ruff format --check morpheus tests
56
+ uv run ty check
57
+ uv run pytest tests/ -v
58
+
59
+ demo: ## Run a quick demo
60
+ @echo "Creating demo migration system..."
61
+ @mkdir -p demo_temp && cd demo_temp
62
+ @uv run morpheus init
63
+ @uv run morpheus create initial_schema --tags schema
64
+ @uv run morpheus status
65
+ @uv run morpheus dag
66
+ @echo "Demo complete! Check demo_temp/ directory"