jupyterlite-pyodide-lock-uv#

A uv locker strategy for jupyterlite-pyodide-lock.

Lockers#

UvLocker#

Locker implementation jupyterlite-pyodide-lock-uv.

class jupyterlite_pyodide_lock_uv.locker.UvLocker(**kwargs) None[source]#

Bases: BaseLocker

A locker that uses uv pip compile.

Parameters:

kwargs (Any)

Create a configurable given a config config.

Parameters#

configConfig

If this is empty, default values are used. If config is a Config instance, it will be used to configure the instance.

parentConfigurable instance, optional

The parent Configurable instance of this object.

Notes#

Subclasses of Configurable must call the __init__() method of Configurable before doing anything else and using super():

class MyConfigurable(Configurable):
    def __init__(self, config=None):
        super(MyConfigurable, self).__init__(config=config)
        # Then any other code you need to finish initialization.

This ensures that instances will be configured properly.

param kwargs:

type kwargs:

Any

property all_uv_pip_compile_args: list[str]#

All args for uv pip compile.

build_constraints_txt(requirements) None[source]#

Combine all constraints.

Parameters:

requirements (dict[str, str])

Return type:

None

build_one_constraint_from_pyodide_lock(pkg, requirements) dict[str, str][source]#

Build a PEP-508 @ constraint from a pyodide-lock.json package.

Parameters:
Return type:

dict[str, str]

build_one_package_requirement(wheel) dict[str, str][source]#

Build a package @ file://url spec for an on-disk wheel.

Parameters:

wheel (Path)

Return type:

dict[str, str]

build_pyodide_lock() None[source]#

Update {out_dir}/pyodide-lock/pyodide-lock.json from wheels.

Return type:

None

build_requirements_txt() dict[str, str][source]#

Combine all requirements.

Return type:

dict[str, str]

build_tmp_pyodide_lock(old_lockfile, wheels) dict[str, Any][source]#

Use local wheels to make a patched pyodide-lock.json.

Parameters:
Return type:

dict[str, Any]

property cache_dir: Path#

The location of cached files discovered during the solve.

collect_pylock_wheel(pkg) Iterator[Path][source]#

Ensure a local wheel from a PEP-751 package.

Parameters:

pkg (dict[str, Any])

Return type:

Iterator[Path]

property constraints_txt: Path#

A temporary constraints.txt.

extra_uv_pip_compile_args c.UvLocker.extra_uv_pip_compile_args = TypedTuple()#

extra arguments to uv pip compile, such as --default-index

fix_one_tmp_pyodide_lock_package(root_posix, lock_dir, package, found_wheels) None[source]#

Update a pyodide-lock URL for deployment.

Parameters:
Return type:

None

property lockfile_cache: Path#

The location of the updated lockfile.

property pylock: Path#

A temporary pylock.toml.

pyodide_cdn_url c.UvLocker.pyodide_cdn_url = Unicode('https://cdn.jsdelivr.net/pyodide/v0.27.6/full')#

remote URL for the version of a full pyodide distribution; defaults to the version provided by jupyterlite_pyodide_kernel

property requirements_in: Path#

The a temporary requirements.in to solve.

async resolve() bool[source]#

Get the lock.

Return type:

bool

run_pip_compile() None[source]#

Run a constrained uv pip compile.

Return type:

None

timeout c.UvLocker.timeout = Int(0)#

seconds to wait for a solve

uv_bin c.UvLocker.uv_bin = Unicode('')#

a custom executable for uv

uv_pip_compile_args c.UvLocker.uv_pip_compile_args = TypedTuple()#

arguments to uv pip compile

uv_platform c.UvLocker.uv_platform = Unicode('wasm32-pyodide2024')#

the uv python platform