Skip to content

Releases: labthings/python-labthings

v1.3.2

23 Aug 19:55
e2b3b3b
Compare
Choose a tag to compare

This is a bugfix release, fixing the behavour of StrictLock and CompositeLock objects when
used in with statements (#275).

  • Bump pylint from 2.9.5 to 2.10.2 (655a583)
  • Locks release on exception (ed7855e)
  • Test lock releases with/without arguments (7151372)
  • Test to ensure locks are released on error (8bdc522)

v1.3.1

11 Aug 22:16
Compare
Choose a tag to compare

This release fixes a bug that caused errors and invalid Thing Descriptions when any schemas in the API included fields with allow_none set to True. This is due to a difference between the W3C Thing Description spec and the JSON Schema language - the latter permits types to be list values, e.g. ["string", "none"] while the former does not. This release handles that case properly, using the oneOf mechanism.

v1.3.0

26 Jul 16:30
52695d5
Compare
Choose a tag to compare

v1.3.0 (2021-07-25)

This release focuses on improving the OpenAPI description, which is auto-generated from the code. Previously this has created invalid output, which stopped some of the documentation and code generation tools from working. This is now fixed. There are also improvements to the way errors are handled, in particular it's now possible for Marshmallow validation errors to propagate correctly from Action threads.

Minor fixes and security updates

  • ✏️ Fix typo in README.md (3ab2d12)
  • [Security] Bump py from 1.9.0 to 1.10.0 (f1eb043)
  • [Security] Bump urllib3 from 1.26.3 to 1.26.4 (215fa94)
  • Bump apispec from 4.6.0 to 4.7.1 (e62c570)
  • Bump marshmallow from 3.10.0 to 3.12.1 (131f9d4)
  • Bump marshmallow from 3.12.1 to 3.12.2 (8333b65)
  • Bump pylint from 2.8.3 to 2.9.3 (93eba68)
  • Bump pylint from 2.9.3 to 2.9.4 (f43ead9)
  • Bump pytest from 6.2.2 to 6.2.4 (7fa0983)
  • Bump pytest from 6.2.2 to 6.2.4 (a4516d5)
  • Bump sphinx from 3.5.4 to 4.1.0 (cc15230)
  • Bump sphinx from 4.1.0 to 4.1.1 (2297f79)
  • Bump sphinx-autoapi from 1.7.0 to 1.8.1 (6c0feea)
  • Bump sphinx-rtd-theme from 0.5.1 to 0.5.2 (baa5c8b)
  • Bump webargs from 7.0.1 to 8.0.0 (6bcc454)
  • Bump zeroconf from 0.28.8 to 0.31.0 (219b0a3)
  • Bump zeroconf from 0.31.0 to 0.32.1 (0e511f5)
  • Bump zeroconf from 0.32.1 to 0.33.0 (6903b18)
  • Bump zeroconf from 0.33.0 to 0.33.1 (bd6d804)
  • Upgrade to GitHub-native Dependabot (4061871)

Error handline improvements

Exceptions in Action threads end up quietly reported in the Action description. This was preventing
Marshmallow from validating Action arguments, which was a problem. This release changes the behaviour slightly
so that if arguments are invalid, or if flask.abort() is called at the start of an action, it responds
with an HTTP error code rather than a 201 Created response.

Commits that support this:

  • added a docstring (850592f)
  • added read-only property for _exception (e87152d)
  • Added tests for action errors -> HTTP codes (1a7a93b)
  • Fix assertion for duplicate actions (75c75b9)
  • Fix a comment (23c720a)
  • fix typo (f816354)
  • Linting fixes (1c97565)
  • Only propagate HTTP exceptions (50f9936)
  • Propagate exceptions from action threads (e26663f)
  • Properly handle late HTTPExceptions (671d403)
  • Tidied API test code (bbb08b8)
  • Whitespace/isort fixes (89c1ddf)

Documentation improvements

This release changes the way documentation propagates through LabThings and Flask to the OpenAPI description.
The current release doesn't change the contents of the Thing Description, but it does mean that the OpenAPI
output is valid, and that's now tested for some common cases in the CI.

Important things to note are:

  • View classes can now attach properties either to the class, or to individual methods.
  • summary and description properties will be used if present, or the docstring will be used if not.
  • responses and parameters properties set the method's responses and parameters. If set on the class,
    they will be used for all methods.

Attributes have been added to built-in views as needed to produce valid OpenAPI documentation, though there
is always room to add more meaningful descriptions. Documentation is now much more thoroughly tested,
including using apispec and prance to check the OpenAPI description is valid.

Commits that form a part of this effort:

  • Add YAML version of openapi docs (39d91e7)
  • Added a test for OpenAPI serialisation (52851f4)
  • Added APISpec utilities (f49aedb)
  • Added APISpec validation to dependencies (1935f25)
  • Added more unit tests (8490acb)
  • Added OpenAPI validation to tests (a100fa9)
  • added remove_summary option to get_docstring (cd4a994)
  • Added some more tests of thing description (54d5df9)
  • Added the "YAML" extra to apispec (345d544)
  • Allow per-Operation docstrings (05b2747)
  • Avoid premature serialisation (9ec6fa2)
  • Better response descriptions for builtin endpoints (f161213)
  • blackened (c52a66d)
  • Blackened (e21c6e2)
  • Check duplicate action names (f39851c)
  • Cope with missing input/output schemas (8f1cc14)
  • Documented parameters for actions & static (38fb5ca)
  • Eliminate built action schemas (67a9257)
  • Exhaustive testing for docstring additions (704cba9)
  • Fix OneOf and tidy up build_action_schema (c6c0b5b)
  • Fix OpenAPI route registration (7ba0950)
  • Fix whitespace in docstring test (af6a8d3)
  • Fixed remove_summary and remove_newlines (f6ba74e)
  • Fixed typing in ensure_schema (9b51698)
  • Fixes from unit testing (b9f9fc9)
  • Format fixes (a5a9ed9)
  • Format fixes (001d6bb)
  • formatting fixes (e27e904)
  • linter fixes (8ddfaec)
  • Linting and typing fixes (8353bcb)
  • Manage indentation better in docstrings (559b769)
  • More helpful docstring for ActionView.get (6819f23)
  • propagate parameters and responses per-operation (9ea10f5)
  • Provide names for generated schemas (8654d02)
  • Removed unused function (674d09f)
  • Removed unused import (5f9d284)
  • Swap MethodView for View in builder.static_from (2f12098)
  • Use deepcopy to avoid modifying responses (bfc6fc4)
  • Whitespace fixes (a27e16a)

v1.2.4

22 Mar 10:48
Compare
Choose a tag to compare

v1.2.4 (2021-03-22)

  • [Security] Bump jinja2 from 2.11.2 to 2.11.3 (16ec89b)
  • [Security] Bump urllib3 from 1.26.2 to 1.26.3 (05af37c)
  • Bump apispec from 4.0.0 to 4.2.0 (e3e1d81)
  • Bump apispec from 4.2.0 to 4.3.0 (1e6743b)
  • Bump flask-cors from 3.0.9 to 3.0.10 (72ef6b7)
  • Bump mypy from 0.790 to 0.800 (81df983)
  • Bump mypy from 0.800 to 0.812 (c96f660)
  • Bump pylint from 2.6.0 to 2.7.2 (44a6973)
  • Bump pytest from 6.2.1 to 6.2.2 (6c75aec)
  • Bump pytest-cov from 2.10.1 to 2.11.0 (921eb47)
  • Bump pytest-cov from 2.11.0 to 2.11.1 (86572bf)
  • Bump sphinx from 3.4.2 to 3.4.3 (3458f95)
  • Bump sphinx from 3.4.3 to 3.5.3 (64e5e07)
  • Bump sphinx-autoapi from 1.5.1 to 1.6.0 (30ead18)
  • Bump sphinx-autoapi from 1.6.0 to 1.7.0 (cb93348)
  • v1.2.3 (c0cf4a7)

v1.2.3

05 Jan 13:50
Compare
Choose a tag to compare

v1.2.3 (2021-01-05)

  • Added basic marshalling tests (0b2cbbb)
  • Bump marshmallow from 3.9.1 to 3.10.0 (4973071)
  • Bump pytest from 6.1.2 to 6.2.1 (76f6017)
  • Bump sphinx from 3.3.1 to 3.4.2 (deab86c)
  • Bump sphinx-rtd-theme from 0.5.0 to 0.5.1 (ddca13c)
  • Bump webargs from 6.1.1 to 7.0.1 (aeba41b)
  • Bump zeroconf from 0.28.6 to 0.28.8 (78f78eb)
  • Converted use_body to nested functions (37919b1)
  • Formatting (0900cbd)
  • Improved type annotations (6e8b47e)
  • Tidied imports (4ddc120)

v1.2.2

04 Dec 11:30
Compare
Choose a tag to compare

v1.2.2 (2020-12-04)

Fix

  • Remove duplicated action exception log (fe5fa4e)

  • MyPy fixes (dc7547a)

v1.2.1

30 Nov 17:13
Compare
Choose a tag to compare

v1.2.1 (2020-11-30)

  • Allow Fields in OptionalSchema type (c22927e)

v1.2.0

30 Nov 16:51
Compare
Choose a tag to compare

v1.2.0 (2020-11-30)

  • Add extension property to views and added LABTHINGS_EXTENSIONS class list loader (15c364a)
  • Added set_extension method to View class (427b12e)
  • Allow (but warn) instances in LABTHINGS_EXTENSIONS list (0165bc7)
  • Switch away from dunder to LABTHINGS_EXTENSIONS (3b6e9af)

v1.1.6

30 Nov 13:46
Compare
Choose a tag to compare

v1.1.6 (2020-11-30)

  • Added extra type defs (d90e9c1)
  • Added public rules property (bd58673)
  • Bump apispec from 3.3.2 to 4.0.0 (5ed03fe)
  • Fixed get_by_path to allow returning Any type value (e9ed244)
  • Fixed mypy ignore (cf33d1e)
  • Fixed view schema type annotations (6ef3f4a)
  • Global mypy ignore_missing_imports = True (53e077c)

v1.1.5

24 Nov 18:28
Compare
Choose a tag to compare

v1.1.5 (2020-11-24)