pyfabric 0.1.0a1__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 (110) hide show
  1. pyfabric-0.1.0a1/.gitattributes +18 -0
  2. pyfabric-0.1.0a1/.github/CODEOWNERS +2 -0
  3. pyfabric-0.1.0a1/.github/dependabot.yml +22 -0
  4. pyfabric-0.1.0a1/.github/workflows/ci.yml +58 -0
  5. pyfabric-0.1.0a1/.github/workflows/dependency-review.yml +17 -0
  6. pyfabric-0.1.0a1/.github/workflows/publish.yml +58 -0
  7. pyfabric-0.1.0a1/.gitignore +215 -0
  8. pyfabric-0.1.0a1/CLAUDE.md +104 -0
  9. pyfabric-0.1.0a1/CONTRIBUTING.md +94 -0
  10. pyfabric-0.1.0a1/LICENSE +21 -0
  11. pyfabric-0.1.0a1/PKG-INFO +158 -0
  12. pyfabric-0.1.0a1/README.md +103 -0
  13. pyfabric-0.1.0a1/docs/api.md +358 -0
  14. pyfabric-0.1.0a1/docs/prompts.md +237 -0
  15. pyfabric-0.1.0a1/docs/roadmap.md +62 -0
  16. pyfabric-0.1.0a1/docs/testing.md +215 -0
  17. pyfabric-0.1.0a1/docs/vision.md +47 -0
  18. pyfabric-0.1.0a1/pyproject.toml +180 -0
  19. pyfabric-0.1.0a1/src/pyfabric/__init__.py +10 -0
  20. pyfabric-0.1.0a1/src/pyfabric/_logging.py +173 -0
  21. pyfabric-0.1.0a1/src/pyfabric/_version.py +24 -0
  22. pyfabric-0.1.0a1/src/pyfabric/cli.py +160 -0
  23. pyfabric-0.1.0a1/src/pyfabric/client/__init__.py +1 -0
  24. pyfabric-0.1.0a1/src/pyfabric/client/auth.py +274 -0
  25. pyfabric-0.1.0a1/src/pyfabric/client/graph.py +157 -0
  26. pyfabric-0.1.0a1/src/pyfabric/client/http.py +257 -0
  27. pyfabric-0.1.0a1/src/pyfabric/client/livy.py +166 -0
  28. pyfabric-0.1.0a1/src/pyfabric/client/ontology/__init__.py +135 -0
  29. pyfabric-0.1.0a1/src/pyfabric/client/ontology/_id_gen.py +19 -0
  30. pyfabric-0.1.0a1/src/pyfabric/client/ontology/builder.py +447 -0
  31. pyfabric-0.1.0a1/src/pyfabric/client/ontology/crud.py +70 -0
  32. pyfabric-0.1.0a1/src/pyfabric/client/ontology/parts.py +591 -0
  33. pyfabric-0.1.0a1/src/pyfabric/client/ontology_sync.py +376 -0
  34. pyfabric-0.1.0a1/src/pyfabric/data/__init__.py +1 -0
  35. pyfabric-0.1.0a1/src/pyfabric/data/lakehouse.py +287 -0
  36. pyfabric-0.1.0a1/src/pyfabric/data/onelake.py +254 -0
  37. pyfabric-0.1.0a1/src/pyfabric/data/sql.py +195 -0
  38. pyfabric-0.1.0a1/src/pyfabric/items/__init__.py +1 -0
  39. pyfabric-0.1.0a1/src/pyfabric/items/bundle.py +243 -0
  40. pyfabric-0.1.0a1/src/pyfabric/items/crud.py +189 -0
  41. pyfabric-0.1.0a1/src/pyfabric/items/types.py +157 -0
  42. pyfabric-0.1.0a1/src/pyfabric/items/validate.py +143 -0
  43. pyfabric-0.1.0a1/src/pyfabric/py.typed +0 -0
  44. pyfabric-0.1.0a1/src/pyfabric/testing/__init__.py +14 -0
  45. pyfabric-0.1.0a1/src/pyfabric/testing/analyze.py +76 -0
  46. pyfabric-0.1.0a1/src/pyfabric/testing/duckdb_spark.py +268 -0
  47. pyfabric-0.1.0a1/src/pyfabric/testing/fixtures.py +47 -0
  48. pyfabric-0.1.0a1/src/pyfabric/testing/mock_notebookutils.py +122 -0
  49. pyfabric-0.1.0a1/src/pyfabric/testing/plugin.py +9 -0
  50. pyfabric-0.1.0a1/src/pyfabric/workspace/__init__.py +1 -0
  51. pyfabric-0.1.0a1/src/pyfabric/workspace/workspaces.py +155 -0
  52. pyfabric-0.1.0a1/tests/__init__.py +0 -0
  53. pyfabric-0.1.0a1/tests/client/__init__.py +0 -0
  54. pyfabric-0.1.0a1/tests/client/test_auth.py +151 -0
  55. pyfabric-0.1.0a1/tests/client/test_auth_errors.py +101 -0
  56. pyfabric-0.1.0a1/tests/client/test_graph_errors.py +84 -0
  57. pyfabric-0.1.0a1/tests/client/test_http.py +131 -0
  58. pyfabric-0.1.0a1/tests/client/test_http_errors.py +184 -0
  59. pyfabric-0.1.0a1/tests/client/test_livy.py +36 -0
  60. pyfabric-0.1.0a1/tests/client/test_livy_errors.py +124 -0
  61. pyfabric-0.1.0a1/tests/client/test_ontology.py +445 -0
  62. pyfabric-0.1.0a1/tests/client/test_ontology_parts.py +374 -0
  63. pyfabric-0.1.0a1/tests/conftest.py +217 -0
  64. pyfabric-0.1.0a1/tests/data/__init__.py +0 -0
  65. pyfabric-0.1.0a1/tests/data/test_onelake.py +32 -0
  66. pyfabric-0.1.0a1/tests/data/test_sample_db.py +150 -0
  67. pyfabric-0.1.0a1/tests/data/test_sql_errors.py +142 -0
  68. pyfabric-0.1.0a1/tests/fixtures/create_sample_db.py +164 -0
  69. pyfabric-0.1.0a1/tests/fixtures/workspace/df_example.Dataflow/.platform +12 -0
  70. pyfabric-0.1.0a1/tests/fixtures/workspace/df_example.Dataflow/mashup.pq +1 -0
  71. pyfabric-0.1.0a1/tests/fixtures/workspace/df_example.Dataflow/queryMetadata.json +11 -0
  72. pyfabric-0.1.0a1/tests/fixtures/workspace/env_example.Environment/.platform +11 -0
  73. pyfabric-0.1.0a1/tests/fixtures/workspace/env_example.Environment/Libraries/PublicLibraries/environment.yml +3 -0
  74. pyfabric-0.1.0a1/tests/fixtures/workspace/env_example.Environment/Setting/Sparkcompute.yml +6 -0
  75. pyfabric-0.1.0a1/tests/fixtures/workspace/lh_example.Lakehouse/.platform +11 -0
  76. pyfabric-0.1.0a1/tests/fixtures/workspace/lh_example.Lakehouse/lakehouse.metadata.json +1 -0
  77. pyfabric-0.1.0a1/tests/fixtures/workspace/nb_example.Notebook/.platform +11 -0
  78. pyfabric-0.1.0a1/tests/fixtures/workspace/nb_example.Notebook/notebook-content.py +11 -0
  79. pyfabric-0.1.0a1/tests/fixtures/workspace/pl_example.Pipeline/.platform +11 -0
  80. pyfabric-0.1.0a1/tests/fixtures/workspace/pl_example.Pipeline/pipeline-content.json +5 -0
  81. pyfabric-0.1.0a1/tests/fixtures/workspace/rpt_example.Report/.platform +11 -0
  82. pyfabric-0.1.0a1/tests/fixtures/workspace/rpt_example.Report/report.json +4 -0
  83. pyfabric-0.1.0a1/tests/fixtures/workspace/sm_example.SemanticModel/.platform +11 -0
  84. pyfabric-0.1.0a1/tests/fixtures/workspace/sm_example.SemanticModel/model.bim +7 -0
  85. pyfabric-0.1.0a1/tests/fixtures/workspace/vl_example.VariableLibrary/.platform +11 -0
  86. pyfabric-0.1.0a1/tests/fixtures/workspace/vl_example.VariableLibrary/settings.json +6 -0
  87. pyfabric-0.1.0a1/tests/fixtures/workspace/vl_example.VariableLibrary/valueSets/DEV.json +5 -0
  88. pyfabric-0.1.0a1/tests/fixtures/workspace/vl_example.VariableLibrary/variables.json +11 -0
  89. pyfabric-0.1.0a1/tests/fixtures/workspace/wh_example.Warehouse/.platform +11 -0
  90. pyfabric-0.1.0a1/tests/fixtures/workspace_invalid/bad_platform.Notebook/.platform +1 -0
  91. pyfabric-0.1.0a1/tests/fixtures/workspace_invalid/bad_platform.Notebook/notebook-content.py +1 -0
  92. pyfabric-0.1.0a1/tests/fixtures/workspace_invalid/nb_no_content.Notebook/.platform +11 -0
  93. pyfabric-0.1.0a1/tests/fixtures/workspace_invalid/wrong_name.Lakehouse/.platform +11 -0
  94. pyfabric-0.1.0a1/tests/fixtures/workspace_invalid/wrong_name.Lakehouse/lakehouse.metadata.json +1 -0
  95. pyfabric-0.1.0a1/tests/items/__init__.py +0 -0
  96. pyfabric-0.1.0a1/tests/items/test_bundle_errors.py +81 -0
  97. pyfabric-0.1.0a1/tests/items/test_crud.py +83 -0
  98. pyfabric-0.1.0a1/tests/items/test_types.py +155 -0
  99. pyfabric-0.1.0a1/tests/items/test_validate.py +281 -0
  100. pyfabric-0.1.0a1/tests/items/test_validate_e2e.py +73 -0
  101. pyfabric-0.1.0a1/tests/items/test_validate_pairwise.py +122 -0
  102. pyfabric-0.1.0a1/tests/test_cli.py +43 -0
  103. pyfabric-0.1.0a1/tests/test_logging.py +120 -0
  104. pyfabric-0.1.0a1/tests/test_version.py +9 -0
  105. pyfabric-0.1.0a1/tests/testing/__init__.py +0 -0
  106. pyfabric-0.1.0a1/tests/testing/test_analyze.py +15 -0
  107. pyfabric-0.1.0a1/tests/testing/test_duckdb_spark.py +157 -0
  108. pyfabric-0.1.0a1/tests/testing/test_mock_notebookutils.py +89 -0
  109. pyfabric-0.1.0a1/tests/workspace/__init__.py +0 -0
  110. pyfabric-0.1.0a1/tests/workspace/test_workspaces.py +56 -0
