Commit Graph

455 Commits

Author SHA1 Message Date
Hood Chatham 07322414e8
Replace numpy disable-svml patch with upstreamed version (#2702) 2022-06-13 16:35:05 -07:00
Hood Chatham dc33b25a6f
MAINT Tidy up numpy patches (#2701) 2022-06-12 15:19:09 -07:00
Hood Chatham b9c90fe813
Remove another numpy patch (#2699) 2022-06-12 12:18:45 -07:00
Hood Chatham a47e9085b8
Drop Numpy use local blas lapack patch (#2696) 2022-06-12 13:07:00 +02:00
Hood Chatham d3544a06a8
Drop numpy init alloc cache patch (#2698) 2022-06-12 11:44:34 +09:00
Hood Chatham 105e1bffa3
Drop numpy execinfo patch (#2691) 2022-06-12 11:43:55 +09:00
Hood Chatham 1fc1d6ce8a
Remove numpy disable maybe uninitialized patch (#2694) 2022-06-12 00:32:11 +02:00
Hood Chatham 91c56911f6
Drop numpy fix-longdouble patch (#2693) 2022-06-12 00:31:34 +02:00
Hood Chatham ed5953ceaf
Remove fix-invalid-asm-instruction patch (#2697) 2022-06-12 00:29:36 +02:00
Hood Chatham 52f27f06ad
Update to emscripten 3.1.6 (#2672) 2022-06-10 08:13:36 -07:00
Hood Chatham dbbbbb67b2
Cryptography v36.0.2 w/ Rust (#2378) 2022-06-09 10:57:34 -07:00
Jo Bovy b880ec2395
PKG Add galpy (#2676)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-06-09 14:04:28 +02:00
Hood Chatham 0cb41c4ac6
FIX Don't build a shared library for libgsl (#2677) 2022-06-09 13:59:46 +02:00
Hood Chatham 0283a39629
ENH Add a new "disabled" key to meta.yaml (#2671)
Frequently when updating Python or Emscripten, a handlful of packages
stop working. Because of the way that the CI works, these prevent
other packages from being built or tested. However, packages with
many dependents are currently annoying to disable. This adds a key
to meta.yaml "disable: true" that turns off a package.

I also fixed the "!package" and no-numpy-dependents to be transitive.

We use graphlib to sort the packages topologically, then we traverse
the packages once in build order to locate all the packages which
transitively depend on disabled packages. Then we traverse in reverse
build order to locate all packages that are dependencies of non-disabled
requested packages.
2022-06-08 08:25:12 -07:00
Gyeongjae Choi 587a73fa14
PKG Add XGBoost (#2537)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2022-06-07 17:49:57 +09:00
Liumeo 9b76b7a4ee
Add gmpy2 and its dependencies (#2665)
Add gmpy2 and its dependencies libmpc, libmpfr and libgmp. 
gmpy2 is an optional dependency of SymPy.
2022-06-05 19:09:15 -07:00
Alexey Ignatiev a6ef2ef378
python-sat 0.1.7.dev17 (#2661) 2022-06-05 10:28:59 +02:00
Hood Chatham c5f3a48e15
MAINT Define loadPackage in _compat rather than pyodide_js (#2654) 2022-05-31 13:58:50 +02:00
Hood Chatham 6976ea69f4
MAINT Update side modules to use SIDE_MODULE_LDFLAGS (#2650)
It causes trouble when these flags get out of sync, cf
WASM_BIGINT branch #2643
2022-05-30 21:00:11 -07:00
Hood Chatham cfdb77f642
ENH Add support in micropip for installing binary wheels (#2591)
We use `packaging.tags.sys_tags` to get the list of supported tags
then use `packaging.utils.parse_wheel_filename` to get the set of
tags the current wheel implement then check if one of the wheel's
tags is a supported tag. This is a fully accurate check method and
could also catch things like abi3 wheels that are compatible with
multiple Python versions.
2022-05-29 19:00:10 -07:00
Hood Chatham 2f4f258bb5
MAINT Use target sysconfigdata rather than host sysconfigdata when cross compiling (#2516)
sysconfig.py uses the environment variable `_PYTHON_SYSCONFIGDATA_NAME`
to decide where to look for the sysconfig data file with info about the compile target.
We also need to separately insure that our sysconfig data file is on the path. We
don't want the rest of our target stdlib on the path, so I made an extra sysconfigdata
folder, copied the sysconfig data into it, and put it on the path.
2022-05-29 18:59:10 -07:00
Ryan Russell 57100ab604
docs(various): Typo fixes (#2641) 2022-05-29 09:45:45 -07:00
Hood Chatham 798da1796e
Add loadDynlib to micropip._compat (split off from #2591) (#2639) 2022-05-28 23:06:51 -07:00
echorand (Amit Saha) 377bb50c14
Fix support for extras in micropip (#2584)
Fix for #2535

See explanation:
https://gist.github.com/amitsaha/df2141e7e798d946ae559bf34e74ab42
2022-05-28 12:43:17 -07:00
Hood Chatham d818f410c4
Use tblib to pickle errors in `run_in_pyodide` (#2619) 2022-05-27 12:28:46 -07:00
Hood Chatham 806e5dff61
MAINT improve isolation for micropip tests (#2623)
I added a new `wheel_base` fixture which creates a new temporary
directory and mocks `site.getsitepackages()` to return it. I also removed
the `WHEEL_BASE` global variable from micropip and instead calculate
it each time in `micropip.install`.
2022-05-26 18:16:24 -07:00
Hood Chatham cb65f45f12
MAINT Remove `driver_timeout` argument from `run_in_pyodide` in favor of `pytest.mark.driver_timeout` (#2615) 2022-05-26 14:26:24 -07:00
Henry Schreiner 5523d539bf
chore(types): fill out remaining partial types (#2612) 2022-05-25 20:31:04 -07:00
Hood Chatham 36dee13657
MAINT run_in_pyodide function should take selenium fixture as an explicit argument (#2617)
This updates run_in_pyodide to assume that the first argument of the function will be a selenium fixture.
2022-05-25 19:47:43 -07:00
Hood Chatham 1eab80ea40
MAINT Add pytest.mark.xfail_browsers and use it to reduce boilerplate (#2616)
Use a decorator to indicate which browsers we want to xfail test. 
This works for `run_in_pyodide` as well as normal tests.
2022-05-25 13:34:40 -07:00
Hood Chatham 8ed430d300
Allow using other decorators with `@run_in_pyodide` (#2541)
Allow using `pytest.mark.xfail`, `pytest.mark.parametrize`, hypothesis,
and other decorators in `run_in_pyodide` tests
2022-05-25 10:31:26 -07:00
Hood Chatham a525c54d66
MAINT Use ordinary asyncio.gather in micropip tests (#2611) 2022-05-24 20:29: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
Hood Chatham 01d0bd2526
MAINT Remove outdated chrome 89 xfails (#2603) 2022-05-24 12:22:47 -07:00
Hood Chatham 6efe7c356f
ENH Add `micropip.freeze` (#2581)
This adds a function `micropip.freeze()` which creates a `packages.json`
lock file which includes all packages that were loaded by micropip in the
current Pyodide session. This can be used in subsequent sessions to load
the same set of packages with `pyodide.loadPackage`.

For example in our repl:

```py
from js.console import log
import micropip
await micropip.install("sphinx-version-warning") # Installs 19 wheels from pypi
log(micropip.freeze())
```
Then opening the browser console, we can copy the JSON and make a new 
`packages.json` file out of it. (Our repl will just say "<Long output truncated>"
but the browser console truncates it and provides tools to make it easy to copy.) 
Reloading the page with the new `packages.json`, `versionwarning` will autoload:
```py
import versionwarning # Automatically loads 19 wheels from PyPI
```
We detected that `versionwarning` is an export provided by the `sphinx-version-warning`
package via the `top_level.txt` file. This file is part of the `egg-info` spec but isn't
mentioned anywhere in the `dist-info` spec. But wheels seem to include it nonetheless.
2022-05-23 14:10:33 -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
Hood Chatham e824643de5
MAINT Add support for testing extras to `mock_fetch` fixture (#2593)
This PR adds support for extras to the `mock_fetch` fixture. A simple example would be as follows:
```python
@pytest.mark.asyncio
async def test_extras(mock_fetch: mock_fetch_cls, mock_importlib):
    mock_fetch.add_pkg_version("reportlab")
    mock_fetch.add_pkg_version("beagle-vote", extras={"pdf" : ["reportlab"]})

    await micropip.install("beagle-vote[pdf]")

    pkg_list = micropip.list()
    assert "reportlab" in pkg_list
```
This test does not pass #2535 but hopefully it will pass on branch #2584.
2022-05-22 21:16:23 -07:00
Hood Chatham 60b9344b56
MAINT Improvements to micropip test mocks (#2589)
Various improvements to `test_micropip`. The main feature is a new fixture
`mock_fetch` with an `add_pkg` method that takes a package name, a map
from version to requirements, and a choice of platform. This should
hopefully make writing more tests a lot easier (which is good because
we could use more micropip test coverage but we are limited by the
difficulty of writing good tests).

This also adds a fixture to create distinct dummy package names and
enables `@pytest.mark.asyncio` to handle the async calls rather than
using `asyncio.get_event_loop.run_until_complete`.
2022-05-21 21:11:30 -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
Ben Jeffery 35db93ea06
Remove uneeded numpy install in tskit build (#2579)
As suggested at #2506 (comment)
2022-05-18 19:04:04 -07:00
Hood Chatham f2d80e0843
ENH Use `dist-info` + `importlib.metadata` to store and retrieve package metadata (#2572)
This switches to using the file system to store the information about packages
and using importlib.metadata to retrieve it.
This has two related benefits:

    We don't have to separately maintain our own separate state about what
    we've installed.

    We are guaranteed to agree with the Python stdlib about whether or not a
    package is installed, and if so which version is installed. Since the state is
    maintained in only one place, there is no chance of it diverging.

According to the packaging specs, if the package is from a url we should put
that into a file here:
packaging.python.org/en/latest/specifications/direct-url/#direct-url
Other than that, we should set the INSTALLER to pyodide.loadPackage
if the package was loaded with pyodide.loadPackage either directly or
indirectly via micropip. Otherwise set INSTALLER to micropip. That
way we can maintain the current behavior of micropip.list:

    if direct_url.json is present, then source is the url in direct_url.json
    otherwise, set source to pyodide if INSTALLER is pyodide.loadPackage
    and set it to micropip if INSTALLER is micropip.

Oddly enough, the packaging specs suggest no place to put the source
index, so it seems that according to the specs if a package was installed
by name from some custom index, this info should not be recorded.
2022-05-18 14:37:34 -07:00
Gyeongjae Choi 6376f1bdb5
PKG Bump scikit-learn to 1.1.0 (#2574) 2022-05-17 21:57:05 -07:00
Gyeongjae Choi ad0064e2c4
BLD Install libraries to centralized directory (#2551) 2022-05-18 13:14:16 +09:00
Hood Chatham c6f6166ef2
micropip Fix async race condition (#2569)
It's possible that while we were awaiting on `_get_pypi_json`, some other branch
of the resolver already installed a different version of the same wheel. We need
to check a second time for whether the constraint is satisfied between when we
get the `pypi` metadata and when we put the information into `transaction.locked`
or else we might accidentally install the same wheel twice.
2022-05-17 12:34:37 -07:00
Ben Jeffery 4417005e2c
PKG Add msprime and deps including libgsl (#2548)
msprime is a widely used genetic simulation tool.
2022-05-17 12:31:43 -07:00
Roman Yurchak e2b22a84c3
Add FAQ when micropip fails to find a pure python wheel (#2558)
Closes #2557:
Users keep reporting issues about micropip not finding a pure python wheel
e.g. latest in pyscript/pyscript#297 so it appears the the current message is
not explicit enough.

We should explain in more detail,
* what is happening and why
* what the user can do about it and possibly point them to the issue tracker.
2022-05-17 11:07:36 -07:00
Hood Chatham 1ff5d32afd
MAINT micropip Move wheel-related methods into WheelInfo class (#2568)
More micropip maintenance.
* `_parse_wheel_url` ==> static method `WheelInfo.from_url`
* `_extract_wheel` ==> `WheelInfo.extract`
* `_validate_wheel` ==> `WheelInfo.validate`
* `_install_wheel` ==> `WheelInfo.install`
* Parts of `Transaction.add_wheel` were extracted into new methods
`WheelInfo.download` and `WheelInfo.requires`.
2022-05-16 19:58:53 -07:00
Hood Chatham 4c80429827
Fix ordering in micropip add_requirement (#2563)
Steps for `add_requirement`:

1. Convert `req` from a string to a Requirement if necessary
2. If `req.marker` is present, check whether `req.marker` matches `ctx`, if not we don't need it.
3. Check if `req` is already installed
4. Check if `req` is available from `packages.json`
5. Check if `req` is available from pypi

For some reason we had step 4 occurring before steps 2 and 3. This puts them in the correct order.
2022-05-16 19:12:30 -07:00
Hood Chatham 5353170373
MAINT Move testing compatibility stubs from _micropip into separate files (#2566)
This improves readability and gets the testing junk out of the top of `_micropip.py`.
2022-05-16 18:32:53 -07:00
Hood Chatham c4cc40673f
MAINT micropip: move most methods from `PackageManager` to `Transaction` and remove `PackageManager` (#2565)
This is more reorganization of `micropip` to try to make the logic easier to follow.
I turned `INSTALLED_PACKAGES` into a global variable. I turned `_install` into
a top level function definition and merged it with `install` rather than a class method.
The other methods of `PackageManager` turned into `Transaction` methods. I also 
removed `PackageManager` entirely.
2022-05-16 18:10:14 -07:00