Skip to content

Commit 7d24791

Browse files
Initial PR & build pipeline definitions (#27)
* initial pipeline setup * align with agents-for-python 1 * make format errors non blocking for now --------- Co-authored-by: Tim Pellissier <tpellissier@microsoft.com>
1 parent 81d2c8f commit 7d24791

8 files changed

Lines changed: 229 additions & 22 deletions

File tree

.azdo/ci-pr.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Azure DevOps PR validation pipeline
2+
# Matches GitHub Actions workflow for consistency
3+
4+
pr:
5+
- main
6+
7+
trigger: none # Only run on PRs, not on direct pushes
8+
9+
pool:
10+
vmImage: ubuntu-latest
11+
12+
# Simplified to single Python version (per project requirements)
13+
# Can expand to matrix testing later if needed
14+
15+
steps:
16+
- task: UsePythonVersion@0
17+
inputs:
18+
versionSpec: '3.12'
19+
addToPath: true
20+
displayName: 'Use Python 3.12'
21+
22+
- script: |
23+
python -m pip install --upgrade pip
24+
python -m pip install flake8 black build
25+
if [ -f dev_dependencies.txt ]; then pip install -r dev_dependencies.txt; fi
26+
displayName: 'Install dependencies'
27+
28+
- script: |
29+
black src tests --check
30+
displayName: 'Check format with black'
31+
32+
- script: |
33+
# stop the build if there are Python syntax errors or undefined names
34+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35+
# exit-zero treats all errors as warnings
36+
flake8 . --count --exit-zero --show-source --statistics
37+
displayName: 'Lint with flake8'
38+
39+
- script: |
40+
python -m build
41+
displayName: 'Build package'
42+
43+
- script: |
44+
python -m pip install dist/*.whl
45+
displayName: 'Install wheel'
46+
47+
- script: |
48+
pytest
49+
displayName: 'Test with pytest'
50+
51+
- task: PublishTestResults@2
52+
condition: succeededOrFailed()
53+
inputs:
54+
testResultsFiles: '**/test-*.xml'
55+
testRunTitle: 'Python 3.12'
56+
displayName: 'Publish test results'

.flake8

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[flake8]
2+
max-line-length = 120
3+
max-complexity = 10
4+
exclude =
5+
__pycache__
6+
.venv
7+
venv
8+
build
9+
dist
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Python package
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
# Simplified to single Python version (per project requirements)
17+
# Can expand to matrix testing later: strategy.matrix.python-version: ["3.10", "3.11", "3.12", "3.13"]
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Python 3.12
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.12"
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install flake8 black build
31+
if [ -f dev_dependencies.txt ]; then pip install -r dev_dependencies.txt; fi
32+
33+
- name: Check format with black
34+
continue-on-error: true # TODO: fix detected formatting errors and remove this line.
35+
run: |
36+
black src tests --check
37+
38+
- name: Lint with flake8
39+
run: |
40+
# stop the build if there are Python syntax errors or undefined names
41+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
42+
# exit-zero treats all errors as warnings, matching Agents-for-python approach
43+
flake8 . --count --exit-zero --show-source --statistics
44+
45+
- name: Build package
46+
run: |
47+
python -m build
48+
49+
- name: Install wheel
50+
run: |
51+
python -m pip install dist/*.whl
52+
53+
- name: Test with pytest
54+
run: |
55+
pytest

CHANGELOG.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
- Initial SDK implementation with CRUD operations
12+
- Service principal authentication support
13+
- Interactive browser authentication support
14+
- SQL query execution via `query_sql()`
15+
- File upload capabilities
16+
- Pandas integration for query results
17+
- Structured error handling with specific exception types
18+
- GitHub Actions CI pipeline for automated testing
19+
- Azure DevOps PR validation pipeline
20+
21+
### Changed
22+
- N/A
23+
24+
### Deprecated
25+
- N/A
26+
27+
### Removed
28+
- N/A
29+
30+
### Fixed
31+
- N/A
32+
33+
### Security
34+
- N/A
35+
36+
## [0.1.0] - TBD
37+
38+
### Added
39+
- First alpha release
40+
- Core Dataverse client with authentication
41+
- Basic CRUD operations (create, get, update, delete)
42+
- OData query support
43+
- SQL query support
44+
- Error handling framework
45+
- Example scripts for common scenarios
46+
47+
---
48+
49+
## Release Notes Template
50+
51+
When creating a new release, copy this template:
52+
53+
```markdown
54+
## [X.Y.Z] - YYYY-MM-DD
55+
56+
### Added
57+
- New features
58+
59+
### Changed
60+
- Changes in existing functionality
61+
62+
### Deprecated
63+
- Soon-to-be removed features
64+
65+
### Removed
66+
- Removed features
67+
68+
### Fixed
69+
- Bug fixes
70+
71+
### Security
72+
- Security improvements or fixes
73+
```

dev_dependencies.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Development dependencies for dataverse-client-python
2+
# Install with: pip install -r dev_dependencies.txt
3+
4+
pytest>=8.3.1
5+
pytest-asyncio>=0.21
6+
pytest-mock>=3.0
7+
black>=23.0
8+
flake8>=6.0
9+
build>=0.10
10+
twine>=4.0

pyproject.toml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
[build-system]
2-
requires = ["setuptools>=61.0"]
2+
requires = ["setuptools>=64"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
name = "dataverse-python-client"
6+
name = "dataverse-client-python"
77
version = "0.1.0"
8-
description = "Dataverse Python client"
9-
authors = [{ name = "POC" }]
10-
readme = "README.md"
8+
description = "Python SDK for Microsoft Dataverse"
9+
readme = {file = "README.md", content-type = "text/markdown"}
10+
authors = [{name = "Microsoft Corporation"}]
11+
license = "MIT"
12+
license-files = ["LICENSE"]
1113
requires-python = ">=3.10"
14+
classifiers = [
15+
"Programming Language :: Python :: 3.10",
16+
"Programming Language :: Python :: 3.11",
17+
"Programming Language :: Python :: 3.12",
18+
"Programming Language :: Python :: 3.13",
19+
"Operating System :: OS Independent",
20+
]
1221
dependencies = [
13-
"azure-identity>=1.17.0",
14-
"azure-core>=1.30.2",
15-
"requests>=2.32.0",
16-
"pytest>=8.3.1",
17-
"pandas>=2.2.0",
22+
"azure-identity>=1.17.0",
23+
"azure-core>=1.30.2",
24+
"requests>=2.32.0",
25+
"pandas>=2.2.0",
1826
]
1927

28+
[project.urls]
29+
"Homepage" = "https://github.com/microsoft/PowerPlatform-DataverseClient-Python"
30+
2031
[tool.setuptools]
21-
# Use the src/ layout
2232
package-dir = {"" = "src"}
23-
24-
[tool.setuptools.packages.find]
25-
# Discover packages under src/, include our package, and exclude non-package folders
26-
where = ["src"]
27-
include = ["dataverse_sdk*"]
28-
exclude = ["tests*", "examples*"]
29-
30-
[tool.pytest.ini_options]
31-
addopts = "-q"
32-
pythonpath = ["src"]

src/dataverse_sdk/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from .__version__ import __version__
12
from .client import DataverseClient
23

3-
__all__ = ["DataverseClient"]
4+
__all__ = ["DataverseClient", "__version__"]

src/dataverse_sdk/__version__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""Version information for dataverse-client-python package."""
2+
3+
__version__ = "0.1.0"

0 commit comments

Comments
 (0)