Skip to content

Commit c8b24db

Browse files
authored
Merge pull request #198 from asmeurer/dev-docs-updates
Some updates to the dev docs
2 parents 7d3c73c + 720fa06 commit c8b24db

File tree

4 files changed

+119
-41
lines changed

4 files changed

+119
-41
lines changed

docs/_static/custom.css

+14
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,17 @@ body {
1010
html {
1111
scroll-behavior: auto;
1212
}
13+
14+
/* Make checkboxes from the tasklist extension ('- [ ]' in Markdown) not add bullet points to the checkboxes.
15+
16+
This can be removed once https://github.com/executablebooks/mdit-py-plugins/issues/59 is addressed.
17+
*/
18+
19+
.contains-task-list {
20+
list-style: none;
21+
}
22+
23+
/* Make the checkboxes indented like they are bullets */
24+
.task-list-item-checkbox {
25+
margin: 0 0.2em 0.25em -1.4em;
26+
}

docs/conf.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
templates_path = ['_templates']
3939
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
4040

41-
myst_enable_extensions = ["dollarmath", "linkify"]
41+
myst_enable_extensions = ["dollarmath", "linkify", "tasklist"]
42+
myst_enable_checkboxes = True
4243

4344
napoleon_use_rtype = False
4445
napoleon_use_param = False

docs/dev/implementation-notes.md

+14
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,17 @@ identical PyTorch uses a similar layout in `array_api_compat/torch/`, but it
4747
differs enough from NumPy/CuPy that very few common wrappers for those
4848
libraries are reused. Dask is close to NumPy in behavior and so most Dask
4949
functions also reuse the NumPy/CuPy common wrappers.
50+
51+
Occasionally, a wrapper implementation will need to reference another wrapper
52+
implementation, rather than the base `xp` version. The easiest way to do this
53+
is to call `array_namespace`, like
54+
55+
```py
56+
wrapped_xp = array_namespace(x)
57+
wrapped_xp.wrapped_func(...)
58+
```
59+
60+
Also, if there is a very minor difference required for wrapping, say, CuPy and
61+
NumPy, they can still use a common implementation in `common/_aliases.py` and
62+
use the `is_*_namespace()` or `is_*_function()` [helper
63+
functions](../helper-functions.rst) to branch as necessary.

docs/dev/releasing.md

+89-40
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,108 @@
11
# Releasing
22

3-
To release, first make sure that all CI tests are passing on `main`.
3+
- [ ] **Create a PR with a release branch**
44

5-
Note that CuPy must be tested manually (it isn't tested on CI). Use the script
5+
This makes it easy to verify that CI is passing, and also gives you a place
6+
to push up updates to the changelog and any last minute fixes for the
7+
release.
68

7-
```
8-
./test_cupy.sh
9-
```
9+
- [ ] **Double check the release branch is fully merged with `main`.**
1010

11-
on a machine with a CUDA GPU.
11+
(e.g., if the release branch is called `release`)
1212

13-
Once you are ready to release, create a PR with a release branch, so that you
14-
can verify that CI is passing. You must edit
13+
```
14+
git checkout main
15+
git pull
16+
git checkout release
17+
git merge main
18+
```
1519

16-
```
17-
array_api_compat/__init__.py
18-
```
20+
- [ ] **Make sure that all CI tests are passing.**
1921

20-
and update the version (the version is not computed from the tag because that
21-
would break vendorability). You should also edit
22+
Note that the GitHub action that publishes to PyPI does not check if CI is
23+
passing before publishing. So you need to check this manually.
2224

23-
```
24-
docs/changelog.md
25-
```
25+
This does mean you can ignore CI failures, but ideally you should fix any
26+
failures or update the `*-xfails.txt` files before tagging, so that CI and
27+
the CuPy tests fully pass. Otherwise it will be hard to tell what things are
28+
breaking in the future. It's also a good idea to remove any xpasses from
29+
those files (but be aware that some xfails are from flaky failures, so
30+
unless you know the underlying issue has been fixed, an xpass test is
31+
probably still xfail).
2632

27-
with the changes for the release.
33+
- [ ] **Test CuPy.**
2834

29-
Once everything is ready, create a tag
35+
CuPy must be tested manually (it isn't tested on CI, see
36+
https://github.com/data-apis/array-api-compat/issues/197). Use the script
3037

31-
```
32-
git tag -a <version>
33-
```
38+
```
39+
./test_cupy.sh
40+
```
3441

35-
(note the tag names are not prefixed, for instance, the tag for version 1.5 is
36-
just `1.5`)
42+
on a machine with a CUDA GPU.
3743

38-
and push it to GitHub
3944

40-
```
41-
git push origin <version>
42-
```
45+
- [ ] **Update the version.**
4346

44-
Check that the `publish distributions` action on the tag build works. Note
45-
that this action will run even if the other CI fails, so you must make sure
46-
that CI is passing *before* tagging.
47+
You must edit
4748

48-
This does mean you can ignore CI failures, but ideally you should fix any
49-
failures or update the `*-xfails.txt` files before tagging, so that CI and the
50-
cupy tests pass. Otherwise it will be hard to tell what things are breaking in
51-
the future. It's also a good idea to remove any xpasses from those files (but
52-
be aware that some xfails are from flaky failures, so unless you know the
53-
underlying issue has been fixed, an xpass test is probably still xfail).
49+
```
50+
array_api_compat/__init__.py
51+
```
5452

55-
If the publish action fails for some reason and didn't upload the release to
56-
PyPI, you will need to delete the tag and try again.
53+
and update the version (the version is not computed from the tag because
54+
that would break vendorability).
5755

58-
After the PyPI package is published, the conda-forge bot should update the
59-
feedstock automatically.
56+
- [ ] **Update the [changelog](../changelog.md).**
57+
58+
Edit
59+
60+
```
61+
docs/changelog.md
62+
```
63+
64+
with the changes for the release.
65+
66+
- [ ] **Create the release tag.**
67+
68+
Once everything is ready, create a tag
69+
70+
```
71+
git tag -a <version>
72+
```
73+
74+
(note the tag names are not prefixed, for instance, the tag for version 1.5 is
75+
just `1.5`)
76+
77+
- [ ] **Push the tag to GitHub.**
78+
79+
*This is the final step. Doing this will build and publish the release!*
80+
81+
```
82+
git push origin <version>
83+
```
84+
85+
This will trigger the [`publish
86+
distributions`](https://github.com/data-apis/array-api-compat/actions/workflows/publish-package.yml)
87+
GitHub Action that will build the release and push it to PyPI.
88+
89+
- [ ] **Check that the [`publish
90+
distributions`](https://github.com/data-apis/array-api-compat/actions/workflows/publish-package.yml)
91+
action build on the tag worked.** Note that this action will run even if the
92+
other CI fails, so you must make sure that CI is passing *before* tagging.
93+
94+
If it failed for some reason, you may need to delete the tag and try again.
95+
96+
- [ ] **Merge the release branch.**
97+
98+
This way any changes you made in the branch, such as updates to the
99+
changelog or xfails files, are updated in `main`. This will also make the
100+
docs update (the docs are published automatically from the sources on
101+
`main`).
102+
103+
- [ ] **Update conda-forge.**
104+
105+
After the PyPI package is published, the conda-forge bot should update the
106+
feedstock automatically after some time. The bot should automerge, so in
107+
most cases you don't need to do anything here, unless some metadata on the
108+
feedstock needs to be updated.

0 commit comments

Comments
 (0)