Skip to content

Commit 1918666

Browse files
docs: finish Package Management section
1 parent 89a100d commit 1918666

File tree

8 files changed

+78
-18
lines changed

8 files changed

+78
-18
lines changed

afterpython/cli/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def afterpython_group(ctx):
5050
afterpython_group.add_command(dev)
5151
afterpython_group.add_command(update)
5252
afterpython_group.add_command(check)
53+
afterpython_group.add_command(check, name="lint")
5354
afterpython_group.add_command(format)
5455
afterpython_group.add_command(sync)
5556
afterpython_group.add_command(start)

afterpython/doc/myst.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ This section serves as a quick guide to MyST. Quotes below are sourced from the
2929
## Jupyter Notebook
3030
The [MyST Document Engine][MyST Overview] can parse [Jupyter Notebook]s and render them as HTML. This means you can write content in both MyST Markdown and Jupyter Notebooks—`afterpython` will organize and render them together as part of your project website.
3131

32+
### Notebook Cell Tags
33+
You can add tags to notebook cells to control their behavior. For example, you can add the `hide-input` tag to a cell to hide the input of the cell.
34+
35+
*See [Notebook Cell Tags](https://mystmd.org/guide/notebook-configuration#tbl-notebook-cell-tags) for more details.*
36+
3237
### Molab Badge
3338

3439
If the [environment variable](references/environment_variables.md) `AP_MOLAB_BADGE` is set to `1`, `afterpython` automatically adds [molab] badges to Jupyter Notebooks during the build process.
@@ -88,3 +93,12 @@ authors:
8893
:::{tip}
8994
This entire documentation is written in MyST Markdown. You can click the "Edit this page" button in the top right corner to see the source code as an example of how to write content in MyST Markdown.
9095
:::
96+
97+
98+
---
99+
## Synchronization
100+
`ap sync` copies corresponding values from `pyproject.toml` and `afterpython.toml` into `authors.yml` and `myst.yml`.
101+
102+
For example, after updating authors in `pyproject.toml`, run `ap sync` to update `authors.yml` and your `myst.yml` files automatically.
103+
104+
You can also change `[company.name]` in `afterpython.toml` and run `ap sync` to update `venue.title` (set to the company name) in your `myst.yml` files.

afterpython/doc/myst.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ project:
4141
- title: Package Maintenance
4242
children:
4343
- file: package_maintenance/package_management.md
44+
- file: package_maintenance/release_management.md
4445
- file: package_maintenance/ci_cd.md
4546
- title: References
4647
children:
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[pre-commit]: https://github.com/pre-commit/pre-commit
2+
13
# CI/CD Pipelines
24

35
## `pre-commit`
@@ -7,6 +9,4 @@
79

810
## GitHub Actions
911

10-
## GitHub Dependabots
11-
12-
## PyPI and GitHub Releases
12+
## GitHub Dependabots 🚧
Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,51 @@
1-
# Package Management
1+
[uv]: https://github.com/astral-sh/uv
2+
[poetry]: https://github.com/python-poetry/poetry
3+
[pdm]: https://github.com/pdm-project/pdm
4+
[ruff]: https://github.com/astral-sh/ruff
5+
[pixi]: https://github.com/prefix-dev/pixi
26

3-
## Integrations
4-
- uv
5-
- ruff
6-
- pre-commit
7+
# Package Management
78

89
## Dependency Management
9-
- uv
10-
- pcu
10+
`afterpython` doesn’t manage your dependencies or lock you into a tool. Choose what you prefer:
11+
- [uv] (what `afterpython`’s wrapper commands call)
12+
- [pdm]
13+
- [poetry]
14+
15+
Example wrapper:
16+
- `ap install` runs `uv sync --all-extras --all-groups`.
17+
18+
19+
---
20+
## Linting and Formatting
21+
`afterpython` uses [ruff] for linting and formatting, configured in `afterpython/ruff.toml`.
22+
23+
Example wrapper:
24+
- `ap check` (alias: `ap lint`) runs `ruff check --config ./afterpython/ruff.toml`.
25+
26+
Or you can just directly use `ruff` command as usual since it will automatically find the config file in `afterpython/ruff.toml`.
27+
28+
29+
---
30+
## Python Check Updates (`pcu`)
31+
As a package maintainer, you face a dilemma: your dependencies (e.g. `pandas`) release new versions with bug fixes and features, but updating the minimum versions (e.g. `pandas>=2.0.0`) in your `pyproject.toml` means dropping support for users with older versions.
32+
33+
This is why minimum version updates are usually done manually—it's up to the package maintainer to decide when to require newer dependency versions.
34+
35+
`pcu` (similar to `ncu` in Node.js) helps automate this process:
36+
- `pcu` shows the latest available versions of your dependencies
37+
- `pcu -u` updates the minimum versions in your `pyproject.toml`
38+
- `pcu -u --all` also updates the versions in your `.pre-commit-config.yaml`
39+
1140

12-
## Release Management
13-
- `ap bump`
14-
- `ap publish`
15-
- `ap release`
41+
You can also run `ap update deps` (`pcu` is an alias for this) to achieve the same effect.
1642

1743

18-
## pixi
44+
:::{warning}
45+
Only update minimum versions when you have a good reason—such as needing bug fixes, new features, or addressing breaking changes you've adapted to. Otherwise, you're forcing users to upgrade their environments unnecessarily, creating installation barriers without providing any actual benefits.
46+
:::
1947

2048

21-
```{seealso}
22-
See Also:
23-
```
49+
---
50+
## pixi 🚧
51+
[pixi] manages both your package dependencies and your environment. For example, if your project installs `pyspark` and you need to lock Java to version 17, `pixi` handles that for you.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Release Management
2+
3+
- `ap commit`
4+
- `ap pc` / `ap pre-commit`
5+
- `ap cz` / `ap commitizen`
6+
- `ap bump`
7+
- `ap publish`
8+
- `ap release`
9+
10+
11+
## PyPI and GitHub Releases

afterpython/doc/references/roadmap.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This roadmap is tentative and subject to change
88
- AI chatbot like kapa.ai using WebLLM
99
- full-text search engine using pagefind
1010
- incremental build, only build changed content (for `ap dev`)
11+
- github dependabots
1112
- integrate with `git-cliff` for changelog generation
1213
- integrate with `pixi`, supports `conda install`
1314
- supports docs built by different engines? e.g. Sphix, MkDocs

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ source-exclude = [
8282
"afterpython/static",
8383
"afterpython/_website",
8484
"afterpython/_build",
85+
"afterpython/cz.toml",
86+
"afterpython/.pre-commit-config.yaml",
8587
"afterpython/ruff.toml",
8688
"afterpython/afterpython.toml",
8789
"afterpython/authors.yml",
@@ -96,6 +98,8 @@ wheel-exclude = [
9698
"afterpython/static",
9799
"afterpython/_website",
98100
"afterpython/_build",
101+
"afterpython/cz.toml",
102+
"afterpython/.pre-commit-config.yaml",
99103
"afterpython/ruff.toml",
100104
"afterpython/afterpython.toml",
101105
"afterpython/authors.yml",

0 commit comments

Comments
 (0)