-
Notifications
You must be signed in to change notification settings - Fork 80
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
Build pyodide wheels in CI #2433
Conversation
701bc4c
to
f464c3c
Compare
Codecov Report
@@ Coverage Diff @@
## latest #2433 +/- ##
==========================================
- Coverage 84.81% 84.81% -0.01%
==========================================
Files 133 133
Lines 14819 14820 +1
Branches 2513 2513
==========================================
Hits 12569 12569
- Misses 1948 1949 +1
Partials 302 302
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
8f94057
to
28fde38
Compare
release: | ||
name: Publish wheels | ||
runs-on: ubuntu-20.04 | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
needs: build_wheels | ||
needs: [build_wheels, build_wasm] |
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.
This is fast enough (3 minutes) to be in the default wheels to be built per PR.
.github/workflows/dev_envs.yml
Outdated
- uses: cachix/cachix-action@v10 | ||
with: | ||
name: sourmash-bio | ||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
|
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.
set up a cache to avoid the long build times
- run: nix run .# -- --version | ||
|
||
- run: nix-shell --command "tox -e py39" | ||
- run: nix-shell --command "tox -e py310" |
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.
run with the same Python version for the nix package, so we don't need to download/build two Python versions
doc/conf.py
Outdated
@@ -65,8 +65,8 @@ | |||
# The version info for the project you're documenting, acts as replacement for | |||
# |version| and |release|, also used in various other places throughout the | |||
# built documents. | |||
from pkg_resources import get_distribution |
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.
@@ -78,19 +78,23 @@ harness = false | |||
|
|||
## Wasm section. Crates only used for WASM, as well as specific configurations | |||
|
|||
[target.'cfg(all(target_arch = "wasm32", target_vendor="unknown"))'.dependencies.wasm-bindgen] | |||
[target.'cfg(all(target_arch = "wasm32", target_os="unknown"))'.dependencies.wasm-bindgen] |
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.
- the pure wasm target is
wasm32-unknown-unknown
(used for the NPM package) - the pyodide wasm target is
wasm32-unknown-emscripten
- wasi is target
wasm32-wasi
so setting os
instead of vendor
here matches wasm32-*-unknown
instead of wasm32-unknown-*
and avoid restricting POSIX/libc
-like targets like emscripten
and wasi
[target.'cfg(all(target_arch = "wasm32"))'.dependencies.chrono] | ||
version = "0.4.23" | ||
features = ["wasmbind"] |
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.
we don't have a direct dependency on chrono
, but setting this feature here solves problems in upstream deps
`pkg_resources` is part of `setuptools`, so removing it allows not having a runtime dep on `setuptools`. It is also discouraged since `importlib` has the necessary features. https://setuptools.pypa.io/en/latest/pkg_resources.html Declare `importlib_resources` as a dependency for tests in 3.8 (since the `.files()` method was added in 3.9 stdlib) Update Read the Docs config to avoid the default 3.7 version. Relevant to sourmash-bio/sourmash#2433 and NixOS/nixpkgs#205878
d423c3b
to
c9551b7
Compare
c9551b7
to
918fcb6
Compare
I think this is enough to submit the package to pyodide and emscripten-forge, so going for a merge Ready for review @sourmash-bio/devs |
move wasm wheel to default PR checks add cache for nix sync with Python package version
0953c0f
to
0248eff
Compare
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.
LGTM ;)
Add sourmash (Python + Rust extension, packaged with maturin) and missing pure-wheel deps (screed, bitstring, cachetools, deprecation). After a couple of fixes in sourmash-bio/sourmash#2433 I managed to build it out-of-tree, would like to have it available here to make it easier to distribute (while PyPI doesn't support emscripten wheels).
Following https://pyodide.org/en/latest/development/building-and-testing-packages.html#build-github-actions-example