-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
Make the repository compatible with Jupyter Releaser #162
Comments
Testing on a simple (soon to be archived) repo: https://github.com/jtpio/jupyterlab-python-file, logging here some findings. It looks like the "Draft Release Action" current builds npm before Python: And the cookiecutter assumes using |
Adding the following hook to the "jupyter-releaser": {
"hooks": {
"before-build-npm": [
"python -m pip install jupyterlab~=3.0",
"jlpm"
]
}
}, But then stops a bit later when trying to extract the package: Probably because the result of |
Checking the last line of the command output seems to do the trick for now: diff --git a/jupyter_releaser/npm.py b/jupyter_releaser/npm.py
index d1c6aa6..731e087 100644
--- a/jupyter_releaser/npm.py
+++ b/jupyter_releaser/npm.py
@@ -24,7 +24,7 @@ def build_dist(package, dist_dir):
if osp.isdir(package):
basedir = package
- tarball = osp.join(package, util.run("npm pack", cwd=package))
+ tarball = osp.join(package, util.run("npm pack", cwd=package).split('\n')[-1])
else:
basedir = osp.dirname(package)
tarball = package Next the releaser tries to import the package, but since that test extension is not importable it fails a little bit after: Also the cookiecutter now defaults to underscores for the package name which it means it shouldn't be an issue with a fresh new extension. |
Looks like everything went well after:
.github/actions/publish-release/action.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.github/actions/publish-release/action.yml b/.github/actions/publish-release/action.yml
index 15b4844..517db7e 100644
--- a/.github/actions/publish-release/action.yml
+++ b/.github/actions/publish-release/action.yml
@@ -31,6 +31,8 @@ runs:
export RH_DRY_RUN=${{ inputs.dry_run }}
export release_url=${{ inputs.release_url }}
export RH_NPM_COMMAND="npm publish --access public"
+
+ echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
# Install Jupyter Releaser from git
pip install -q git+https://github.com/jupyter-server/jupyter_releaser.git@v1
|
This could probably handled here: https://github.com/jupyter-server/jupyter_releaser/blob/cba7bf7981c41415eda5ae4d2d3026908f003211/jupyter_releaser/npm.py#L130-L141 |
Problem
Extension authors creating a new extension from this cookiecutter will very likely want to release it at some point.
For now there is no real instructions for releasing the extension in the cookicutter itself, just a couple of notes in the extension tutorial: https://jupyterlab.readthedocs.io/en/stable/extension/extension_tutorial.html#publishing-your-extension
Ideally, the generated extension would automatically be compatible with the Jupyter Releaser so it can be published to both PyPI and npm: https://github.com/jupyter-server/jupyter_releaser
Proposed Solution
Additional context
This topic was also discussed in #101
The text was updated successfully, but these errors were encountered: