Skip to content

Commit 6f4b382

Browse files
committed
another way
1 parent 7e69b1a commit 6f4b382

File tree

4 files changed

+58
-82
lines changed

4 files changed

+58
-82
lines changed

.github/workflows/agentex-tutorials-test.yml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,6 @@ jobs:
1818
curl -LsSf https://astral.sh/uv/install.sh | sh
1919
echo "$HOME/.local/bin" >> $GITHUB_PATH
2020
21-
- name: Install Rye
22-
run: |
23-
curl -sSf https://rye.astral.sh/get | bash
24-
# Source the rye environment as recommended by the installer
25-
source "$HOME/.rye/env"
26-
# Add to PATH for subsequent steps
27-
echo "$HOME/.rye/shims" >> $GITHUB_PATH
28-
# Verify installation
29-
which rye
30-
rye --version
31-
env:
32-
RYE_VERSION: "0.44.0"
33-
RYE_INSTALL_OPTION: "--yes"
34-
3521
- name: Checkout scale-agentex repo
3622
uses: actions/checkout@v4
3723
with:
@@ -61,15 +47,19 @@ jobs:
6147
# Verify all deps are up
6248
docker compose ps
6349
50+
- name: Build AgentEx SDK
51+
run: |
52+
echo "🔨 Building AgentEx SDK wheel..."
53+
uv build
54+
echo "✅ SDK built successfully"
55+
ls -la dist/
56+
6457
- name: Run Parallel Tutorial Tests
6558
working-directory: ./examples/tutorials
6659
run: |
67-
# Ensure rye is available (source the environment from previous step)
68-
source "$HOME/.rye/env"
69-
70-
# Verify rye is working
71-
echo "Rye version: $(rye --version)"
72-
echo "Rye path: $(which rye)"
60+
# Verify uv is working
61+
echo "UV version: $(uv --version)"
62+
echo "UV path: $(which uv)"
7363
7464
# Find all tutorial directories
7565
tutorial_paths=()

