Commit Graph

1209 Commits

Author SHA1 Message Date
Andrea Giammarchi
aa73d964ff Merge branch 'main' into reverted-4cores 2024-09-30 17:30:08 +02:00
Andrea Giammarchi
c257b704e6 Try to find out what we really need in CI (#2197) 2024-09-30 16:56:50 +02:00
webreflection
73409aca78 Try to find out what we really need in CI 2024-09-30 15:49:36 +02:00
Andrea Giammarchi
fc599d96a2 Use ubuntu-latest-8core everywhere (#2196) 2024-09-30 14:52:32 +02:00
Andrea Giammarchi
8de97a7e7b Updated coincident to use a local channel (#2195)
* Updated coincident to use a local channel
2024-09-30 14:03:33 +02:00
Nicholas Tollervey
2642be863b Fix sed search/replace when creating static page for a specific PyScript release. (#2194) 2024-09-30 11:13:02 +01:00
Nicholas Tollervey
9dad29ec17 Refactor repository. Fixes #2161 (#2192)
* Remove duplicate LICENSE.
* Remove un-userd pyscript.sw directory and its content.
* Remove ReadTheDocs settings (unused).
* Remove un-used pyproject.toml
* Remove now unused CHANGELOG. Changes now tracked via release notes on GitHub.
* Updated / cleaned release page template and associated GH actions.
* Update prettierignore to remove un-needed refs.
* Move troubleshooting into correct README.
* Add reason for the index.html
* Rename the "pyscript.core" directory to "core".
* Update PR template because CHANGELOG is no longer used.
* Codespell configuration in pyproject.toml.
* Update pyscript.core -> core in .githubignore
* Remove test-results/.last-run.json. This should be ignored by git.
* Pin nodejs version.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-30 10:29:26 +01:00
Nicholas Tollervey
abb1eb28fe Only use a single worker for playwright tests. (#2191) 2024-09-27 16:06:04 +01:00
Nicholas Tollervey
532ac0c80f Increase timeout for heavy-load test. (#2190) 2024-09-27 15:46:57 +01:00
Nicholas Tollervey
c1849d28e0 Bump python-minifier to latest version (supports most recent versions of Python). (#2189)
Co-authored-by: Andrea Giammarchi <andrea.giammarchi@gmail.com>
2024.9.2
2024-09-27 14:35:59 +01:00
Andrea Giammarchi
ad2af2392b Indirect refs counting (#2188) 2024-09-27 15:26:57 +02:00
Andrea Giammarchi
957ab69c21 Fix #2185 - Updated Polyscript and coincident (#2187) 2024-09-27 12:35:51 +02:00
Nicholas Tollervey
f5d49ee52c Test refinement. (#2183)
* Test refinement.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-26 12:02:25 +01:00
Nicholas Tollervey
06138bbb48 Update test suite (#2181)
* pyscript.web tests pass with upytest.
* Refactor of old integration tests to new Python tests.
* Added comprehensive test suite for Python based `pyscript` module.
* Add integration tests to Makefile (and CI)
* Remove un-needed upload action.
* Ensure fails are properly logged as an array. Remove the explicit test step, since this is already built into the build step.
* Bump polyscript.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andrea Giammarchi <andrea.giammarchi@gmail.com>
2024-09-25 16:23:59 +01:00
Andrea Giammarchi
ae66d13d57 Fixed config issue via polyscript update (#2182) 2024-09-24 11:01:20 +02:00
Andrea Giammarchi
5aaeebf32c Make WebSocket lazy attributes definition possible (#2180) 2024-09-23 13:19:26 +02:00
Andrea Giammarchi
a6b0964185 Fix #2155 - Allow editor.process to run on behalf of users (#2177)
* Fix #2155 - Allow editor.process to run on behalf of users

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updated dev/dependendencies

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-20 15:42:29 +02:00
Andrea Giammarchi
dd86169f2a Exposing config type once resolved and running (#2175) 2024-09-17 17:04:32 +02:00
Andrea Giammarchi
84c7d69db9 Remove useless test_report (#2169) 2024-09-15 14:29:55 +02:00
nasrin pathan
ca9b565adc Update README.md (#2170) 2024-09-15 14:29:03 +02:00
Andrea Giammarchi
b2d1018db1 Fix #2167 - Provide instructions to build the project (#2168)
* Fix #2167 - Provide instructions to build the project

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-13 16:58:32 +02:00
Nicholas Tollervey
c4e25d879e Update GH actions to node 20 and Python env for PyMinifier. (#2166)
* Update GH actions to node 20 and Python env for PyMinifier.

* Fix spaces.

* Fix test.yml

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024.9.1
2024-09-13 14:37:17 +01:00
Andrea Giammarchi
c82dbb755e cleanup npm package (#2163) 2024-09-13 15:04:21 +02:00
Andrea Giammarchi
1ed77321a5 Add a storage equivalent for JS (#2165)
* Add a storage equivalent for JS

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-13 12:05:40 +02:00
Andrea Giammarchi
e36a57eb06 Fix #2160 - Implement progress events (#2162) 2024-09-12 18:41:36 +02:00
Andrea Giammarchi
ee3cd76022 Follow up - Remove all innerHTML += for consistency sake (#2159) 2024-09-11 15:12:04 +02:00
Andrea Giammarchi
eb31e51a45 Fix #2150 - Avoid trashing previous added elements (#2151) 2024-09-11 11:37:42 +02:00
Andrea Giammarchi
c8c2dd0806 Avoid throwing if Pyodide does not await due missing arguments (#2158)
* Fix #2156 - Avoid requiring args for async functions

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-06 15:16:28 +02:00
Andrea Giammarchi
e525d54be0 Fix #2156 - Test @when with async listener (#2157) 2024-09-06 14:56:50 +02:00
Andrea Giammarchi
7b9f7c13f5 Improve by far error reporting around PyEditor bootstrap (#2153)
* Improve by far error reporting around PyEditor bootstrap

* Improve by far error reporting around PyEditor bootstrapiImprove by far error reporting around PyEditor bootstrap

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-04 16:52:08 +02:00
Andrea Giammarchi
7582cbef9c Fix #2146 - Workaround Pyodide issue with attributes (#2148)
* Fix #2146 - Workaround Pyodide issue with attributes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix #2146 - Updated polyscript

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-08-27 16:47:52 +02:00
Andrea Giammarchi
b395cde49c Forgot to build tests/index.html and push (#2144) 2024-08-26 12:29:16 +02:00
Andrea Giammarchi
9f46234f71 Fix #2114 - Cleanup the test folder + automation (#2143)
* Fix #2114 - Cleanup the test folder + automation
* Merged both test and tests into a single folder
2024-08-08 17:08:59 +02:00
Andrea Giammarchi
f4c4edeb29 Implemented pyminify for our stdlib (#2140)
* Implemented pyminify for our stdlib

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-08-07 12:33:20 +02:00
Andrea Giammarchi
7166c32384 Fix #2093 - Show setup errors with the editor (#2138)
* Fix #2093 - Show setup errors with the editor

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-08-06 16:31:42 +02:00
pre-commit-ci[bot]
ed126889ae [pre-commit.ci] pre-commit autoupdate (#2137)
updates:
- [github.com/psf/black: 24.4.2 → 24.8.0](https://github.com/psf/black/compare/24.4.2...24.8.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-08-06 12:36:00 +02:00
Andrea Giammarchi
0d0ea96435 Defaulting to async for top-level await (#2134) 2024.8.2 2024-08-05 15:55:53 +02:00
Andrea Giammarchi
fafdf74007 Fixed async methods attached to window (#2136) 2024-08-05 11:58:22 +02:00
Martin
999897df12 The all-new, pyscript.web (ignore the branch name :) ) (#2129)
* Minor cleanups: move all Element classes to bottom of module.

* Commenting.

* Commenting.

* Commenting.

* Group dunder methods.

* Don't cache the element's parent.

* Remove style type check until we decide whether or not to add for classes too.

* Add ability to register/unregister element classes.

* Implement __iter__ for container elements.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Minor renaming to make it clear when we have an Element instance vs an actual DOM element.

* remove duplication: added Element.get_tag_name

* Commenting.

* Allow Element.append to 1) use *args, 2) accept iterables

* Remove iterable check - inteferes with js proxies.

* Don't use *args, so it quacks more like a list ;)

* Element.append take 2 :)

* Remove unused code.

* Move to web.py with a page object!

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added 'page.title' too :)

* Add __getitem__ as a shortcut for page.find

* Add Element.__getitem__ to be consistent

* Make __getitem__ consistent for Page, Element and ElementCollection.

* Docstringing.

* Docstringing.

* Docstringing/commenting.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix select.add (revert InnerHTML->html)

* Commenting.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Hand-edit some of the AI :)

* Rename ElementCollection.children -> ElementCollection.elements

* Remove unnecessary guard.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024.8.1
2024-08-01 10:36:57 +01:00
Andrea Giammarchi
d47fb58ede Update Pyodide to its 0.26.2 version (#2133) 2024-07-31 20:34:21 +02:00
Andrea Giammarchi
f316341e73 Updated Polyscript and added Panel worker test (#2130)
* Updated Polyscript and added Panel worker test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-07-31 14:31:35 +02:00
Andrea Giammarchi
8c46fcabf7 Updating polyscript to its latest (#2128)
* Updating polyscript to its latest
2024-07-29 16:59:31 +02:00
Martin
e4ff4d8fab Controversial version where Element just delegates to the underlying DOM element. (#2127)
* Update elements.py

* remove grid which allows simpler class tag mapping.
2024-07-24 13:27:12 -05:00
Martin
f20a0003ed fix: broken methods video.snap and canvas.download (#2126)
* fix: broken methods video.snap and canvas.download

* Allow canvas.draw to use actual image width/height.
2024-07-23 15:35:07 -05:00
Martin
6c938dfe3b Override __getattr__ and __setattr__ on ElementCollection. (#2116)
* Override __getattr__ and __setattr__ on ElementCollection.

* fix: bug when using a string to query an ElementCollection.

* Use Element.find when indexing ElementCollection with a string.

* For consistency also have a find method on ElementCollection.

* ElementCollection.find now returns a collection of collections :)

* fix tests: for textContent

* Revert to extend for ElementCollection.find :)

* Make element_from_dom a classmethod Element.from_dom

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* rename: Element.from_dom -> Element.from_dom_element

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* PyCharm warning sweep.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Workaround for mp not allowing setting via __dict__

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-07-22 10:32:37 -05:00
Andrea Giammarchi
d884586a82 Updated Polyscript to its latest (#2124) 2024-07-19 12:21:04 +02:00
Fabio Pliger
f8f7ba89c1 Cleanup pyscript web elements (#2094)
* change pydom example to use new pyscript.web namespace

* change tests to use new pyscript.web namespace

* create new pyscript.web package and move pydom to pyscript.web.dom

* add __init__ to pyscript.web and expose the dom instance instead of the pyscript.web.dom module

* move elements from pyweb.ui to pyscript.web and temp fix pydom import

* moved of elements file completed

* moved media from pyweb to pyscript.web

* RIP pyweb

* move JSProperty from pyscript.web.dom to pyscript.web.elements

* move element classes from pyscript.web.dom to pyscript.web.elements

* first round of fixes while running tests

* fix test typo

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* restore right type type returned for Element.parent. ALL TESTS PASS LOCALLY NOW

* lint

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* clean up dom.py from dead commented code and osbolete comments

* bugfix: dom shouldn't return None when it can't find any element for a specific selector so it now returns an empty collection

* additional cleanup in tests

* lint

* initial cleaning up of unused modules

* change element.append to not consider types anymore and add tests for appending elements.Element or a JsProxy object

* add Element.append tests for append JS elements directly and appending nodeList as well

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Tag and create the correct subclass of Element.

* Move: Element.snap -> video.snap

* Move: Element.download and draw to canvas.download and draw.

* Minor cleanups.

* Commenting.

* Allow css classes to be passed to Element constructor.

* Commenting.

* Typo fix.

* Make html, id and text JSProperties.

* Commenting.

* Remove unnecessary selected attribute on BaseElement.

* Extract: BaseElement.from_js -> element_from_js

* Pass *args and **kwargs to element_from_js and remove BaseElement.create

* Move value attribute to specific Element subclasses.

* fix: wrapping of existing js elements.

* Add body and head elements so parent and children work everywhere.

* Revert order of HasOptions mixin for the select element.

* Comment out tests that are no longer relevant (see comment).

* Use correct super args in mixin.

* Have to use element_from_js when returning options from OptionsProxy.

* rename: StyleProxy -> Style, OptionsProxy -> Options and added Classes.

* Remove cached_property.

* Remove list-y methods from Classes collection.

* Allow explicit children or *args for containers.

* controversial: fix tests to use find rather than dom

* Add html element so (say) body.parent does what is expected.

* Collapse Element class hierarchy.

* rename: js_element -> dom_element

* rename: element_from_js -> element_from_dom

* replace: JS with DOM

* rename: _js -> _dom_element

* fix dom tests.

* Complete element list with void elements derived from Element.

* Added attributes to the newly added Element subclasses.

* remove dom module, replace with instance.

Also, remove media :)

* fix: typo in test for 'b' element.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Remove dom and media modules.

* fix up ts definitions.

* Added missing import (used in content property).

* Added TODO :)

* wip: Add ClassesCollection

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Attempt to ask black to leave class list alone.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add classes attribute to ElementCollection

* wip: work on classes collection

* Extract code to get set of all class names in ClassesCollection.

* Update elements.py

* Polishing.

* Make children return an ElementCollection

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* wip: Add the ability to set multiple properties.

* Add __getitem__ back to the dom object.

* Put validation when setting DOM properties back in.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* All tests green.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Remove unnecessary comment.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Martin <martin.chilvers@gmail.com>
2024.7.1
2024-07-03 14:21:23 -07:00
Andrea Giammarchi
67d47511d5 Fix MicroPython terminal input when no REPL is used/needed (#2113)
* Fix terminal input when no REPL is used/needed
* Fix input backspace too
2024-07-03 13:03:31 +02:00
Andrea Giammarchi
6f49f18937 Updated Polyscript with its workers feature (#2104)
* Updated Polyscript with its workers feature
* Worked around the inconsistent behavior between Pyodide and MicroPython
* Fixed Pyodide greedy access to undesired Proxy fields
2024-06-26 14:01:22 +02:00
Andrea Giammarchi
7b8ef7ebe2 Fix #2109 - Allow inline JSON config attribute in PyEditor (#2110)
Fix #2109 - Allow inline JSON config attribute in PyEditor
2024-06-24 17:04:28 +02:00