Skip to content

Commit 1c716bb

Browse files
docs: fix factual errors, inconsistencies, and typos in the guide (#800)
* fix(docs): correct factual errors and inconsistencies in guide - packaging tutorial: fix wrong Snell's law output value - pytest guide: fix inverted skipif condition, strict-markers describes markers not fixtures, add missing assert in approx example - packaging-simple: requires-python upper-cap check is PP004, not PY004 - packaging-compiled: "pure Python project" link pointed at itself - gha-basic: step output reference missing .outputs. - gha-wheels: fix mis-indented pull_request trigger; test-groups not test-extras - tasks: fix broken hatch URL (pypa, not pypi) - style: fix flake8-print URL and stray ) in Ruff v2 badge - docs: fix corner example link (pointed at astropy) - data-files: unify peak_spacings directory name - test tutorial: align dir tree and pytest output with snell example, drop incorrect Arrange-Act-Assert reference Assisted-by: ClaudeCode:claude-opus-4.8 * docs: fix typos and grammar across the guide - index: repair broken intro sentence - guides/index: "on for" -> "one for" - packaging-simple: "you you use" - coverage: dangling "either with" - gha-pure: complete trailing sentence about publish guard - docs: "snipits" -> "snippets", reframe "Popular frameworks" note, fix stale linkcheck-handler prose - mypy: add self to Protocol/impl methods - backports: importlib.metadata, tomli_w, tzdata - design: "One alternative is to replace" - testing: venerable, autospec=True, numpy ndarray - tutorials/docs: fix {toctree} fence and "interoperate" * style: pre-commit fixes * chore: remove commented CLAUDE file Signed-off-by: Henry Schreiner <henryfs@princeton.edu> --------- Assisted-by: ClaudeCode:claude-opus-4.8 Signed-off-by: Henry Schreiner <henryfs@princeton.edu> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 917daa6 commit 1c716bb

21 files changed

Lines changed: 59 additions & 56 deletions

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,7 @@ Thumbs.db
183183
# Common editor files
184184
*~
185185
*.swp
186+
187+
# Symlink to AGENTS.md
188+
CLAUDE.md
189+
.claude/

docs/pages/guides/coverage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ your jobs and combine them into one `.coverage` file before running
137137

138138
##### Manually combining coverage
139139

140-
If you are running in parallel, either with `pytest-xdist`, you can set
140+
If you are running in parallel, such as with `pytest-xdist`, you can set
141141
`run.parallel` to `true`, which will add a unique suffix to the coverage file(s)
142142
produced. If you are using the multiprocessing patch, that also will generate a
143143
unique suffix for each process launch.

docs/pages/guides/docs.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ the same format used by GitHub, Wikipedia, and others. This guide covers Sphinx
1010
and Mkdocs, and uses the modern MyST plugin to get Markdown support.
1111

1212
:::{note} Popular frameworks
13-
There are other frameworks as well; these often are simpler, but are not as
14-
commonly used, and have somewhat fewer examples and plugins. They are:
13+
The two frameworks covered in this guide are the most commonly used in the
14+
scientific Python community. The main options are:
1515

1616
- [Sphinx](https://www.sphinx-doc.org/en/master/): A popular documentation
1717
framework for scientific libraries with a history of close usage with
1818
scientific tools like LaTeX. Examples include
1919
[astropy](https://docs.astropy.org/en/stable/index_user_docs.html) and
20-
[corner](https://docs.astropy.org/en/stable/index_user_docs.html).
20+
[corner](https://corner.readthedocs.io).
2121
- [MkDocs](https://www.mkdocs.org): A from-scratch new documentation system
2222
based on markdown and HTML. Less support for man pages & PDFs than Sphinx,
2323
since it doesn't use docutils. Has over
@@ -197,7 +197,7 @@ several good extensions:
197197
- [`sphinx.ext.napoleon`][] adds support for several common documentation styles
198198
like numpydoc.
199199
- `sphinx_autodoc_typehints` handles type hints
200-
- `sphinx_copybutton` adds a handle little copy button to code snipits.
200+
- `sphinx_copybutton` adds a handy little copy button to code snippets.
201201

202202
We are including both possible file extensions. We are also avoiding some common
203203
file patterns, just in case.
@@ -602,9 +602,9 @@ some conditional installs based on arguments (sphinx-autobuild is only needed if
602602
serving). It does an editable install of your package so that you can skip the
603603
install steps with `-R` and still get updated documentation.
604604

605-
Then there's a dedicated handler for the 'linkcheck' builder, which just checks
606-
links, and doesn't really produce output. Finally, we collect some useful args,
607-
and run either the autobuild (for `--serve`) or regular build. We could have
605+
The `-b` argument selects the builder, so you can pass `-b linkcheck` to just
606+
check links, for example. Finally, we collect some useful args, and run either
607+
the autobuild (when interactive) or a regular build. We could have
608608
just added `python -m http.server` pointing at the built documentation, but
609609
autobuild will rebuild if you change a file while serving.
610610
:::

docs/pages/guides/gha_basic.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,9 @@ actions have outputs, and bash actions can manually write to output:
226226
```
227227

228228
You can now refer to this step in a later step with
229-
`${{ steps.someid.something }}`. You also can get it from another job by using
230-
`${{ needs.<jobname>.outputs.something }}`. The `toJson()` function is useful
231-
for inputting JSON - you can even generate matrices dynamically this way!
229+
`${{ steps.someid.outputs.something }}`. You also can get it from another job by
230+
using `${{ needs.<jobname>.outputs.something }}`. The `toJson()` function is
231+
useful for inputting JSON - you can even generate matrices dynamically this way!
232232

233233
#### Pretty output
234234

docs/pages/guides/gha_pure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
This will run when you manually trigger a build ([`workflow_dispatch`][]), or
4747
when you publish a release. Later, we will make sure that the actual publish
4848
step requires the event to be a publish event, so that manual triggers (and
49-
branches/PRs, if those are enabled).
49+
branches/PRs, if those are enabled) do not publish to PyPI.
5050

5151
If you want tags instead of releases, you can add the `on: push: tags: "v*"` key
5252
instead of the releases - however, _please_ remember to make a GitHub release of

docs/pages/guides/gha_wheels.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ on:
2424
release:
2525
types:
2626
- published
27-
pull_request:
28-
paths:
29-
- .github/workflows/cd.yml
27+
pull_request:
28+
paths:
29+
- .github/workflows/cd.yml
3030
```
3131
3232
This will run on releases. If you use a develop branch, you could include
@@ -55,7 +55,7 @@ build-verbosity = 1
5555
```
5656

5757
The build frontend is set to `build[uv]`, which is faster than the default build
58-
backend; you just need uv installed, but that's easy to do. The `test-extras`
58+
backend; you just need uv installed, but that's easy to do. The `test-groups`
5959
will cause the pip install to use the dependency-group(s) specified. The
6060
`test-command` will use pytest to run your tests. You can also set the build
6161
verbosity (`-v` in pip) if you want to.

docs/pages/guides/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ which should help in ensuring a consistent developer and user experience when
1919
working with distribution.
2020

2121
A section on CI follows, with a [general setup guide][gha_basic], and then two
22-
choices for using CI to distribute your package, on for [pure Python][gha_pure],
23-
and one for [compiled extensions][gha_wheels]. You can read about setting up
24-
good tests on the [pytest page][pytest], with [coverage][]. There's also a page
25-
on setting up [docs][], as well.
22+
choices for using CI to distribute your package, one for
23+
[pure Python][gha_pure], and one for [compiled extensions][gha_wheels]. You can
24+
read about setting up good tests on the [pytest page][pytest], with
25+
[coverage][]. There's also a page on setting up [docs][], as well.
2626

2727
:::{tip} New project template
2828
Once you have completed the guidelines, there is a

docs/pages/guides/mypy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ from typing import Protocol
127127

128128

129129
class Duck(Protocol):
130-
def quack() -> str: ...
130+
def quack(self) -> str: ...
131131
```
132132

133133
Now any object that can "quack" (and return a string) is a Duck. We can even add
@@ -145,7 +145,7 @@ we can write a duck implementation and test it like this:
145145

146146
```python
147147
class MyDuck:
148-
def quack() -> str:
148+
def quack(self) -> str:
149149
return "quack"
150150
```
151151

docs/pages/guides/packaging_compiled.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The most exciting developments have been new native build backends:
4444

4545
:::{note}
4646
You should be familiar with [packing a pure Python
47-
project](pages/guides/packaging-compiled) - the metadata
47+
project](pages/guides/packaging-simple) - the metadata
4848
configuration is the same.
4949
:::
5050
There are also classic setuptools plugins:

docs/pages/guides/packaging_simple.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ build-backend = "setuptools.build_meta"
9494
```
9595

9696
For `requires-python`, you should specify the minimum you require, and you
97-
should not put an upper cap on it {rr}`PY004`, as this field is used to
97+
should not put an upper cap on it {rr}`PP004`, as this field is used to
9898
back-solve for old package versions that pass this check, allowing you to safely
9999
drop Python versions.
100100

@@ -109,7 +109,7 @@ the installed version - this obviously tends to break if you build parts of the
109109
library or if you access package metadata.
110110

111111
This sadly is not part of the standard metadata in `[project]`, so it depends on
112-
what backend you you use. Hatchling, Flit, PDM, and setuptools use automatic
112+
what backend you use. Hatchling, Flit, PDM, and setuptools use automatic
113113
detection.
114114

115115
If you don't match your package name and import name (which you should except

0 commit comments

Comments
 (0)