rlsbl 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rlsbl",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Release orchestration and project scaffolding for npm and PyPI",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -47,10 +47,12 @@ def _parse_next_link(headers):
47
47
  return None
48
48
  for part in link.split(","):
49
49
  if 'rel="next"' in part:
50
- # Extract URL between < and >
51
50
  start = part.index("<") + 1
52
51
  end = part.index(">")
53
- return part[start:end]
52
+ url = part[start:end]
53
+ if not url.startswith("https://api.github.com/"):
54
+ return None
55
+ return url
54
56
  return None
55
57
 
56
58
 
@@ -480,7 +480,7 @@ def run_cmd_multi(registries_list, args, flags):
480
480
 
481
481
  # Process merged publish workflow template
482
482
  merged_tpl_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)),
483
- "..", "templates", "merged")
483
+ "templates", "merged")
484
484
  merged_created, merged_skipped, merged_warnings, merged_hashes = process_mappings(
485
485
  merged_tpl_dir,
486
486
  [{"template": "publish.yml.tpl", "target": ".github/workflows/publish.yml"}],
@@ -210,6 +210,18 @@ def run_cmd(registry, args, flags):
210
210
  except Exception:
211
211
  pass
212
212
 
213
+ # Update .rlsbl/version marker so it's included in the release commit
214
+ rlsbl_version_marker = os.path.join(".rlsbl", "version")
215
+ if os.path.exists(os.path.dirname(rlsbl_version_marker)):
216
+ try:
217
+ from .. import __version__ as rlsbl_ver
218
+ with open(rlsbl_version_marker, "w") as f:
219
+ f.write(rlsbl_ver + "\n")
220
+ if rlsbl_version_marker not in files_to_commit:
221
+ files_to_commit.append(rlsbl_version_marker)
222
+ except Exception:
223
+ pass
224
+
213
225
  # Commit if anything was actually modified (version bump or tagging)
214
226
  needs_commit = new_version != current_version or not is_clean_tree()
215
227
  if files_to_commit and needs_commit:
@@ -2,12 +2,20 @@
2
2
 
3
3
  import sys
4
4
 
5
- from ..utils import run, check_gh_installed, check_gh_auth, get_push_timeout
5
+ from ..utils import run, check_gh_installed, check_gh_auth, get_push_timeout, is_clean_tree
6
6
 
7
7
 
8
8
  def run_cmd(registry, args, flags):
9
- check_gh_installed()
10
- check_gh_auth()
9
+ if not check_gh_installed():
10
+ print("Error: gh CLI is not installed.", file=sys.stderr)
11
+ sys.exit(1)
12
+ if not check_gh_auth():
13
+ print("Error: gh CLI is not authenticated.", file=sys.stderr)
14
+ sys.exit(1)
15
+
16
+ if not is_clean_tree():
17
+ print("Error: working tree is not clean. Commit your changes first.", file=sys.stderr)
18
+ sys.exit(1)
11
19
 
12
20
  # Find the latest tag
13
21
  try:
@@ -39,12 +39,12 @@ def get_version_file():
39
39
 
40
40
  def get_template_dir():
41
41
  """Returns path to the go-specific template directory."""
42
- return os.path.join(os.path.dirname(__file__), "..", "..", "templates", "go")
42
+ return os.path.join(os.path.dirname(__file__), "..", "templates", "go")
43
43
 
44
44
 
45
45
  def get_shared_template_dir():
46
46
  """Returns path to the shared template directory."""
47
- return os.path.join(os.path.dirname(__file__), "..", "..", "templates", "shared")
47
+ return os.path.join(os.path.dirname(__file__), "..", "templates", "shared")
48
48
 
49
49
 
50
50
  def get_template_vars(dir_path):
@@ -32,7 +32,7 @@ def write_version(dir_path, version):
32
32
 
33
33
  # Preserve trailing newline if present
34
34
  trailing_newline = "\n" if raw.endswith("\n") else ""
35
- output = json.dumps(pkg, indent=indent) + trailing_newline
35
+ output = json.dumps(pkg, indent=indent, ensure_ascii=False) + trailing_newline
36
36
  # Atomic write: write to temp file, then rename
37
37
  tmp_path = pkg_path + ".tmp"
38
38
  with open(tmp_path, "w", encoding="utf-8") as f:
@@ -47,12 +47,12 @@ def get_version_file():
47
47
 
48
48
  def get_template_dir():
49
49
  """Returns path to the npm-specific template directory."""
50
- return os.path.join(os.path.dirname(__file__), "..", "..", "templates", "npm")
50
+ return os.path.join(os.path.dirname(__file__), "..", "templates", "npm")
51
51
 
52
52
 
53
53
  def get_shared_template_dir():
54
54
  """Returns path to the shared template directory."""
55
- return os.path.join(os.path.dirname(__file__), "..", "..", "templates", "shared")
55
+ return os.path.join(os.path.dirname(__file__), "..", "templates", "shared")
56
56
 
57
57
 
58
58
  def get_template_vars(dir_path):
@@ -67,12 +67,12 @@ def get_version_file():
67
67
 
68
68
  def get_template_dir():
69
69
  """Returns path to the pypi-specific template directory."""
70
- return os.path.join(os.path.dirname(__file__), "..", "..", "templates", "pypi")
70
+ return os.path.join(os.path.dirname(__file__), "..", "templates", "pypi")
71
71
 
72
72
 
73
73
  def get_shared_template_dir():
74
74
  """Returns path to the shared template directory."""
75
- return os.path.join(os.path.dirname(__file__), "..", "..", "templates", "shared")
75
+ return os.path.join(os.path.dirname(__file__), "..", "templates", "shared")
76
76
 
77
77
 
78
78
  def get_template_vars(dir_path):
package/rlsbl/tagging.py CHANGED
@@ -32,7 +32,7 @@ def ensure_npm_keyword(dir_path=".", quiet=False):
32
32
 
33
33
  # Preserve trailing newline if present
34
34
  trailing_newline = "\n" if raw.endswith("\n") else ""
35
- output = json.dumps(pkg, indent=indent) + trailing_newline
35
+ output = json.dumps(pkg, indent=indent, ensure_ascii=False) + trailing_newline
36
36
 
37
37
  # Atomic write: write to temp file, then rename
38
38
  tmp_path = pkg_path + ".tmp"
@@ -82,11 +82,16 @@ def ensure_pypi_keyword(dir_path=".", quiet=False):
82
82
  # Find the indent used for existing items
83
83
  item_indent_match = re.search(r'\n( +)"', array_content)
84
84
  item_indent = item_indent_match.group(1) if item_indent_match else " "
85
- new_array_content = array_content.rstrip() + f',\n{item_indent}"rlsbl"\n'
85
+ # Strip trailing comma to avoid double comma when the list
86
+ # already has a trailing comma before the closing bracket
87
+ stripped = array_content.rstrip()
88
+ stripped = stripped.rstrip(",")
89
+ new_array_content = stripped + f',\n{item_indent}"rlsbl"\n'
86
90
  else:
87
91
  # Single-line
88
92
  if array_content.strip():
89
- new_array_content = array_content.rstrip() + ', "rlsbl"'
93
+ stripped_sl = array_content.rstrip().rstrip(",")
94
+ new_array_content = stripped_sl + ', "rlsbl"'
90
95
  else:
91
96
  new_array_content = '"rlsbl"'
92
97
  new_field = prefix + new_array_content + "]"
@@ -8,15 +8,19 @@ set -euo pipefail
8
8
  echo "Running pre-release checks..."
9
9
 
10
10
  if [ -f go.mod ]; then
11
- echo "Detected Go project"
11
+ echo " Go: vet + build + test"
12
12
  go vet ./...
13
13
  go build ./...
14
14
  go test ./... -race -short -count=1
15
- elif [ -f package.json ]; then
16
- echo "Detected npm project"
15
+ fi
16
+
17
+ if [ -f package.json ] && node -e "process.exit(require('./package.json').scripts?.test ? 0 : 1)" 2>/dev/null; then
18
+ echo " npm: test"
17
19
  npm test
18
- elif [ -f pyproject.toml ]; then
19
- echo "Detected Python project"
20
+ fi
21
+
22
+ if [ -f pyproject.toml ]; then
23
+ echo " Python: pytest"
20
24
  if command -v uv &>/dev/null; then
21
25
  uv run pytest
22
26
  elif command -v pytest &>/dev/null; then
File without changes
File without changes
File without changes
File without changes