From f265f8f849db9ac7871ae7a9b3c4261a4dc79d78 Mon Sep 17 00:00:00 2001 From: Jay Date: Mon, 9 Nov 2026 14:43:41 -0500 Subject: [PATCH] Add README: install, usage, development --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..14c6650 --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# new-python + +CLI tool to scaffold a Python repository configured with pipenv, a basic `justfile`, code formatters, and a pre-commit hook. For use in test-driven development workflows. + +## Install + +Clone the repo, then create a symlink to `./bin/new-python` in a directory in your PATH, such as `~/.local/bin`. + +```sh +git clone https://git.wisehodl.dev/jay/new-python ~/lib/new-python +ln -s ~/lib/new-python/bin/new-python ~/.local/bin/new-python +``` + +## Usage + +```sh +new-python NAME [--packages PKG ...] [--dir PATH] [--python VERSION] +``` + +- `NAME` — Project name in kebab-case (e.g., `demo-project`) +- `--packages` — Runtime dependencies to add to the Pipfile +- `--dir` — Parent directory for the new project (default: current directory) +- `--python` — Python version pin (default: `3.12.4`, must be installed in pyenv) + +The script renders the template, initializes a Git repo on `main`, runs `pipenv install --dev`, creates the initial commit, and installs the pre-commit hook. + +```sh +$ new-python demo-project --dir ~/path/to/repo +/home/user/path/to/repo/demo-project +``` + +## Development + +- `pipenv install --dev` — set up virtual environment +- `just test` — run test suite (pass path to run a single test) +- `just ci` — run linter, formatter checks, and tests +- `just fmt` — run automatic code formatters + +Template files live in `template/` and use `{{NAME}}`, `{{PKG}}`, and `{{PYVER}}` placeholders. `tests/test_selfhost.py` checks that this repository's configuration matches the template files.