Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .azdo/ci-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Azure DevOps PR validation pipeline
# Matches GitHub Actions workflow for consistency

pr:
- main

trigger: none # Only run on PRs, not on direct pushes

pool:
vmImage: ubuntu-latest

# Simplified to single Python version (per project requirements)
# Can expand to matrix testing later if needed

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.12'
addToPath: true
displayName: 'Use Python 3.12'

- script: |
python -m pip install --upgrade pip
python -m pip install flake8 black build
if [ -f dev_dependencies.txt ]; then pip install -r dev_dependencies.txt; fi
displayName: 'Install dependencies'

- script: |
black src tests --check
displayName: 'Check format with black'

- script: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings
flake8 . --count --exit-zero --show-source --statistics
displayName: 'Lint with flake8'

- script: |
python -m build
displayName: 'Build package'

- script: |
python -m pip install dist/*.whl
displayName: 'Install wheel'

- script: |
pytest
displayName: 'Test with pytest'

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Python 3.12'
displayName: 'Publish test results'
9 changes: 9 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[flake8]
max-line-length = 120
max-complexity = 10
exclude =
__pycache__
.venv
venv
build
dist
55 changes: 55 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Python package

permissions:
contents: read

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
# Simplified to single Python version (per project requirements)
# Can expand to matrix testing later: strategy.matrix.python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 black build
if [ -f dev_dependencies.txt ]; then pip install -r dev_dependencies.txt; fi

- name: Check format with black
continue-on-error: true # TODO: fix detected formatting errors and remove this line.
run: |
black src tests --check

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings, matching Agents-for-python approach
flake8 . --count --exit-zero --show-source --statistics

- name: Build package
run: |
python -m build

- name: Install wheel
run: |
python -m pip install dist/*.whl

- name: Test with pytest
run: |
pytest
73 changes: 73 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- Initial SDK implementation with CRUD operations
- Service principal authentication support
- Interactive browser authentication support
- SQL query execution via `query_sql()`
- File upload capabilities
- Pandas integration for query results
- Structured error handling with specific exception types
- GitHub Actions CI pipeline for automated testing
- Azure DevOps PR validation pipeline

### Changed
- N/A

### Deprecated
- N/A

### Removed
- N/A

### Fixed
- N/A

### Security
- N/A

## [0.1.0] - TBD

### Added
- First alpha release
- Core Dataverse client with authentication
- Basic CRUD operations (create, get, update, delete)
- OData query support
- SQL query support
- Error handling framework
- Example scripts for common scenarios

---

## Release Notes Template

When creating a new release, copy this template:

```markdown
## [X.Y.Z] - YYYY-MM-DD

### Added
- New features

### Changed
- Changes in existing functionality

### Deprecated
- Soon-to-be removed features

### Removed
- Removed features

### Fixed
- Bug fixes

### Security
- Security improvements or fixes
```
10 changes: 10 additions & 0 deletions dev_dependencies.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Development dependencies for dataverse-client-python
# Install with: pip install -r dev_dependencies.txt

pytest>=8.3.1
pytest-asyncio>=0.21
pytest-mock>=3.0
black>=23.0
flake8>=6.0
build>=0.10
twine>=4.0
42 changes: 21 additions & 21 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
[build-system]
requires = ["setuptools>=61.0"]
requires = ["setuptools>=64"]
build-backend = "setuptools.build_meta"

[project]
name = "dataverse-python-client"
name = "dataverse-client-python"
version = "0.1.0"
description = "Dataverse Python client"
authors = [{ name = "POC" }]
readme = "README.md"
description = "Python SDK for Microsoft Dataverse"
readme = {file = "README.md", content-type = "text/markdown"}
authors = [{name = "Microsoft Corporation"}]
license = "MIT"
license-files = ["LICENSE"]
requires-python = ">=3.10"
classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: OS Independent",
]
dependencies = [
"azure-identity>=1.17.0",
"azure-core>=1.30.2",
"requests>=2.32.0",
"pytest>=8.3.1",
"pandas>=2.2.0",
"azure-identity>=1.17.0",
"azure-core>=1.30.2",
"requests>=2.32.0",
"pandas>=2.2.0",
]

[project.urls]
"Homepage" = "https://github.com/microsoft/PowerPlatform-DataverseClient-Python"

[tool.setuptools]
# Use the src/ layout
package-dir = {"" = "src"}

[tool.setuptools.packages.find]
# Discover packages under src/, include our package, and exclude non-package folders
where = ["src"]
include = ["dataverse_sdk*"]
exclude = ["tests*", "examples*"]

[tool.pytest.ini_options]
addopts = "-q"
pythonpath = ["src"]
3 changes: 2 additions & 1 deletion src/dataverse_sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .__version__ import __version__
from .client import DataverseClient

__all__ = ["DataverseClient"]
__all__ = ["DataverseClient", "__version__"]
3 changes: 3 additions & 0 deletions src/dataverse_sdk/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Version information for dataverse-client-python package."""

__version__ = "0.1.0"
Loading