pyairflowtester 0.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.
Files changed (60) hide show
  1. pyairflowtester-0.1.0/.github/workflows/ci.yml +212 -0
  2. pyairflowtester-0.1.0/.gitignore +58 -0
  3. pyairflowtester-0.1.0/.pre-commit-config.yaml +52 -0
  4. pyairflowtester-0.1.0/COMPLETE_SYSTEM_SUMMARY.md +449 -0
  5. pyairflowtester-0.1.0/Cargo.lock +2778 -0
  6. pyairflowtester-0.1.0/Cargo.toml +44 -0
  7. pyairflowtester-0.1.0/DEPENDENCY_CACHING_STRATEGY.md +790 -0
  8. pyairflowtester-0.1.0/DEPENDENCY_INTELLIGENCE_DESIGN.md +1041 -0
  9. pyairflowtester-0.1.0/DEPENDENCY_INTELLIGENCE_PHASE1_COMPLETE.md +499 -0
  10. pyairflowtester-0.1.0/IMPLEMENTATION_STATUS.md +311 -0
  11. pyairflowtester-0.1.0/LICENSE +36 -0
  12. pyairflowtester-0.1.0/Makefile +86 -0
  13. pyairflowtester-0.1.0/P0_COMPLETE.md +284 -0
  14. pyairflowtester-0.1.0/PHASE1_DELIVERY_CHECKLIST.md +364 -0
  15. pyairflowtester-0.1.0/PHASE1_IMPLEMENTATION_SUMMARY.md +460 -0
  16. pyairflowtester-0.1.0/PHASES_2_4_COMPLETE.md +586 -0
  17. pyairflowtester-0.1.0/PKG-INFO +362 -0
  18. pyairflowtester-0.1.0/README.md +313 -0
  19. pyairflowtester-0.1.0/WEEKS_5_8_COMPLETE.md +352 -0
  20. pyairflowtester-0.1.0/db/migrations/001_init_schema.sql +182 -0
  21. pyairflowtester-0.1.0/examples/dependency_intelligence_usage.py +360 -0
  22. pyairflowtester-0.1.0/examples/github_workflow.yml +123 -0
  23. pyairflowtester-0.1.0/examples/sample_dag.py +104 -0
  24. pyairflowtester-0.1.0/pyproject.toml +109 -0
  25. pyairflowtester-0.1.0/python/pyairflowtester/__init__.py +31 -0
  26. pyairflowtester-0.1.0/python/pyairflowtester/analyzer.py +163 -0
  27. pyairflowtester-0.1.0/python/pyairflowtester/cli.py +281 -0
  28. pyairflowtester-0.1.0/python/pyairflowtester/dependency_intelligence/__init__.py +110 -0
  29. pyairflowtester-0.1.0/python/pyairflowtester/dependency_intelligence/analytics.py +391 -0
  30. pyairflowtester-0.1.0/python/pyairflowtester/dependency_intelligence/analyzers.py +421 -0
  31. pyairflowtester-0.1.0/python/pyairflowtester/dependency_intelligence/cli.py +350 -0
  32. pyairflowtester-0.1.0/python/pyairflowtester/dependency_intelligence/graph.py +414 -0
  33. pyairflowtester-0.1.0/python/pyairflowtester/dependency_intelligence/intelligence.py +459 -0
  34. pyairflowtester-0.1.0/python/pyairflowtester/dependency_intelligence/models.py +206 -0
  35. pyairflowtester-0.1.0/python/pyairflowtester/dependency_intelligence/observability.py +428 -0
  36. pyairflowtester-0.1.0/python/pyairflowtester/dependency_intelligence/parsers.py +382 -0
  37. pyairflowtester-0.1.0/python/pyairflowtester/models.py +133 -0
  38. pyairflowtester-0.1.0/python/pyairflowtester/report.py +206 -0
  39. pyairflowtester-0.1.0/python/pyairflowtester/rules/__init__.py +360 -0
  40. pyairflowtester-0.1.0/python/pyairflowtester/rules/config.py +469 -0
  41. pyairflowtester-0.1.0/python/pyairflowtester/rules/dag.py +142 -0
  42. pyairflowtester-0.1.0/python/pyairflowtester/rules/dag_advanced.py +381 -0
  43. pyairflowtester-0.1.0/python/pyairflowtester/rules/dbt.py +166 -0
  44. pyairflowtester-0.1.0/python/pyairflowtester/scanner.py +123 -0
  45. pyairflowtester-0.1.0/python/pyairflowtester/scoring.py +146 -0
  46. pyairflowtester-0.1.0/python/tests/__init__.py +1 -0
  47. pyairflowtester-0.1.0/python/tests/test_dag_advanced_rules.py +241 -0
  48. pyairflowtester-0.1.0/python/tests/test_dependency_analytics.py +274 -0
  49. pyairflowtester-0.1.0/python/tests/test_dependency_analyzers.py +335 -0
  50. pyairflowtester-0.1.0/python/tests/test_dependency_graph.py +289 -0
  51. pyairflowtester-0.1.0/python/tests/test_dependency_intelligence_phase2.py +377 -0
  52. pyairflowtester-0.1.0/python/tests/test_dependency_parsers.py +388 -0
  53. pyairflowtester-0.1.0/python/tests/test_scanner.py +75 -0
  54. pyairflowtester-0.1.0/python/tests/test_scoring.py +122 -0
  55. pyairflowtester-0.1.0/src/dag_parser.rs +300 -0
  56. pyairflowtester-0.1.0/src/dbt_parser.rs +348 -0
  57. pyairflowtester-0.1.0/src/lib.rs +111 -0
  58. pyairflowtester-0.1.0/src/rule_engine.rs +288 -0
  59. pyairflowtester-0.1.0/src/scoring.rs +256 -0
  60. pyairflowtester-0.1.0/tests/test_rule_engine.rs +112 -0
