-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug(job_modules): should be case insensitive
and now they are. as of this fix see pep https://peps.python.org/pep-0508/
- Loading branch information
Showing
2 changed files
with
10 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
""" | ||
Converts Job modules (Pyodide core packages) for Pyodide worktime. | ||
Author: Severn Lortie <[email protected]> | ||
Author: | ||
Severn Lortie <[email protected]> | ||
Will Pringle <[email protected]> | ||
Date: Aug 2024 | ||
""" | ||
|
||
from ..resources import pyodide_lock_repodata_json as repodata | ||
|
||
def pyodide_full_module_dependencies(modules): | ||
"""Generates a list of every required pip package.""" | ||
dependencies = [] | ||
|
||
# PIP packages are case insensitive, see pep-0508 | ||
modules = list(map(lambda x: x.lower(), modules)) | ||
|
||
for module in modules: | ||
if not module in repodata['packages']: | ||
raise Exception('Usage of unsupported module "${module}". "${module}" is currently not supported by the Pyodide Worktime.') | ||
|
@@ -25,12 +32,14 @@ def pyodide_full_module_dependencies(modules): | |
|
||
# TODO: do we need this? | ||
def convert_modules_to_requires(modules): | ||
"""Convert pip module package names to dcp package names.""" | ||
dcp_packages = [] | ||
for pyodide_module in modules: | ||
dcp_packages.append(f"pyodide-{pyodide_module}/pyodide-{pyodide_module}.js") | ||
return dcp_packages | ||
|
||
def convert_module_names_to_import_names(modules): | ||
"""Converts pip module package name to import names.""" | ||
imports = [] | ||
for module in modules: | ||
imports.extend(repodata['packages'][module]['imports']) # 1 or more unique imports per module | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters