Skip to content

Commit 15640d3

Browse files
authored
Merge pull request #44 from jlowin/os-tests
Set up multiple os tests
2 parents 0f2b5a3 + 4a9f365 commit 15640d3

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

Diff for: .github/workflows/run-tests.yml

+12-5
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ on:
1212
- "tests/**"
1313
- "uv.lock"
1414
- "pyproject.toml"
15+
- ".github/workflows/**"
1516
pull_request:
1617
paths:
1718
- "src/**"
1819
- "tests/**"
1920
- "uv.lock"
2021
- "pyproject.toml"
22+
- ".github/workflows/**"
2123

2224
workflow_dispatch:
2325

@@ -26,20 +28,25 @@ permissions:
2628

2729
jobs:
2830
run_tests:
29-
name: Run tests
30-
runs-on: ubuntu-latest
31+
name: "Run tests: Python ${{ matrix.python-version }} on ${{ matrix.os }}"
32+
runs-on: ${{ matrix.os }}
33+
strategy:
34+
matrix:
35+
os: [ubuntu-latest, windows-latest, macos-latest]
36+
python-version: ["3.10"]
37+
fail-fast: false
3138

3239
steps:
3340
- uses: actions/checkout@v4
3441

3542
- name: Install uv
3643
uses: astral-sh/setup-uv@v4
3744

38-
- name: Set up Python
39-
run: uv python install 3.11
45+
- name: Set up Python ${{ matrix.python-version }}
46+
run: uv python install ${{ matrix.python-version }}
4047

4148
- name: Install FastMCP
42-
run: uv sync --extra dev
49+
run: uv sync --extra tests
4350

4451
- name: Run tests
4552
run: uv run pytest -vv

Diff for: README.md

+5-8
Original file line numberDiff line numberDiff line change
@@ -464,23 +464,20 @@ FastMCP requires Python 3.10+ and [uv](https://docs.astral.sh/uv/).
464464

465465
### Installation
466466

467-
Create a fork of this repository, then clone it:
467+
For development, we recommend installing FastMCP with development dependencies, which includes various utilities the maintainers find useful.
468468

469469
```bash
470-
git clone https://github.com/YouFancyUserYou/fastmcp.git
470+
git clone https://github.com/jlowin/fastmcp.git
471471
cd fastmcp
472+
uv sync --frozen --extra dev
472473
```
473474

474-
Next, create a virtual environment and install FastMCP:
475+
For running tests only (e.g., in CI), you only need the testing dependencies:
475476

476477
```bash
477-
uv venv
478-
source .venv/bin/activate
479-
uv sync --frozen --all-extras --dev
478+
uv sync --frozen --extra tests
480479
```
481480

482-
483-
484481
### Testing
485482

486483
Please make sure to test any new functionality. Your tests should be simple and atomic and anticipate change rather than cement complex patterns.

Diff for: pyproject.toml

+3-5
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,14 @@ requires = ["hatchling>=1.21.0", "hatch-vcs>=0.4.0"]
2323
build-backend = "hatchling.build"
2424

2525
[project.optional-dependencies]
26-
dev = [
27-
"copychat>=0.5.2",
28-
"ipython>=8.12.3",
29-
"pdbpp>=0.10.3",
26+
tests = [
3027
"pre-commit",
31-
"pytest-xdist>=3.6.1",
3228
"pytest>=8.3.3",
3329
"pytest-asyncio>=0.23.5",
30+
"pytest-xdist>=3.6.1",
3431
"ruff",
3532
]
33+
dev = ["fastmcp[tests]", "copychat>=0.5.2", "ipython>=8.12.3", "pdbpp>=0.10.3"]
3634

3735
[tool.pytest.ini_options]
3836
asyncio_mode = "auto"

0 commit comments

Comments
 (0)