Fix documentation inconsistencies and bump document versions
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Python Development Guidelines
|
||||
|
||||
**Document Version:** v8
|
||||
**Document Version:** v9
|
||||
|
||||
> **Note on Versioning:**
|
||||
> - This document version is independent — reused across projects
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Python Library Development Guidelines
|
||||
|
||||
**Document Version:** v1
|
||||
**Document Version:** v2
|
||||
|
||||
> **Note on Versioning:**
|
||||
> - This document version is independent — reused across projects
|
||||
@@ -127,7 +127,6 @@ Define specific exception types in `src/<package>/exceptions.py`. Use a fail-fas
|
||||
- **pytest** only — no `unittest`, no `TestCase` classes, no `self.assert*`
|
||||
- Arrange-Act-Assert pattern
|
||||
- Test naming: `test_<action>_<context>`
|
||||
- Do not commit `poetry.lock` — this is a library; consumers pin their own dependencies
|
||||
|
||||
---
|
||||
|
||||
|
||||
+14
-5
@@ -8,12 +8,15 @@ Create a `template/` folder in project root with reusable files for new Python p
|
||||
template/
|
||||
├── .env # Environment variables (sample)
|
||||
├── .gitignore # Git ignore rules
|
||||
├── AGENTS.md # AI assistant rules
|
||||
├── CHANGELOG.md # Changelog template
|
||||
├── DESIGN_DOCUMENT.md # Development guidelines
|
||||
├── PROJECT.md # Project documentation template
|
||||
├── main.py # Entry point with loguru
|
||||
├── README.md # Project overview, tool descriptions, build instructions
|
||||
├── <tool_name>.py # Entry point — named by purpose or tool name
|
||||
├── <tool_name>.spec # PyInstaller spec (only for projects shipping an .exe)
|
||||
├── prebuild.py # Pre-build script: venv check, version print, console= rewrite
|
||||
├── pyproject.toml # Poetry config (ruff, mypy, pytest)
|
||||
├── docs/
|
||||
│ └── .gitkeep # Detailed documentation lives here, never in the root
|
||||
├── src/
|
||||
│ ├── __init__.py
|
||||
│ ├── _version.py # Version fallback for PyInstaller
|
||||
@@ -23,12 +26,16 @@ template/
|
||||
└── test_constants.py # Basic test
|
||||
```
|
||||
|
||||
`AGENTS.md` and `DESIGN_DOCUMENT.md` are **not** part of the template — they are copied
|
||||
into the project root from the documentation repository and are never committed.
|
||||
|
||||
## Key Features
|
||||
|
||||
- **Version extraction** from `pyproject.toml` with `_version.py` fallback for PyInstaller builds
|
||||
- **DEBUG mode** via `ENV_DEBUG=true` in `.env` (adds "DEV" suffix to version: v1.2.3DEV)
|
||||
- **loguru** for logging (never print)
|
||||
- **Poetry** for dependency management
|
||||
- **Build configuration** via `ENV_BUILD_CONSOLE` and `ENV_BUILD_SPEC` in `.env`, applied by `prebuild.py`
|
||||
- **loguru** for logging (never print for debugging)
|
||||
- **Poetry** for dependency management, `poetry.lock` committed
|
||||
- **pytest** for testing (no unittest)
|
||||
- **ruff + mypy** for linting and type checking (120-character lines)
|
||||
|
||||
@@ -38,3 +45,5 @@ template/
|
||||
- Generic/reusable format
|
||||
- Keep files simple and minimal
|
||||
- `.gitignore` is the shared core from `Project template/.gitignore` with `Python/.gitignore` appended
|
||||
- Entry point is named by purpose or tool name — a project may have several
|
||||
- `prebuild.py` and the `.spec` file are only needed for projects distributed as a standalone `.exe`
|
||||
|
||||
+4
-2
@@ -4,10 +4,12 @@ from pathlib import Path
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
from src.constants import VERSION
|
||||
|
||||
# .env must be loaded before src.constants is imported — constants.py reads ENV_DEBUG
|
||||
# at import time to build VERSION.
|
||||
load_dotenv()
|
||||
|
||||
from src.constants import VERSION # noqa: E402
|
||||
|
||||
print("=" * 50)
|
||||
print("PREBUILD CONFIGURATION")
|
||||
print("=" * 50)
|
||||
|
||||
Reference in New Issue
Block a user