Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ __pycache__/
*.so
.idea

# macOS
.DS_Store

# Distribution / packaging
.Python
build/
Expand Down
70 changes: 70 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,76 @@ Get started quickly with the OpenStack MCP server using Claude Desktop
}
```

# Development

## Setup

This project supports both `uv` and `tox` for development and testing.

### Using uv (Fast Local Development)

```bash
# Install dependencies (including dev and test groups)
uv sync

# Run tests
uv run --group test pytest

# Run linting
uv run ruff check src tests

# Format code
uv run ruff format src tests
```

### Using tox (OpenStack Standard)

```bash
# Install tox
pip install tox
# or
uv tool install tox

# Run tests
tox -e py3

# Run linting
tox -e pep8

# Auto-format code
tox -e format

# Generate coverage report
tox -e cover

# Run arbitrary commands in virtualenv
tox -e venv -- <command>

# Test on specific Python version
tox -e py310 # or py311, py312, py313

# List all available environments
tox list
```

## Testing

The project includes comprehensive test coverage (85%+). Tests are located in the `tests/` directory.

```bash
# Run all tests
tox -e py3

# Run with coverage
tox -e cover

# Run with debugger
tox -e debug

# Run specific test file
tox -e py3 -- tests/tools/test_compute_tools.py
```

# Contributing
Contributions are welcome! Please see the [CONTRIBUTING](CONTRIBUTING.rst) file for details on how to contribute to this project.

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dev = [
"ruff>=0.12.5",
"pre-commit>=4.2.0",
"setuptools-scm>=9.2.0",
]
]
test = [
"pytest>=8.4.1",
]
Expand Down
69 changes: 69 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
[tox]
minversion = 4.3.0
envlist = py3,py{310,311,312,313},pep8
skipsdist = False

[testenv]
usedevelop = True
setenv =
VIRTUAL_ENV={envdir}
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60
deps =
-r{toxinidir}/requirements.txt
pytest>=8.4.1
commands =
pytest {posargs}

[testenv:pep8]
description = Run style checks with ruff
deps =
ruff>=0.12.5
commands =
ruff check src tests
ruff format --check src tests

[testenv:format]
description = Auto-format code with ruff
deps =
ruff>=0.12.5
commands =
ruff check --fix src tests
ruff format src tests

[testenv:venv]
description = Run arbitrary commands in a virtual environment
commands = {posargs}

[testenv:cover]
description = Generate test coverage report
deps =
{[testenv]deps}
coverage>=7.0
pytest-cov>=6.0.0
commands =
pytest --cov=openstack_mcp_server --cov-report=html:cover --cov-report=xml:cover/coverage.xml --cov-report=term {posargs}

[testenv:debug]
description = Run tests with debugging
commands =
pytest --pdb {posargs}

[testenv:docs]
description = Build documentation (placeholder for future use)
allowlist_externals = echo
commands =
echo "Documentation building not yet configured"

[testenv:py310]
basepython = python3.10

[testenv:py311]
basepython = python3.11

[testenv:py312]
basepython = python3.12

[testenv:py313]
basepython = python3.13