Skip to content

Commit 3befe2f

Browse files
committed
docs: add contributor 4.5 runbook
Refs DFPY-73
1 parent 6f57af2 commit 3befe2f

3 files changed

Lines changed: 237 additions & 3 deletions

File tree

CONTRIBUTING.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ pushes except for explicit emergency maintenance.
2727

2828
## Local Development
2929

30+
The current contributor runbook for DataFog 4.5 lives in
31+
[`docs/contributing.rst`](docs/contributing.rst). It includes supported Python
32+
versions, install profiles, focused and broad test commands, docs-build
33+
verification, and the 4.5 release-flow boundary.
34+
3035
```bash
3136
git clone https://github.com/datafog/datafog-python
3237
cd datafog-python
@@ -43,17 +48,33 @@ package install:
4348
pip install -r requirements-dev.txt
4449
```
4550

46-
For optional NLP or OCR work, install the relevant extras:
51+
For optional NLP, OCR, or distributed work, install the relevant extras:
4752

4853
```bash
4954
pip install -e ".[dev,cli,nlp]"
5055
pip install -e ".[dev,cli,nlp,nlp-advanced]"
56+
pip install -e ".[dev,cli,ocr]"
57+
pip install -e ".[dev,cli,distributed]"
5158
pip install -e ".[all,dev]"
5259
```
5360

5461
## Tests
5562

56-
Run the core test suite before opening a pull request:
63+
Run focused tests for the area you changed before opening a pull request. For
64+
core import and dependency-boundary work, use:
65+
66+
```bash
67+
DATAFOG_NO_TELEMETRY=1 DO_NOT_TRACK=1 \
68+
pytest tests/test_runtime_dependency_safety.py tests/test_no_network_core.py -q
69+
```
70+
71+
For broader local confidence, run the non-slow suite:
72+
73+
```bash
74+
pytest -m "not slow" -q
75+
```
76+
77+
To mimic the core CI profile, run:
5778

