Skip to content

Commit 80c883e

Browse files
committed
update project docs
1 parent 0a56ffa commit 80c883e

File tree

7 files changed

+84
-72
lines changed

7 files changed

+84
-72
lines changed

.github/workflows/QUICKSTART.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ The `publish-pypi.yml` workflow uses a pre-built Docker image for faster executi
5555
**Or build locally:**
5656

5757
```bash
58-
docker build -t ghcr.io/opensecflow/netdriver/python-poetry:3.12 -f .github/Dockerfile.ci .
59-
docker push ghcr.io/opensecflow/netdriver/python-poetry:3.12
58+
docker build -t ghcr.io/opensecflow/netdriver/python-uv:3.12 -f .github/Dockerfile.ci .
59+
docker push ghcr.io/opensecflow/netdriver/python-uv:3.12
6060
```
6161

6262
**Note**: This only needs to be done once. The image will be cached and reused.
@@ -103,8 +103,8 @@ Before publishing to production PyPI, test with TestPyPI:
103103

104104
```bash
105105
# 1. Update version numbers
106-
poetry version -P projects/agent 0.3.1
107-
poetry version -P projects/simunet 0.3.1
106+
sed -i 's/^version = ".*"/version = "0.3.1"/' projects/agent/pyproject.toml
107+
sed -i 's/^version = ".*"/version = "0.3.1"/' projects/simunet/pyproject.toml
108108

109109
# 2. Commit changes
110110
git add projects/*/pyproject.toml
@@ -156,20 +156,21 @@ The `release.yml` workflow will automatically:
156156
**Solution:** Version already exists on PyPI. Bump the version:
157157

158158
```bash
159-
poetry version -P projects/agent patch
160-
poetry version -P projects/simunet patch
159+
# Manually update version in pyproject.toml files
160+
sed -i 's/^version = ".*"/version = "0.3.2"/' projects/agent/pyproject.toml
161+
sed -i 's/^version = ".*"/version = "0.3.2"/' projects/simunet/pyproject.toml
161162
# Then rebuild and publish
162163
```
163164

164-
### Workflow fails with "Poetry not found" or image pull error
165+
### Workflow fails with "uv not found" or image pull error
165166

166167
**Solution:** Build the CI Docker image first
167168

168169
```bash
169170
# Go to Actions → "Build CI Image" → Run workflow
170171
```
171172

172-
Or check the image name matches: `ghcr.io/opensecflow/netdriver/python-poetry:3.12`
173+
Or check the image name matches: `ghcr.io/opensecflow/netdriver/python-uv:3.12`
173174

174175
### Package shows as "0 B" or malformed
175176

@@ -198,7 +199,7 @@ unzip -l projects/agent/dist/netdriver_agent-*.whl
198199
### Release Process
199200

200201
1. Develop features on branches
201-
2. Test locally: `poetry build-project -C projects/agent`
202+
2. Test locally: `uv build --directory projects/agent`
202203
3. Create PR and verify build test passes
203204
4. Merge to master
204205
5. Test on TestPyPI

.github/workflows/README.md

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This directory contains GitHub Actions workflows for automated building, testing
3030

3131
**What it does**:
3232

33-
- Uses pre-built Docker container with Poetry installed
33+
- Uses pre-built Docker container with uv installed
3434
- Builds wheel packages for selected projects
3535
- Publishes to PyPI or TestPyPI
3636
- Uploads build artifacts
@@ -68,7 +68,7 @@ The project supports independent release workflows for agent and simunet:
6868

6969
```bash
7070
# Update agent version in pyproject.toml (optional, will be updated by workflow)
71-
poetry version 1.0.0 -C projects/agent
71+
sed -i 's/^version = ".*"/version = "1.0.0"/' projects/agent/pyproject.toml
7272

7373
# Commit version changes (optional)
7474
git add projects/agent/pyproject.toml
@@ -98,7 +98,7 @@ git push origin agent-1.0.0
9898

