Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ repos:
name: Disallow improper capitalization
language: pygrep
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest|RST|PyLint
exclude: (.pre-commit-config.yaml|docs/pages/guides/style\.md)$
exclude: (.pre-commit-config.yaml|docs/guides/style\.md)$
- id: disallow-words
name: Disallow certain words
language: pygrep
Expand All @@ -101,5 +101,5 @@ repos:
name: Cog the pages
language: python
entry: cog -P -r -I ./helpers
files: "^docs/pages/guides/(packaging_compiled|docs|tasks|gha_basic).md|^copier.yml|^docs/_partials/pyproject.md"
files: "^docs/guides/(packaging_compiled|docs|tasks|gha_basic).md|^copier.yml|^docs/_partials/pyproject.md"
additional_dependencies: [cogapp, cookiecutter, tomlkit]
3 changes: 2 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ bundle install
bundle exec jekyll serve --livereload
```

The pages are in markdown in `pages/`. Images and data files are in `assets/`.
The pages are in markdown, in the `guides/`, `tutorials/`, `principles/`, and
`patterns/` folders. Images and data files are in `assets/`.

To bump versions, use nox. You can run `nox -s pc_bump` to bump the pre-commit
versions, and `nox -s gha_bump` to bump the GitHub Actions versions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ reasons that a wheel is better than only providing an sdist:
is going to go
:::

[on the next page]: pages/guides/gha-wheels
[on the next page]: guides/gha-wheels

## Job setup

Expand Down
File renamed without changes.
26 changes: 13 additions & 13 deletions docs/pages/guides/index.md β†’ docs/guides/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ your repository with the guidelines, runnable [right in the guide][] via
WebAssembly! All checks point to a linked badge in the guide.
:::

[tutorials]: pages/tutorials/index
[style]: pages/guides/style
[mypy]: pages/guides/mypy
[docs]: pages/guides/docs
[simple packaging]: pages/guides/packaging-simple
[compiled packaging]: pages/guides/packaging-compiled
[classic packaging]: pages/guides/packaging-classic
[coverage]: pages/guides/coverage
[gha_basic]: pages/guides/gha-basic
[gha_pure]: pages/guides/gha-pure
[gha_wheels]: pages/guides/gha-wheels
[pytest]: pages/guides/pytest
[right in the guide]: pages/guides/repo-review
[tutorials]: tutorials/index
[style]: guides/style
[mypy]: guides/mypy
[docs]: guides/docs
[simple packaging]: guides/packaging-simple
[compiled packaging]: guides/packaging-compiled
[classic packaging]: guides/packaging-classic
[coverage]: guides/coverage
[gha_basic]: guides/gha-basic
[gha_pure]: guides/gha-pure
[gha_wheels]: guides/gha-wheels
[pytest]: guides/pytest
[right in the guide]: guides/repo-review

[cookiecutter]: https://cookiecutter.readthedocs.io
[copier]: https://copier.readthedocs.io
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/guides/mypy.md β†’ docs/guides/mypy.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ everything. Try to turn on as much as possible, and increase it until you can
run with full `strict` checking. See the [style page][] for configuration
suggestions.

[style page]: pages/guides/style
[style page]: guides/style

For a library to support typing, it has to a) add types using any of the three
methods, and b) add a `py.typed` empty file to indicate that it's okay to look
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ outlined as well.
There are several popular packaging systems. This guide covers the old
configuration style for [Setuptools][]. Unless you really need it, you should be
using the modern style described in [Simple
Packaging](pages/guides/packaging-simple). The modern style is
Packaging](guides/packaging-simple). The modern style is
guided by Python Enhancement Proposals (PEPs), and is more stable than the
setuptools-specific mechanisms that evolve over the years. This page is kept to
help users with legacy code (and hopefully upgrade it).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The most exciting developments have been new native build backends:

:::{note}
You should be familiar with [packing a pure Python
project](pages/guides/packaging-simple) - the metadata
project](guides/packaging-simple) - the metadata
configuration is the same.
:::
There are also classic setuptools plugins:
Expand Down Expand Up @@ -112,7 +112,7 @@ build-backend = "maturin"
:::
::::

```{include} ../../_partials/pyproject.md
```{include} ../_partials/pyproject.md
```

## Tool section in pyproject.toml
Expand Down Expand Up @@ -453,4 +453,4 @@ it is free-threaded. 3.13.5 was rushed out to fix it.
[meson-python]: https://meson-python.readthedocs.io
[setuptools-rust]: https://setuptools-rust.readthedocs.io/en/latest/
[maturin]: https://www.maturin.rs
[gha_wheels]: pages/guides/gha-wheels
[gha_wheels]: guides/gha-wheels
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ build-backend = "setuptools.build_meta"
:::
::::

