-
Notifications
You must be signed in to change notification settings - Fork 1.5k
pyscript API/docstring refactor with comprehensive tests
#2414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
… module, tests for it should be in the external repository from which this code is derived.
for more information, see https://pre-commit.ci
…ename certain internal things for readability and comprehension.
….py module. All code paths are exercised and checked.
…y all pass in a local browser.
…unt for the new named worker in the test HTML.
for more information, see https://pre-commit.ci
|
This PR is ready for review. My apologies for the size, but this relates to the nature of the changes taking place (lots of docs). So, some guidance for reviewers. My approachAs outlined at the start I had three aims:
The outcomeGiven these aims, for each of the sub-modules in the
While the size of the code base has increased by a huge amount (just look at all those docs!) the mini-fied version delivered to the user ( Finally, there will be a complementary PR/branch in the docs repository for auto-generating our API docs from this source code. I'll reference it here once this work is ready to be reviewed. 👍 Softly breaking adjustmentsOur biggest module is (by far)
That's it! Clearly some of this is opinionated, but I hope my way of working reveals why I've made the choices I have. Once this lands our API docs will be VASTLY improved, and we'll have a single source of truth for such technical documentation (i.e. it's a part of the context of the source code, as it should be). Finally, we've set an obvious and consistent precedent for code standards (small and simple with human-comprehensible names that will be minified), documentation (Markdown with examples) and tests (comprehensive, intentional and browser based). |
|
Related PR in the docs repostory: pyscript/docs#201 |
|
Now that I've got the docs automatically building via pyscript/docs#201 I need to revisit all the Markdown to adjust it so it renders properly in the context of the docs. |
…rated documentation (where triple quoted strings are used to document module attributes).
|
Markdown now renders nicely over in pyscript/docs#201. Side effect: I now know far too much about the |
|
@ntoll there are two main points to address but everything else looks good to me. I want this to land before the other because it looks like the one in docs just copies over these files so it'd be pointless to approve that one, even if the the automatic code generation looks fine, although it will need a rebase after changes happen in here and this gets merged, then eventually I can approve the other one too. |
|
OK... @WebReflection I've addressed your couple of points. If you're happy, I'm happy. 🚀 |
WebReflection
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks 🙏
Description
This PR has several aims:
pyscriptnamespace. These will be integrated automatically into the "API" section of the PyScript docs.pyscriptnamespace as general housekeeping, simplification and removal of unnecessary / unused code.upytestbased test suite where possible.Already I've notice code that would never work in MicroPython (where dict ordering was implied in the code - but MicroPython's dicts don't guarantee order). More comprehensive and complete tests found this pretty quickly.
Changes
For each module in the
pyscriptnamespace: docs, refactoring and tests have been accomplished (adjusted as work is completed):__init__.pydisplay.pyevents.pyfetch.pyffi.pyflatted.pyfs.pymagic_js.py(an "internal" module renamed tocontext.py)media.pystorage.pyutil.pyweb.pywebsocket.pyworkers.pyChecklist
make buildworks locally.