22
33> Create pre-solved environments for jupyterlite-pyodide-kernel with pyodide-lock.
44
5+ | docs | install | build |
6+ | :-------------------------: | :----------------------------------------------------------------------------------------: | :----------------------------------: |
7+ | [ ![ docs] [ docs-badge ]] [ docs ] | [ ![ install from pypi] [ pypi-badge ]] [ pypi ] [ ![ install from conda-forge] [ conda-badge ]] [ conda ] | [ ![ build] [ workflow-badge ]] [ workflow ] |
8+
9+ [ docs ] : https://jupyterlite-pyodide-lock.rtfd.org
10+ [ docs-badge] :
11+ https://readthedocs.org/projects/jupyterlite-pyodide-lock/badge/?version=latest
12+ [ conda-badge ] : https://img.shields.io/conda/vn/conda-forge/jupyterlite-pyodide-lock
13+ [ conda ] : https://anaconda.org/conda-forge/jupyterlite-pyodide-lock
14+ [ pypi-badge ] : https://img.shields.io/pypi/v/jupyterlite-pyodide-lock
15+ [ pypi ] : https://pypi.org/project/jupyterlite-pyodide-lock
16+ [ workflow-badge] :
17+ https://github.com/deathbeds/jupyterlite-pyodide-lock/actions/workflows/test.yml/badge.svg?branch=main
18+ [ workflow] :
19+ https://github.com/deathbeds/jupyterlite-pyodide-lock/actions/workflows/test.yml?query=branch%3Amain
20+
21+ View the full documentation on [ ReadTheDocs] [ rtfd ] .
22+
23+ [ rtfd ] : https://jupyterlite-pyodide-lock.rtfd.org/en/latest
24+
525## Installing
626
7- > This package is not yet released. See ` CONTRIBUTING.md ` for development.
8- >
9- > ``` bash
10- > pip install jupyterlite-pyodide-lock
11- > ` ` `
12- >
13- > or mamba/conda:
14- >
15- > ` ` ` bash
16- > mamba install -c conda-forge jupyterlite-pyodide-lock
17- > ` ` `
27+ ``` bash
28+ pip install jupyterlite-pyodide-lock
29+ ```
30+
31+ or:
32+
33+ ``` bash
34+ mamba install -c conda-forge jupyterlite-pyodide-lock
35+ ```
1836
1937## Usage
2038
@@ -30,36 +48,34 @@ A number of ways to add requirements to the lock file are supported:
3048 - URLs to remote wheels that will be downloaded and cached
3149 - local paths relative to ` lite_dir ` of ` .whl ` files (or folders of wheels)
3250
33- ` ` ` yaml
34- # examples/jupyter_lite_config.json
35- { ' PyodideLockAddon' : { ' enabled' : true, ' specs' : [
36- # pep508 spec
37- ' ipywidgets >=8.1,<8.2' ,
38- ], ' packages' : [
39- # a wheel
40- ' ../dist/ipywidgets-8.1.2-py3-none-any.whl' ,
41- # a folder of wheels
42- ' ../dist' ,
43- ] } }
51+ ``` json
52+ {
53+ "PyodideLockAddon" : {
54+ "enabled" : true ,
55+ "specs" : [" ipywidgets >=8.1,<8.2" ],
56+ "packages" : [" ../dist/ipywidgets-8.1.2-py3-none-any.whl" , " ../dist" ]
57+ }
58+ }
4459```
4560
4661#### Lockers
4762
4863The _ Locker_ is responsible for starting a browser, executing ` micopip.install ` and
4964` micropip.freeze ` to try to get a viable lock file solution.
5065
51- ` ` ` yaml
52- { ' PyodideLockAddon' : {
53- ' enabled' : true,
54- # the default locker: uses naive a `subprocess.Popen` approach
55- ' locker' : ' browser' ,
56- }, ' BrowserLocker' : {
57- # requires `firefox` or `firefox.exe` on PATH
58- ' browser' : ' firefox' ,
59- ' headless' : true,
60- ' private_mode' : true,
61- ' temp_profile' : true,
62- } }
66+ ``` json
67+ {
68+ "PyodideLockAddon" : {
69+ "enabled" : true ,
70+ "locker" : " browser"
71+ },
72+ "BrowserLocker" : {
73+ "browser" : " firefox" ,
74+ "headless" : true ,
75+ "private_mode" : true ,
76+ "temp_profile" : true
77+ }
78+ }
6379```
6480
6581A convenience CLI options will show some information about detected browsers:
@@ -76,13 +92,13 @@ newer than that date will be filtered out before a lock is attempted.
7692Combined with a fixed ` pyodide_url ` archive, this should prevent known packages and
7793their dependencies from "drifting."
7894
79- ` ` ` yaml
95+ ``` json
8096{
81- ' PyodideAddon' :
97+ " PyodideAddon" :
8298 {
83- ' pyodide_url' : f" https://github.com/pyodide/pyodide/releases/download/0.25.0/pyodide-core-0.25.0.tar.bz2" ,
99+ " pyodide_url" : f"https://github.com/pyodide/pyodide/releases/download/0.25.0/pyodide-core-0.25.0.tar.bz2",
84100 },
85- ' PyodideLockAddon' : { ' enabled' : true, ' lock_date_epoch' : 1712980201 },
101+ " PyodideLockAddon" : { " enabled" : true , " lock_date_epoch" : 1712980201 }
86102}
87103```
88104
0 commit comments