examples/tutorials/00_sync/000_hello_acp/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ description = "An AgentEx agent that just says hello and acknowledges the user's
99
readme = "README.md"
1010
requires-python = ">=3.12"
1111
dependencies = [
12-
"agentex-sdk",
1312
"scale-gp",
1413
"pytest",
1514
"pytest-xdist"

examples/tutorials/run_agent_test.sh

Lines changed: 42 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -115,33 +115,33 @@ start_agent() {
115115
# Change to tutorial directory
116116
cd "$tutorial_path" || return 1
117117

118-
# Debug current directory and virtualenv status
119-
echo -e "${YELLOW}DEBUG: Current directory: $PWD${NC}"
120-
echo -e "${YELLOW}DEBUG: Tutorial path: $tutorial_path${NC}"
121-
122-
# Check if .venv exists
123-
echo -e "${YELLOW}DEBUG: Tutorial .venv contents:${NC}"
124-
if [ -d ".venv" ]; then
125-
ls -la .venv/ || echo "Cannot list .venv contents"
126-
else
127-
echo "No .venv directory found"
128-
fi
129-
130-
# Check what packages are available in rye context
131-
echo -e "${YELLOW}DEBUG: Available packages in tutorial rye context:${NC}"
132-
rye run pip list 2>/dev/null || echo "Cannot list packages"
118+
# Start the agent in background and capture PID
119+
local manifest_path="$PWD/manifest.yaml" # Always use full path
133120

134-
# Specifically check for agentex-sdk
135-
echo -e "${YELLOW}DEBUG: Checking for agentex-sdk:${NC}"
136-
rye run pip show agentex-sdk 2>/dev/null || echo "agentex-sdk not found in virtualenv"
121+
echo -e "${YELLOW}DEBUG: Manifest path: $manifest_path${NC}"
122+
echo -e "${YELLOW}DEBUG: Log file: $logfile${NC}"
137123

138-
# Show rye project status
139-
echo -e "${YELLOW}DEBUG: Rye show output:${NC}"
140-
rye show 2>/dev/null || echo "No rye project detected"
124+
if [ "$BUILD_CLI" = true ]; then
125+
echo -e "${YELLOW}DEBUG: Using locally built wheel${NC}"
126+
127+
# From tutorial subdirectory, we need to go up 4 levels to reach repo root
128+
# tutorials/00_sync/000_hello_acp -> tutorials -> examples -> agentex-python
129+
local wheel_file=$(ls ../../../../dist/agentex_sdk-*.whl 2>/dev/null | head -n1)
130+
if [[ -z "$wheel_file" ]]; then
131+
echo -e "${RED}❌ No built wheel found in ../../../../dist/agentex_sdk-*.whl${NC}"
132+
echo -e "${YELLOW}💡 Please build the local SDK first by running: uv build${NC}"
133+
echo -e "${YELLOW}💡 From the repo root directory: /Users/roxanne.farhad/Desktop/scale/agentex-python${NC}"
134+
cd "$original_dir"
135+
return 1
136+
fi
141137

142-
# Start the agent in background and capture PID
143-
local agentex_cmd=$(get_agentex_command)
144-
$agentex_cmd agents run --manifest manifest.yaml > "$logfile" 2>&1 &
138+
echo -e "${YELLOW}DEBUG: Using wheel: $wheel_file${NC}"
139+
# Use the built wheel
140+
uv run --with "$wheel_file" agentex agents run --manifest "$manifest_path" > "$logfile" 2>&1 &
141+
else
142+
echo -e "${YELLOW}DEBUG: Using system CLI${NC}"
143+
uv run agentex agents run --manifest manifest.yaml > "$logfile" 2>&1 &
144+
fi
145145
local pid=$!
146146

147147
# Return to original directory
@@ -311,9 +311,9 @@ execute_tutorial_test() {
311311
fi
312312
}
313313

314-
# Function to build CLI from source
315-
build_cli() {
316-
echo -e "${YELLOW}🔨 Building CLI from source...${NC}"
314+
# Function to check if built wheel is available
315+
check_built_wheel() {
316+
echo -e "${YELLOW}🔍 Checking for locally built wheel...${NC}"
317317

318318
# Navigate to the repo root (two levels up from examples/tutorials)
319319
local repo_root="../../"
@@ -324,44 +324,31 @@ build_cli() {
324324
return 1
325325
}
326326

327-
# Check if rye is available
328-
if ! command -v rye &> /dev/null; then
329-
echo -e "${RED}❌ rye is required to build the CLI${NC}"
330-
echo "Please install rye: curl -sSf https://rye.astral.sh/get | bash"
327+
# Check if wheel exists
328+
local wheel_file=$(ls dist/agentex_sdk-*.whl 2>/dev/null | head -n1)
329+
if [[ -z "$wheel_file" ]]; then
330+
echo -e "${RED}❌ No built wheel found in dist/agentex_sdk-*.whl${NC}"
331+
echo -e "${YELLOW}💡 Please build the local SDK first by running: uv build${NC}"
332+
echo -e "${YELLOW}💡 From the repo root directory: $(pwd)${NC}"
331333
cd "$original_dir"
332334
return 1
333335
fi
334336

335-
# Build the CLI
336-
echo -e "${YELLOW}Running rye sync --all-features...${NC}"
337-
if ! rye sync --all-features; then
338-
echo -e "${RED}❌ Failed to sync dependencies${NC}"
339-
cd "$original_dir"
340-
return 1
341-
fi
337+
echo -e "${GREEN}✅ Found built wheel: $wheel_file${NC}"
342338

343-
echo -e "${YELLOW}Running rye build...${NC}"
344-
if ! rye build; then
345-
echo -e "${RED}❌ Failed to build package${NC}"
339+
# Test the wheel by running agentex --help
340+
echo -e "${YELLOW}Verifying built wheel...${NC}"
341+
if ! uv run --with "$wheel_file" agentex --help >/dev/null 2>&1; then
342+
echo -e "${RED}❌ Failed to run agentex with built wheel${NC}"
346343
cd "$original_dir"
347344
return 1
348345
fi
349346

350-
echo -e "${GREEN}CLI built successfully${NC}"
347+
echo -e "${GREEN}Built wheel verified successfully${NC}"
351348
cd "$original_dir"
352349
return 0
353350
}
354351

355-
# Function to get the appropriate agentex command
356-
get_agentex_command() {
357-
if [ "$BUILD_CLI" = true ]; then
358-
# Use the local build via rye run (rye is in PATH)
359-
echo "rye run agentex"
360-
else
361-
# Use the system-installed version
362-
echo "uv run agentex"
363-
fi
364-
}
365352

366353
# Main execution function
367354
main() {
@@ -401,10 +388,10 @@ main() {
401388

402389
echo ""
403390

404-
# Build CLI if requested
391+
# Check built wheel if requested
405392
if [ "$BUILD_CLI" = true ]; then
406-
if ! build_cli; then
407-
echo -e "${RED}❌ Failed to build CLI from source${NC}"
393+
if ! check_built_wheel; then
394+
echo -e "${RED}❌ Failed to find or verify built wheel${NC}"
408395
exit 1
409396
fi
410397
echo ""

uv.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)