Skip to content

Commit d81c53d

Browse files
committed
Replace tox with UV
Signed-off-by: Teo <teocns@gmail.com>
1 parent 64b172c commit d81c53d

File tree

4 files changed

+67
-10
lines changed

4 files changed

+67
-10
lines changed

.github/workflows/codecov.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,34 @@ on:
1414

1515
jobs:
1616
test:
17+
strategy:
18+
matrix:
19+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
1720
runs-on: ubuntu-latest
1821

1922
steps:
2023
- name: Checkout code
21-
uses: actions/checkout@v2
24+
uses: actions/checkout@v4
2225

23-
- name: Set up Python
24-
uses: actions/setup-python@v2
26+
- uses: astral-sh/setup-uv@v4
2527
with:
26-
python-version: 3.11
28+
python-version: ${{ matrix.python-version }}
29+
enable-cache: true
30+
cache-dependency-glob: "**/pyproject.toml"
2731

2832
- name: Install dependencies
2933
run: |
30-
python -m pip install --upgrade pip
31-
pip install tox
34+
uv pip install -e ".[test]"
3235
33-
- name: Run tests with tox
34-
run: tox
36+
- name: Run tests
37+
run: |
38+
uv pip install coverage
39+
coverage run --source . -m pytest
40+
coverage report -m
41+
coverage xml
3542
3643
- name: Upload coverage to Codecov
37-
uses: codecov/codecov-action@v2
44+
uses: codecov/codecov-action@v4
3845
with:
3946
token: ${{ secrets.CODECOV_TOKEN }}
4047
files: ./coverage.xml

CONTRIBUTING.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,21 @@ Even if you're not ready to contribute code, we'd love to hear your thoughts. Dr
8989
pre-commit run --all-files
9090
```
9191

92+
3. **Test Environment Setup**:
93+
```bash
94+
uv pip install -e ".[test]" # Install with test dependencies
95+
pytest # Run tests for current Python version
96+
```
97+
98+
For testing across multiple Python versions:
99+
```bash
100+
for ver in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do
101+
uv venv -p $ver .venv-$ver
102+
.venv-$ver/bin/pip install -e ".[test]"
103+
.venv-$ver/bin/pytest
104+
done
105+
```
106+
92107
## Testing
93108

94109
We maintain comprehensive testing documentation in [tests/README.md](tests/README.md). This includes:

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ AgentOps provides support for Llama Stack Python Client(>=0.0.53), allowing you
698698
| Platform | Dashboard | Evals |
699699
| ---------------------------------------------------------------------------- | ------------------------------------------ | -------------------------------------- |
700700
| ✅ Python SDK | ✅ Multi-session and Cross-session metrics | ✅ Custom eval metrics |
701-
| 🚧 Evaluation builder API | ✅ Custom event tag tracking  | 🔜 Agent scorecards |
701+
| 🚧 Evaluation builder API | ✅ Custom event tag tracking | 🔜 Agent scorecards |
702702
|[Javascript/Typescript SDK](https://github.com/AgentOps-AI/agentops-node) | ✅ Session replays | 🔜 Evaluation playground + leaderboard |
703703

704704
## Debugging Roadmap 🧭
@@ -756,3 +756,15 @@ Check out our growth in the community:
756756

757757

758758
_Generated using [github-dependents-info](https://github.com/nvuillam/github-dependents-info), by [Nicolas Vuillamy](https://github.com/nvuillam)_
759+
760+
## Development
761+
762+
We use `uv` for dependency management and testing. To run tests:
763+
764+
```bash
765+
uv pip install -e ".[test]"
766+
pytest
767+
```
768+
769+
UV provides faster dependency resolution and modern tooling features.
770+
See [CONTRIBUTING.md](CONTRIBUTING.md) for multi-version testing.

pyproject.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,24 @@ dev = [
6565
langchain = [
6666
"langchain==0.2.14; python_version >= '3.8.1'"
6767
]
68+
test = [
69+
"pytest==7.4.0",
70+
"pytest-depends",
71+
"pytest-asyncio",
72+
"pytest-vcr",
73+
"pytest-mock",
74+
"pyfakefs",
75+
"requests_mock==1.11.0",
76+
"coverage",
77+
"mypy",
78+
"types-requests",
79+
"psutil",
80+
"openai",
81+
"langchain-core",
82+
"langchain",
83+
"termcolor",
84+
"python-dotenv",
85+
]
6886

6987
[project.scripts]
7088
agentops = "agentops.cli:main"
@@ -138,3 +156,8 @@ packages = ["agentops"]
138156

139157
[tool.uv]
140158
default-groups = ["dev"]
159+
python = "3.7" # Minimum supported version
160+
compile-bytecode = true
161+
162+
[tool.uv.pip]
163+
strict = true

0 commit comments

Comments
 (0)