You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add PyPI distribution workflows
* More docs
* `cargo dist generate`
* Split apart `uv tool install` vs `uv tool run` advice
Now that I understand them more
* Add wheel documentation
* One liner
* CHANGELOG
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+45-9Lines changed: 45 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,21 +4,39 @@ Welcome! We really appreciate that you'd like to contribute to Air, thanks in ad
4
4
5
5
# Release process
6
6
7
-
The release process of Air has some manual steps. One complication is that for each release of the CLI binary, we create a new release of the VS Code / OpenVSX extension as this is our primary way of distributing Air. The version numbers between the CLI binary and the VS Code / OpenVSX extension will end up being different.
7
+
The release process of Air has some manual steps.
8
8
9
-
When you want to cut a release of the Air binary and Air VS Code / OpenVSX extension:
9
+
For each release of the CLI binary, we also create a release of:
10
+
11
+
- The air-formatter PyPI package (with the same version number)
12
+
13
+
- The VS Code and OpenVSX extension (with a different version number)
14
+
15
+
When you want to cut a release of Air:
10
16
11
17
- Create a release branch
12
18
13
-
- Polish `CHANGELOG.md`, bump the version and add a new `Development version` header (yep, right away - `cargo dist` is smart enough to ignore this header).
19
+
- Polish `CHANGELOG.md`
20
+
21
+
- Clean up any bullets that need reorganization
22
+
23
+
- Bump the `CHANGELOG.md` version
14
24
15
-
-Polish `editors/code/CHANGELOG.md`, bump the version and add a new `Development version` header.
25
+
- Add a new `Development version` header (yep, right away - `cargo dist` is smart enough to ignore this header)
16
26
17
-
- Mention that the new version of the binary is shipped with the extension.
27
+
- Polish `editors/code/CHANGELOG.md`
28
+
29
+
- Mention that the new version of the binary is shipped with the extension
30
+
31
+
- Bump the `CHANGELOG.md` version
32
+
33
+
- Add a new `Development version` header
18
34
19
35
- In `crates/air/Cargo.toml`, bump the version.
20
36
21
-
- Run `cargo check` to sync `Cargo.lock`, in case your LSP didn't do it already.
37
+
- Run `cargo check` to sync `Cargo.lock`, in case your LSP didn't do it already.
38
+
39
+
- In `python/pyproject.toml`, bump the version.
22
40
23
41
- In `editors/code/package.json`, bump the minor version to the next even number for standard releases, or to the next odd number for preview releases.
24
42
@@ -30,19 +48,23 @@ When you want to cut a release of the Air binary and Air VS Code / OpenVSX exten
30
48
31
49
- The release workflow will:
32
50
33
-
- Build the binaries and installer scripts.
51
+
- Build the Air binaries and installer scripts.
52
+
53
+
- Build the Python wheels from the Air binaries.
54
+
55
+
- Push the Python wheels to PyPI.
34
56
35
57
- Create and push a git tag for the version.
36
58
37
59
- Create a GitHub Release attached to that git tag.
38
60
39
-
- Attach the binaries and scripts to that GitHub Release as artifacts.
61
+
- Attach the binaries and installer scripts to that GitHub Release as artifacts.
40
62
41
63
- Manually run the [extension release workflow](https://github.com/posit-dev/air/actions/workflows/release-vscode.yml)
42
64
43
65
- It runs on `workflow_dispatch`, and automatically pulls in the latest release binary of Air from the binary release workflow above. It will release to both the VS Code marketplace and the OpenVSX marketplace.
44
66
45
-
- Bump the version of Air recorded in Positron's [`product.json`](https://github.com/posit-dev/positron/blob/main/product.json).
67
+
- Bump the version of Air recorded in Positron's [`product.json`](https://github.com/posit-dev/positron/blob/main/product.json) and do a PR to Positron.
46
68
47
69
- Merge the release branch
48
70
@@ -87,6 +109,20 @@ For a new release:
87
109
88
110
If you have any questions about the process, refer to [Zed's update guide](https://zed.dev/docs/extensions/developing-extensions#updating-an-extension).
89
111
112
+
# Python wheels
113
+
114
+
Python wheel creation and publishing is handled automatically at release time through `release.yml`. Here we document parts of that automated process.
115
+
116
+
The Python wheels we distribute have the sole purpose of shipping the Air binary. There is no Python code in the wheel, and we don't support `python -m air` (meaning there is no `__main__.py` entry point). We expect it is more likely used as `uvx --from air-formatter air format .` (for a one off run) or as `uv tool install air-formatter` (for a global install of `air` which is symlinked into `~/.local/bin`), neither of which go through the thin Python shim that `python -m air` would do. Instead, these just call the shipped air binary directly.
117
+
118
+
The scaffolding forthe Python package isin`python/`. We use `uv_build` as the build system, since it has nice support for the `scripts/` directory, which is where we put the Air binary for distribution.
119
+
120
+
In CI, `build-wheels.yml` runs as part of `build.yml`, which itself is called via cargo-dist's `release.yml`. `build-wheels.yml` collects the binaries from the other build steps and builds a per-platform wheel that puts the platform specific binary into `scripts/`. In `pyproject.toml`, we've set`[tool.uv.build-backend.data]` so that `uv_build` knows to copy over `scripts/` into the resulting wheel at build time. We then run `uv build` to build a generic "any" wheel without a specific platform, however, because there is a platform specific binary in there we really need it to be tagged with a specific platform. So we have to retag it with the known platform tag as a follow up. These platform tags tell PyPI how to deliver the right wheel when the user requests `air-formatter`.
121
+
122
+
Later on in`release.yml`, the `publish-pypi.yml` job runs at publish time. It collects the wheels and uses `uv publish` to send them off to PyPI. This is a specially named job! It uses PyPI's Trusted Publishing so that we don't need any tokens. Instead, on Davis's PyPI account we have told PyPI to expect that `posit-dev/air` has a `publish-pypi.yml` workflow with a `environment: pypi` GitHub Environment set up, and when binaries are pushed from that source, PyPI will accept them without any additional tokens.
123
+
124
+
If you're testing the Python wheel generation locally, use `just build-wheel` to build the wheel, and `just run-wheel <air args>` to run it. This will build release Air, copy it into `scripts/`, build the "any" wheel (which is correct for you, since you just built Air), and then`run-wheel` will run it with `uv tool run`.
125
+
90
126
# VS Code Extension development installation
91
127
92
128
- Build the development version of the Air CLI with:
0 commit comments