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
8 changes: 0 additions & 8 deletions .devcontainer/dev.docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,5 @@ services:
- ${SSH_AUTH_SOCK:-/dev/null}:/ssh-agent:ro
- .:/workspace:cached
- ${GITCONFIG_PATH:-${HOME}/.gitconfig}:/etc/gitconfig:ro
networks:
- agent
ports:
- ${DOC_PORT}:8000

networks:
agent:
external: true
name: agent
driver: bridge
18 changes: 2 additions & 16 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
{
"customizations": {
"vscode": {
"extensions": [
"streetsidesoftware.code-spell-checker",
"oderwat.indent-rainbow",
"yzhang.markdown-all-in-one",
"christian-kohler.path-intellisense",
"Gruntfuggly.todo-tree",
"aaron-bond.better-comments",
"tamasfe.even-better-toml",
"ms-python.python",
"meta.pyrefly"
]
}
},
"customizations": {},
"dockerComposeFile": [
"../docker-compose.yml",
"dev.docker-compose.yml"
],
"initializeCommand": "if [ ! -f .env ]; then cat package.env > .env; fi && docker network inspect agent >/dev/null 2>&1 || docker network create agent",
"initializeCommand": "if [ ! -f .env ]; then cat package.env > .env; fi",
"name": "initpy",
"postAttachCommand": "make dev",
"remoteUser": "devu",
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ SPDX-FileCopyrightText: 2026 Artur Lissin
SPDX-License-Identifier: CC0-1.0
-->

## v0.11.0 (2026-10-02)

### Feat

- remove AI commit generation and simplify commit process

### Refactor

- update prompt logic

## v0.10.0 (2026-08-04)

### Feat
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ ARG NODE_VERSION

RUN dnf clean all && dnf install -y bash

RUN userdel -r ${USERNAME} 2>/dev/null || true
RUN groupdel ${USERNAME} 2>/dev/null || true
RUN groupadd --gid ${USER_GID} ${USERNAME}
RUN useradd --uid ${USER_UID} --gid ${USER_GID} -m -d ${HOME_MAIN} ${USERNAME}
RUN groupadd --force --gid ${USER_GID} ${USERNAME} && \
useradd --uid ${USER_UID} --gid ${USER_GID} -m -d ${HOME_MAIN} ${USERNAME} || \
usermod -u ${USER_UID} -g ${USER_GID} ${USERNAME}

RUN mkdir -p "${HOME_MAIN}/.local/bin" \
&& chown ${USERNAME}:${USERNAME} -R ${HOME_MAIN}

Expand Down
35 changes: 4 additions & 31 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,36 +97,9 @@ export_runUpdate:
cd $(PKG_DOCS) && $(PNPME) update

com commit:
@echo "" > .commit_msg
@if curl -sf --compressed -o /dev/null http://commit:8080; then \
$(MAKE) message || exit 1; \
@if [ -f .commit_msg ] && [ -s .commit_msg ]; then \
$$EDITOR .commit_msg; \
git commit -F .commit_msg && rm -f .commit_msg; \
else \
$(UVE) run cz commit || exit 1; \
$(UVE) run cz commit --write-message-to-file .commit_msg && rm -f .commit_msg; \
fi
@echo "" > .commit_msg

recom recommit:
@if curl -sf --compressed -o /dev/null http://commit:8080; then \
[ -s .commit_msg ] || (echo "Missing commit message!" && exit 1); \
git commit -F .commit_msg || exit 1; \
else\
$(UVE) run cz commit --retry || exit 1; \
fi
@echo "" > .commit_msg

message:
git diff --staged -U0 --no-prefix -- . ':(exclude)uv.lock' ':(exclude)*pnpm-lock.yaml' | \
sed 's/ */ /g' | \
jq -Rs --rawfile prompt configs/prompt/commit.md \
'{"messages": [{ "role": "user", "content": ("<GIT_DIFF>" + . + "</GIT_DIFF>" + $$prompt)} ]}' | \
curl -f -s -X POST http://commit:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d @- | \
jq -r 'select(.choices[0].finish_reason == "stop") | .choices[0].message.content' > .commit_msg
vim .commit_msg
@if ! $(UVE) run cz check --commit-msg-file .commit_msg; then \
echo "Commit message failed cz check. Aborting."; \
echo "" > .commit_msg; \
exit 1; \
fi
git commit -F .commit_msg
28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SPDX-License-Identifier: CC0-1.0

### A Bare-Bone Python Monorepo Template

[![release: 0.10.0](https://img.shields.io/badge/rel-0.10.0-blue.svg?style=flat-square)](https://github.com/artdotlis/INITpy)
[![release: 0.11.0](https://img.shields.io/badge/rel-0.11.0-blue.svg?style=flat-square)](https://github.com/artdotlis/INITpy)
[![The Unlicense](https://img.shields.io/badge/License-Unlicense-brightgreen.svg?style=flat-square)](https://choosealicense.com/licenses/unlicense/)
[![Documentation Status](https://img.shields.io/badge/docs-GitHub-blue.svg?style=flat-square)](https://artdotlis.github.io/INITpy/)

Expand All @@ -21,11 +21,12 @@ SPDX-License-Identifier: CC0-1.0

## ✨ Key Features

* **Single-Source Truth:** Tooling and dependencies are declared in one `pyproject.toml`.
* **Single-Source Truth:** Python dependencies managed via `uv` in `pyproject.toml`.
* **Native Monorepo Support:** Built-in logic for managing multiple packages (`pkg1`, `shared_utils`).
* **AI-Powered Commits:** Integration with **Ollama** to generate Conventional Commit messages based on your staged changes.
* **Conventional Commits:** Uses `commitizen` with `vim` for editing commit messages.
* **Strict Consistency:** A Docker-based Dev Container ensures every contributor uses the exact same tool versions.
* **Robust CI/CD:** Ready-to-go workflows for testing, linting (`ruff`), and static analysis (`pyrefly`).
* **Documentation:** Built with `zensical` (Python) and deployed via GitHub Pages.

-----

Expand Down Expand Up @@ -57,7 +58,7 @@ INITpy/
├── bin/ # Tooling shell scripts
├── configs/ # Tooling & Linting configurations
├── packages/ # Your Python packages (Monorepo)
│ ├── docs/ # Documentation configuration
│ ├── docs/
│ ├── pkg1/
│ └── shared_utils/
├── pyproject.toml # The heart of the project
Expand All @@ -74,19 +75,21 @@ All commands must be run within the Dev Container or by passing `CONTAINER=conta

| Category | Command | Action |
| :--- | :--- | :--- |
| **Setup** | `make dev` | Installs lefthook, syncs all dependencies |
| **Active** | `make runAct` | Enters the virtual environment shell. |
| **Quality** | `make runChecks` | Runs `ruff`, `pyrefly`, and other pre-commit hooks. |
| **Quality** | `make runChecks` | Runs `lefthook` pre-commit hooks (includes `ruff`, `pyrefly`) |
| **Test** | `make runTests` | Runs the test suite via `tox`. |
| **Docs** | `make serveDocs` | Previews documentation at `localhost:$DOC_PORT`. |
| **Docs** | `make serveDocs` | Previews documentation at `http://localhost:8000` (configurable via `.env` - `DOC_PORT`). |
| **Release** | `make runBump` | Bumps version and updates CHANGELOG. |
| **Git** | `make commit` | Generates AI commit message (via Ollama) or opens `cz`. |
| **Git** | `make commit`, `make com` | Generates commit message with `commitizen` or opens `vim` for editing, then commits. |

### 🧠 Smart Commits
### ✍️ Commit Messages

The `make commit` target checks if an Ollama server is reachable.
The `make commit`/`make com` target:
- If `.commit_msg` exists and is non-empty: opens it in `vim` for editing, then commits
- Else: runs `cz commit --write-message-to-file` to generate a commit message, commits using that message

- **If Ollama is up:** It sends your `git diff` to the model, generates a message, and opens `vim` for you to edit.
- **If Ollama is down:** It falls back to standard `commitizen` prompts.
> **Note**: The Makefile removes `.commit_msg` after committing (temp file cleanup).

-----

Expand All @@ -96,6 +99,7 @@ The API documentation is built with **Zensical**.

- **Build:** `make runDocs`
- **Serve:** `make serveDocs`
- **Port:** Configured via `DOC_PORT` in `.env` (default: `9191`)

-----

Expand All @@ -107,7 +111,7 @@ Released into the public domain via the [Unlicense](https://choosealicense.com/l

### Why the `CONTAINER=container` guard?

To prevent accidental execution on your host, this `Makefile` uses a mandatory `CONTAINER` constraint. This safety gate ensures the code runs exclusively in the intended containerized environment.
To prevent accidental execution on your host, `Makefile` uses a mandatory `CONTAINER` constraint. This safety gate ensures the code runs exclusively in the intended containerized environment.

-----

Expand Down
1 change: 0 additions & 1 deletion bin/lint/licenses.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ fi
echo "COPYRIGHT is set: $COPYRIGHT"

LICENSE_FILES=(
"$ROOT/configs/REUSE.toml"
"$ROOT/.zensical.toml"
)

Expand Down
1 change: 0 additions & 1 deletion bin/lint/lint_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ ALL_ENV=(
"MAKEFILE_LIST"
"HOME"
"PATH"
"MAKE"
)

IGNORE_ENV=(
Expand Down
7 changes: 0 additions & 7 deletions configs/REUSE.toml

This file was deleted.

16 changes: 5 additions & 11 deletions configs/docker/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ ARG BIN_DEPLOY_PREP
ARG BIN_DEPLOY_REQ
ARG BIN_DEPLOY_ENTRY_DEV

RUN groupadd --gid $USER_GID $USERNAME \
&& useradd -m -d $HOME_MAIN \
--uid $USER_UID --gid $USER_GID $USERNAME

COPY . /tmp/app

WORKDIR /tmp/app
Expand All @@ -35,15 +31,13 @@ WORKDIR /

RUN rm -rf /tmp/app

RUN userdel -r ${USERNAME} 2>/dev/null || true
RUN groupdel ${USERNAME} 2>/dev/null || true
RUN groupadd --gid ${USER_GID} ${USERNAME}
RUN useradd --uid ${USER_UID} --gid ${USER_GID} -m -d ${HOME_MAIN} ${USERNAME}
RUN groupadd --force --gid ${USER_GID} ${USERNAME} && \
useradd --uid ${USER_UID} --gid ${USER_GID} -m -d ${HOME_MAIN} ${USERNAME} || \
usermod -u ${USER_UID} -g ${USER_GID} ${USERNAME}

RUN mkdir -p ${WORK_DIR} && mkdir -p /var/www &&\
RUN mkdir -p ${WORK_DIR} && \
chown ${USERNAME}:${USERNAME} -R ${WORK_DIR} && \
chown ${USERNAME}:${USERNAME} -R ${HOME_MAIN} && \
chown ${USERNAME}:${USERNAME} -R /var/www
chown ${USERNAME}:${USERNAME} -R ${HOME_MAIN}

RUN git config --global --add safe.directory ${WORK_DIR}
RUN dnf install -y openssh openssh-clients
Expand Down
117 changes: 0 additions & 117 deletions configs/prompt/commit.md

This file was deleted.

2 changes: 1 addition & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
"scripts": {
"build": "pnpm list --depth 0 --parseable --lockfile-only | grep node_modules | xargs -I {} find {} -type f -name '*.min.js' | xargs -I {} cp {} \"$EXTRA_JS\""
},
"version": "0.10.0"
"version": "0.11.0"
}
2 changes: 1 addition & 1 deletion packages/pkg1/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[project]
classifiers = ["Private :: Do Not Upload"]
name = "pkg1"
version = "0.10.0"
version = "0.11.0"
description = "One of the projects in the monorepo."
readme = "README.md"
authors = [
Expand Down
2 changes: 1 addition & 1 deletion packages/shared_utils/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[project]
classifiers = ["Private :: Do Not Upload"]
name = "shared-utils"
version = "0.10.0"
version = "0.11.0"
description = "Shared library for packages."
readme = "README.md"
authors = [
Expand Down
Loading
Loading