Commit Graph

38 Commits

Author SHA1 Message Date
Henry Schreiner 2efbc190ac
Update pyproject.toml 2024-08-14 16:16:31 -04:00
M Bussonnier 135d83e50a
Update pre-commit and fix new issues (#4975) 2024-08-01 10:52:39 +02:00
Loïc Estève 4cfc0ff4b6
Update codespell version in pre-commit (#4938) 2024-07-16 13:44:45 +02:00
Gyeongjae Choi df44d6d5b2
Update subtable name for checking in-tree build (#4835) 2024-06-05 20:12:34 +09:00
Hood Chatham 902453a231
Add JsProxy bindings system (#4699)
We've gotten a lot of complaints about how hard it is to call certain JS
functions, but it's hard to do much to improve the situation without knowing
anything about the specific function being called.

However, if we know about the API, we can choose how to convert to/from JS as
appropriate and make things a lot easier. This adds a method to JsProxy called
`bind_sig` which adjusts how __getattr__ and __call__ work on the proxy so we
can choose our converters. I added a class called JsSignature which
guides what we do when we call the function. I completely rewrote
JsProxy_Vectorcall to use this. I added handling for Promise results so we can
automatically bind a signature to the result of the Promise.

There's a lot leftover to do:
* Generator and AsyncGenerator types
* Alternatives A | B (try A converter and if it raises a TypeError fall back to B)
* TypedDict converters
* Make calling certain objects call `Reflect.construct`
* Cleaner __getattr__ handling, __setattr__ handling
* A way to raise AttributeError if the attribute is missing from the signature
  even if it's present in the JS object (important for backwards compatibility)
* Signatures for JS stdlib functions

My idea is that the signatures should simultaneously function as mypy typehints
as much as this is practical.
2024-05-09 16:21:14 -04:00
Christian Clauss ee13a60fbc
Placate mypy with type: ignore (#4677) 2024-04-08 18:02:42 +09:00
Gyeongjae Choi b36c9a6084
Make `asyncio.sleep(0)` run faster (take 2) (#4590) 2024-03-07 21:09:12 +09:00
Gyeongjae Choi f2411848f7
Revert "Make `asyncio.sleep(0)` run faster (#4568)" (#4583) 2024-03-01 12:22:03 +09:00
Gyeongjae Choi 5c55d93fc1
Make `asyncio.sleep(0)` run faster (#4568) 2024-02-28 23:14:26 +09:00
Hood Chatham 2a765ae927
TYPING Run mypy checks against Python 3.11 (#4324) 2023-12-04 21:37:40 +09:00
Hood Chatham af7544cbbb
Add a no dynamic linking build option (#4203) 2023-10-14 12:13:27 -07:00
Gyeongjae Choi b1256c0a22
Rename setup.py in coolprop (#4145)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-09-19 20:33:58 +09:00
Roman Yurchak 17be4f1347
Use pyodide-lock for pyodide-lock.json parsing in Python (#3949)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-06-29 16:45:06 +00:00
Hood Chatham 09f903e8ab
NFC Update pre-commit rules to cover pyodide-build (#3911) 2023-06-06 14:21:03 -07:00
Gyeongjae Choi 5a8ecf130a
Add `xbuildenv create` CLI command and remove old entrypoints (#3732)
Add a private pyodide xbuildenv create CLI commad that replaces pyodide-build create_xbuildenv. Also removes legacy entrypoints: `pyodide-build {create,install}_xbuildenv.
2023-04-07 20:54:11 +09:00
Roman Yurchak 8058cb6703
Support for py-compiling folders + repodata.json update (#3700)
Co-authored-by: Gyeongjae Choi <def6488@gmail.com>
2023-03-28 11:28:28 +00:00
Christian Clauss 57f36ac6f8
Ruff is now compatible with Python pattern matching (#3650) 2023-03-13 22:45:06 +01:00
Christian Clauss 01c00d70b4
PEP621: Move pytest configuration into pyproject.toml (#3609)
* PEP621: Move pytest configuration into pyproject.toml

Migrate `setup.cfg` to `pyproject.toml` using [ini2toml](https://pypi.org/project/ini2toml) to do the file conversion and running [validate-pyproject](https://github.com/abravalheri/validate-pyproject) in pre-commit to validate the results.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-27 08:33:53 +09:00
Gyeongjae Choi 1138a4af2d
Add url parameter to install_xbuildenv (#3592) 2023-02-22 11:56:35 +09:00
Gyeongjae Choi 0d5bd851fe
Use loky.cpu_count() instead of os.cpu_count() (#3598) 2023-02-22 07:53:19 +09:00
Roman Yurchak 48258ff146
Replace isort, flake8, pycln and pyupgrade by ruff (#3522)
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2023-02-07 08:35:20 +09:00
Hood Chatham 3b2952fc92
Python3.11 (#3252) 2023-01-23 19:45:59 -08:00
Gyeongjae Choi ae4492a1fd
Add a CLI command to create a zipfile of Python libraries (#3411)
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2023-01-14 14:59:42 +01:00
pre-commit-ci[bot] 52e8609c54
[pre-commit.ci] pre-commit autoupdate (#3254) 2022-12-02 15:12:33 -08:00
Hood Chatham 29323915c3
Add a typeshed for the js module (#3298)
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2022-12-02 09:16:16 +01:00
Roman Yurchak 4dd8a3e0cb
Switch to meta.yaml parsing with pydantic (#3079) 2022-09-11 09:20:56 +02:00
Henry Schreiner 5523d539bf
chore(types): fill out remaining partial types (#2612) 2022-05-25 20:31:04 -07:00
Henry Schreiner 693ee011c4
fix(types): removing implicit generics (#2595)
* fix(types): removing implicit generics

* fix(types): address feedback
2022-05-24 19:06:31 -07:00
Henry Schreiner bbbaa09393
fix(types): explicit reexport & strict equality (#2596)
Enable precommit flags `no_implicit_reexport` and `strict_equality`
2022-05-23 13:24:21 -07:00
Henry Schreiner e31bb554e4
chore: complete more incomplete types (#2590)
* chore: add some incomplete types
* chore: modernize pyproject.toml

Adding more incomplete types. About 2/3 of the way through being
able to turn on the strictness flag for it.
2022-05-21 13:35:02 -07:00
Gyeongjae Choi 60d530801e
ENH Remove hard coded paths in `pyodide_build` (#2351)
We are pushing pyodide_build to PyPI as a Python package, but for now, 
installing pyodide_build from PyPI (i.e. pip install pyodide_build`) is almost 
useless because:

    there are bunch of hard-coded paths (e.g. Path(__file__).parents[2]),
    its dependencies are not specified in setup.cfg.

This PR is for mitigating this situation by removing hard-coded paths and
adding tests, and is also a preparation for our new CLI 
(https://github.com/pyodide/pyodide/issues/1977).
2022-04-09 13:41:10 -07:00
Henry Schreiner 6f62a89d86
fix: better mypy coverage (#2339) 2022-04-01 21:58:54 +02:00
Hood Chatham 0e1e2ac01c
Python 3.10 (#2225) 2022-03-17 15:48:56 -07:00
Henry Schreiner 18e664afb1
chore: isort avoid local build confusion, bump pre-commit (#2274) 2022-03-14 14:08:50 -07:00
Henry Schreiner 8385df36a4
tests: enabling mypy on untyped defs (#2204) 2022-02-23 17:10:53 -05:00
Henry Schreiner 66856a7427
MAINT isort (#2200) 2022-02-21 23:27:03 +01:00
Henry Schreiner ed22c06e07
chore: pyupgrade 3.9+ (#2195) 2022-02-20 17:13:37 -05:00
Henry Schreiner 41b6db1bab
style: improve pre-commit (#2177) 2022-02-19 09:06:25 +01:00