```{include} ../../_partials/pyproject.md
```{include} ../_partials/pyproject.md
```

For `requires-python`, you should specify the minimum you require, and you
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/pages/guides/style.md β†’ docs/guides/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ and `ignore-without-code` {rr}`MY104`, `redundant-expr` {rr}`MY105`, and
checks) and have to be ignored occasionally, but can find some significant logic
errors in your typing.

[mypy page]: pages/guides/mypy
[mypy page]: guides/mypy

## Setuptools specific checks

Expand Down
File renamed without changes.
24 changes: 12 additions & 12 deletions docs/pages/index.md β†’ docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ fellow scientists and research software engineers.
Jupyter notebooks that are becoming unwieldy? Are changes to some parts of your
code accidentally breaking other parts of your code? Do you want to present them
in a more maintainable, reusable, and shareable form? Start at the
[tutorial](pages/tutorials/index).
[tutorial](tutorials/index).

**Learn recommended tools and best practices.**
[Topical guides](pages/guides/index) provide task-based instruction on topics
[Topical guides](guides/index) provide task-based instruction on topics
that scientists and research software engineers may encounter as their projects
evolve and grow. This covers modern packaging ([simple][] or [compiled][]),
[style checking][], [testing][], [documentation][], [static typing][], [CI][],
Expand All @@ -35,12 +35,12 @@ WebAssembly! All checks point to a linked badge in the guide.
:::

**Learn to write better research code.** A high-level document on
[principles](pages/principles/index) provides advice based on the
[principles](principles/index) provides advice based on the
community's collective experience building code that is easier for researchers
to use successfully and easier to maintain over time.

**Use our solutions for common tasks.** A growing collection of
[patterns](pages/patterns/index) provides tested approaches for
[patterns](patterns/index) provides tested approaches for
tasks and can be tricky to get exactly right, such as including data files with
Python packages.

Expand Down Expand Up @@ -75,14 +75,14 @@ with many updates. Improved support for compiled components supported in part
by NSF grant [OAC-2209877][].
:::

[simple]: pages/guides/packaging-simple
[compiled]: pages/guides/packaging-compiled
[style checking]: pages/guides/style
[testing]: pages/guides/pytest
[documentation]: pages/guides/docs
[static typing]: pages/guides/mypy
[ci]: pages/guides/gha-pure
[right in the guide]: pages/guides/repo-review
[simple]: guides/packaging-simple
[compiled]: guides/packaging-compiled
[style checking]: guides/style
[testing]: guides/pytest
[documentation]: guides/docs
[static typing]: guides/mypy
[ci]: guides/gha-pure
[right in the guide]: guides/repo-review

[scientific-python/cookie]: https://github.com/scientific-python/cookie
[repo-review]: https://repo-review.readthedocs.io
Expand Down
58 changes: 29 additions & 29 deletions docs/myst.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,39 @@ project:
- rr-role.mjs

toc:
- file: pages/index.md
- file: pages/tutorials/index.md
- file: index.md
- file: tutorials/index.md
children:
- file: pages/tutorials/dev-environment.md
- file: pages/tutorials/module.md
- file: pages/tutorials/packaging.md
- file: pages/tutorials/test.md
- file: pages/tutorials/docs.md
- file: pages/guides/index.md
- file: tutorials/dev-environment.md
- file: tutorials/module.md
- file: tutorials/packaging.md
- file: tutorials/test.md
- file: tutorials/docs.md
- file: guides/index.md
children:
- file: pages/guides/pytest.md
- file: pages/guides/coverage.md
- file: pages/guides/docs.md
- file: pages/guides/packaging_simple.md
- file: pages/guides/packaging_compiled.md
- file: pages/guides/packaging_classic.md
- file: pages/guides/style.md
- file: pages/guides/mypy.md
- file: pages/guides/gha_basic.md
- file: pages/guides/gha_pure.md
- file: pages/guides/gha_wheels.md
- file: pages/guides/tasks.md
- file: pages/principles/index.md
- file: guides/pytest.md
- file: guides/coverage.md
- file: guides/docs.md
- file: guides/packaging_simple.md
- file: guides/packaging_compiled.md
- file: guides/packaging_classic.md
- file: guides/style.md
- file: guides/mypy.md
- file: guides/gha_basic.md
- file: guides/gha_pure.md
- file: guides/gha_wheels.md
- file: guides/tasks.md
- file: principles/index.md
children:
- file: pages/principles/process.md
- file: pages/principles/design.md
- file: pages/principles/testing.md
- file: pages/patterns/index.md
- file: principles/process.md
- file: principles/design.md
- file: principles/testing.md
- file: patterns/index.md
children:
- file: pages/patterns/exports.md
- file: pages/patterns/backports.md
- file: pages/patterns/data_files.md
- file: pages/guides/repo_review.md
- file: patterns/exports.md
- file: patterns/backports.md
- file: patterns/data_files.md
- file: guides/repo_review.md

site:
template: book-theme
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions docs/pages/patterns/index.md β†’ docs/patterns/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ If you would like to use backport packages, see [Backports][].

If you are wondering about public API, see [Exports][].

[including data files]: pages/patterns/data-files
[backports]: pages/patterns/backports
[exports]: pages/patterns/exports
[including data files]: patterns/data-files
[backports]: patterns/backports
[exports]: patterns/exports

```{tableofcontents}
```
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ research code. [Process recommendations][] discusses the process of writing
software, and [Design recommendations][] covers some tips about writing easy to
read and maintain code.

[Process recommendations]: pages/principles/process
[Design recommendations]: pages/principles/design
[Process recommendations]: principles/process
[Design recommendations]: principles/design


```{tableofcontents}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ the test-case to make sure it fails when the code is broken.

