Skip to content

Commit 51df5d5

Browse files
author
Grant Harris
committed
Merge branch 'users/gwharris7/fix-setup-utils' of https://github.com/microsoft/Agent365-python into users/gwharris7/fix-setup-utils
2 parents f43900f + 47b371d commit 51df5d5

7 files changed

Lines changed: 241 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,13 @@ jobs:
107107
run: uv lock && uv sync --locked --all-extras --dev
108108

109109
- name: Verify centralized version constraints
110-
run: python scripts/verify_constraints.py
110+
run: uv run --frozen tox -e verify-constraints
111111

112112
- name: Check linting
113-
run: |
114-
uv run --frozen ruff check . --preview
113+
run: uv run --frozen tox -e lint
115114

116115
- name: Check formatting
117-
run: |
118-
uv run --frozen ruff format --check .
116+
run: uv run --frozen tox -e format
119117

120118
- name: Build package
121119
run: |
@@ -124,14 +122,12 @@ jobs:
124122
AGENT365_PYTHON_SDK_PACKAGE_VERSION: ${{ needs.version-number.outputs.PACKAGE_VERSION }}
125123

126124
- name: Run unit tests
127-
run: |
128-
uv run --frozen pytest tests/ -v --tb=short -m "not integration"
125+
run: uv run --frozen tox -e py3${{ matrix.python-version == '3.11' && '11' || '12' }}
129126

130127
- name: Run integration tests
131128
# Only run integration tests if secrets are available
132129
if: ${{ vars.RUN_INTEGRATION_TESTS == 'true' }}
133-
run: |
134-
uv run --frozen pytest -m integration -v --tb=short
130+
run: uv run --frozen tox -e integration
135131
env:
136132
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
137133
AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ dist/
7272
build/
7373
.eggs/
7474
.pytest_cache/
75+
.tox/
7576
_version.py
7677

7778
# Test coverage and reports

CLAUDE.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,31 @@ pytest tests/ --cov=libraries --cov-report=html -v
6161
- `unit`: Fast, mocked tests (default)
6262
- `integration`: Slow tests requiring real services/API keys
6363

64+
### Running with tox
65+
66+
```bash
67+
# Run all default environments (lint, format, unit tests on 3.11 + 3.12)
68+
uv run tox
69+
70+
# Run a specific environment
71+
uv run tox -e lint
72+
uv run tox -e format
73+
uv run tox -e py311
74+
uv run tox -e py312
75+
76+
# Run integration tests (requires env vars)
77+
uv run tox -e integration
78+
79+
# Verify centralized dependency constraints
80+
uv run tox -e verify-constraints
81+
82+
# Pass extra args to pytest
83+
uv run tox -e py311 -- -k "environment"
84+
85+
# List all available environments
86+
uv run tox list
87+
```
88+
6489
### Linting and Formatting
6590

6691
```bash
@@ -241,7 +266,8 @@ Place it before imports with one blank line after.
241266
The `.github/workflows/ci.yml` pipeline:
242267
- Runs on pushes to `main` and `release/*` branches
243268
- Tests both Python 3.11 and 3.12
244-
- Executes: lint check → format check → build → unit tests → integration tests (if secrets available)
269+
- Uses **tox** (via `uv run --frozen tox -e <env>`) to run lint, format, test, and constraint verification steps
270+
- Executes: verify-constraints → lint → format → build → unit tests → integration tests (if secrets available)
245271
- Only publishes packages on `release/*` branches when SDK changes detected
246272
- Uses git-based versioning (tags on release branches = official versions, others = dev versions)
247273

libraries/microsoft-agents-a365-observability-core/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ dependencies = [
3131
"opentelemetry-exporter-otlp",
3232
"pydantic",
3333
"typing-extensions",
34+
"wrapt",
3435
"microsoft-agents-a365-runtime",
3536
]
3637

libraries/microsoft-agents-a365-observability-extensions-langchain/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ dependencies = [
3232
"opentelemetry-api",
3333
"opentelemetry-sdk",
3434
"opentelemetry-instrumentation",
35+
"wrapt",
3536
]
3637

3738
[project.urls]

pyproject.toml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ dev-dependencies = [
4848
"pytest-asyncio",
4949
"pytest-mock",
5050
"ruff",
51+
"tox>=4.0",
52+
"tox-uv>=1.0",
5153
"python-dotenv",
5254
"openai",
5355
"agent-framework-azure-ai",
@@ -92,6 +94,9 @@ constraint-dependencies = [
9294
"microsoft-agents-activity >= 0.4.0",
9395
"microsoft-agents-hosting-core >= 0.4.0",
9496

97+
# --- Monkey-patching / wrapping ---
98+
"wrapt >= 1.14",
99+
95100
# --- Data Validation & Utilities ---
96101
"aiohttp >= 3.8.0",
97102
"asyncio-throttle >= 1.0.0",
@@ -100,6 +105,10 @@ constraint-dependencies = [
100105
"PyJWT >= 2.8.0",
101106
"typing-extensions >= 4.0.0",
102107

108+
# --- Tox ---
109+
"tox >= 4.23.0",
110+
"tox-uv >= 1.18.0",
111+
103112
# --- Development & Testing ---
104113
"black >= 23.0.0",
105114
"mypy >= 1.0.0",
@@ -204,3 +213,35 @@ skip-magic-trailing-comma = false
204213

205214
# Like Black, automatically detect the appropriate line ending.
206215
line-ending = "auto"
216+
217+
# Tox configuration
218+
[tool.tox]
219+
requires = ["tox>=4.23", "tox-uv>=1.18"]
220+
221+
[tool.tox.env_run_base]
222+
runner = "uv-venv-lock-runner"
223+
uv_sync_flags = ["--all-extras", "--dev"]
224+
commands = [["pytest", "tests/", "-v", "--tb=short", "-m", "not integration", { replace = "posargs", default = "", extend = true }]]
225+
226+
[tool.tox.env.py311]
227+
base_python = ["python3.11"]
228+
229+
[tool.tox.env.py312]
230+
base_python = ["python3.12"]
231+
232+
[tool.tox.env.lint]
233+
base_python = ["python3.11"]
234+
commands = [["ruff", "check", ".", "--preview", { replace = "posargs", default = "", extend = true }]]
235+
236+
[tool.tox.env.format]
237+
base_python = ["python3.11"]
238+
commands = [["ruff", "format", "--check", ".", { replace = "posargs", default = "", extend = true }]]
239+
240+
[tool.tox.env.integration]
241+
base_python = ["python3.11"]
242+
commands = [["pytest", "-m", "integration", "-v", "--tb=short", { replace = "posargs", default = "", extend = true }]]
243+
pass_env = ["AZURE_OPENAI_API_KEY", "AZURE_OPENAI_ENDPOINT", "AZURE_OPENAI_DEPLOYMENT", "AZURE_OPENAI_API_VERSION", "AGENT365_TEST_TENANT_ID", "AGENT365_TEST_AGENT_ID", "ENABLE_OBSERVABILITY"]
244+
245+
[tool.tox.env.verify-constraints]
246+
base_python = ["python3.11"]
247+
commands = [["python", "scripts/verify_constraints.py"]]

0 commit comments

Comments
 (0)