Skip to content

Commit 22cb9db

Browse files
committed
Move to UV as build system, clean up some hallucianted code
1 parent 010f14e commit 22cb9db

File tree

8 files changed

+320
-593
lines changed

8 files changed

+320
-593
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ jobs:
170170
- name: ⚙️ Checkout the project
171171
uses: actions/checkout@v4
172172
with:
173-
fetch-depth: 0 # Full history for hatch-vcs
173+
fetch-depth: 0 # Full history for UV build
174174

175175
- name: ⚙️ Install uv
176176
uses: astral-sh/setup-uv@v4

.github/workflows/release.yml

Lines changed: 19 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ jobs:
1919
with:
2020
egress-policy: audit
2121

22-
- uses: actions/checkout@v4
22+
- name: ⚙️ Checkout the project
23+
uses: actions/checkout@v4
2324
with:
24-
fetch-depth: 0 # Full history for hatch-vcs
25+
fetch-depth: 0 # Full history for UV build
2526

2627
- name: ⚙️ Install uv
2728
uses: astral-sh/setup-uv@v4
@@ -31,32 +32,6 @@ jobs:
3132
- name: ⚙️ Set up Python
3233
run: uv python install 3.12
3334

34-
- name: ⚙️ Get version from tag and hatch-vcs
35-
id: get-version
36-
run: |
37-
# Get version from git tag (remove 'v' prefix if present)
38-
TAG_VERSION="${GITHUB_REF#refs/tags/}"
39-
TAG_VERSION="${TAG_VERSION#v}"
40-
echo "tag-version=$TAG_VERSION" >> $GITHUB_OUTPUT
41-
42-
# Get version from hatch-vcs (which uses git tags)
43-
SOURCE_VERSION=$(uv run python -m hatchling version)
44-
echo "version=$SOURCE_VERSION" >> $GITHUB_OUTPUT
45-
46-
echo "Tag version: $TAG_VERSION"
47-
echo "Hatch-VCS version: $SOURCE_VERSION"
48-
49-
- name: ⚙️ Validate version consistency
50-
run: |
51-
if [ "${{ steps.get-version.outputs.version }}" != "${{ steps.get-version.outputs.tag-version }}" ]; then
52-
echo "❌ Version mismatch!"
53-
echo "Tag version: ${{ steps.get-version.outputs.tag-version }}"
54-
echo "Hatch-VCS version: ${{ steps.get-version.outputs.version }}"
55-
echo "Please ensure the git tag is properly formatted for hatch-vcs."
56-
exit 1
57-
fi
58-
echo "✅ Version validation passed: ${{ steps.get-version.outputs.version }}"
59-
6035
security-scan:
6136
runs-on: ubuntu-latest
6237
needs: validate-release
@@ -66,7 +41,8 @@ jobs:
6641
with:
6742
egress-policy: audit
6843

69-
- uses: actions/checkout@v4
44+
- name: ⚙️ Checkout the project
45+
uses: actions/checkout@v4
7046
with:
7147
fetch-depth: 0
7248

@@ -75,22 +51,15 @@ jobs:
7551
with:
7652
version: "latest"
7753

78-
- name: ⚙️ Set up Python
79-
run: uv python install 3.12
80-
81-
- name: ⚙️ Install dependencies
82-
run: uv sync --all-extras --dev
54+
- name: ⚙️ Set Python up and add dependencies
55+
run: |
56+
uv python install 3.12
57+
uv sync --all-extras --dev
58+
uv add --dev bandit safety
8359
8460
- name: ⚙️ Run security scan with bandit
8561
run: |
86-
uv add --dev bandit[toml]
87-
uv run bandit -r src/ -f json -o bandit-report.json || true
8862
uv run bandit -r src/
89-
90-
- name: ⚙️ Run dependency vulnerability scan
91-
run: |
92-
uv add --dev safety
93-
uv run safety check --json --output safety-report.json || true
9463
uv run safety check
9564
9665
test:
@@ -117,7 +86,8 @@ jobs:
11786
with:
11887
egress-policy: audit
11988

120-
- uses: actions/checkout@v4
89+
- name: ⚙️ Checkout the project
90+
uses: actions/checkout@v4
12191
with:
12292
fetch-depth: 0
12393

@@ -127,10 +97,9 @@ jobs:
12797
version: "latest"
12898

12999
- name: ⚙️ Set up Python ${{ matrix.python-version }}
130-
run: uv python install ${{ matrix.python-version }}
131-
132-
- name: ⚙️ Install dependencies
133-
run: uv sync --all-extras --dev
100+
run: |
101+
uv python install ${{ matrix.python-version }}
102+
uv sync --all-extras --dev
134103
135104
- name: ⚙️ Run tests
136105
run: uv run pytest tests/ -v --tb=short
@@ -162,9 +131,10 @@ jobs:
162131
with:
163132
egress-policy: audit
164133

165-
- uses: actions/checkout@v4
134+
- name: ⚙️ Checkout the project
135+
uses: actions/checkout@v4
166136
with:
167-
fetch-depth: 0 # Full history for hatch-vcs
137+
fetch-depth: 0 # Full history for UV build
168138

169139
- name: ⚙️ Install uv
170140
uses: astral-sh/setup-uv@v4
@@ -201,59 +171,9 @@ jobs:
201171
path: dist/
202172
retention-days: 90
203173

204-
create-github-release-assets:
205-
runs-on: ubuntu-latest
206-
needs: [validate-release, build-and-publish]
207-
permissions:
208-
contents: write # For uploading release assets
209-
steps:
210-
- name: ⚙️ Harden Runner
211-
uses: step-security/harden-runner@v2
212-
with:
213-
egress-policy: audit
214-
215-
- uses: actions/checkout@v4
216-
217-
- name: ⚙️ Download build artifacts
218-
uses: actions/download-artifact@v4
219-
with:
220-
name: dist-${{ needs.validate-release.outputs.version }}
221-
path: dist/
222-
223-
- name: ⚙️ Upload release assets
224-
uses: softprops/action-gh-release@v2
225-
with:
226-
files: |
227-
dist/*.tar.gz
228-
dist/*.whl
229-
body: |
230-
## 🚀 Redis MCP Server v${{ needs.validate-release.outputs.version }}
231-
232-
This release has been automatically published to PyPI with security scanning and comprehensive testing.
233-
234-
### Installation
235-
```bash
236-
pip install redis-mcp-server==${{ needs.validate-release.outputs.version }}
237-
```
238-
239-
### Quick Start
240-
```bash
241-
uvx redis-mcp-server --url redis://localhost:6379/0
242-
```
243-
244-
### What's Changed
245-
See the commit history for detailed changes in this release.
246-
247-
### Verification
248-
- ✅ All tests passed across Python 3.10-3.13
249-
- ✅ Security scan completed
250-
- ✅ Package built and verified successfully
251-
- ✅ Published to PyPI with attestations
252-
- ✅ Version consistency validated
253-
254174
notify-success:
255175
runs-on: ubuntu-latest
256-
needs: [validate-release, build-and-publish, create-github-release-assets]
176+
needs: [validate-release, build-and-publish]
257177
if: success()
258178
steps:
259179
- name: ⚙️ Success notification

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ uv.lock
2727
/safety-report.json
2828
/coverage.xml
2929
/.coverage
30+
/htmlcov/

0 commit comments

Comments
 (0)