Skip to content

v0.8.0-beta.1

Pre-release
Pre-release
Compare
Choose a tag to compare
@jtc42 jtc42 released this 09 Jul 15:16
· 394 commits to master since this release

v0.8.0-beta.1 (2020-07-09)

Major changes

This release introduces a massively simplified API, at the expense of being more opinionated about how we marshal View responses.
By being stricter about what ActionView and PropertyView derivatives can do, we're able to greatly simplify the internal code.

  • The Tasks view (/tasks) is now deprecated, and has been replaced with a root /actions view.

    • These are functionally identical, however some keys are named differently (e.g. return is now output)
  • The tasks submodule no longer includes a global task list.

    • This has been replaced with a labthing attribute actions. To access the full list of action tasks, use current_thing.actions
    • To spawn a new action task, use current_thing.actions.spawn(function, *args, **kwargs)
  • Thing Descriptions no longer rely on the apispec module. They are now generated using a built-in json schema converter module, forked from marshmallow_jsonschema

  • apispec information is now built by the View class method, using marshmallow_jsonschema. This greatly simplifies the internal code, however note that schemas in the OpenAPI spec will now always be inline, rather than referenced.

Major new features

  • Action views now automatically include a GET method, which returns a list of actions of that type

  • Action wait time can now be changed, allowing developers to guarantee an Action will return when completed, rather than returning a running status, or always return running immediately without any waiting.

  • Introduces the current_thing proxy, which gives you a proxy to the current app's attached LabThing object

Change commits

  • Added 0.7 compatibility layer (334539b)
  • Added Action queue method (08ed9ce)
  • Added alias to Flask Response class (c9d693c)
  • Added alias to Marshmallow pre_dump and pre_load (c80e45f)
  • Added basic deque submodule (cb0df6f)
  • Added default error schema to API spec (48196ec)
  • Added init file (47458cc)
  • Added input content_type attribute (5ec94ee)
  • Allow calling abstract Semantics (d4fe57e)
  • Allow mock WS client to close after a specific response (df0062e)
  • Allow OpenAPIConverter to use _jsonschema_type_mapping (cae8e10)
  • Allow overriding Action wait time (87adad5)
  • Changed views to be more opinionated (9fa713e)
  • Created a current_thing LocalProxy (2b421b8)
  • Fix HTTP method check (8ae6060)
  • Fix OpenAPI formatting (c90a646)
  • Fixed applying semtype string (d84ae58)
  • Fixed arg handling in request handlers (93cd2ff)
  • Fixed automatic marshalling (d467463)
  • Fixed builder (00fe6dc)
  • Fixed comments (d5853ba)
  • Fixed default View arguments (881ee3f)
  • Fixed how _register_view looks for view tags (82648f5)
  • Fixed internal imports (bca418e)
  • Fixed OpenAPI spec with missing schemas (2394d81)
  • Fixed reading content type (f5e7e35)
  • Fixed switched arg_methods and marshal_methods (4641e66)
  • Fixed TaskList description (a5d6ea6)
  • Fixed view class scope (80410f1)
  • Got basic simpler spec working (caa983b)
  • Handle different request and response types in TD (8427445)
  • Handle missing schema better (31a7a04)
  • Handle missing semantic type (19dbb37)
  • Handle passing None to schema_to_json (8c1068d)
  • Improved coverage (1c6a019)
  • Improved coverage (a0ec226)
  • Improved coverage for lock call context (8d37bd8)
  • Improved HTTP form builder (56a22bf)
  • Improved WS response checker (d6c69eb)
  • Inherit basic OpenAPI spec from superclass (2371bd6)
  • Initial reorganisation (33b6dc7)
  • Loostened codecov failure conditions (c4fc243)
  • Made class-tags non-removable by default (6b41db8)
  • Manually marshal tasks view (ae2192a)
  • Migrated OpenAPI away from APISpec library (2e28d14)
  • Move content_type into class responses dictionary (a2302fe)
  • Moved APISpec to a class method (3a82dba)
  • Only marshal for "get", "put", "post", "patch" (e606d35)
  • Properly marshal extensions list (82124c9)
  • Re-added compatibility import (0582e77)
  • Remove reliance on OpenAPI spec for Thing Description (45bb9df)
  • Remove unused imports (fd2144b)
  • Remove unused imports (3c6a628)
  • Removed APISpec module dependence from TD (a4aab52)
  • Removed decorators entirely (c9f7dbc)
  • Removed default task pool (d67b5b0)
  • Removed docs view property (d5565cd)
  • Removed legacy property mode and raise invalid semtypes (f363982)
  • Removed marshal_task (80ef05b)
  • Removed URL prefix (cdf151c)
  • Removed uses of old apispec (833229f)
  • Renamed to jsonschema_type_mapping (9bc663d)
  • Renamed to SerializedExceptionHandler (3671552)
  • Simplified class attributes (5bb0cc6)
  • Simplified class attributes (6c0460d)
  • SImplified interaction contentType definitions (bc8ddc5)
  • Specified marshal_methods (3020d31)
  • Split general JSON schema formatting away from APIspec (b718258)
  • Switch to gevent Event (4297910)
  • Switched action tasks to use LabThing-level pool (53ea2bf)
  • Switched to PUT for properties (376db07)
  • Temporarily removed CBOR encoding support (26cb16a)
  • Tidied up comments (c2c0085)
  • Tidied up view descriptions (48e34d9)
  • Updated ActionSchema links to new /actions view (2f1b117)
  • Updated TD to use new apispec methods (445aa8f)
  • Use data_key for field schemas where given (9b47bff)

Examples

Tests

  • Removed old API tests (450bf61)
  • Added static unit test responses (14a1d9a)
  • Added test for property content_type (19d035c)
  • Fixed tests for fixed OpenAPI structure (b461b7c)
  • Improved tag test (d7889d0)
  • Updated test exclusions (cf9c867)
  • Updated tests (8b33105)
  • Updated tests for new default response spec (db0992d)
  • Updated tests for new structure (f0b8f48)
  • Updated default server view tests (e1f4ca8)
  • Updated view builder tests (a455797)
  • Use ActionView to test response_content_type (3169b94)

Security

Dependencies

  • Bump marshmallow from 3.6.1 to 3.7.0 (7591ee4)
  • Bump zeroconf from 0.27.1 to 0.28.0 (4fba334)
  • Updated version and dependencies (6d4c873 d3c74c9)
  • Added pylint to dev deps (2f20adb)