A good place to start writing tests is from the perspective of a user of your
module or library, as described in the [Test
Tutorial](pages/tutorials/test), and [Testing with pytest
guide](pages/guides/pytest). These tests follow the "Detroit
Tutorial](tutorials/test), and [Testing with pytest
guide](guides/pytest). These tests follow the "Detroit
School", focusing on behavior, avoiding testing of private attributes,
minimizing the use of mocks/patches/test-doubles.

Expand Down Expand Up @@ -393,7 +393,7 @@ run unit tests in your source folder, from your package root, use
your source repository), use `pytest --pyargs {package name}`.

You can set the default test path in `pyproject.toml`, see: [Configuring
pytest](pages/guides/pytest#configuring-pytest)
pytest](guides/pytest#configuring-pytest)

We recommend configuring pytest to run ONLY your fastest, least demanding test
suite by default.
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/tutorials/docs.md β†’ docs/tutorials/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Or you can generate a table that links out to documentation for each object.
````
<!-- rumdl-enable -->

See the [guide](pages/guides/docs) for more information on how to
See the [guide](guides/docs) for more information on how to
integrate this into a package, and setup for nox.

[sphinx]: https://www.sphinx-doc.org/
Expand All @@ -204,4 +204,4 @@ integrate this into a package, and setup for nox.
[sphinx-autodoc2]: https://sphinx-autodoc2.readthedocs.io/
[mkdocs]: https://www.mkdocs.org/
[mkdocs-material]: https://squidfunk.github.io/mkdocs-material/
[documentation guide]: pages/guides/docs
[documentation guide]: guides/docs
4 changes: 2 additions & 2 deletions docs/pages/tutorials/index.md β†’ docs/tutorials/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ start off on the right foot.
Keeping in mind that too much software infrastructure can be overwhelming to
those who haven't yet encountered the need for it, we introduce only the core
essentials in this opinionated tutorial. From there, we recommend looking
through the section on [principles](pages/principles/index). As
through the section on [principles](principles/index). As
your project grows you may find some good use for the more specific and advanced
topics covered in the [guides](pages/guides/index).
topics covered in the [guides](guides/index).

```{tableofcontents}
```
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ automatically generate nice-looking HTML documentation later. Notable features:
- (Optional) There is a section of one or more examples.

We will revisit docstrings in the section on writing
[documentation](pages/tutorials/docs).
[documentation](tutorials/docs).

[snell's law]: https://en.wikipedia.org/wiki/Snell%27s_law
[numpydoc standard]: https://numpydoc.readthedocs.io/en/latest/format.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,4 @@ In [1]: snell?
For more about packaging, also see our [packaging guide][].

[version control with git]: https://swcarpentry.github.io/git-novice/
[packaging guide]: pages/guides/packaging-simple
[packaging guide]: guides/packaging-simple
2 changes: 1 addition & 1 deletion docs/pages/tutorials/test.md β†’ docs/tutorials/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,4 @@ Consult the [pytest documentation][] for more. For more advanced pytest
suggestions, see our [pytest guide][].

[pytest documentation]: https://docs.pytest.org/en/latest/
[pytest guide]: pages/guides/pytest
[pytest guide]: guides/pytest
10 changes: 5 additions & 5 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ def pc_bump(session: nox.Session) -> None:
session.install("lastversion>=3.4")
versions = {}
pages = [
Path("docs/pages/guides/style.md"),
Path("docs/guides/style.md"),
Path("{{cookiecutter.project_name}}/.pre-commit-config.yaml"),
Path(".pre-commit-config.yaml"),
]
Expand Down Expand Up @@ -494,11 +494,11 @@ def gha_bump(session: nox.Session) -> None:
"""
Bump the GitHub Actions.
"""
pages = list(Path("docs/pages/guides").glob("gha_*.md"))
pages = list(Path("docs/guides").glob("gha_*.md"))
pages.extend(Path("{{cookiecutter.project_name}}/.github/workflows").iterdir())
pages.append(Path("docs/pages/guides/style.md"))
pages.append(Path("docs/pages/guides/tasks.md"))
pages.append(Path("docs/pages/guides/coverage.md"))
pages.append(Path("docs/guides/style.md"))
pages.append(Path("docs/guides/tasks.md"))
pages.append(Path("docs/guides/coverage.md"))
full_txt = "\n".join(page.read_text() for page in pages)

# This assumes there is a single version per action
Expand Down
Loading