Skip to content

Commit 951e3b4

Browse files
committed
Log when there is no npm token
1 parent 36ac20f commit 951e3b4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

jupyter_releaser/npm.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""npm-related utilities."""
2+
23
# Copyright (c) Jupyter Development Team.
34
# Distributed under the terms of the Modified BSD License.
45
import json
@@ -153,6 +154,8 @@ def handle_npm_config(npm_token):
153154
short_reg = registry.replace("https://", "//")
154155
short_reg = short_reg.replace("http://", "//")
155156
auth_entry = f"{short_reg}:_authToken={npm_token}"
157+
else:
158+
util.log("No NPM_TOKEN provided, will attempt to use npm Trusted Publishers if configured")
156159

157160
# Handle existing config
158161
if npmrc.exists():
@@ -182,13 +185,13 @@ def get_package_versions(version):
182185
npm_version = data.get("version", "")
183186
if npm_version != version:
184187
message += f"\nPython version: {version}"
185-
message += f'\nnpm version: {data["name"]}: {npm_version}'
188+
message += f"\nnpm version: {data['name']}: {npm_version}"
186189
if "workspaces" in data:
187190
message += "\nnpm workspace versions:"
188191
for path in _get_workspace_packages(data):
189192
text = path.joinpath("package.json").read_text(encoding="utf-8")
190193
data = json.loads(text)
191-
message += f'\n{data["name"]}: {data.get("version", "")}'
194+
message += f"\n{data['name']}: {data.get('version', '')}"
192195
return message
193196

194197

0 commit comments

Comments
 (0)