9999
```bash
100100
# Update simunet version in pyproject.toml (optional, will be updated by workflow)
101-
poetry version 2.5.0 -C projects/simunet
101+
sed -i 's/^version = ".*"/version = "2.5.0"/' projects/simunet/pyproject.toml
102102

103103
# Commit version changes (optional)
104104
git add projects/simunet/pyproject.toml
@@ -165,7 +165,7 @@ Use this when you only need to release the agent:
165165
1. **Update version number** (optional):
166166

167167
```bash
168-
poetry version 1.0.0 -C projects/agent
168+
sed -i 's/^version = ".*"/version = "1.0.0"/' projects/agent/pyproject.toml
169169
```
170170

171171
2. **Commit changes** (optional):
@@ -197,7 +197,7 @@ Use this when you need to release simunet:
197197
1. **Update version number** (optional):
198198

199199
```bash
200-
poetry version 2.5.0 -C projects/simunet
200+
sed -i 's/^version = ".*"/version = "2.5.0"/' projects/simunet/pyproject.toml
201201
```
202202

203203
2. **Commit changes** (optional):
@@ -235,8 +235,8 @@ To test publishing before official release:
235235
2. **Or use CLI**:
236236

237237
```bash
238-
poetry publish -P projects/agent -r testpypi
239-
poetry publish -P projects/simunet -r testpypi
238+
uv publish --directory projects/agent --publish-url https://test.pypi.org/legacy/ --token $TESTPYPI_TOKEN
239+
uv publish --directory projects/simunet --publish-url https://test.pypi.org/legacy/ --token $TESTPYPI_TOKEN
240240
```
241241

242242
3. **Verify on TestPyPI**:
@@ -382,12 +382,12 @@ The project uses prefixed tag patterns for independent releases:
382382

383383
### 5. Build CI Image (`build-ci-image.yml`)
384384

385-
**Purpose**: Creates a Docker image with Poetry and Python pre-installed for faster CI/CD
385+
**Purpose**: Creates a Docker image with uv and Python pre-installed for faster CI/CD
386386

387387
**What it includes**:
388388

389389
- Python 3.12
390-
- Poetry with multiproject and polylith plugins
390+
- uv package manager
391391
- Git and essential build tools
392392

393393
**Building the image**:
@@ -408,24 +408,24 @@ The `publish-pypi.yml` workflow uses this approach:
408408
jobs:
409409
publish:
410410
runs-on: ubuntu-latest
411-
container:
412-
image: ghcr.io/${{ github.repository }}/python-poetry:3.12
413411
steps:
414412
- uses: actions/checkout@v4
415-
# Poetry and plugins are already installed!
416-
- run: poetry build-project -C projects/agent
413+
- uses: astral-sh/setup-uv@v4
414+
- run: uv python install
415+
- run: uv sync
416+
- run: uv build --directory projects/agent
417417
```
418418
419419
**Benefits of using Docker image**:
420420
421-
- ⚡ **Faster**: No need to install Poetry and plugins on every run
421+
- ⚡ **Faster**: No need to install uv on every run
422422
- 🔒 **Consistent**: Same environment across all workflows
423423
- 💾 **Cacheable**: Image layers are cached by Docker
424424
- 🎯 **Reproducible**: Exact same versions every time
425425
426426
**Image locations**:
427427
428-
- GitHub Container Registry: `ghcr.io/opensecflow/netdriver/python-poetry:3.12`
428+
- GitHub Container Registry: `ghcr.io/opensecflow/netdriver/python-uv:3.12`
429429
- Available tags: `latest`, `master`, `<branch>-<sha>`
430430

431431
**Benefits**:
@@ -485,20 +485,18 @@ container:
485485
password: ${{ secrets.DOCKER_PASSWORD }}
486486
```
487487

488-
### 3. Verify Poetry is available
488+
### 3. Verify uv is available
489489

490-
Poetry and plugins are pre-installed, so you can use them directly:
490+
uv is pre-installed, so you can use it directly:
491491

492492
```yaml
493-
- name: Verify Poetry installation
493+
- name: Verify uv installation
494494
run: |
495-
poetry --version
496-
poetry self show plugins
495+
uv --version
497496
```
498497

499498
## References
500499

501-
- [Poetry Documentation](https://python-poetry.org/docs/)
502-
- [Poetry Polylith Plugin](https://github.com/DavidVujic/poetry-polylith-plugin)
500+
- [uv Documentation](https://docs.astral.sh/uv/)
503501
- [PyPI Publishing Guide](https://packaging.python.org/tutorials/packaging-projects/)
504502
- [GitHub Actions - Python](https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python)

CLAUDE.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,37 +63,33 @@ Sessions track device state including:
6363

6464
```bash
6565
# Install dependencies
66-
poetry install
67-
68-
# Install Poetry plugins (if not already installed)
69-
poetry self add poetry-multiproject-plugin
70-
poetry self add poetry-polylith-plugin
66+
uv sync
7167
```
7268

7369
### Running Services
7470

7571
```bash
7672
# Start agent service (REST API on http://localhost:8000)
77-
poetry run agent
73+
uv run agent
7874

