Skip to content

Commit 0e01688

Browse files
authored
feat: Remove support for douki decorator (#12)
1 parent f43f222 commit 0e01688

20 files changed

+924
-962
lines changed

.makim.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ groups:
5858
run: |
5959
pytest \
6060
--cov=douki \
61-
--cov-fail-under=85 \
61+
--cov-fail-under=90 \
6262
--cov-report term-missing \
6363
--no-cov-on-fail ${{ args.path }} ${{ args.params }}
6464
@@ -94,14 +94,20 @@ groups:
9494
help: Test douki check on an already-synced file
9595
backend: bash
9696
run: |
97-
douki check tests/smoke/clean_file.py
97+
TMPDIR=$(mktemp -d)
98+
cp tests/smoke/clean_file.py "$TMPDIR/clean.py"
99+
douki check "$TMPDIR/clean.py"
100+
rm -rf "$TMPDIR"
98101
99102
check-dirty:
100103
help: Test douki check on an unsynced file (exit 1)
101104
backend: bash
102105
run: |
106+
TMPDIR=$(mktemp -d)
107+
cp tests/smoke/dirty_file.py "$TMPDIR/dirty.py"
103108
# douki check should exit 1 when changes are needed
104-
douki check tests/smoke/dirty_file.py && exit 1 || true
109+
douki check "$TMPDIR/dirty.py" && exit 1 || true
110+
rm -rf "$TMPDIR"
105111
106112
sync-and-idempotent:
107113
help: Test douki sync applies changes and is idempotent

README.md

Lines changed: 32 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
11
# Douki
22

3-
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)![Mkdocs](https://img.shields.io/badge/Documentation%20engine-Mkdocs-orange)
4-
[![Built with Material for MkDocs](https://img.shields.io/badge/Material_for_MkDocs-526CFE?style=for-the-badge&logo=MaterialForMkDocs&logoColor=white)](https://squidfunk.github.io/mkdocs-material/)
5-
![Conda](https://img.shields.io/badge/Virtual%20environment-conda-brightgreen?logo=anaconda)[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
6-
![coverage](https://img.shields.io/badge/Code%20coverage%20testing-coverage.py-blue)
7-
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
8-
![vulture](https://img.shields.io/badge/Find%20unused%20code-vulture-blue)
9-
![McCabe](https://img.shields.io/badge/Complexity%20checker-McCabe-blue)
10-
![mypy](https://img.shields.io/badge/Static%20typing-mypy-blue)
11-
![pytest](https://img.shields.io/badge/Testing-pytest-cyan?logo=pytest)[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
12-
![Makim](https://img.shields.io/badge/Automation%20task-Makim-blue)![GitHub Actions](https://img.shields.io/badge/GitHub%20Actions-CI-blue?logo=githubactions)
3+
**Language-agnostic YAML docstrings for Python.**
134

14-
Documetatio from annotations
5+
Douki is a developer tool that uses a structured YAML format inside Python
6+
docstrings. It keeps your docstrings in sync with your function signatures and
7+
validates them against a schema — all without adding a runtime dependency to
8+
your package.
159

16-
- Software License: BSD 3 Clause
10+
## Why Douki?
1711

18-
- Documentation: https://osl-incubator.github.io/douki
12+
- **Structured** — docstrings are YAML, not free-form text. Parameters have
13+
`type`, `description`, `optional`, and `default` fields.
14+
- **Auto-synced**`douki sync` adds new parameters, removes stale ones, and
15+
updates return types automatically.
16+
- **Validated** — every docstring is checked against a JSON Schema so typos and
17+
invalid fields are caught early.
18+
- **Dev-only** — Douki is a development tool. It does **not** need to be a
19+
runtime dependency of your package.
20+
- **Migratable** — convert existing NumPy-style docstrings with
21+
`douki sync --migrate numpy`.
1922

20-
### Douki YAML Format
23+
## Quick Start
24+
25+
Install Douki as a dev dependency:
26+
27+
```bash
28+
pip install douki
29+
```
30+
31+
Write a docstring in Douki YAML format:
2132

2233
```python
2334
def add(a: int, b: int = 0) -> int:
@@ -38,56 +49,19 @@ def add(a: int, b: int = 0) -> int:
3849
return a + b
3950
```
4051

41-
Fields like `visibility` (default: `public`), `mutability` (default: `mutable`),
42-
and `scope` (default: `static` for functions, `instance` for methods) are
43-
omitted when they match their Python defaults.
44-
45-
### CLI — `douki sync` / `douki check`
46-
47-
Synchronize Douki YAML docstrings with Python function
48-
signatures. Designed to run standalone or as a **pre-commit hook**.
52+
Sync your docstrings with the actual signatures:
4953

5054
```bash
51-
# Show what would change (exit 1 if diffs exist)
55+
# Preview changes
5256
douki check src/
5357

5458
# Apply changes in-place
5559
douki sync src/
56-
57-
# Specific files
58-
douki check path/to/file.py
59-
```
60-
61-
Without arguments, both commands default to the current directory.
62-
63-
#### Migrating from NumPy docstrings
64-
65-
Convert existing NumPy-style docstrings to Douki YAML:
66-
67-
```bash
68-
# Preview what the migration would look like
69-
douki check --migrate numpy src/
70-
71-
# Apply the migration
72-
douki sync --migrate numpy src/
73-
```
74-
75-
#### Pre-commit integration
76-
77-
```yaml
78-
# .pre-commit-config.yaml
79-
repos:
80-
- repo: https://github.com/osl-incubator/douki
81-
rev: v0.6.0 # pin to a release tag
82-
hooks:
83-
- id: douki-check
84-
name: douki check
85-
entry: douki check
86-
language: python
87-
types: [python]
8860
```
8961

90-
## Credits
62+
## What's Next?
9163

92-
This package was created with
93-
[scicookie](https://github.com/osl-incubator/scicookie) project template.
64+
- [Installation](installation.md) — install via pip, conda, or from source
65+
- [Usage Guide](usage.md) — CLI commands, YAML schema, and migration
66+
- [Changelog](changelog.md) — release history
67+
- [Contributing](contributing.md) — how to contribute

docs/index.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../README.md

docs/installation.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
11
# Installation
22

3-
## Stable release
3+
## Stable Release
44

5-
To install Douki, run this command in your terminal:
5+
Install Douki as a **development dependency** — it does not need to be a
6+
runtime dependency of your package.
67

7-
```bash
8-
pip install douki
9-
```
8+
=== "pip"
109

11-
This is the preferred method to install Douki, as it will always install the most
12-
recent stable release.
10+
```bash
11+
pip install douki
12+
```
1313

14-
If you don't have [pip](https://pip.pypa.io) installed, this
15-
[Python installation guide](http://docs.python-guide.org/en/latest/starting/installation/)
16-
can guide you through the process.
14+
=== "conda"
1715

18-
## From sources
16+
```bash
17+
conda install -c conda-forge douki
18+
```
1919

20-
The sources for Douki can be downloaded from the
21-
[Github repo](https://github.com/osl-incubator/douki.git).
20+
=== "Poetry (dev)"
2221

23-
You can either clone the public repository:
22+
```bash
23+
poetry add --group dev douki
24+
```
2425

25-
```bash
26-
git clone https://github.com/osl-incubator/douki.git
27-
```
26+
## From Source
2827

29-
Or download the [tarball](https://github.com/osl-incubator/douki.git/tarball/main):
28+
Clone the repository and install with Poetry:
3029

3130
```bash
32-
curl -OJL https://github.com/osl-incubator/douki.git/tarball/main
31+
git clone https://github.com/osl-incubator/douki.git
32+
cd douki
33+
poetry install
3334
```
3435

35-
Once you have a copy of the source, you can install it with:
36+
## Requirements
3637

37-
```bash
38-
poetry install
39-
```
38+
- Python ≥ 3.10

0 commit comments

Comments
 (0)