|
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 |
2 | 6 |
|
3 | | -## Integrations |
4 | | -- uv |
5 | | -- ruff |
6 | | -- pre-commit |
| 7 | +# Package Management |
7 | 8 |
|
8 | 9 | ## 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 | + |
11 | 40 |
|
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. |
16 | 42 |
|
17 | 43 |
|
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 | +::: |
19 | 47 |
|
20 | 48 |
|
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. |
0 commit comments