Hacker News new | ask | show | jobs
by westurner 658 days ago
Package checksums can be specified per-platform in requirements.txt and Pipfile.lock files. Is it advisable to only list package names, in TOML that can't be parsed from source comments with the AST parser?

.ipynb nbformat inlines binary data outputs from e.g. _repr_png_() as base64 data, rather than delimiting code and binary data in .py files.

One file zipapp PEX Python Executables are buildable with Twitter Pants build, Buck, and Bazel. PEX files are executable ZIP files with a Python header.

There's a GitHub issue about a Markdown format for notebooks because percent format (`# %%`) and myst-nb formats don't include outputs.

There's also GitHub issue about Jupytext storing outputs

Containers are sandboxes. repo2docker with repo2podman sandboxes a git repo with notebooks by creating a container with a recent version of the notebook software on top.

How does your solution differ from ipyflow and rxpy, for example? Are ipywidgets supported or supportable?

1 comments

> Is it advisable to only list package names, in TOML that can't be parsed from source comments with the AST parser?

This at the top of a notebook is less reproducible and less secure than a requirements.txt with checksums or better:

  %pip install ipytest pytest-cov jupyterlab-miami-nights

  %pip install -q -r requirements.txt

  %pip?
  %pip --help
But you don't need to run pip every time you run a notebook, so it's better to comment out the install steps. But then it requires manual input to run the notebook in a CI task, if it doesn't install everything in a requirements.txt and/or environment.yml or [Jupyter REES] first before running the notebook like repo2docker:

  #%pip install -r  requirements.txt
  #!pip --help
  #!mamba env update -f environment.yml
  #!pixi install --manifest-path pyproject.toml_or_pixi.toml