@@ -0,0 +1,18 @@
1
+ # Normalize all text files to LF in the repository
2
+ * text=auto eol=lf
3
+
4
+ # Explicitly mark binary files
5
+ *.png binary
6
+ *.jpg binary
7
+ *.whl binary
8
+
9
+ # Ensure key file types use LF everywhere
10
+ *.py text eol=lf
11
+ *.toml text eol=lf
12
+ *.yml text eol=lf
13
+ *.yaml text eol=lf
14
+ *.md text eol=lf
15
+ *.txt text eol=lf
16
+ *.cfg text eol=lf
17
+ *.ini text eol=lf
18
+ *.json text eol=lf
@@ -0,0 +1,2 @@
1
+ # All changes require review from an admin
2
+ * @hughdecatte
@@ -0,0 +1,22 @@
1
+ version: 2
2
+ updates:
3
+ # Keep GitHub Actions current (no CVE tracking for Actions)
4
+ - package-ecosystem: "github-actions"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
8
+ groups:
9
+ github-actions:
10
+ patterns:
11
+ - "*"
12
+
13
+ # Python deps: security updates ONLY (CVE-driven)
14
+ # Version updates are handled by Dependabot security updates (repo setting),
15
+ # not dependabot.yml version updates. This entry ensures the dependency
16
+ # graph stays current for vulnerability scanning without auto-bumping
17
+ # versions that have no known CVEs.
18
+ - package-ecosystem: "pip"
19
+ directory: "/"
20
+ schedule:
21
+ interval: "weekly"
22
+ open-pull-requests-limit: 0 # Disable version update PRs
@@ -0,0 +1,58 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: ci-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ lint:
18
+ name: Lint & Format
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v6
22
+ - uses: actions/setup-python@v6
23
+ with:
24
+ python-version: "3.12"
25
+ - run: pip install -e ".[dev]"
26
+ - run: ruff check .
27
+ - run: ruff format --check .
28
+
29
+ type-check:
30
+ name: Type Check
31
+ runs-on: ubuntu-latest
32
+ steps:
33
+ - uses: actions/checkout@v6
34
+ - uses: actions/setup-python@v6
35
+ with:
36
+ python-version: "3.12"
37
+ - run: pip install -e ".[dev]"
38
+ - run: mypy src/
39
+
40
+ test:
41
+ name: Test (Python ${{ matrix.python-version }})
42
+ runs-on: ubuntu-latest
43
+ strategy:
44
+ fail-fast: false
45
+ matrix:
46
+ python-version: ["3.12", "3.13"]
47
+ steps:
48
+ - uses: actions/checkout@v6
49
+ - uses: actions/setup-python@v6
50
+ with:
51
+ python-version: ${{ matrix.python-version }}
52
+ - run: pip install -e ".[dev]"
53
+ - run: pytest --cov=src/pyfabric --cov-branch --cov-report=term-missing --json-report --json-report-file=test-report.json
54
+ - uses: actions/upload-artifact@v7
55
+ if: always()
56
+ with:
57
+ name: test-report-py${{ matrix.python-version }}
58
+ path: test-report.json
@@ -0,0 +1,17 @@
1
+ name: Dependency Review
2
+
3
+ on: [pull_request]
4
+
5
+ permissions:
6
+ contents: read
7
+
8
+ jobs:
9
+ dependency-review:
10
+ name: Dependency Review
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v6
14
+ - uses: actions/dependency-review-action@v4
15
+ with:
16
+ fail-on-severity: high
17
+ deny-licenses: GPL-3.0, AGPL-3.0
@@ -0,0 +1,58 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ build:
9
+ name: Build distribution
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: write
13
+ steps:
14
+ - uses: actions/checkout@v6
15
+ with:
16
+ fetch-depth: 0 # Required for hatch-vcs to derive version from tags
17
+ - uses: actions/setup-python@v6
18
+ with:
19
+ python-version: "3.12"
20
+ - run: pip install build pip-audit
21
+ - run: pip-audit
22
+ - run: python -m build
23
+ - uses: anchore/sbom-action@v0
24
+ with:
25
+ path: dist/
26
+ format: spdx-json
27
+ output-file: sbom.spdx.json
28
+ - uses: actions/upload-artifact@v7
29
+ with:
30
+ name: dist
31
+ path: dist/
32
+ - uses: actions/upload-artifact@v7
33
+ with:
34
+ name: sbom
35
+ path: sbom.spdx.json
36
+
37
+ publish:
38
+ name: Publish to PyPI
39
+ needs: build
40
+ runs-on: ubuntu-latest
41
+ environment:
42
+ name: pypi
43
+ url: https://pypi.org/p/pyfabric
44
+ permissions:
45
+ id-token: write
46
+ attestations: write
47
+ contents: read
48
+ steps:
49
+ - uses: actions/download-artifact@v8
50
+ with:
51
+ name: dist
52
+ path: dist/
53
+ - uses: actions/attest-build-provenance@v4
54
+ with:
55
+ subject-path: dist/*
56
+ - uses: pypa/gh-action-pypi-publish@release/v1
57
+ with:
58
+ attestations: true
@@ -0,0 +1,215 @@
1
+ # hatch-vcs generated version file
2
+ src/pyfabric/_version.py
3
+
4
+ # Test artifacts
5
+ .test-report.json
6
+ .logs/
7
+ tests/fixtures/sample.duckdb
8
+
9
+ # Byte-compiled / optimized / DLL files
10
+ __pycache__/
11
+ *.py[codz]
12
+ *$py.class
13
+
14
+ # C extensions
15
+ *.so
16
+
17
+ # Distribution / packaging
18
+ .Python
19
+ build/
20
+ develop-eggs/
21
+ dist/
22
+ downloads/
23
+ eggs/
24
+ .eggs/
25
+ lib/
26
+ lib64/
27
+ parts/
28
+ sdist/
29
+ var/
30
+ wheels/
31
+ share/python-wheels/
32
+ *.egg-info/
33
+ .installed.cfg
34
+ *.egg
35
+ MANIFEST
36
+
37
+ # PyInstaller
38
+ # Usually these files are written by a python script from a template
39
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
40
+ *.manifest
41
+ *.spec
42
+
43
+ # Installer logs
44
+ pip-log.txt
45
+ pip-delete-this-directory.txt
46
+
47
+ # Unit test / coverage reports
48
+ htmlcov/
49
+ .tox/
50
+ .nox/
51
+ .coverage
52
+ .coverage.*
53
+ .cache
54
+ nosetests.xml
55
+ coverage.xml
56
+ *.cover
57
+ *.py.cover
58
+ .hypothesis/
59
+ .pytest_cache/
60
+ cover/
61
+
62
+ # Translations
63
+ *.mo
64
+ *.pot
65
+
66
+ # Django stuff:
67
+ *.log
68
+ local_settings.py
69
+ db.sqlite3
70
+ db.sqlite3-journal
71
+
72
+ # Flask stuff:
73
+ instance/
74
+ .webassets-cache
75
+
76
+ # Scrapy stuff:
77
+ .scrapy
78
+
79
+ # Sphinx documentation
80
+ docs/_build/
81
+
82
+ # PyBuilder
83
+ .pybuilder/
84
+ target/
85
+
86
+ # Jupyter Notebook
87
+ .ipynb_checkpoints
88
+
89
+ # IPython
90
+ profile_default/
91
+ ipython_config.py
92
+
93
+ # pyenv
94
+ # For a library or package, you might want to ignore these files since the code is
95
+ # intended to run in multiple environments; otherwise, check them in:
96
+ # .python-version
97
+
98
+ # pipenv
99
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
100
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
101
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
102
+ # install all needed dependencies.
103
+ #Pipfile.lock
104
+
105
+ # UV
106
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
107
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
108
+ # commonly ignored for libraries.
109
+ #uv.lock
110
+
111
+ # poetry
112
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
113
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
114
+ # commonly ignored for libraries.
115
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
116
+ #poetry.lock
117
+ #poetry.toml
118
+
119
+ # pdm
120
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
121
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
122
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
123
+ #pdm.lock
124
+ #pdm.toml
125
+ .pdm-python
126
+ .pdm-build/
127
+
128
+ # pixi
129
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
130
+ #pixi.lock
131
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
132
+ # in the .venv directory. It is recommended not to include this directory in version control.
133
+ .pixi
134
+
135
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
136
+ __pypackages__/
137
+
138
+ # Celery stuff
139
+ celerybeat-schedule
140
+ celerybeat.pid
141
+
142
+ # SageMath parsed files
143
+ *.sage.py
144
+
145
+ # Environments
146
+ .env
147
+ .envrc
148
+ .venv
149
+ env/
150
+ venv/
151
+ ENV/
152
+ env.bak/
153
+ venv.bak/
154
+
155
+ # Spyder project settings
156
+ .spyderproject
157
+ .spyproject
158
+
159
+ # Rope project settings
160
+ .ropeproject
161
+
162
+ # mkdocs documentation
163
+ /site
164
+
165
+ # mypy
166
+ .mypy_cache/
167
+ .dmypy.json
168
+ dmypy.json
169
+
170
+ # Pyre type checker
171
+ .pyre/
172
+
173
+ # pytype static type analyzer
174
+ .pytype/
175
+
176
+ # Cython debug symbols
177
+ cython_debug/
178
+
179
+ # PyCharm
180
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
181
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
182
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
183
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
184
+ #.idea/
185
+
186
+ # Abstra
187
+ # Abstra is an AI-powered process automation framework.
188
+ # Ignore directories containing user credentials, local state, and settings.
189
+ # Learn more at https://abstra.io/docs
190
+ .abstra/
191
+
192
+ # Visual Studio Code
193
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
194
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
195
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
196
+ # you could uncomment the following to ignore the entire vscode folder
197
+ # .vscode/
198
+
199
+ # Ruff stuff:
200
+ .ruff_cache/
201
+
202
+ # PyPI configuration file
203
+ .pypirc
204
+
205
+ # Cursor
206
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
207
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
208
+ # refer to https://docs.cursor.com/context/ignore-files
209
+ .cursorignore
210
+ .cursorindexingignore
211
+
212
+ # Marimo
213
+ marimo/_static/
214
+ marimo/_lsp/
215
+ __marimo__/
@@ -0,0 +1,104 @@
1
+ # CLAUDE.md
2
+
3
+ Instructions for AI coding assistants (Claude, Copilot, etc.) working in
4
+ this repository.
5
+
6
+ ## Project Overview
7
+
8
+ pyfabric is a Python library for programmatically creating, validating,
9
+ and locally testing Microsoft Fabric items that are compatible with Fabric
10
+ git sync. Target users are AI coding assistants and developers who need to
11
+ generate and test Fabric item definitions locally.
12
+
13
+ ## Technical Stack
14
+
15
+ - **Python**: 3.12+ (use modern syntax: `type X = ...`, `match`, `X | Y` unions)
16
+ - **Build**: hatchling with hatch-vcs (version from git tags)
17
+ - **Layout**: src-layout (`src/pyfabric/`)
18
+ - **Linting**: ruff (configured in pyproject.toml)
19
+ - **Type checking**: mypy in strict mode
20
+ - **Logging**: structlog (JSON output, token masking, context binding)
21
+ - **Testing**: pytest (tests in `tests/`)
22
+ - **CI**: GitHub Actions (lint, type-check, test, dependency review)
23
+
24
+ ## Sub-package Structure
25
+
26
+ ```
27
+ src/pyfabric/
28
+ client/ — Auth, REST API, HTTP client for Fabric service
29
+ items/ — Create, load, save, validate Fabric item definitions
30
+ data/ — OneLake DFS, SQL connections, lakehouse table I/O
31
+ workspace/ — Workspace-level operations
32
+ testing/ — pytest fixtures, DuckDB Spark mock for users
33
+ cli.py — CLI entry point
34
+ ```
35
+
36
+ ## Key Conventions
37
+
38
+ - All code must pass `ruff check`, `ruff format --check`, and `mypy --strict`
39
+ - All public functions and classes must have type annotations
40
+ - Use `X | None` not `typing.Optional[X]`; use `X | Y` not `typing.Union`
41
+ - Use `list`, `dict`, `tuple` not `typing.List`, `typing.Dict`, `typing.Tuple`
42
+ - `from __future__ import annotations` is NOT needed (Python 3.12+)
43
+ - Prefer `pathlib.Path` over `os.path`
44
+ - Prefer dataclasses or named tuples over plain dicts for structured data
45
+ - Tests use pytest fixtures; avoid unittest.TestCase
46
+ - No mutable default arguments
47
+ - Use `import structlog` and `log = structlog.get_logger()` (NOT stdlib `logging`)
48
+ - Use `log.info("message", key=value)` for structured context (NOT f-strings in messages)
49
+
50
+ ## Running Checks
51
+
52
+ ```bash
53
+ ruff check . # Lint
54
+ ruff format --check . # Format check
55
+ mypy src/ # Type check
56
+ pytest # Run tests
57
+ ```
58
+
59
+ ## Version Management
60
+
61
+ Version is derived from git tags via hatch-vcs. Do NOT manually edit
62
+ version strings. The file `src/pyfabric/_version.py` is auto-generated
63
+ and must not be committed.
64
+
65
+ ## Dependencies
66
+
67
+ - Runtime dependencies go in `[project] dependencies` in pyproject.toml
68
+ - Optional dependency groups: `[azure]`, `[data]`, `[testing]`, `[all]`, `[dev]`
69
+ - Keep runtime dependencies minimal — heavy deps belong in optional groups
70
+
71
+ ## Fabric Item Structure (git sync format)
72
+
73
+ All Fabric items follow this directory structure:
74
+
75
+ ```
76
+ {DisplayName}.{ItemType}/
77
+ .platform # Required: metadata + logicalId (UUID)
78
+ {definition_files...} # Item-specific content
79
+ ```
80
+
81
+ The `.platform` file uses schema version 2.0:
82
+ ```json
83
+ {
84
+ "$schema": "https://developer.microsoft.com/json-schemas/fabric/gitIntegration/platformProperties/2.0.0/schema.json",
85
+ "metadata": {
86
+ "type": "{ItemType}",
87
+ "displayName": "{DisplayName}"
88
+ },
89
+ "config": {
90
+ "version": "2.0",
91
+ "logicalId": "{UUID}"
92
+ }
93
+ }
94
+ ```
95
+
96
+ Supported item types: Notebook, Lakehouse, Dataflow, Environment,
97
+ VariableLibrary, SemanticModel, Report, Pipeline, Warehouse.
98
+
99
+ ## What NOT to Do
100
+
101
+ - Do not add `__version__ = "..."` manually anywhere
102
+ - Do not create setup.py or setup.cfg
103
+ - Do not commit `src/pyfabric/_version.py`
104
+ - Do not use `datetime.utcnow()` — use `datetime.now(timezone.utc)`
@@ -0,0 +1,94 @@
1
+ # Contributing
2
+
3
+ This project is maintained exclusively by the Creative Planning engineering
4
+ team. We do not accept external pull requests, issues, or feature requests.
5
+
6
+ You are welcome to fork this repository and modify it under the terms of
7
+ the [MIT License](LICENSE).
8
+
9
+ ---
10
+
11
+ ## For Creative Planning Team Members
12
+
13
+ ### Development Setup
14
+
15
+ ```bash
16
+ git clone https://github.com/Creative-Planning/pyfabric.git
17
+ cd pyfabric
18
+ python -m venv .venv
19
+ source .venv/bin/activate # or .venv\Scripts\activate on Windows
20
+ pip install -e ".[dev]"
21
+ ```
22
+
23
+ ### Running Checks Locally
24
+
25
+ ```bash
26
+ ruff check . # Lint
27
+ ruff format --check . # Format check
28
+ ruff format . # Auto-format
29
+ mypy src/ # Type check
30
+ pytest # Tests
31
+ pytest --cov=pyfabric # Tests with coverage
32
+ pip-audit # Vulnerability scan
33
+ ```
34
+
35
+ ### Branch Workflow
36
+
37
+ 1. Create a feature branch from `main`
38
+ 2. Make your changes and commit locally
39
+ 3. Push your branch and open a pull request against `main`
40
+ 4. CI checks must pass (lint, format, type check, tests, dependency review)
41
+ 5. A CODEOWNERS review is required
42
+ 6. PRs are **squash merged** — your commits are combined into one clean
43
+ commit on `main` with a linear history
44
+
45
+ Squash merge is the only merge strategy enabled on this repo.
46
+
47
+ ### Commit Signing
48
+
49
+ The `main` branch requires signed commits. Because all PRs are squash
50
+ merged through the GitHub UI, **GitHub signs the squash commit
51
+ automatically** — you do not need to configure commit signing on your
52
+ machine to contribute via pull requests.
53
+
54
+ If you want verified signatures on your own branch commits (optional),
55
+ configure SSH signing:
56
+
57
+ 1. Generate or import an ed25519 SSH key
58
+ 2. Add the public key to your GitHub account as a **signing key**
59
+ (Settings > SSH and GPG keys > New SSH key > Key type: Signing key)
60
+ 3. Configure git:
61
+ ```bash
62
+ git config --global gpg.format ssh
63
+ git config --global user.signingkey "key::ssh-ed25519 AAAA...your-public-key..."
64
+ git config --global commit.gpgsign true
65
+ ```
66
+ 4. On Windows, point git at the Windows OpenSSH binaries so it can reach
67
+ the system SSH agent:
68
+ ```bash
69
+ git config --global core.sshCommand "C:/Windows/System32/OpenSSH/ssh.exe"
70
+ git config --global gpg.ssh.program "C:/Windows/System32/OpenSSH/ssh-keygen.exe"
71
+ ```
72
+ 5. Ensure the Windows OpenSSH agent service is running (requires
73
+ administrator PowerShell):
74
+ ```powershell
75
+ Set-Service ssh-agent -StartupType Automatic
76
+ Start-Service ssh-agent
77
+ ```
78
+
79
+ ### Pull Request Requirements
80
+
81
+ All PRs require:
82
+
83
+ - Passing CI (lint, type check, tests, dependency review)
84
+ - One approving review from a code owner
85
+ - Signed commits on `main` (handled automatically by squash merge)
86
+
87
+ ### Releasing
88
+
89
+ 1. Merge all changes to `main`.
90
+ 2. Create a git tag: `git tag v0.1.0`
91
+ 3. Push the tag: `git push origin v0.1.0`
92
+ 4. Create a GitHub Release from the tag.
93
+ 5. The publish workflow handles PyPI upload, SBOM generation, and
94
+ SLSA attestation automatically.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Creative Planning
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.