Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
30 changes: 13 additions & 17 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,33 @@ name: Python package

on:
push:
branches: [master]
pull_request:
branches: [master]
paths:
- 'RobotFrameworkService/**'
- 'tests/**'
- 'pyproject.toml'
- '.github/workflows/python-package.yml'
- 'uv.lock'

jobs:
build:
runs-on: ubuntu-latest
env:
UV_PYTHON: ${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest httpx
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install .
uv python install ${{ matrix.python-version }}
uv sync --group test
mkdir logs
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
uv run pytest
13 changes: 5 additions & 8 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,15 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v7
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
UV_PUBLISH_USERNAME: ${{ secrets.PYPI_USERNAME }}
UV_PUBLISH_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
uv build
uv publish
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
112 changes: 112 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Contributing Guide

Thank you for your interest in contributing to robotframework-webservice! This guide will help you set up your local development environment.

## Prerequisites

- **[uv](https://docs.astral.sh/uv/getting-started/installation/)** installed (fast Python package manager and project manager)

## Local Development Setup

### 1. Clone the repository

```bash
git clone https://github.com/your-org/robotframework-webservice.git
cd robotframework-webservice
```

### 2. Install dependencies with uv

```bash
# Install main dependencies and dev tools
uv sync
```

This installs all project and development dependencies into a virtual environment.

### 3. Activate the virtual environment (optional)

```bash
# On Linux/macOS
source .venv/bin/activate

# On Windows
.venv\Scripts\activate
```

Or prefix commands with `uv run`:

```bash
uv run python --version
```

## Running Tests

Run the test suite using Python's unittest discovery:

```bash
# Run all tests
uv run python -m unittest discover -s tests -p "test_*.py"

# Run a specific test file
uv run python -m unittest tests.test_app

# Run a specific test class
uv run python -m unittest tests.test_app.EndpointTesttest_s

# Run a specific test method
uv run python -m unittest tests.test_app.EndpointTesttest_s.test_is_service_available
```

### In VS Code

- Install the **Python** extension (ms-python.python)
- Open the Testing panel (beaker icon in sidebar)
- Tests should auto-discover; click **Refresh Tests** if needed
- Click on any test to run it, or run all tests

## Running the Service

Start the FastAPI web service:

```bash
uv run uvicorn RobotFrameworkService.main:app --reload
```

The service will be available at `http://localhost:8000`. View API docs at `http://localhost:8000/docs`.

## Code Quality

The project uses:

- **[RobotCode](https://robotcode.io/)** – Language server and linter for Robot Framework
- **[Robocop](https://robocop.readthedocs.io/)** – Static analysis for Robot Framework

Run checks:

```bash
# Lint Robot Framework files
uv run robocop examples/ tests/

# Use RobotCode for analysis (via VS Code extension or CLI)
uv run robotcode --help
```

## Development Workflow

1. Create a feature branch: `git checkout -b feature/your-feature`
2. Make your changes and add tests
3. Run tests locally: `uv run python -m unittest discover -s tests -p "test_*.py"`
4. Commit and push: `git push origin feature/your-feature`
5. Open a pull request

## Troubleshooting

**Tests not discovered in VS Code?**
- Ensure `tests/__init__.py` exists
- Run `Python: Discover Tests` from the command palette
- Reload VS Code if needed

**Module import errors?**
- Verify the virtual environment is active: `uv run python -c "import sys; print(sys.executable)"`
- Install dependencies: `uv sync`
48 changes: 48 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "robotframework-webservice"
dynamic = ["version"]
description = "Webservice for running Robot Framework tests and tasks"
authors = [{ name = "Markus Stahl", email = "markus.i.sverige@gmail.com" }]
readme = "README.md"
requires-python = ">=3.10"
license = { text = "Apache License 2.0" }
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Framework :: FastAPI",
"Framework :: Robot Framework",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
urls = { Homepage = "https://github.com/MarketSquare/robotframework-webservice" }
dependencies = [
"aiofiles>=25.1.0",
"fastapi>=0.135.1",
"requests>=2.32.5",
"robotframework>=6.0.0",
"uvicorn>=0.41.0",
]

[dependency-groups]
dev = [
"httpx>=0.28.1",
"pytest>=9.0.2",
"robotcode>=2.2.0",
"robotframework-robocop>=8.2.2",
]
test = ["httpx>=0.28.1", "pytest>=9.0.2"]

[tool.hatch.version]
path = "src/RobotFrameworkService/version.py"
pattern = 'VERSION = "(?P<version>[^"]+)"'

[tool.hatch.build.targets.wheel]
packages = ["src/RobotFrameworkService"]
2 changes: 0 additions & 2 deletions requirements-dev.txt

This file was deleted.

1 change: 0 additions & 1 deletion requirements-test.txt

This file was deleted.

5 changes: 0 additions & 5 deletions requirements.txt

This file was deleted.

40 changes: 0 additions & 40 deletions setup.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added tests/__init__.py
Empty file.
Loading