Skip to content

Pyscript 0.30 release

Compare
Choose a tag to compare
@craigbarratt craigbarratt released this 08 Oct 18:52
· 505 commits to master since this release

The 0.30 release contains a number of new features, and several bug fixes.

The main new features are:

  • support for apps and importable modules and packages below the <config>/pyscript directory
  • support for trigger functions as closures, allowing factory functions to create multiple similar trigger functions
  • added a variable pyscript.config that allows access to yaml configuration settings
  • added task.executor() for functions that block (eg, doing I/O) or have long running times
  • added support for with, async for, lambda and named expressions
  • use the croniter package for cron functions
  • improved exception handling and reporting

Breaking changes:

  • task.unique() now only applies within the current global context; the same name used in other global contexts will not be affected
  • accessing an undefined state variable now throws a NameError exception, instead of returning None, except in @state_trigger or @state_active, where undefined state variables, attributes or the .old value will still evaluate to None if not defined

Infrastructure:

  • moved documentation from README to hacs-pyscript.readthedocs.io and added more material
  • added precommit checks for black, isort, flake8 and pytest
  • set line-length to 109 for black/flake8/isort
  • revamped pytest setup
  • improved test coverage

Bug fixes include:

  • variable scoping in function closures now works correctly
  • fixed augmented assignments
  • list/set/dict comprehension looping vars are now in implicitly nested scope
  • del works correctly for non-locally scoped variables
  • sunrise and sunset times now correct for dates other than today

Thanks to @fleXible for several PRs (adding croniter, fixing sunset/sunrise, revamping test infrastructure, refactoring and precommits, among others) and @dlashua for extensive testing, various bug reports and feature requests.

Enjoy!