Skip to content

Commit 93a78ef

Browse files
authored
Merge pull request #25 from eifrach/convert_uv
NO-ISSUE: changing the project to run using UV
2 parents 9f68a61 + 3be3bf2 commit 93a78ef

File tree

8 files changed

+634
-17
lines changed

8 files changed

+634
-17
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.tekton/
2+
.venv/
3+
.gitignore
4+
.git/
5+
openshift/

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
Snowflake_CSV/
1+
Snowflake_CSV/
2+
.venv/

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11

Containerfile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@ FROM registry.access.redhat.com/ubi9/python-311
22

33
WORKDIR /app
44

5-
# Copy requirements and install dependencies
6-
COPY requirements.txt ./
7-
RUN pip install --no-cache-dir -r requirements.txt
5+
# Install UV
6+
RUN pip install uv
87

9-
# Copy application files
10-
COPY ./src/ ./
8+
# Copy project files needed for uv sync
9+
COPY pyproject.toml ./
10+
COPY .python-version ./
11+
COPY README.md ./
12+
13+
# Copy application files (needed for editable install)
14+
COPY ./src/ ./src/
15+
16+
# Install dependencies using UV
17+
RUN uv sync --no-dev
1118
# Environment variables (set these when running the container)
1219
# SNOWFLAKE_BASE_URL - Snowflake API base URL (optional, defaults to Red Hat's instance)
1320
# SNOWFLAKE_TOKEN - Snowflake authentication token (required)
@@ -21,4 +28,4 @@ ENV MCP_TRANSPORT=stdio
2128
# Expose metrics port
2229
EXPOSE 8000
2330

24-
CMD ["python", "mcp_server.py"]
31+
CMD ["uv", "run", "python", "src/mcp_server.py"]

README.md

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ The server includes optional Prometheus metrics support for monitoring:
5757

5858
## Prerequisites
5959

60-
- Python 3.8+
60+
- Python 3.10+
61+
- [UV](https://docs.astral.sh/uv/) (Python package manager)
6162
- Podman or Docker
6263
- Access to Snowflake with appropriate credentials
6364

@@ -92,6 +93,22 @@ The following environment variables are used to configure the Snowflake connecti
9293

9394
## Installation & Setup
9495

96+
### Migration from pip to UV
97+
98+
This project has been updated to use UV for dependency management. If you have an existing setup:
99+
100+
1. Remove your old virtual environment:
101+
```bash
102+
rm -rf venv/
103+
```
104+
105+
2. Install UV if you haven't already (see Local Development section below)
106+
107+
3. Install dependencies with UV:
108+
```bash
109+
uv sync
110+
```
111+
95112
### Local Development
96113

97114
1. Clone the repository:
@@ -100,16 +117,28 @@ git clone <repository-url>
100117
cd jira-mcp-snowflake
101118
```
102119

103-
2. Install dependencies:
120+
2. Install UV if you haven't already:
121+
```bash
122+
# On macOS/Linux
123+
curl -LsSf https://astral.sh/uv/install.sh | sh
124+
125+
# On Windows
126+
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
127+
128+
# Or via pip
129+
pip install uv
130+
```
131+
132+
3. Install dependencies:
104133
```bash
105-
pip install -r requirements.txt
134+
uv sync
106135
```
107136

108-
3. Set up environment variables (see Environment Variables section above)
137+
4. Set up environment variables (see Environment Variables section above)
109138

110-
4. Run the server:
139+
5. Run the server:
111140
```bash
112-
python src/mcp_server.py
141+
uv run python src/mcp_server.py
113142
```
114143

115144
### Container Deployment
@@ -122,7 +151,7 @@ To build the container image locally using Podman, run:
122151
podman build -t jira-mcp-snowflake:latest .
123152
```
124153

125-
This will create a local image named `jira-mcp-snowflake:latest` that you can use to run the server.
154+
This will create a local image named `jira-mcp-snowflake:latest` that you can use to run the server. The container now uses UV for fast dependency management.
126155

127156
## Running with Podman or Docker
128157

pyproject.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[project]
2+
name = "jira-mcp-snowflake"
3+
version = "0.1.0"
4+
description = "A Model Context Protocol (MCP) server that provides access to JIRA issue data stored in Snowflake"
5+
readme = "README.md"
6+
requires-python = ">=3.10"
7+
dependencies = [
8+
"httpx==0.28.1",
9+
"mcp==1.10.1",
10+
"prometheus_client==0.20.0",
11+
]
12+
13+
[project.scripts]
14+
jira-mcp-snowflake = "src.mcp_server:main"
15+
16+
[build-system]
17+
requires = ["hatchling"]
18+
build-backend = "hatchling.build"
19+
20+
[tool.hatch.build.targets.wheel]
21+
packages = ["src"]
22+
23+
[tool.uv]
24+
dev-dependencies = []

requirements.txt

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

uv.lock

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

0 commit comments

Comments
 (0)