7975
# Start simulation network service (SSH servers on configured ports)
80-
poetry run simunet
76+
uv run simunet
8177
```
8278

8379
### Testing
8480

8581
```bash
8682
# Run all tests
87-
poetry run pytest
83+
uv run pytest
8884

8985
# Run unit tests only
90-
poetry run pytest -m unit
86+
uv run pytest -m unit
9187

9288
# Run integration tests only
93-
poetry run pytest -m integration
89+
uv run pytest -m integration
9490

9591
# Run specific test file
96-
poetry run pytest tests/bases/netdriver/agent/test_cisco_nexus.py
92+
uv run pytest tests/bases/netdriver/agent/test_cisco_nexus.py
9793
```
9894

9995
### Configuration
@@ -176,7 +172,7 @@ Uses Loguru configured via `netdriver.log.logman`:
176172
## Important Notes
177173

178174
- Python 3.12+ required
179-
- Uses Poetry for dependency management
175+
- Uses uv for dependency management
180176
- All SSH operations are async (AsyncSSH-based)
181177
- Session keys format: `{protocol}:{username}@{ip}:{port}`
182178
- The agent runs with auto-reload enabled by default (suitable for development)

CONTRIBUTING.md

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,37 @@ Thank you for your interest in contributing to NetDriver! We welcome contributio
44

55
## Table of Contents
66

7-
- [Code of Conduct](#code-of-conduct)
8-
- [Getting Started](#getting-started)
9-
- [Development Environment Setup](#development-environment-setup)
10-
- [How to Contribute](#how-to-contribute)
11-
- [Development Guidelines](#development-guidelines)
12-
- [Adding a New Device Plugin](#adding-a-new-device-plugin)
13-
- [Testing](#testing)
14-
- [Pull Request Process](#pull-request-process)
15-
- [Reporting Bugs](#reporting-bugs)
16-
- [Feature Requests](#feature-requests)
7+
- [Contributing to NetDriver](#contributing-to-netdriver)
8+
- [Table of Contents](#table-of-contents)
9+
- [Code of Conduct](#code-of-conduct)
10+
- [Our Pledge](#our-pledge)
11+
- [Our Standards](#our-standards)
12+
- [Enforcement](#enforcement)
13+
- [Getting Started](#getting-started)
14+
- [Development Environment Setup](#development-environment-setup)
15+
- [Prerequisites](#prerequisites)
16+
- [Setup Steps](#setup-steps)
17+
- [How to Contribute](#how-to-contribute)
18+
- [Development Guidelines](#development-guidelines)
19+
- [Code Style](#code-style)
20+
- [Example Code Style](#example-code-style)
21+
- [Commit Messages](#commit-messages)
22+
- [Branch Naming](#branch-naming)
23+
- [Adding a New Device Plugin](#adding-a-new-device-plugin)
24+
- [1. Create Plugin File](#1-create-plugin-file)
25+
- [2. Implement Plugin Class](#2-implement-plugin-class)
26+
- [3. Add Tests](#3-add-tests)
27+
- [4. Update Documentation](#4-update-documentation)
28+
- [Testing](#testing)
29+
- [Running Tests](#running-tests)
30+
- [Writing Tests](#writing-tests)
31+
- [Pull Request Process](#pull-request-process)
32+
- [Reporting Bugs](#reporting-bugs)
33+
- [Screenshots](#screenshots)
34+
- [Feature Requests](#feature-requests)
35+
- [Project Structure](#project-structure)
36+
- [Questions or Need Help?](#questions-or-need-help)
37+
- [Recognition](#recognition)
1738

1839
## Code of Conduct
1940

@@ -59,7 +80,7 @@ Before you start contributing, please:
5980
### Prerequisites
6081

6182
- Python 3.12 or higher
62-
- Poetry 1.8.3 or higher
83+
- uv 0.9.26 or higher (https://docs.astral.sh/uv/)
6384
- Git
6485

6586
### Setup Steps
@@ -82,27 +103,23 @@ Before you start contributing, please:
82103
pyenv local 3.12.7
83104
```
84105

