Skip to content

Commit cffe168

Browse files
committed
Consolidate package metadata and template others
* Add more metadata into `package.json` * Rely on hatch nodejs plugins to fill in `pyproject.toml` * Template Conda recipe with metadata * Prefer `package.json` first (primary source of truth) * Fallback to `pyproject.toml` second * Manually write the rest
1 parent 9e0b838 commit cffe168

File tree

3 files changed

+26
-24
lines changed

3 files changed

+26
-24
lines changed
+19-19
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
{% set package_json = load_file_data("package.json") %}
2+
{% set pyproject_toml = load_file_data("pyproject.toml") %}
3+
14
{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %}
25
{% set date_string = environ['RAPIDS_DATE_STRING'] %}
36

4-
{% set python_min = "3.9" %}
7+
{% set requires_python = pyproject_toml["project"]["requires-python"] %}
58

69

710
package:
@@ -20,35 +23,32 @@ build:
2023

2124
requirements:
2225
host:
23-
- python {{ python_min }}
26+
- python {{ requires_python }}
2427
- pip
2528
- nodejs
26-
- hatch-jupyter-builder >=0.5
27-
- hatch-nodejs-version >=0.3.2
28-
- hatchling >=1.5.0
29-
- jupyterlab >=4.0.0
29+
{% for r in pyproject_toml["build-system"]["requires"] %}
30+
- {{ r }}
31+
{% endfor %}
3032
run:
31-
- python >={{ python_min }}
32-
- jupyterlab >=4.0.0
33-
- psutil
34-
- pynvml >=12.0.0,<13.0.0a0
33+
- python {{ requires_python }}
34+
{% for r in pyproject_toml["project"]["dependencies"] %}
35+
- {{ r }}
36+
{% endfor %}
3537

3638
test:
3739
requires:
38-
- python {{ python_min }}
40+
- python {{ requires_python }}
3941
- pip
4042
commands:
4143
- pip check
4244
imports:
4345
- jupyterlab_nvdashboard
4446

4547
about:
46-
home: https://rapids.ai
47-
license: BSD-3-Clause
48-
license_family: BSD
48+
home: {{ package_json["homepage"] }}
49+
license: {{ package_json["license"] }}
4950
license_file: ../../../LICENSE
50-
summary: A JupyterLab extension for displaying dashboards of GPU usage
51-
description: |
52-
A JupyterLab extension for displaying dashboards of GPU usage.
53-
doc_url: https://github.com/rapidsai/jupyterlab-nvdashboard
54-
dev_url: https://github.com/rapidsai/jupyterlab-nvdashboard
51+
summary: {{ package_json["description"] }}
52+
description: {{ package_json["description"] }}
53+
doc_url: {{ package_json["homepage"] }}
54+
dev_url: {{ package_json["repository"]["url"] }}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"bugs": {
1212
"url": "https://github.com/rapidsai/jupyterlab-nvdashboard/issues"
1313
},
14-
"license": "",
14+
"license": "BSD-3-Clause",
1515
"author": "NV Dashboard contributors",
1616
"files": [
1717
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",

pyproject.toml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2023, NVIDIA CORPORATION.
1+
# Copyright (c) 2023-2025, NVIDIA CORPORATION.
22

33
[build-system]
44
requires = [
@@ -12,7 +12,9 @@ build-backend = "hatchling.build"
1212
[project]
1313
name = "jupyterlab_nvdashboard"
1414
readme = "README.md"
15-
license = { file = "LICENSE" }
15+
license-files = [
16+
"LICENSE",
17+
]
1618
requires-python = ">=3.9"
1719
classifiers = [
1820
"Framework :: Jupyter",
@@ -33,7 +35,7 @@ dependencies = [
3335
"psutil",
3436
"pynvml>=12.0.0,<13.0.0a0",
3537
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit dependencies.yaml and run `rapids-dependency-file-generator`.
36-
dynamic = ["version", "description", "authors", "urls", "keywords"]
38+
dynamic = ["version", "license", "description", "authors", "urls", "keywords"]
3739

3840
[project.optional-dependencies]
3941
test = [
@@ -47,7 +49,7 @@ test = [
4749
source = "nodejs"
4850

4951
[tool.hatch.metadata.hooks.nodejs]
50-
fields = ["description", "authors", "urls"]
52+
fields = ["license", "description", "authors", "urls"]
5153

5254
[tool.hatch.build.targets.sdist]
5355
artifacts = ["jupyterlab_nvdashboard/labextension"]

0 commit comments

Comments
 (0)