Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyodide
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
pyodide
Commits
2aa98eb6
Commit
2aa98eb6
authored
Aug 29, 2018
by
Roman Yurchak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document loading packages from custom URLs
parent
11fcaf8d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
4 deletions
+21
-4
docs/new_packages.md
docs/new_packages.md
+2
-1
docs/using_pyodide_from_iodide.md
docs/using_pyodide_from_iodide.md
+9
-1
docs/using_pyodide_from_javascript.md
docs/using_pyodide_from_javascript.md
+9
-1
src/pyodide.js
src/pyodide.js
+1
-1
No files found.
docs/new_packages.md
View file @
2aa98eb6
...
@@ -50,7 +50,8 @@ The supported keys in the `meta.yaml` file are described below.
...
@@ -50,7 +50,8 @@ The supported keys in the `meta.yaml` file are described below.
The name of the package. It must match the name of the package used when
The name of the package. It must match the name of the package used when
expanding the tarball, which is sometimes different from the name of the package
expanding the tarball, which is sometimes different from the name of the package
in the Python namespace when installed. It must also match the name of the
in the Python namespace when installed. It must also match the name of the
directory in which the
`meta.yaml`
file is placed.
directory in which the
`meta.yaml`
file is placed. It can only contain
alpha-numeric characters and
`-`
,
`_`
.
#### `package/version`
#### `package/version`
...
...
docs/using_pyodide_from_iodide.md
View file @
2aa98eb6
...
@@ -51,7 +51,15 @@ Pyodide. To use other libraries, you'll need to load their package using
...
@@ -51,7 +51,15 @@ Pyodide. To use other libraries, you'll need to load their package using
from a Javascript cell. This downloads the file data over the network (as a
from a Javascript cell. This downloads the file data over the network (as a
`.data`
and
`.js`
index file) and installs the files in the virtual filesystem.
`.data`
and
`.js`
index file) and installs the files in the virtual filesystem.
When you request a package, all of that package's dependencies are also loaded.
Packages can be loaded by name, for those included in the official pyodide
repository (e.g.
`pyodide.loadPackage('numpy')`
). It is also possible to load
packages from custom URLs (e.g.
`pyodide.loadPackage('https://foo/bar/numpy.js')`
), in which case the URL must
end with
`<package-name>.js`
.
When you request a package from the official repository, all of that package's
dependencies are also loaded. Dependency resolution is not yet implemented
when loading packages from custom URLs.
`pyodide.loadPackage`
returns a
`Promise`
.
`pyodide.loadPackage`
returns a
`Promise`
.
...
...
docs/using_pyodide_from_javascript.md
View file @
2aa98eb6
...
@@ -39,7 +39,15 @@ Pyodide. To use other libraries, you'll need to load their package using
...
@@ -39,7 +39,15 @@ Pyodide. To use other libraries, you'll need to load their package using
`pyodide.loadPackage`
. This downloads the file data over the network (as a
`pyodide.loadPackage`
. This downloads the file data over the network (as a
`.data`
and
`.js`
index file) and installs the files in the virtual filesystem.
`.data`
and
`.js`
index file) and installs the files in the virtual filesystem.
When you request a package, all of that package's dependencies are also loaded.
Packages can be loaded by name, for those included in the official pyodide
repository (e.g.
`pyodide.loadPackage('numpy')`
). It is also possible to load
packages from custom URLs (e.g.
`pyodide.loadPackage('https://foo/bar/numpy.js')`
), in which case the URL must
end with
`<package-name>.js`
.
When you request a package from the official repository, all of that package's
dependencies are also loaded. Dependency resolution is not yet implemented
when loading packages from custom URLs.
`pyodide.loadPackage`
returns a
`Promise`
.
`pyodide.loadPackage`
returns a
`Promise`
.
...
...
src/pyodide.js
View file @
2aa98eb6
...
@@ -67,7 +67,7 @@ var languagePluginLoader = new Promise((resolve, reject) => {
...
@@ -67,7 +67,7 @@ var languagePluginLoader = new Promise((resolve, reject) => {
}
}
});
});
}
else
{
}
else
{
log
.
console
(
`Unknown package '
${
package
}
'`
);
console
.
log
(
`Unknown package '
${
package
}
'`
);
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment