Skip to content

Commit 093adfa

Browse files
authored
Merge pull request #123 from labthings/non-optional-server-dependencies
Make server dependencies non-optional
2 parents c2e09b8 + 7298f52 commit 093adfa

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
python-version: ${{ matrix.python }}
8282

8383
- name: Install Dependencies
84-
run: pip install -e .[dev,server]
84+
run: pip install -e .[dev]
8585

8686
- name: Lint with Ruff
8787
run: ruff check .

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ Features include:
2828

2929
## Installation
3030

31-
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.
31+
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`.
3232

3333
## Developer notes
3434

35-
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.
35+
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.
3636

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

4343
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.
4444

@@ -49,3 +49,4 @@ See the [examples folder](./examples/) for a runnable demo.
4949
[Web of Things]: https://www.w3.org/WoT/
5050
[python-labthings]: https://github.com/labthings/python-labthings/
5151
[OpenFlexure Microscope software]: https://gitlab.com/openflexure/openflexure-microscope-server/
52+
[pre-commit hook]: https://openflexure.org/contribute#use-git-hooks-for-ci-checks

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file was autogenerated by uv via the following command:
2-
# uv pip compile --extra dev --extra server pyproject.toml --output-file dev-requirements.txt
2+
# uv pip compile --extra dev pyproject.toml --output-file dev-requirements.txt
33
annotated-types==0.7.0
44
# via pydantic
55
anyio==4.8.0

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Compared to `python-labthings`_, this framework updates dependencies, shrinks th
4444
Installation
4545
------------
4646

47-
``pip install labthings-fastapi[server]``
47+
``pip install labthings-fastapi``
4848

4949
Indices and tables
5050
==================

docs/source/quickstart/quickstart_example.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ source .venv/bin/activate # or .venv/Scripts/activate on Windows
55
# END venv
66
echo "Installing labthings-fastapi"
77
# BEGIN install
8-
pip install labthings-fastapi[server]
8+
pip install labthings-fastapi
99
# END install
1010
echo "running example"
1111
# BEGIN serve

pyproject.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ dependencies = [
1919
"typing_extensions",
2020
"anyio ~=4.0",
2121
"httpx",
22+
"fastapi[all]>=0.115.0",
23+
"zeroconf >=0.28.0",
2224
]
2325

2426
[project.optional-dependencies]
@@ -29,10 +31,6 @@ dev = [
2931
"ruff>=0.1.3",
3032
"types-jsonschema",
3133
]
32-
server = [
33-
"fastapi[all]>=0.115.0",
34-
"zeroconf >=0.28.0",
35-
]
3634

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

0 commit comments

Comments
 (0)