plain.code 0.8.2__tar.gz → 0.9.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plain.code
3
- Version: 0.8.2
3
+ Version: 0.9.0
4
4
  Summary: Code formatting and linting for Plain.
5
5
  Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
6
6
  License-File: LICENSE
@@ -0,0 +1,23 @@
1
+ # plain-code changelog
2
+
3
+ ## [0.9.0](https://github.com/dropseed/plain/releases/plain-code@0.9.0) (2025-07-03)
4
+
5
+ ### What's changed
6
+
7
+ - Updated Biome integration to support the new **Biome 2** release. The download logic now uses the new `@biomejs/biome@<version>` tag format and the built-in default configuration has been modernised (`root: true`, `files.includes`, etc.) ([83fa906](https://github.com/dropseed/plain/commit/83fa906)).
8
+ - A progress bar is now displayed while the Biome binary is being downloaded so you can see the download progress in real time ([ec637aa](https://github.com/dropseed/plain/commit/ec637aa)).
9
+
10
+ ### Upgrade instructions
11
+
12
+ - If you have pinned a specific Biome version in your `pyproject.toml` under `[tool.plain.code.biome]`, make sure it is compatible with Biome 2 (for example, `version = "2.0.0"`). Otherwise, use `plain code update` to update to Biome 2.
13
+
14
+ ## [0.8.3](https://github.com/dropseed/plain/releases/plain-code@0.8.3) (2025-06-26)
15
+
16
+ ### What's changed
17
+
18
+ - Added this `CHANGELOG.md` file to start tracking changes for the `plain.code` package ([82710c3](https://github.com/dropseed/plain/commit/82710c3)).
19
+ - No functional changes were introduced in this release.
20
+
21
+ ### Upgrade instructions
22
+
23
+ - No changes required
@@ -6,6 +6,7 @@ import os
6
6
  import platform
7
7
  import subprocess
8
8
 
9
+ import click
9
10
  import requests
10
11
  import tomlkit
11
12
 
@@ -17,6 +18,8 @@ from plain.runtime import PLAIN_TEMP_PATH
17
18
  class Biome:
18
19
  """Download, install, and invoke the Biome CLI standalone binary."""
19
20
 
21
+ TAG_PREFIX = "@biomejs/biome@"
22
+
20
23
  @property
21
24
  def target_directory(self) -> str:
22
25
  # Directory under .plain to store the binary and lockfile
@@ -92,10 +95,8 @@ class Biome:
92
95
  # Build download URL based on version (tag: cli/vX.Y.Z) or latest
93
96
  slug = self.detect_platform_slug()
94
97
  if version:
95
- tag = version if version.startswith("v") else f"v{version}"
96
- release = f"cli/{tag}"
97
98
  url = (
98
- f"https://github.com/biomejs/biome/releases/download/{release}/"
99
+ f"https://github.com/biomejs/biome/releases/download/{self.TAG_PREFIX}{version}/"
99
100
  f"biome-{slug}"
100
101
  )
101
102
  else:
@@ -103,6 +104,7 @@ class Biome:
103
104
  f"https://github.com/biomejs/biome/releases/latest/download/"
104
105
  f"biome-{slug}"
105
106
  )
107
+
106
108
  resp = requests.get(url, stream=True)
107
109
  resp.raise_for_status()
108
110
 
@@ -111,9 +113,20 @@ class Biome:
111
113
  if not os.path.isdir(td):
112
114
  os.makedirs(td, exist_ok=True)
113
115
 
116
+ total = int(resp.headers.get("Content-Length", 0))
114
117
  with open(self.standalone_path, "wb") as f:
115
- for chunk in resp.iter_content(chunk_size=8192):
116
- f.write(chunk)
118
+ if total:
119
+ with click.progressbar(
120
+ length=total,
121
+ label="Downloading Biome",
122
+ width=0,
123
+ ) as bar:
124
+ for chunk in resp.iter_content(chunk_size=8192):
125
+ f.write(chunk)
126
+ bar.update(len(chunk))
127
+ else:
128
+ for chunk in resp.iter_content(chunk_size=8192):
129
+ f.write(chunk)
117
130
  os.chmod(self.standalone_path, 0o755)
118
131
 
119
132
  # Determine resolved version for lockfile
@@ -122,12 +135,11 @@ class Biome:
122
135
  else:
123
136
  resolved = ""
124
137
  if resp.history:
125
- # Look for redirect to tag cli/vX.Y.Z
138
+ # Look for redirect to actual tag version
126
139
  loc = resp.history[0].headers.get("Location", "")
127
- parts = loc.split("/")
128
- if "cli" in parts:
129
- idx = parts.index("cli")
130
- resolved = parts[idx + 1].lstrip("v")
140
+ if self.TAG_PREFIX in loc:
141
+ remaining = loc.split(self.TAG_PREFIX, 1)[-1]
142
+ resolved = remaining.split("/")[0]
131
143
 
132
144
  if not resolved:
133
145
  raise RuntimeError("Failed to determine resolved version from redirect")
@@ -1,16 +1,18 @@
1
1
  {
2
+ "root": true,
2
3
  "vcs": {
3
4
  "enabled": true,
4
5
  "clientKind": "git",
5
6
  "useIgnoreFile": true
6
7
  },
7
8
  "files": {
8
- "ignore": [
9
- "**/vendor/**",
10
- "**/*.min.*",
11
- "**/tests/**",
12
- "**/htmlcov/**",
13
- "**/.venv/**"
9
+ "includes": [
10
+ "**",
11
+ "!**/vendor/**",
12
+ "!**/*.min.*",
13
+ "!**/tests/**",
14
+ "!**/htmlcov/**",
15
+ "!**/.venv/**"
14
16
  ]
15
17
  },
16
18
  "formatter": {
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "plain.code"
3
- version = "0.8.2"
3
+ version = "0.9.0"
4
4
  description = "Code formatting and linting for Plain."
5
5
  authors = [{name = "Dave Gaeddert", email = "dave.gaeddert@dropseed.dev"}]
6
6
  readme = "README.md"
File without changes
File without changes
File without changes
File without changes