Skip to content

Support for Automatic <py-env> with dependency + few tweaks to contributing and readme docs#36

Open
leriomaggio wants to merge 36 commits intopyscript:mainfrom
leriomaggio:feat_pyenv_support
Open

Support for Automatic <py-env> with dependency + few tweaks to contributing and readme docs#36
leriomaggio wants to merge 36 commits intopyscript:mainfrom
leriomaggio:feat_pyenv_support

Conversation

@leriomaggio
Copy link

This PR finalises the new pyscript-cli features developed during the last hack-days.

In particular, the new features this PR brings are:

  • support for automatic analysis of code dependencies (i.e. imports) which will be then injected into a <py-env> tag in the html template.
    • both packages and (local) modules are supported - resulting in paths as per PyScript naming.
    • Unsupported imports and packages (e.g. packages not supported by Pyodide) are also detected, with a WARNING raised to signal that resulting code may not work.
  • now both Python files (.py) and Notebooks (.ipynb) could be passed in as input and converted.
    • so far notebooks are merely converted into Python files before being processed.

Note: from hack-days version, this code has been merged and aligned to support the new plugin-hook design/feature, plus - more importantly - a few tests for the new features have been included.
On this note, a quick refactoring has been done to test_cli to include fixtures for code, with relatively simple injectable dependencies.

Other changes in this PR concerns:

  • improved CONTRIBUTING.md documentation providing instructions on how to setup dev environment (not just for docs)
    • on this note, poetry dependencies have been revised and updated, including pre-commit as dependency, with instructions in the main doc on how to install hooks.
  • added line in README.md to showcase input code from both python and notebooks files.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants