From 6a5056e7eeb2b2176d79d6bc8c3ee4e636991e69 Mon Sep 17 00:00:00 2001 From: MARCHAND MANON Date: Fri, 1 Mar 2024 15:29:20 +0100 Subject: [PATCH 1/5] fix: deprecated install_npm, switch to pyproject.toml --- pyproject.toml | 44 +++++++++++++++++++++++++++++++++++++++++++- setup.py | 32 ++------------------------------ 2 files changed, 45 insertions(+), 31 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index eee6fa5a..382cb734 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,45 @@ [build-system] requires = ["jupyter_packaging>=0.7.9", "jupyterlab>=3.0", "setuptools>=40.8.0", "wheel", "traitlets>=5.9.0", "traitlets>=5.9.0"] -build-backend = "setuptools.build_meta" \ No newline at end of file +build-backend = "setuptools.build_meta" + + + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.build] +artifacts = [ + "ipyaladin/nbextension/index.*", + "ipyaladin/labextension/*.tgz", + "ipyaladin/labextension", +] + +[tool.hatch.build.targets.wheel.shared-data] +"ipyaladin/nbextension" = "share/jupyter/nbextensions/ipyaladin" +"ipyaladin/labextension" = "share/jupyter/labextensions/ipyaladin" +"./install.json" = "share/jupyter/labextensions/ipyaladin/install.json" +"./ipyaladin.json" = "etc/jupyter/nbconfig/notebook.d/ipyaladin.json" + +[tool.hatch.build.targets.sdist] +exclude = [ + ".github", +] + +[tool.hatch.build.hooks.jupyter-builder] +build-function = "hatch_jupyter_builder.npm_builder" +ensured-targets = [ + "ipyaladin/nbextension/index.js", + "ipyaladin/labextension/package.json", +] +skip-if-exists = [ + "ipyaladin/nbextension/index.js", + "ipyaladin/labextension/package.json", +] +dependencies = [ + "hatch-jupyter-builder>=0.8.3", +] + +[tool.hatch.build.hooks.jupyter-builder.build-kwargs] +path = "." +build_cmd = "build:prod" +npm = ["jlpm"] \ No newline at end of file diff --git a/setup.py b/setup.py index b3d5db48..b6c66813 100644 --- a/setup.py +++ b/setup.py @@ -1,30 +1,2 @@ -from setuptools import setup -from pathlib import Path - -from jupyter_packaging import ( - create_cmdclass, - install_npm, - ensure_targets, - combine_commands, -) - -JS_DIR = Path(__file__).resolve().parent / 'js' - -# Representative files that should exist after a successful build -jstargets = [JS_DIR / 'dist' / 'index.js'] - -data_files_spec = [ - ('share/jupyter/nbextensions/ipyaladin', 'ipyaladin/nbextension', '*.*'), - ('share/jupyter/labextensions/ipyaladin', 'ipyaladin/labextension', '**'), - ('share/jupyter/labextensions/ipyaladin', '.', 'install.json'), - ('etc/jupyter/nbconfig/notebook.d', '.', 'ipyaladin.json'), -] - -cmdclass = create_cmdclass('jsdeps', data_files_spec=data_files_spec) -cmdclass['jsdeps'] = combine_commands( - install_npm(JS_DIR, npm=['yarn'], build_cmd='build:prod'), - ensure_targets(jstargets), -) - -# See setup.cfg for other parameters -setup(cmdclass=cmdclass) +# setup.py shim for use with applications that require it. +__import__("setuptools").setup() From b74d361fd06ccd14621e880d8d4c3bf9625747df Mon Sep 17 00:00:00 2001 From: MARCHAND MANON Date: Fri, 1 Mar 2024 15:29:56 +0100 Subject: [PATCH 2/5] fix: pin aladin-lite version to 3.2.0 --- js/lib/jupyter-aladin.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/lib/jupyter-aladin.js b/js/lib/jupyter-aladin.js index ab6dcd41..6b891209 100644 --- a/js/lib/jupyter-aladin.js +++ b/js/lib/jupyter-aladin.js @@ -32,8 +32,7 @@ const loadScript = (FILE_URL, async = true, type = "text/javascript") => { } }); }; -let AladinLiteJS_Loader = loadScript("https://code.jquery.com/jquery-3.6.1.min.js") - .then(() => { return loadScript("https://aladin.u-strasbg.fr/AladinLite/api/v3/latest/aladin.js") }) +let AladinLiteJS_Loader = loadScript("https://aladin.cds.unistra.fr/AladinLite/api/v3/3.2.0/aladin.js") .then(async () => { await A.init; }); From fda56ae822592d7eccc712470e9184aaf4d2261f Mon Sep 17 00:00:00 2001 From: MARCHAND MANON Date: Fri, 1 Mar 2024 15:35:33 +0100 Subject: [PATCH 3/5] update version number --- CHANGELOG.md | 10 ++++++++++ conda-recipe/meta.yaml | 2 +- conda-recipe/readme | 6 +++--- ipyaladin/_version.py | 4 ++-- js/package.json | 2 +- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c433eb7f..0121cdea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * **Fixed** for any bug fixes. * **Security** in case of vulnerabilities. +## [0.2.6] + +### Fixed + +* fix deprecated npm_install module and replaced by hatch_jupyter_builder.npm_builder + +### Changed + +* The corresponding Aladin-lite version is now pinned instead of pointing to the latest version. + ## [0.2.5] ### Fixed diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 7322989f..fb208dee 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -1,5 +1,5 @@ {% set name = "ipyaladin" %} -{% set version = "0.2.5" %} +{% set version = "0.2.6" %} package: name: "{{ name|lower }}" diff --git a/conda-recipe/readme b/conda-recipe/readme index e5151677..5f8b6c36 100644 --- a/conda-recipe/readme +++ b/conda-recipe/readme @@ -18,9 +18,9 @@ conda skeleton pypi --extra-specs jupyter-packaging ipyaladin // change the meta.yaml in ipyaladin/ cp post-link.* pre-unlink.* ipyaladin conda build ipyaladin --output-folder distrib -conda convert --platform all distrib/linux-64/ipyaladin-0.2.5-py39_0.tar.bz2 -o distrib +conda convert --platform all distrib/linux-64/ipyaladin-0.2.6-py39_0.tar.bz2 -o distrib anaconda login -anaconda upload distrib/osx-64/ipyaladin-0.2.5-py39_0.tar.bz2 -anaconda upload distrib/linux-64/ipyaladin-0.2.5-py39_0.tar.bz2 +anaconda upload distrib/osx-64/ipyaladin-0.2.6-py39_0.tar.bz2 +anaconda upload distrib/linux-64/ipyaladin-0.2.6-py39_0.tar.bz2 rm -r distrib ipyaladin diff --git a/ipyaladin/_version.py b/ipyaladin/_version.py index d1b5e50b..632f5678 100644 --- a/ipyaladin/_version.py +++ b/ipyaladin/_version.py @@ -1,4 +1,4 @@ # Module version -__version__ = '0.2.5' +__version__ = '0.2.6' -NPM_PACKAGE_RANGE='^0.2.5' \ No newline at end of file +NPM_PACKAGE_RANGE='^0.2.6' \ No newline at end of file diff --git a/js/package.json b/js/package.json index 13470693..9e5c6ccd 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "ipyaladin", - "version": "0.2.5", + "version": "0.2.6", "description": "ipyaladin", "author": "Thomas Boch, Jerome Desroziers and Matthieu Baumann", "license": "BSD-3-Clause", From 7c0a105dd272a375e64d0d20300cfd2ae938fc5c Mon Sep 17 00:00:00 2001 From: MARCHAND MANON Date: Fri, 1 Mar 2024 16:14:07 +0100 Subject: [PATCH 4/5] :memo: add changelog entry for npm_builder fix --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0121cdea..7d99c173 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -* fix deprecated npm_install module and replaced by hatch_jupyter_builder.npm_builder +* fix deprecated npm_install jupyter module and replaced by hatch_jupyter_builder.npm_builder ### Changed From 292c03988d44a3be109dcfbbd767102afae0bef2 Mon Sep 17 00:00:00 2001 From: MARCHAND MANON Date: Fri, 1 Mar 2024 16:17:59 +0100 Subject: [PATCH 5/5] :memo: no dependency to jquery anymore --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d99c173..9807cbbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed * The corresponding Aladin-lite version is now pinned instead of pointing to the latest version. +* There is no dependency to jquery anymore ## [0.2.5]