gristlabs_grist-core/app/plugin
Alex Hall 42afb17e36 (core) Run and test imports only in Python 3, upgrade openpyxl, fix weird date handling
Summary:
Python 2 only needs to be supported for the sake of old documents and formulas. This doesn't apply to the separate sandboxes that parse files for imports. Using Python 3 only allows using newer libraries and library versions. In particular, the latest version of openpyxl doesn't support Python 2. This will also make it easier to make other similar changes in the future, such as replacing messytables with a modern library. See https://grist.slack.com/archives/C0234CPPXPA/p1661261829343999?thread_ts=1661260442.837959&cid=C0234CPPXPA

The latest openpyxl is better at handling a particular edge case with broken dates in Excel, but still doesn't quite do what we want, so we monkeypatch it. Discussion: https://grist.slack.com/archives/C02EGJ1FUCV/p1661440851911869?thread_ts=1661154219.515549&cid=C02EGJ1FUCV

Setting `preferredPythonVersion` to '3' in SafePythonComponent ensures that JS always creates import sandboxes that use Python 3. Within Python, a module used by all imports will raise an error in Python 2. Python unit tests of imports are now only run in Python 3, using the `load_tests` protocol of `unittest`.

Test Plan: Mostly existing tests. Added another strange date to the Excel fixture.

Reviewers: dsagal

Reviewed By: dsagal

Subscribers: dsagal

Differential Revision: https://phab.getgrist.com/D3606
2022-09-02 16:27:34 +02:00
..
CustomSectionAPI-ti.ts (core) Run and test imports only in Python 3, upgrade openpyxl, fix weird date handling 2022-09-02 16:27:34 +02:00
CustomSectionAPI.ts add a description property to column mapping for custom widgets (#255) 2022-08-26 08:25:34 -04:00
DocApiTypes-ti.ts (core) add grist.selectedTable.create/update/destroy/upsert to custom widget api 2022-03-15 11:11:58 -04:00
DocApiTypes.ts (core) flesh out getAccessToken API documentation 2022-07-28 08:50:12 -04:00
FileParserAPI-ti.ts (core) Adding schema validation for records endpoint 2021-10-18 21:40:50 +02:00
FileParserAPI.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
grist-plugin-api.ts (core) flesh out getAccessToken API documentation 2022-07-28 08:50:12 -04:00
GristAPI-ti.ts (core) add an access token mechanism to help with attachments in custom widgets 2022-07-19 11:55:18 -04:00
GristAPI.ts (core) flesh out getAccessToken API documentation 2022-07-28 08:50:12 -04:00
GristData-ti.ts (core) Update Plugin API documentation 2022-05-24 17:27:34 -07:00
GristData.ts (core) flesh out getAccessToken API documentation 2022-07-28 08:50:12 -04:00
GristTable-ti.ts (core) add grist.onRecord and grist.onRecords event handlers 2020-08-13 14:34:23 -04:00
GristTable.ts (core) Update Plugin API documentation 2022-05-24 17:27:34 -07:00
gutil.ts (core) add grist.selectedTable.create/update/destroy/upsert to custom widget api 2022-03-15 11:11:58 -04:00
ImportSourceAPI-ti.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
ImportSourceAPI.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
InternalImportSourceAPI-ti.ts (core) Adding schema validation for records endpoint 2021-10-18 21:40:50 +02:00
InternalImportSourceAPI.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
objtypes.ts (core) Use GristObjCode in CellValue 2021-10-11 14:11:32 +02:00
PluginManifest-ti.ts (core) Adding import from google drive to the home screen 2021-08-05 20:46:11 +02:00
PluginManifest.ts (core) Adding import from google drive to the home screen 2021-08-05 20:46:11 +02:00
README.md (core) configure typedoc for generating plugin api documentation 2022-04-04 18:11:33 -04:00
RenderOptions-ti.ts (core) Adding schema validation for records endpoint 2021-10-18 21:40:50 +02:00
RenderOptions.ts (core) configure typedoc for generating plugin api documentation 2022-04-04 18:11:33 -04:00
StorageAPI-ti.ts (core) Adding schema validation for records endpoint 2021-10-18 21:40:50 +02:00
StorageAPI.ts (core) move home server into core 2020-07-21 20:39:10 -04:00
TableOperations.ts (core) Update Plugin API documentation 2022-05-24 17:27:34 -07:00
TableOperationsImpl.ts (core) Improving custom widget API. Changing destroy function signature. 2022-05-05 16:34:26 +02:00
tsconfig.json (core) move home server into core 2020-07-21 20:39:10 -04:00
TypeCheckers.ts (core) Speed up and upgrade build. 2022-06-27 16:10:10 -04:00
WidgetAPI-ti.ts (core) Widget options api 2022-01-13 11:10:17 +01:00
WidgetAPI.ts (core) Widget options api 2022-01-13 11:10:17 +01:00

Methods here are available for use in Grist custom widgets.