mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Use overleaf CDN for loading pyodide packages
GitOrigin-RevId: e17ff3387166421a546a9519786d77ba12cdffc4
This commit is contained in:
committed by
Copybot
parent
a46ca0705f
commit
9e677a2c1e
+42
-3
@@ -325,9 +325,48 @@ describe('<PythonOutputPane />', function () {
|
||||
}}
|
||||
providers={{ FileTreePathProvider, ProjectProvider }}
|
||||
>
|
||||
<PythonExecutionProvider
|
||||
packageBaseUrl={`${window.location.origin}/pyodide-packages/`}
|
||||
>
|
||||
<PythonExecutionProvider>
|
||||
<PythonOutputPane />
|
||||
</PythonExecutionProvider>
|
||||
</EditorProviders>
|
||||
)
|
||||
|
||||
cy.findByRole('button', { name: 'Run Python code' })
|
||||
.should('not.be.disabled')
|
||||
.click()
|
||||
cy.findByText("ModuleNotFoundError: No module named 'tomli'").should(
|
||||
'not.exist'
|
||||
)
|
||||
cy.findByText('hello from tomli').should('exist')
|
||||
})
|
||||
|
||||
it('auto-installs python packages imported by the executing script', function () {
|
||||
const executablePythonFileContents = [
|
||||
'import tomli',
|
||||
'',
|
||||
"print(tomli.loads('greeting = \"hello from tomli\"')['greeting'])",
|
||||
].join('\n')
|
||||
|
||||
const projectFiles = {
|
||||
[pythonExecutableScript.filename]: executablePythonFileContents,
|
||||
}
|
||||
const ProjectProvider = makeProjectProvider(projectFiles)
|
||||
|
||||
cy.mount(
|
||||
<EditorProviders
|
||||
scope={{
|
||||
editor: {
|
||||
sharejs_doc: {
|
||||
doc_id: pythonExecutableScript.file_id,
|
||||
getSnapshot: () => executablePythonFileContents,
|
||||
},
|
||||
currentDocumentId: pythonExecutableScript.file_id,
|
||||
openDocName: pythonExecutableScript.filename,
|
||||
},
|
||||
}}
|
||||
providers={{ FileTreePathProvider, ProjectProvider }}
|
||||
>
|
||||
<PythonExecutionProvider>
|
||||
<PythonOutputPane />
|
||||
</PythonExecutionProvider>
|
||||
</EditorProviders>
|
||||
|
||||
-1
@@ -349,7 +349,6 @@ describe('PyodideWorkerClient', function () {
|
||||
{
|
||||
type: 'init',
|
||||
baseAssetPath: BASE_ASSET_PATH,
|
||||
packageBaseUrl: undefined,
|
||||
},
|
||||
])
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user