Skip to content

Commit 5815df0

Browse files
authored
Merge pull request #21 from redis-developer/feature/separate-client-codebase
Make a separate codebase for the client
2 parents 6d4236e + 01dedbb commit 5815df0

37 files changed

+7735
-3002
lines changed
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: Agent Memory Client CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags:
7+
- 'client/v*.*.*'
8+
pull_request:
9+
branches: [main]
10+
11+
jobs:
12+
test:
13+
name: Test (Python ${{ matrix.python-version }})
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
python-version: ["3.10", "3.11", "3.12"]
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v3
29+
30+
- name: Install dependencies
31+
working-directory: agent-memory-client
32+
run: uv sync --extra dev
33+
34+
- name: Lint with Ruff
35+
working-directory: agent-memory-client
36+
run: uv run ruff check agent_memory_client
37+
38+
- name: Check formatting with Ruff formatter
39+
working-directory: agent-memory-client
40+
run: uv run ruff format --check agent_memory_client
41+
42+
- name: Type check with mypy
43+
working-directory: agent-memory-client
44+
run: uv run mypy agent_memory_client
45+
46+
- name: Run tests
47+
working-directory: agent-memory-client
48+
run: uv run pytest tests/ --cov=agent_memory_client --cov-report=xml
49+
50+
publish-testpypi:
51+
name: Publish to TestPyPI
52+
needs: test
53+
if: startsWith(github.ref, 'refs/tags/client/') && contains(github.ref, '-')
54+
runs-on: ubuntu-latest
55+
environment: testpypi
56+
permissions:
57+
id-token: write
58+
contents: read
59+
steps:
60+
- uses: actions/checkout@v4
61+
62+
- name: Set up Python
63+
uses: actions/setup-python@v4
64+
with:
65+
python-version: '3.12'
66+
67+
- name: Install build tools
68+
run: |
69+
python -m pip install --upgrade pip
70+
pip install build
71+
72+
- name: Build package
73+
working-directory: agent-memory-client
74+
run: python -m build
75+
76+
- name: Publish package to TestPyPI
77+
uses: pypa/gh-action-pypi-publish@release/v1
78+
with:
79+
repository-url: https://test.pypi.org/legacy/
80+
packages-dir: agent-memory-client/dist/
81+
82+
publish-pypi:
83+
name: Publish to PyPI
84+
needs: test
85+
if: startsWith(github.ref, 'refs/tags/client/') && !contains(github.ref, '-')
86+
runs-on: ubuntu-latest
87+
environment: pypi
88+
permissions:
89+
id-token: write
90+
contents: read
91+
steps:
92+
- uses: actions/checkout@v4
93+
94+
- name: Set up Python
95+
uses: actions/setup-python@v4
96+
with:
97+
python-version: '3.12'
98+
99+
- name: Install build tools
100+
run: |
101+
python -m pip install --upgrade pip
102+
pip install build
103+
104+
- name: Build package
105+
working-directory: agent-memory-client
106+
run: python -m build
107+
108+
- name: Publish package to PyPI
109+
uses: pypa/gh-action-pypi-publish@release/v1
110+
with:
111+
packages-dir: agent-memory-client/dist/
112+
113+
# Alternative: API Token Authentication (if trusted publishing doesn't work)
114+
# Uncomment the sections below and add these secrets to your repository:
115+
# - TEST_PYPI_API_TOKEN (for TestPyPI)
116+
# - PYPI_API_TOKEN (for PyPI)
117+
#
118+
# For TestPyPI job, replace the publish step with:
119+
# - name: Publish package to TestPyPI
120+
# uses: pypa/gh-action-pypi-publish@release/v1
121+
# with:
122+
# repository-url: https://test.pypi.org/legacy/
123+
# packages-dir: agent-memory-client/dist/
124+
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
125+
#
126+
# For PyPI job, replace the publish step with:
127+
# - name: Publish package to PyPI
128+
# uses: pypa/gh-action-pypi-publish@release/v1
129+
# with:
130+
# packages-dir: agent-memory-client/dist/
131+
# password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/python-tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ jobs:
6060
pip install uv
6161
uv sync --all-extras
6262
63+
- name: Install agent-memory-client
64+
run: |
65+
uv pip install -e ./agent-memory-client
66+
6367
- name: Run tests
6468
run: |
6569
uv run pytest --run-api-tests

CLAUDE.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@ pip install uv
88

99
```bash
1010
# Development workflow
11-
uv install # Install dependencies
11+
uv venv # Create a virtualenv (once)
12+
source .venv/bin/activate # Activate the virtualenv (start of terminal session)
13+
uv install --all-extras # Install dependencies
14+
uv sync --all-extras # Sync latest dependencies
1215
uv run ruff check # Run linting
1316
uv run ruff format # Format code
14-
uv run pytest # Run tests
15-
uv run pytest tests/ # Run specific test directory
17+
uv run pytest # Run tests
18+
uv run pytest tests/ # Run specific test directory
19+
uv add <dependency> # Add a dependency to pyproject.toml and update lock file
20+
uv remove <dependency> # Remove a dependency from pyproject.toml and update lock file
1621

1722
# Server commands
1823
uv run agent-memory api # Start REST API server (default port 8000)

0 commit comments

Comments
 (0)