Skip to content

Commit e040477

Browse files
Merge pull request #149 from labthings/spelling-fixes
Add CodeSpell to Actions, and fix some spellings
2 parents c109ec7 + e557f61 commit e040477

File tree

22 files changed

+57
-46
lines changed

22 files changed

+57
-46
lines changed

.codespellrc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[codespell]
2+
3+
skip = *.git,
4+
./.vscode,
5+
*.pyc,
6+
__pycache__,
7+
./build,
8+
./dist,
9+
./docs/_build,
10+
./htmlcov,
11+
./src/openflexure_microscope_server/static,
12+
.venv,
13+
*.egg-info,
14+
report.xml,
15+
dev-requirements.txt,
16+
coverage.yml,
17+
coverage.lcov,
18+
coverage.xml,
19+
LICENSE,
20+
21+
# The regex allows it to also check snake case strings. This stops codespell doing
22+
# autocorrection. If a lot of changes are needed this can be commented out.
23+
# Having this does mean that contractions in variable names will be marked as spelt
24+
# incorrectly.
25+
regex = [a-zA-Z0-9\-'’]+

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ jobs:
5454
- name: Format with Ruff
5555
run: ruff format --check .
5656

57+
- name: Check spelling
58+
run: codespell .
59+
5760
- name: Lint with Flake8 (for docstrings)
5861
if: ${{ contains('3.12,3.13', matrix.python) }}
5962
# Flake8 crashes on Python < 3.12, so we exclude those versions.

dev-requirements.txt

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,8 @@ click==8.2.1
3232
# rich-toolkit
3333
# typer
3434
# uvicorn
35-
colorama==0.4.6
36-
# via
37-
# click
38-
# pytest
39-
# sphinx
40-
# uvicorn
35+
codespell==2.4.1
36+
# via labthings-fastapi (pyproject.toml)
4137
coverage==7.9.2
4238
# via pytest-cov
4339
dnspython==2.7.0
@@ -53,10 +49,6 @@ email-validator==2.2.0
5349
# via
5450
# fastapi
5551
# pydantic
56-
exceptiongroup==1.3.0
57-
# via
58-
# anyio
59-
# pytest
6052
fastapi==0.116.1
6153
# via labthings-fastapi (pyproject.toml)
6254
fastapi-cli==0.0.8
@@ -247,14 +239,6 @@ sphinxcontrib-serializinghtml==2.0.0
247239
# via sphinx
248240
starlette==0.47.1
249241
# via fastapi
250-
tomli==2.2.1
251-
# via
252-
# coverage
253-
# flake8-pyproject
254-
# mypy
255-
# pydoclint
256-
# pytest
257-
# sphinx
258242
typer==0.16.0
259243
# via
260244
# fastapi-cli
@@ -265,20 +249,16 @@ typing-extensions==4.14.1
265249
# via
266250
# labthings-fastapi (pyproject.toml)
267251
# anyio
268-
# astroid
269-
# exceptiongroup
270252
# fastapi
271253
# mypy
272254
# pydantic
273255
# pydantic-core
274256
# pydantic-extra-types
275257
# referencing
276-
# rich
277258
# rich-toolkit
278259
# starlette
279260
# typer
280261
# typing-inspection
281-
# uvicorn
282262
typing-inspection==0.4.1
283263
# via pydantic-settings
284264
ujson==5.10.0
@@ -292,6 +272,8 @@ uvicorn==0.35.0
292272
# fastapi
293273
# fastapi-cli
294274
# fastapi-cloud-cli
275+
uvloop==0.21.0
276+
# via uvicorn
295277
watchfiles==1.1.0
296278
# via uvicorn
297279
websockets==15.0.1

docs/source/quickstart/quickstart.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ You can also interact with it from another Python instance, for example by runni
3636
.. literalinclude:: counter_client.py
3737
:language: python
3838

39-
It's best to write ``Thing`` subclasses in Python packages that can be imported. This makes them easier to re-use and distribute, and also allows us to run a LabThings server from the command line, configured by a configuration file. An example config file is below:
39+
It's best to write ``Thing`` subclasses in Python packages that can be imported. This makes them easier to reuse and distribute, and also allows us to run a LabThings server from the command line, configured by a configuration file. An example config file is below:
4040

4141
.. literalinclude:: example_config.json
4242
:language: JSON

docs/source/quickstart/quickstart_example.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
echo "Setting up environemnt"
1+
echo "Setting up environment"
22
# BEGIN venv
33
python -m venv .venv --prompt labthings
44
source .venv/bin/activate # or .venv/Scripts/activate on Windows

docs/source/wot_core_concepts.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Events
3939

4040
An event "describes an event source that pushes data asynchronously from the Thing to the Consumer. Here not state, but state transitions (i.e., events) are communicated. Events MAY be triggered through conditions that are not exposed as Properties."
4141

42-
Common examples are notifying clients when a Property is changed, or when an Action starts or finishes. However, Thing developers can introduce new Events such as warnings, status messages, and logs. For example, a device may emit an events when the internal temperature gets too high, or when an interlock is tripped. This Event can then be pushed to both users AND other Things, allowing automtic response to external conditions.
42+
Common examples are notifying clients when a Property is changed, or when an Action starts or finishes. However, Thing developers can introduce new Events such as warnings, status messages, and logs. For example, a device may emit an events when the internal temperature gets too high, or when an interlock is tripped. This Event can then be pushed to both users AND other Things, allowing automatic response to external conditions.
4343

4444
A good example of this might be having Things automatically pause data-acquisition Actions upon detection of an overheat or interlock Event from another Thing. Events are not currently implemented in `labthings-fastapi`, but are planned for future releases.
4545

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ dev = [
4040
"sphinx-rtd-theme",
4141
"sphinx>=7.2",
4242
"sphinx-autoapi",
43+
"codespell",
4344
]
4445

4546
[project.urls]

src/labthings_fastapi/client/in_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class DependencyNameClashError(KeyError):
143143
dictionary. This makes the assumption that, if a name is reused, it is
144144
reused for the same dependency.
145145
146-
When names are re-used, we check if the values match. If not, this
146+
When names are reused, we check if the values match. If not, this
147147
exception is raised.
148148
"""
149149

src/labthings_fastapi/decorators/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def thing_action(
106106
:param \**kwargs: Keyword arguments are passed to the constructor
107107
of `.ActionDescriptor`.
108108
109-
:return: Whether used with or without argumnts, the result is that
109+
:return: Whether used with or without arguments, the result is that
110110
the method is wrapped in an `.ActionDescriptor`, so it can be
111111
called as usual, but will also be exposed over HTTP.
112112
"""

src/labthings_fastapi/dependencies/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
example invoking actions or accessing properties on other `.Thing`\ s or
55
calling methods provided by the server.
66
7-
:ref:`dependencies` are a `FastAPI concept`_ that is re-used in LabThings to allow
7+
:ref:`dependencies` are a `FastAPI concept`_ that is reused in LabThings to allow
88
:ref:`actions` to request resources in a way that plays nicely with type hints
99
and is easy to intercept for testing.
1010

0 commit comments

Comments
 (0)