-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for pyodide 0.27.1, including pyarrow + pandas #2901
Changes from all commits
08d22e7
8188fe3
8ec0be0
5f8fdc3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -338,6 +338,15 @@ if(PSP_PYODIDE) | |
string(APPEND CMAKE_CXX_FLAGS "${RELOCATABLE_FLAGS}") | ||
endif() | ||
|
||
if(PSP_PYODIDE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I propose we set this for everything. |
||
string(APPEND CMAKE_CXX_FLAGS " -fvisibility=hidden") | ||
endif() | ||
|
||
if (PSP_PYODIDE AND NOT PSP_WASM_EXCEPTIONS) | ||
# Emscripten exceptions | ||
string(APPEND CMAKE_CXX_FLAGS " -fexceptions") | ||
endif() | ||
|
||
# Build (read: download and extract) header-only dependencies from external sources | ||
set(all_deps_INCLUDE_DIRS "") | ||
psp_build_dep("date" "${PSP_CMAKE_MODULE_PATH}/date.txt.in") | ||
|
@@ -608,11 +617,6 @@ elseif(PSP_CPP_BUILD OR PSP_PYTHON_BUILD) | |
target_include_directories(psp PRIVATE ${psp_INCLUDE_DIRS}) | ||
target_include_directories(psp SYSTEM PRIVATE ${all_deps_INCLUDE_DIRS}) | ||
target_compile_definitions(psp PRIVATE PSP_ENABLE_PYTHON=1 PSP_ENABLE_WASM=1) | ||
# support for emscripten exceptions https://emscripten.org/docs/porting/exceptions.html#emscripten-javascript-based-exception-support | ||
target_compile_options(psp PUBLIC -fexceptions -fvisibility=hidden) | ||
target_compile_options(arrow_static PUBLIC -fexceptions -fvisibility=hidden) | ||
target_compile_options(re2 PUBLIC -fexceptions -fvisibility=hidden) | ||
target_compile_options(protos PUBLIC -fexceptions -fvisibility=hidden) | ||
else() | ||
# Cpython | ||
add_library(psp STATIC ${PYTHON_SOURCE_FILES}) | ||
|
@@ -631,7 +635,6 @@ elseif(PSP_CPP_BUILD OR PSP_PYTHON_BUILD) | |
target_compile_options(psp PRIVATE -fvisibility=hidden) | ||
endif() | ||
|
||
# Link against arrow static library | ||
# Linking against arrow_static also links against its bundled dependencies | ||
target_link_libraries(psp PRIVATE arrow_static re2 protos) | ||
else() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,37 @@ | ||
# pyodide-tests | ||
|
||
Smoke and integration tests for the perspective-python Pyodide wheel. | ||
Smoke and integration tests for the perspective-python Pyodide wheel. The tests | ||
are specced in `pytest` and executed with `playwright`, using the | ||
`pytest-pyodide` package. | ||
|
||
These tests require that a Pyodide wheel has been built to rust/target/wheels | ||
|
||
## test setup | ||
|
||
Create a virtual environment. Install perspective-python requirements and | ||
special pyodide-only requirements: | ||
|
||
``` | ||
pip install -r rust/perspective-python/requirements.txt | ||
pip install -r rust/perspective-python/requirements-pyodide.txt | ||
``` | ||
|
||
## running tests | ||
|
||
Run setup, select `perspective-pyodide` target: | ||
|
||
``` | ||
pnpm -w run setup | ||
``` | ||
|
||
Then run tests: | ||
|
||
``` | ||
pnpm -w test | ||
``` | ||
|
||
If you are prompted to install playwright browsers, run this in your venv: | ||
|
||
``` | ||
python -m playwright install | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
pytest==8.2.2 | ||
pytest-playwright==0.5.2 | ||
pytest-pyodide==0.58.3 | ||
|
||
pytest-timeout==2.3.1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,7 +168,14 @@ async function focus_package() { | |
message: "Focus NPM package(s)?", | ||
default: () => { | ||
if (CONFIG["PACKAGE"]) { | ||
return CONFIG["PACKAGE"].split(","); | ||
const packages = CONFIG["PACKAGE"].split(","); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to test this, run previously the menu selected perspective-python on the second go - which made it easy to accidentally switch back to cpython |
||
if (CONFIG["PSP_PYODIDE"] === "1") { | ||
const py = packages.indexOf("perspective-python"); | ||
if (py >= 0) { | ||
packages[py] = "perspective-pyodide"; | ||
} | ||
} | ||
return packages; | ||
} else { | ||
return [""]; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we move these?