Skip to content

Commit 8d6543a

Browse files
committed
docs : readme on execution
1 parent 271a1ed commit 8d6543a

3 files changed

Lines changed: 149 additions & 13 deletions

File tree

.codespellignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,9 @@ Github
77
Strava
88
fastmcp
99
chathletique
10+
11+
# French words in README
12+
projet
13+
Avantages
14+
commiter
15+
remplace

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.env
22
venv/
3+
experimentations/
34

45
supp.ipynb
56
__pycache__/

README.md

Lines changed: 142 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,30 +66,51 @@ ORS_KEY=your_openrouteservice_api_key
6666
1. **Clone and setup:**
6767
```bash
6868
git clone <your-repo-url>
69-
cd MCP-hackathon
69+
cd chathletique-mcp
7070
```
7171

72-
2. **Install dependencies:**
72+
2. **Install Python dependencies with uv:**
7373
```bash
74-
pip install -r requirements.txt
74+
# Install uv if you don't have it (fast Python package manager)
75+
curl -LsSf https://astral.sh/uv/install.sh | sh
76+
77+
# Install project dependencies
78+
uv sync
79+
80+
# Install development dependencies (for contributing)
81+
uv sync --extra dev
7582
```
7683

7784
3. **Configure environment:**
7885
```bash
79-
# Copy and edit the .env file with your API keys
86+
# Create .env file with your API keys
8087
cp .env.example .env
8188
# Edit .env with your actual API keys
8289
```
8390

91+
4. **Set up code quality tools (for contributors):**
92+
```bash
93+
# Install pre-commit hooks for automatic code quality checks
94+
uv run pre-commit install
95+
96+
# Optional: Run pre-commit on all files to check everything
97+
uv run pre-commit run --all-files
98+
```
99+
84100
## Usage
85101

86102
### Starting the Server
87103

88104
```bash
89-
python main.py
105+
# Using uv (recommended)
106+
uv run python -m src.strava_mcp.main
107+
108+
# Or activate the environment and run directly
109+
source .venv/bin/activate # On Unix/macOS
110+
python -m src.strava_mcp.main
90111
```
91112

92-
The server will start on port 3000 and be accessible at `http://localhost:3000/mcp`. Else you can deploy it directly on huggingface using https://huggingface.co/spaces/Jofthomas/MCP_Server_Template/blob/main/server.py
113+
The server will start on port 3000 and be accessible at `http://localhost:3000/mcp`.
93114

94115
### Testing with MCP Inspector
95116

@@ -173,16 +194,124 @@ The server is built using:
173194

174195
### Project Structure
175196
```
176-
hack/
177-
├── main.py # MCP server entry point
178-
├── strava_tools.py # Strava integration tools
179-
├── weather_tools.py # Weather prediction tools
180-
├── mcp_utils.py # MCP server configuration
181-
├── experimentations/ # Development and testing scripts
182-
├── requirements.txt # Python dependencies
197+
chathletique-mcp/
198+
├── src/strava_mcp/
199+
│ ├── __init__.py # Package initialization
200+
│ ├── main.py # MCP server entry point
201+
│ ├── strava_tools.py # Strava API integration tools
202+
│ ├── weather_tools.py # Weather prediction tools
203+
│ └── mcp_utils.py # MCP server configuration
204+
├── tests/ # Test suite
205+
├── .pre-commit-config.yaml # Code quality configuration
206+
├── pyproject.toml # Project configuration and dependencies
207+
├── uv.lock # Lock file for reproducible installs
183208
└── README.md # This file
184209
```
185210

211+
## 🛠️ Development & Code Quality
212+
213+
This project uses modern Python development tools for maintaining high code quality:
214+
215+
### Code Quality Tools
216+
217+
- **Ruff**: Ultra-fast Python linter and formatter with comprehensive rules
218+
- **MyPy**: Static type checking for better code reliability
219+
- **Pre-commit**: Automatic code quality checks before each commit
220+
- **Pytest**: Testing framework with coverage reporting
221+
- **Black**: Code formatting (integrated with Ruff)
222+
223+
### Pre-commit Hooks
224+
225+
The project includes automatic quality checks that run before each commit:
226+
227+
1. **Code formatting**: Automatic code formatting with Ruff
228+
2. **Import sorting**: Organize imports consistently
229+
3. **Linting**: Check for bugs, security issues, and style problems
230+
4. **Type checking**: Verify type annotations with MyPy
231+
5. **Docstring validation**: Enforce Google-style docstrings
232+
6. **Security scanning**: Detect potential security vulnerabilities
233+
7. **Spell checking**: Catch typos in code and documentation
234+
235+
### Contributing Guidelines
236+
237+
1. **Install development dependencies:**
238+
```bash
239+
uv sync --extra dev
240+
uv run pre-commit install
241+
```
242+
243+
2. **Run tests:**
244+
```bash
245+
uv run pytest
246+
```
247+
248+
3. **Run quality checks manually:**
249+
```bash
250+
# Run all pre-commit hooks
251+
uv run pre-commit run --all-files
252+
253+
# Run specific tools
254+
uv run ruff check src/
255+
uv run mypy src/
256+
```
257+
258+
4. **Commit your changes:**
259+
```bash
260+
git add .
261+
git commit -m "Your commit message"
262+
# Pre-commit hooks run automatically
263+
```
264+
265+
All code is automatically checked for:
266+
- **Security vulnerabilities** (Bandit-style checks)
267+
- **Code style** (PEP 8 compliance)
268+
- **Import organization** (isort-style)
269+
- **Type annotations** (MyPy checking)
270+
- **Documentation quality** (Google docstring format)
271+
- **Common Python mistakes** (Bugbear checks)
272+
273+
### 🇫🇷 Installation et Pre-commit (French)
274+
275+
**Installation rapide avec uv :**
276+
```bash
277+
# 1. Cloner le projet
278+
git clone <votre-repo-url>
279+
cd chathletique-mcp
280+
281+
# 2. Installer uv (gestionnaire de paquets Python ultra-rapide)
282+
curl -LsSf https://astral.sh/uv/install.sh | sh
283+
284+
# 3. Installer les dépendances
285+
uv sync --extra dev
286+
287+
# 4. Configurer les hooks pre-commit
288+
uv run pre-commit install
289+
```
290+
291+
**Comment fonctionne pre-commit :**
292+
293+
Pre-commit est un système qui exécute automatiquement des vérifications de qualité de code **avant chaque commit**.
294+
295+
**Avantages :**
296+
-**Code toujours propre** : Impossible de commiter du code mal formaté
297+
-**Sécurité automatique** : Détection des vulnérabilités courantes
298+
-**Style cohérent** : Formatage automatique selon les standards Google
299+
-**Documentation forcée** : Docstrings obligatoires et bien formatées
300+
-**Imports organisés** : Tri automatique des imports
301+
302+
**Que se passe-t-il lors d'un commit :**
303+
1. Vous faites `git commit -m "mon message"`
304+
2. Pre-commit lance automatiquement tous les outils de qualité
305+
3. Si des problèmes sont détectés, le commit est **bloqué**
306+
4. Les outils corrigent automatiquement ce qu'ils peuvent
307+
5. Vous revérifiez les modifications et recommitez
308+
309+
**Outils inclus :**
310+
- **Ruff** : Linter ultra-rapide (remplace flake8, isort, black)
311+
- **MyPy** : Vérification des types Python
312+
- **Codespell** : Correction des fautes de frappe
313+
- **Security checks** : Détection de failles de sécurité
314+
186315
## License
187316

188317
This project is licensed under the MIT License - see the LICENSE file for details.

0 commit comments

Comments
 (0)