5879
```bash
5980
pytest tests/ -m "not slow" \
@@ -68,9 +89,12 @@ Run the focused test file for the area you changed whenever possible. For
6889
documentation-only changes, build the docs:
6990

7091
```bash
71-
sphinx-build -b html docs docs/_build/html
92+
python -m sphinx -b html docs docs/_build/html
7293
```
7394

95+
See [`docs/contributing.rst`](docs/contributing.rst) for optional-profile smoke
96+
commands and release-prep checks.
97+
7498
## Pull Request Checklist
7599

76100
Before requesting review:

docs/contributing.rst

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
=======================================
2+
Contributor Setup And 4.5 Release Flow
3+
=======================================
4+
5+
This page is the contributor runbook for DataFog 4.5 work. It is meant for
6+
humans and agents preparing local changes, choosing verification commands, and
7+
understanding where the 4.5 release boundary sits.
8+
9+
Version Frame
10+
=============
11+
12+
Current release planning uses this frame:
13+
14+
* Stable package release: ``4.4.0``.
15+
* Current development package version: ``4.4.0a5``.
16+
* Next minor target: ``4.5.0``.
17+
18+
Do not bump routine feature, documentation, or cleanup branches directly to
19+
``4.5.0``. Keep the version stable during local release-prep work, then handle
20+
the final version and release-note alignment in the release-readiness slice.
21+
22+
Python Environments
23+
===================
24+
25+
DataFog currently declares support for Python ``>=3.10,<3.14``. The CI matrix
26+
tests core installs on Python 3.10, 3.11, 3.12, and 3.13. Optional NLP and
27+
NLP-advanced profiles are tested on Python 3.10, 3.11, and 3.12; Python 3.13
28+
optional-profile validation is tracked separately for 4.5.
29+
30+
Create one virtual environment per Python version when you need to compare
31+
profiles locally:
32+
33+
.. code-block:: bash
34+
35+
python3.12 -m venv .venv312
36+
source .venv312/bin/activate
37+
python -m pip install --upgrade pip
38+
39+
For another version, keep the environment name explicit:
40+
41+
.. code-block:: bash
42+
43+
python3.10 -m venv .venv310
44+
python3.11 -m venv .venv311
45+
python3.13 -m venv .venv313
46+
47+
Install Profiles
48+
================
49+
50+
Install the package in editable mode with the smallest profile that matches the
51+
work you are doing:
52+
53+
.. list-table::
54+
:header-rows: 1
55+
56+
* - Profile
57+
- Command
58+
- Notes
59+
* - Core
60+
- ``pip install -e .``
61+
- Lightweight regex engine and package import path.
62+
* - Core test + CLI
63+
- ``pip install -e ".[test,cli]" -r requirements-test.txt``
64+
- Matches the core CI test profile.
65+
* - Docs
66+
- ``pip install -e ".[docs]" -r requirements-docs.txt``
67+
- Enough to build Sphinx docs locally.
68+
* - Local dev
69+
- ``pip install -e ".[dev,cli]" && pip install -r requirements-dev.txt``
70+
- Test, docs, lint, formatting, and pre-commit tooling.
71+
* - NLP
72+
- ``pip install -e ".[test,cli,nlp]" -r requirements-test.txt``
73+
- Also install the spaCy model needed for NLP tests.
74+
* - NLP advanced
75+
- ``pip install -e ".[test,cli,nlp,nlp-advanced]" -r requirements-test.txt``
76+
- Also install spaCy and GLiNER models explicitly.
77+
* - OCR
78+
- ``pip install -e ".[test,ocr]" -r requirements-test.txt``
79+
- Tesseract workflows also need the system ``tesseract`` binary.
80+
* - Distributed
81+
- ``pip install -e ".[test,distributed]" -r requirements-test.txt``
82+
- Spark workflows also need a Java runtime.
83+
* - All extras
84+
- ``pip install -e ".[all,dev]"``
85+
- Use only when you deliberately want every optional surface locally.
86+
87+
Optional model setup is explicit:
88+
89+
.. code-block:: bash
90+
91+
python -m spacy download en_core_web_lg
92+
datafog download-model urchade/gliner_multi_pii-v1 --engine gliner
93+
94+
Focused Verification
95+
====================
96+
97+
Use focused checks for the area you touched before running broader suites.
98+
Set the no-telemetry environment variables when testing core privacy and import
99+
behavior:
100+
101+
.. code-block:: bash
102+
103+
export DATAFOG_NO_TELEMETRY=1
104+
export DO_NOT_TRACK=1
105+
106+
Core dependency and no-network checks:
107+
108+
.. code-block:: bash
109+
110+
python -m pytest tests/test_runtime_dependency_safety.py tests/test_no_network_core.py -q
111+
112+
Run a changed test file directly when behavior changes:
113+
114+
.. code-block:: bash
115+
116+
python -m pytest tests/test_engine_api.py -q
117+
python -m pytest tests/test_agent_api.py -q
118+
python -m pytest tests/test_cli_smoke.py -q
119+
120+
Docs build:
121+
122+
.. code-block:: bash
123+
124+
python -m sphinx -b html docs docs/_build/html
125+
126+
Pre-commit on touched files:
127+
128+
.. code-block:: bash
129+
130+
pre-commit run --files README.md docs/index.rst --show-diff-on-failure
131+
git diff --check
132+
133+
Broad Verification
134+
==================
135+
136+
Run the broad non-slow suite when a change affects shared behavior,
137+
public docs, imports, packaging, or release confidence:
138+
139+
.. code-block:: bash
140+
141+
python -m pytest -m "not slow" -q
142+
143+
To mimic the core CI profile more closely:
144+
145+
.. code-block:: bash
146+
147+
python -m pytest tests/ \
148+
-m "not slow" \
149+
--ignore=tests/test_gliner_annotator.py \
150+
--ignore=tests/test_image_service.py \
151+
--ignore=tests/test_ocr_integration.py \
152+
--ignore=tests/test_spark_integration.py \
153+
--ignore=tests/test_text_service_integration.py
154+
155+
Use optional-profile smoke checks when changing extras, dependency boundaries,
156+
or install behavior:
157+
158+
.. code-block:: bash
159+
160+
DATAFOG_INSTALL_PROFILE=core python -m pytest tests/test_install_profiles.py -q
161+
DATAFOG_INSTALL_PROFILE=cli python -m pytest tests/test_install_profiles.py -q
162+
DATAFOG_INSTALL_PROFILE=nlp python -m pytest tests/test_install_profiles.py -q
163+
DATAFOG_INSTALL_PROFILE=nlp-advanced python -m pytest tests/test_install_profiles.py -q
164+
DATAFOG_INSTALL_PROFILE=ocr python -m pytest tests/test_install_profiles.py -q
165+
DATAFOG_INSTALL_PROFILE=distributed python -m pytest tests/test_install_profiles.py -q
166+
DATAFOG_INSTALL_PROFILE=web python -m pytest tests/test_install_profiles.py -q
167+
168+
4.5 Release Flow
169+
================
170+
171+
The 4.5 work lands as focused pull requests into ``dev``. Keep feature and docs
172+
branches narrow, and avoid mixing local cleanup, external PR review, and final
173+
release mechanics in one branch.
174+
175+
The release flow for 4.5 is:
176+
177+
1. Land the local release-prep baseline and follow-up cleanup/docs slices.
178+
2. Review the external German regex PR after the local release-prep baseline is
179+
in place.
180+
3. Integrate German regex support only if review says it fits the 4.5
181+
lightweight text screening thesis.
182+
4. Validate optional Python 3.13 profiles before claiming support beyond core
183+
SDK and CLI.
184+
5. Prepare release readiness: changelog/release notes, package checks, docs
185+
build, CI state, and version alignment.
186+
6. Bump or override the final stable release to ``4.5.0`` only during the
187+
release-readiness and stable-release path.
188+
189+
The current release workflow strips prerelease suffixes from the package
190+
version unless a manual stable ``version_override`` is provided. For the final
191+
4.5 stable release, use a dedicated release-readiness change or the stable
192+
workflow override so the published version is ``4.5.0`` rather than another
193+
``4.4.0`` prerelease line.
194+
195+
External PR Boundary
196+
====================
197+
198+
The external German PII regex PR belongs after local baseline cleanup. Review
199+
it as a 4.5 candidate, not as a v5 planning shortcut. If accepted, adapt it in
200+
the German regex integration slice with tests, documentation of locale
201+
coverage, and no new dependency burden on the core path.

docs/index.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ Reference
3333

3434
definitions
3535

36+
Contributing
37+
============
38+
39+
.. toctree::
40+
:maxdepth: 2
41+
:caption: Contributing
42+
43+
contributing
44+
3645
Planning And History
3746
====================
3847

0 commit comments

Comments
 (0)