Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
python-version: ${{ matrix.python }}

- name: Install Dependencies
run: pip install -e .[dev,server]
run: pip install -e .[dev]

- name: Lint with Ruff
run: ruff check .
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ Features include:

## Installation

You can install this repository with `pip`, either clone it and run `pip install -e .[dev]` to work on it, or just `pip install https://gitlab.com/rwb27/labthings-fastapi.git`. It will be published on PyPI in the near future, initially as `labthings-fastapi`. It may at some point be renamed to `labthings` v2.
You can install this repository with `pip install labthings-fastapi`. It may at some point be renamed to `labthings` v2. For the latest development version, either clone it and run `pip install -e .[dev]` to work on it, or just `pip install https://gitlab.com/rwb27/labthings-fastapi.git`.

## Developer notes

The code is linted with `ruff .`, type checked with `mypy src`, and tested with `pytest`. These all run in CI with GitHub Actions. The codebase is not even `v0.1` yet so it's still subject to summary rearrangement.
The code is linted with `ruff .`, type checked with `mypy src`, and tested with `pytest`. These all run in CI with GitHub Actions. The codebase is not even `v0.1` yet so it's still subject to summary rearrangement. We recommend a [pre-commit hook] to ensure `ruff` passes on every commit.

Dependencies are defined in `pyproject.toml` and can be compiled to `dev-requirements.txt` with:
```
uv pip compile --extra dev --extra server pyproject.toml --output-file dev-requirements.txt
uv pip compile --extra dev pyproject.toml --output-file dev-requirements.txt
```
If you're not using `uv`, just regular `pip-compile` from `pip-tools` will do the same thing.
If you're not using `uv`, just regular `pip-compile` from `pip-tools` should do the same thing.

All changes to the codebase should go via pull requests, and should only be merged once all the checks in the `test` job are passing. It is preferable to merge code where the `test-with-unpinned-dependencies` job fails, and deal with the dependency issues in another PR, particularly where the required changes are distinct from the code in the PR.

Expand All @@ -49,3 +49,4 @@ See the [examples folder](./examples/) for a runnable demo.
[Web of Things]: https://www.w3.org/WoT/
[python-labthings]: https://github.com/labthings/python-labthings/
[OpenFlexure Microscope software]: https://gitlab.com/openflexure/openflexure-microscope-server/
[pre-commit hook]: https://openflexure.org/contribute#use-git-hooks-for-ci-checks
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file was autogenerated by uv via the following command:
# uv pip compile --extra dev --extra server pyproject.toml --output-file dev-requirements.txt
# uv pip compile --extra dev pyproject.toml --output-file dev-requirements.txt
annotated-types==0.7.0
# via pydantic
anyio==4.8.0
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Compared to `python-labthings`_, this framework updates dependencies, shrinks th
Installation
------------

``pip install labthings-fastapi[server]``
``pip install labthings-fastapi``

Indices and tables
==================
Expand Down
2 changes: 1 addition & 1 deletion docs/source/quickstart/quickstart_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source .venv/bin/activate # or .venv/Scripts/activate on Windows
# END venv
echo "Installing labthings-fastapi"
# BEGIN install
pip install labthings-fastapi[server]
pip install labthings-fastapi
# END install
echo "running example"
# BEGIN serve
Expand Down
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ dependencies = [
"typing_extensions",
"anyio ~=4.0",
"httpx",
"fastapi[all]>=0.115.0",
"zeroconf >=0.28.0",
]

[project.optional-dependencies]
Expand All @@ -29,10 +31,6 @@ dev = [
"ruff>=0.1.3",
"types-jsonschema",
]
server = [
"fastapi[all]>=0.115.0",
"zeroconf >=0.28.0",
]

[project.urls]
"Homepage" = "https://github.com/rwb27/labthings-fastapi"
Expand Down