jupyter-book / mystmd

Command line tools for working with MyST Markdown.
https://mystmd.org/guide
MIT License
191 stars 61 forks source link

📦 Use `nodeenv` when Node.js can't be found by Python package #1487

Closed agoose77 closed 1 week ago

agoose77 commented 3 weeks ago

Fixes https://github.com/jupyter-book/mystmd/issues/1443 by using nodeenv to provision a Node.js environment for installs of our Python package.

Here's an example running in Podman (the final crash appears container related) https://github.com/user-attachments/assets/9ca90520-f1fa-4d37-a6da-a64edc5f0a83

changeset-bot[bot] commented 3 weeks ago

⚠️ No Changeset found

Latest commit: f7b6df85ae76b0d6882ec6c756e419ae42c04ac3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

agoose77 commented 2 weeks ago

@rowanc1 I've added an input call (that can be bypassed by defining the MYSTMD_ALLOW_NODENV env var, where the result depends upon the truthiness ({"yes", "true", "1", "y"}) of the lowercased value.

rowanc1 commented 2 weeks ago

Can you rebase this on the docs PR that just got merged. My understanding is that this will simplify the pip install instructions?

agoose77 commented 2 weeks ago

I have lifted the custom build hook into https://github.com/jupyter-book/hatch-deps-selector/, which means that others can also use it.

Simply put, this plugin makes it possible for us to add additional predefined dependencies to our package metadata at build-time by setting an environment variable.

We will update our conda-forge deployment to reflect this.

agoose77 commented 2 weeks ago

This PR now should hold until https://github.com/conda-forge/staged-recipes/pull/27417 is merged, so that we can immediately update our feedstock recipe.

agoose77 commented 2 weeks ago

@rowanc1 conda-forge now ships the new package required to make this work :)

agoose77 commented 1 week ago

Adding a pre-built wheel to test on Windows... mystmd-1.3.6-py3-none-any.whl.zip

agoose77 commented 1 week ago

@rowanc1 this has been tested on Windows and Linux, and works as expected. We can review during today's meeting if helpful.