85-
3. **Install Poetry**
106+
3. **Install uv**
86107

87108
```bash
88-
curl -sSL https://install.python-poetry.org | python3 -
89-
90-
# Install Poetry plugins
91-
poetry self add poetry-multiproject-plugin
92-
poetry self add poetry-polylith-plugin
109+
curl -LsSf https://astral.sh/uv/install.sh | sh
93110
```
94111

95112
4. **Install Dependencies**
96113

97114
```bash
98-
poetry install
115+
uv sync
99116
```
100117

101118
5. **Verify Installation**
102119

103120
```bash
104121
# Run tests to ensure everything is working
105-
poetry run pytest
122+
uv run pytest
106123
```
107124

108125
## How to Contribute
@@ -257,19 +274,19 @@ Add the new plugin to the supported devices list in the README.
257274

258275
```bash
259276
# Run all tests
260-
poetry run pytest
277+
uv run pytest
261278

262279
# Run with coverage
263-
poetry run pytest --cov=components --cov=bases
280+
uv run pytest --cov=components --cov=bases
264281

265282
# Run specific test file
266-
poetry run pytest tests/bases/netdriver/agent/test_cisco_nexus.py
283+
uv run pytest tests/bases/netdriver/agent/test_cisco_nexus.py
267284

268285
# Run unit tests only
269-
poetry run pytest -m unit
286+
uv run pytest -m unit
270287

271288
# Run integration tests only
272-
poetry run pytest -m integration
289+
uv run pytest -m integration
273290
```
274291

275292
### Writing Tests

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<a name="top"></a>
55

66
[![Python](https://img.shields.io/badge/Python-3.12%2B-blue.svg)](https://www.python.org/)
7-
[![Poetry](https://img.shields.io/badge/Poetry-1.8.3-60A5FA.svg)](https://python-poetry.org/)
7+
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
88
[![License](https://img.shields.io/badge/License-Apache_2.0-green.svg)](./LICENSE)
99
[![Build & Test](https://github.com/OpenSecFlow/netdriver/actions/workflows/build.yml/badge.svg)](https://github.com/OpenSecFlow/netdriver/actions/workflows/build.yml)
1010
[![Contributions Welcome](https://img.shields.io/badge/contributions-welcome-orange.svg)](./CONTRIBUTING.md)

scripts/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ A convenient script to create and push release tags.
3434
### What it does
3535

3636
1. Validates input parameters
37-
2. Checks prerequisites (git repository, poetry installation)
37+
2. Checks prerequisites (git repository, uv installation)
3838
3. Verifies working directory is clean
3939
4. Verifies the tag doesn't already exist
40-
5. Updates version in `projects/<project>/pyproject.toml` using `poetry version`
40+
5. Updates version in `projects/<project>/pyproject.toml`
4141
6. Commits the version change
4242
7. Creates an annotated git tag (e.g., `agent-0.3.5`)
4343
8. Pushes the commit and tag to remote
@@ -84,7 +84,7 @@ git push origin :refs/tags/agent-0.3.5
8484

8585
### Prerequisites
8686

87-
- **Poetry** installed and configured
87+
- **uv** installed and configured
8888
- **Git** configured and authenticated
8989
- Push permissions to the repository
9090
- **Clean working directory** (no uncommitted changes)

tests/bases/netdriver/agent/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def simunet_process(request: pytest.FixtureRequest):
5959
# Start simunet process using uvicorn directly
6060
logman.logger.info("Starting simunet process for integration tests...")
6161
process = subprocess.Popen(
62-
["poetry", "run", "simunet"],
62+
["uv", "run", "simunet"],
6363
stdout=subprocess.PIPE,
6464
stderr=subprocess.PIPE,
6565
text=True

0 commit comments

Comments
 (0)