https://github.com/russellane/pdm-make
tool.pdm.scripts for building à la `make`
https://github.com/russellane/pdm-make
make pyproject-toml python python-package-management task-runner
Last synced: 3 months ago
JSON representation
tool.pdm.scripts for building à la `make`
- Host: GitHub
- URL: https://github.com/russellane/pdm-make
- Owner: russellane
- Created: 2022-02-28T17:32:16.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-28T17:35:08.000Z (about 3 years ago)
- Last Synced: 2024-12-30T21:24:28.179Z (5 months ago)
- Topics: make, pyproject-toml, python, python-package-management, task-runner
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pdm-make
[tool.pdm.scripts](https://pdm.fming.dev/usage/scripts/) for building à la [make](https://en.wikipedia.org/wiki/Make_(software))## pyproject.toml
```toml
[tool.pdm.scripts]
# .vimrc: set makeprg=pdm\ build
pre_build.shell = """set -x;
ctags -R --languages=python __pypackages__ wumpus tests;
python -m black -q wumpus tests &&
python -m isort wumpus tests &&
python -m flake8 wumpus tests &&
python -m pytest --exitfirst --showlocals --verbose tests &&
{ export COLUMNS=97; python -m wumpus --help |
python -m mandown --width 89 --use-config >README.md; };
"""
rebuild.shell = "set -x; rm -f pdm.lock; pdm run clean && pdm install && pdm build"
clean.shell = """set -x;
rm -rf __pypackages__ .pytest_cache dist tags;
find . -type f -name '*.py[co]' -delete &&
find . -type d -name __pycache__ -delete
"""
# bump depends on: `pip install --user pdm-bump`
bump-micro.shell = "set -x; pdm bump micro && pdm run rebuild"
publish.shell = """set -x; cd dist; echo *.whl |
cpio -pdmuv `pip config get global.find-links`
"""# Don't name `install` else `pre_install` and/or `post_install` will also run.
#xxinstall.shell = "set -x; unset PYTHONPATH; pip install --user wumpus"
#uninstall.shell = "set -x; unset PYTHONPATH; pip uninstall wumpus"
xxinstall.shell = "set -x; pipx install wumpus"
uninstall.shell = "set -x; pipx uninstall wumpus"
reinstall.shell = "set -x; pdm run uninstall; pdm run xxinstall"
```## ~/.vimrc
```vim
if filereadable('pyproject.toml')
set makeprg=pdm\ build
endif
```## vim
Run `:make`, then use `:cnext` and `:cprevious` to move through errors.