-
Notifications
You must be signed in to change notification settings - Fork 39
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
Update: Replace deps without python wheels to allow installing in pyodide #345
base: main
Are you sure you want to change the base?
Conversation
The method orjson.dumps(obj) returns bytes so no need to call encode()
stringcase has not been updated since 2017 and does not have a python wheel. A dependecy maintained and with a similar enough api is casefy
hey @Gizemdem your changes are in a good direction let me know if you need help with fixing the tests. The pre-commit CI step is failing, cause one of the linters is not satisfied, if you install pre-commit it will automatically fix the issues for you |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #345 +/- ##
=======================================
Coverage 87.65% 87.65%
=======================================
Files 95 95
Lines 5670 5670
=======================================
Hits 4970 4970
Misses 700 700 ☔ View full report in Codecov by Sentry. |
hey @JR-Morgan and @KatKatKateryna i think we're on solid foundations here to go ahead, could you do a bit of testing in blender and qgis before we merge this? |
hey everyone! I noticed a small thing: this PR is pinning the minimum verson of |
Description & motivation
Relates to: https://speckle.community/t/running-specklepy-inside-pyodide-browser/12826/3
This PR replaces two dependencies, which conflict when a user tries to import specklepy in pyodide.
Pyodide is a python port that allows running python programs natively in a browser. This PR would allow installing
specklepy
in a Python environment running in Pyodide and then extend the possibilities of using these APIs, for example inside a python console running locally in the browser like this one.Changes:
orjson dumps produces bytes, so calling .encode() in the base.py file becomes unnecessary. I validated this with the test test_base.py
Replace stringcase -> casefy. This dependency has the same API of stringcase but offers a python wheel and is actively maintained. It has no other dependencies.
Screenshots:
Validation of changes:
I haven't added a new test, but I focused on running tests in the unit/ directory. Specially the test_base.py since there are changes on the base file due to changing ujson to orjson.
Checklist:
References
https://speckle.community/t/running-specklepy-inside-pyodide-browser/12826/3