Skip to content

Commit 5c7b387

Browse files
dixitaniketbalogh.adam@icloud.comclaudeadambaloghgithub-advanced-security[bot]
authored
Dep cleanup (#190)
* cleanup * Migrate from pip to uv for dependency management Add separate CI workflow for linting/type-checking (make check). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Potential fix for code scanning alert no. 3: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: kukac <adambalogh@users.noreply.github.com> --------- Signed-off-by: kukac <adambalogh@users.noreply.github.com> Co-authored-by: balogh.adam@icloud.com <adambalogh@mac.mynetworksettings.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: kukac <adambalogh@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 88eed08 commit 5c7b387

8 files changed

Lines changed: 413 additions & 43 deletions

File tree

.github/workflows/check.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Check
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
check:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v5
21+
22+
- name: Set up Python
23+
run: uv python install 3.11
24+
25+
- name: Install dependencies
26+
run: uv sync --all-extras
27+
28+
- name: Run checks
29+
run: make check

.github/workflows/test.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,14 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515

16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v5
18+
1619
- name: Set up Python
17-
uses: actions/setup-python@v5
18-
with:
19-
python-version: "3.11"
20+
run: uv python install 3.11
2021

2122
- name: Install dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install -e .
25-
pip install pytest pytest-asyncio
23+
run: uv sync --all-extras
2624

2725
- name: Run tests
2826
run: make test

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
OpenGradient Python SDK - A decentralized model management and inference platform SDK. The SDK enables programmatic access to model repositories and decentralized AI infrastructure, including end-to-end verified AI execution. Use virtualenv for dependency management locally (in `venv` folder).
7+
OpenGradient Python SDK - A decentralized model management and inference platform SDK. The SDK enables programmatic access to model repositories and decentralized AI infrastructure, including end-to-end verified AI execution. Uses `uv` for dependency management.
88

99
## Development Commands
1010

1111
### Build & Installation
1212
```bash
13-
# Install in development mode
14-
pip install -e .
13+
# Install dependencies (syncs from pyproject.toml/uv.lock)
14+
make install # or: uv sync --all-extras
1515

1616
# Build distribution
1717
make build

Makefile

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,40 @@ MODEL ?= google/gemini-3-pro-preview
88
# ============================================================================
99

1010
install:
11-
pip install -e .
11+
uv sync --all-extras
1212

1313
build:
14-
python -m build
14+
uv build
1515

1616
publish:
1717
@echo "Current version:" $$(grep 'version = ' pyproject.toml | cut -d'"' -f2)
1818
rm -rf dist/*
19-
python -m build
20-
twine upload dist/*
19+
uv build
20+
uv publish
2121

2222
check:
23-
ruff format .
24-
mypy src
25-
mypy examples
23+
uv run ruff format .
24+
uv run mypy src
25+
uv run mypy examples
2626

2727
docs:
28-
pdoc opengradient -o docs --template-dir ./templates --force
28+
uv run pdoc opengradient -o docs --template-dir ./templates --force
2929

3030
# ============================================================================
3131
# Testing
3232
# ============================================================================
3333

3434
test:
35-
pytest tests/ -v
35+
uv run pytest tests/ -v
3636

3737
integrationtest:
38-
python integrationtest/agent/test_agent.py
39-
python integrationtest/workflow_models/test_workflow_models.py
38+
uv run python integrationtest/agent/test_agent.py
39+
uv run python integrationtest/workflow_models/test_workflow_models.py
4040

4141
examples:
4242
@for f in $$(find examples -name '*.py' | sort); do \
4343
echo "Running $$f..."; \
44-
python "$$f" || exit 1; \
44+
uv run python "$$f" || exit 1; \
4545
done
4646
@echo "All examples passed."
4747

@@ -50,38 +50,38 @@ examples:
5050
# ============================================================================
5151

5252
infer:
53-
python -m opengradient.cli infer \
53+
uv run python -m opengradient.cli infer \
5454
-m "hJD2Ja3akZFt1A2LT-D_1oxOCz_OtuGYw4V9eE1m39M" \
5555
--input '{"open_high_low_close": [[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,3,4]]}'
5656

5757
completion:
58-
python -m opengradient.cli completion \
58+
uv run python -m opengradient.cli completion \
5959
--model $(MODEL) \
6060
--prompt "Hello, how are you?" \
6161
--max-tokens 50
6262

6363
chat:
64-
python -m opengradient.cli chat \
64+
uv run python -m opengradient.cli chat \
6565
--model $(MODEL) \
6666
--messages '[{"role":"user","content":"Tell me a fun fact"}]' \
6767
--max-tokens 350
6868

6969
chat-stream:
70-
python -m opengradient.cli chat \
70+
uv run python -m opengradient.cli chat \
7171
--model $(MODEL) \
7272
--messages '[{"role":"user","content":"Tell me a short story"}]' \
7373
--max-tokens 1250 \
7474
--stream
7575

7676
chat-tool:
77-
python -m opengradient.cli chat \
77+
uv run python -m opengradient.cli chat \
7878
--model $(MODEL) \
7979
--messages '[{"role":"system","content":"You are a helpful assistant. Use tools when needed."},{"role":"user","content":"What'\''s the weather like in Dallas, Texas? Give me the temperature in fahrenheit."}]' \
8080
--tools '[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"city":{"type":"string"},"state":{"type":"string"},"unit":{"type":"string","enum":["fahrenheit","celsius"]}},"required":["city","state","unit"]}}}]' \
8181
--max-tokens 200
8282

8383
chat-stream-tool:
84-
python -m opengradient.cli chat \
84+
uv run python -m opengradient.cli chat \
8585
--model $(MODEL) \
8686
--messages '[{"role":"system","content":"You are a helpful assistant. Use tools when needed."},{"role":"user","content":"What'\''s the weather like in Dallas, Texas? Give me the temperature in fahrenheit."}]' \
8787
--tools '[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"city":{"type":"string"},"state":{"type":"string"},"unit":{"type":"string","enum":["fahrenheit","celsius"]}},"required":["city","state","unit"]}}}]' \

dev-requirements.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

pyproject.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ dependencies = [
3030
"og-x402==0.0.1.dev2"
3131
]
3232

33+
[project.optional-dependencies]
34+
dev = [
35+
"ruff",
36+
"mypy",
37+
"pytest",
38+
"pytest-asyncio",
39+
"langgraph",
40+
"pdoc3==0.10.0",
41+
"types-protobuf",
42+
]
43+
3344
[project.scripts]
3445
opengradient = "opengradient.cli:cli"
3546

requirements.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)