@@ -0,0 +1,212 @@
1
+ name: CI/CD Pipeline
2
+
3
+ on:
4
+ push:
5
+ branches: [main, develop]
6
+ pull_request:
7
+ branches: [main, develop]
8
+
9
+ env:
10
+ CARGO_TERM_COLOR: always
11
+ RUST_BACKTRACE: 1
12
+
13
+ jobs:
14
+ rust-tests:
15
+ name: Rust Tests & Build
16
+ runs-on: ubuntu-latest
17
+ strategy:
18
+ matrix:
19
+ rust: [stable, beta]
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+
23
+ - name: Install Rust
24
+ uses: dtolnay/rust-toolchain@master
25
+ with:
26
+ toolchain: ${{ matrix.rust }}
27
+
28
+ - name: Cache cargo registry
29
+ uses: actions/cache@v3
30
+ with:
31
+ path: ~/.cargo/registry
32
+ key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
33
+
34
+ - name: Cache cargo index
35
+ uses: actions/cache@v3
36
+ with:
37
+ path: ~/.cargo/git
38
+ key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
39
+
40
+ - name: Cache cargo build
41
+ uses: actions/cache@v3
42
+ with:
43
+ path: target
44
+ key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
45
+
46
+ - name: Run tests
47
+ run: cargo test --verbose
48
+
49
+ - name: Run clippy
50
+ run: cargo clippy -- -D warnings
51
+
52
+ - name: Build release
53
+ run: cargo build --release
54
+
55
+ python-tests:
56
+ name: Python Tests
57
+ runs-on: ubuntu-latest
58
+ strategy:
59
+ matrix:
60
+ python-version: ["3.10", "3.11", "3.12"]
61
+ steps:
62
+ - uses: actions/checkout@v4
63
+
64
+ - name: Set up Python
65
+ uses: actions/setup-python@v4
66
+ with:
67
+ python-version: ${{ matrix.python-version }}
68
+ cache: 'pip'
69
+
70
+ - name: Install dependencies
71
+ run: |
72
+ python -m pip install --upgrade pip
73
+ pip install -e ".[dev]"
74
+
75
+ - name: Lint with ruff
76
+ run: ruff check python/
77
+
78
+ - name: Format check with black
79
+ run: black --check python/
80
+
81
+ - name: Type check with mypy
82
+ run: mypy python/pyairflowtester --ignore-missing-imports || true
83
+
84
+ - name: Run pytest
85
+ run: pytest python/tests/ -v --cov=pyairflowtester --cov-report=xml
86
+
87
+ - name: Upload coverage
88
+ uses: codecov/codecov-action@v3
89
+ with:
90
+ files: ./coverage.xml
91
+ flags: python
92
+
93
+ security-scan:
94
+ name: Security Scan
95
+ runs-on: ubuntu-latest
96
+ steps:
97
+ - uses: actions/checkout@v4
98
+
99
+ - name: Run cargo audit
100
+ uses: rustsec/audit-check-action@v1
101
+
102
+ - name: Run bandit on Python code
103
+ run: |
104
+ pip install bandit
105
+ bandit -r python/pyairflowtester || true
106
+
107
+ build-wheels:
108
+ name: Build Python Wheels
109
+ runs-on: ubuntu-latest
110
+ needs: [rust-tests, python-tests]
111
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
112
+ steps:
113
+ - uses: actions/checkout@v4
114
+
115
+ - name: Set up Python
116
+ uses: actions/setup-python@v4
117
+ with:
118
+ python-version: "3.11"
119
+
120
+ - name: Install Rust
121
+ uses: dtolnay/rust-toolchain@stable
122
+
123
+ - name: Install maturin
124
+ run: pip install maturin
125
+
126
+ - name: Build wheels
127
+ run: maturin build --release
128
+
129
+ - name: Upload wheels
130
+ uses: actions/upload-artifact@v3
131
+ with:
132
+ name: wheels
133
+ path: target/wheels/
134
+
135
+ integration-tests:
136
+ name: Integration Tests
137
+ runs-on: ubuntu-latest
138
+ services:
139
+ postgres:
140
+ image: postgres:15
141
+ env:
142
+ POSTGRES_PASSWORD: postgres
143
+ options: >-
144
+ --health-cmd pg_isready
145
+ --health-interval 10s
146
+ --health-timeout 5s
147
+ --health-retries 5
148
+ ports:
149
+ - 5432:5432
150
+
151
+ steps:
152
+ - uses: actions/checkout@v4
153
+
154
+ - name: Set up Python
155
+ uses: actions/setup-python@v4
156
+ with:
157
+ python-version: "3.11"
158
+
159
+ - name: Install dependencies
160
+ run: |
161
+ python -m pip install --upgrade pip
162
+ pip install -e ".[dev]"
163
+
164
+ - name: Setup database
165
+ env:
166
+ POSTGRES_HOST: localhost
167
+ POSTGRES_USER: postgres
168
+ POSTGRES_PASSWORD: postgres
169
+ run: |
170
+ pip install psycopg2-binary
171
+ python -c "
172
+ import psycopg2
173
+ conn = psycopg2.connect('host=localhost user=postgres password=postgres')
174
+ conn.autocommit = True
175
+ with conn.cursor() as cur:
176
+ cur.execute('CREATE DATABASE pyairflowtester_test')
177
+ conn.close()
178
+ "
179
+
180
+ - name: Run integration tests
181
+ env:
182
+ DATABASE_URL: postgresql://postgres:postgres@localhost/pyairflowtester_test
183
+ run: pytest python/tests/integration/ -v
184
+
185
+ deploy-docs:
186
+ name: Deploy Documentation
187
+ runs-on: ubuntu-latest
188
+ needs: [rust-tests, python-tests]
189
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
190
+ steps:
191
+ - uses: actions/checkout@v4
192
+
193
+ - name: Set up Python
194
+ uses: actions/setup-python@v4
195
+ with:
196
+ python-version: "3.11"
197
+
198
+ - name: Install dependencies
199
+ run: |
200
+ pip install sphinx sphinx-rtd-theme
201
+
202
+ - name: Build documentation
203
+ run: |
204
+ cd docs
205
+ make html
206
+
207
+ - name: Deploy to GitHub Pages
208
+ uses: peaceiris/actions-gh-pages@v3
209
+ if: github.ref == 'refs/heads/main'
210
+ with:
211
+ github_token: ${{ secrets.GITHUB_TOKEN }}
212
+ publish_dir: ./docs/_build/html
@@ -0,0 +1,58 @@
1
+ # Rust
2
+ /target/
3
+ Cargo.lock
4
+ **/*.rs.bk
5
+
6
+ # Python
7
+ __pycache__/
8
+ *.py[cod]
9
+ *$py.class
10
+ *.so
11
+ .Python
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ pip-wheel-metadata/
25
+ share/python-wheels/
26
+ *.egg-info/
27
+ .installed.cfg
28
+ *.egg
29
+ MANIFEST
30
+
31
+ # Virtual environments
32
+ venv/
33
+ env/
34
+ ENV/
35
+
36
+ # IDEs
37
+ .vscode/
38
+ .idea/
39
+ *.swp
40
+ *.swo
41
+ *~
42
+
43
+ # Database
44
+ *.db
45
+ *.sqlite
46
+ *.sqlite3
47
+
48
+ # Environment
49
+ .env
50
+ .env.local
51
+
52
+ # OS
53
+ .DS_Store
54
+ Thumbs.db
55
+
56
+ # Builds
57
+ *.whl
58
+ *.tar.gz
@@ -0,0 +1,52 @@
1
+ repos:
2
+ # Python formatting and linting
3
+ - repo: https://github.com/psf/black
4
+ rev: 23.12.0
5
+ hooks:
6
+ - id: black
7
+ language_version: python3
8
+ files: ^python/
9
+
10
+ - repo: https://github.com/astral-sh/ruff-pre-commit
11
+ rev: v0.1.11
12
+ hooks:
13
+ - id: ruff
14
+ args: [--fix]
15
+ files: ^python/
16
+
17
+ # Rust formatting
18
+ - repo: https://github.com/rust-lang/rust-clippy
19
+ rev: v0.1.75
20
+ hooks:
21
+ - id: clippy
22
+ files: ^src/
23
+
24
+ - repo: https://github.com/doublify/pre-commit-rust
25
+ rev: v1.0
26
+ hooks:
27
+ - id: fmt
28
+ files: ^src/
29
+
30
+ # YAML validation
31
+ - repo: https://github.com/pre-commit/pre-commit-hooks
32
+ rev: v4.5.0
33
+ hooks:
34
+ - id: check-yaml
35
+ - id: check-json
36
+ - id: check-toml
37
+ - id: end-of-file-fixer
38
+ - id: trailing-whitespace
39
+ - id: debug-statements
40
+ - id: detect-private-key
41
+
42
+ # PyAirflowTester - DAG/dbt scanning
43
+ - repo: local
44
+ hooks:
45
+ - id: pyairflowtester-scan
46
+ name: PyAirflowTester Scan
47
+ entry: pyairflowtester scan
48
+ language: system
49
+ types: [python]
50
+ files: ^(dags|dbt)/
51
+ pass_filenames: false
52
+ stages: [commit]