|
1 | | -# Contributing guidelines |
| 1 | +# Contributing to DataFog Python |
2 | 2 |
|
3 | | -# Contributors |
| 3 | +Thanks for helping improve DataFog. The project welcomes issues, bug reports, |
| 4 | +documentation fixes, tests, and pull requests. |
4 | 5 |
|
5 | | -- sroy9675 |
6 | | -- pselvana |
7 | | -- sidmohan0 |
| 6 | +Please follow the [Code of Conduct](CODE_OF_CONDUCT.md) in all project spaces. |
| 7 | + |
| 8 | +## Branch And PR Policy |
| 9 | + |
| 10 | +DataFog uses `dev` as the default development branch and `main` as the stable |
| 11 | +release branch. |
| 12 | + |
| 13 | +Use this workflow for normal contributions: |
| 14 | + |
| 15 | +1. Fork the repository or create a topic branch from `dev`. |
| 16 | +2. Name branches with a GitHub username prefix when practical, for example |
| 17 | + `sidmohan0/dfpy-v44-bridge` or `yourname/fix-cli-redaction`. |
| 18 | +3. Open pull requests into `dev`. |
| 19 | +4. Keep pull requests focused and include tests or docs when behavior changes. |
| 20 | + |
| 21 | +Use `main` only for stable release promotion or urgent release hotfixes. |
| 22 | +Do not use `dev` or `main` as working branches. |
| 23 | + |
| 24 | +Maintainers should prefer pull requests even for small changes. Protected branch |
| 25 | +rules should prevent branch deletion, require CI before merge, and avoid direct |
| 26 | +pushes except for explicit emergency maintenance. |
| 27 | + |
| 28 | +## Local Development |
| 29 | + |
| 30 | +```bash |
| 31 | +git clone https://github.com/datafog/datafog-python |
| 32 | +cd datafog-python |
| 33 | +python -m venv .venv |
| 34 | +source .venv/bin/activate # Windows: .venv\Scripts\activate |
| 35 | +python -m pip install --upgrade pip |
| 36 | +pip install -e ".[dev,cli]" |
| 37 | +``` |
| 38 | + |
| 39 | +For optional NLP or OCR work, install the relevant extras: |
| 40 | + |
| 41 | +```bash |
| 42 | +pip install -e ".[dev,cli,nlp]" |
| 43 | +pip install -e ".[dev,cli,nlp,nlp-advanced]" |
| 44 | +pip install -e ".[all,dev]" |
| 45 | +``` |
8 | 46 |
|
9 | | -for their help |
| 47 | +## Tests |
10 | 48 |
|
11 | | -The datafog community appreciates your contributions via issues and |
12 | | -pull requests. Note that the [code of conduct](CODE_OF_CONDUCT.md) |
13 | | -applies to all interactions with the datafog project, including |
14 | | -issues and pull requests. |
| 49 | +Run the core test suite before opening a pull request: |
15 | 50 |
|
16 | | -When submitting pull requests, please follow the style guidelines of |
17 | | -the project, ensure that your code is tested and documented, and write |
18 | | -good commit messages, e.g., following [these |
19 | | -guidelines](https://chris.beams.io/posts/git-commit/). |
| 51 | +```bash |
| 52 | +pytest tests/ -m "not slow" \ |
| 53 | + --ignore=tests/test_gliner_annotator.py \ |
| 54 | + --ignore=tests/test_image_service.py \ |
| 55 | + --ignore=tests/test_ocr_integration.py \ |
| 56 | + --ignore=tests/test_spark_integration.py \ |
| 57 | + --ignore=tests/test_text_service_integration.py |
| 58 | +``` |
20 | 59 |
|
21 | | -By submitting a pull request, you are licensing your code under the |
22 | | -project [license](LICENSE) and affirming that you either own copyright |
23 | | -(automatic for most individuals) or are authorized to distribute under |
24 | | -the project license (e.g., in case your employer retains copyright on |
25 | | -your work). |
| 60 | +Run the focused test file for the area you changed whenever possible. For |
| 61 | +documentation-only changes, build the docs: |
26 | 62 |
|
27 | | -### Legal Notice |
| 63 | +```bash |
| 64 | +sphinx-build -b html docs docs/_build/html |
| 65 | +``` |
28 | 66 |
|
29 | | -When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license. |
| 67 | +## Pull Request Checklist |
| 68 | + |
| 69 | +Before requesting review: |
| 70 | + |
| 71 | +- Rebase or merge the latest `dev`. |
| 72 | +- Add or update tests for behavior changes. |
| 73 | +- Update docs for user-facing changes. |
| 74 | +- Keep public API changes explicit in the PR description. |
| 75 | +- Note any optional dependency profile you tested, such as `core`, `nlp`, or |
| 76 | + `nlp-advanced`. |
| 77 | + |
| 78 | +## Commit Messages |
| 79 | + |
| 80 | +Use clear, descriptive commit messages. Conventional-style prefixes are welcome |
| 81 | +but not required, for example: |
| 82 | + |
| 83 | +- `fix: handle empty scan input` |
| 84 | +- `docs: clarify branch policy` |
| 85 | +- `test: cover v5 preview redaction wrapper` |
| 86 | + |
| 87 | +## Legal |
| 88 | + |
| 89 | +By submitting a pull request, you license your contribution under the project |
| 90 | +[license](LICENSE). You also affirm that you authored the contribution or have |
| 91 | +the right to submit it under the project license. |
| 92 | + |
| 93 | +## Contributors |
| 94 | + |
| 95 | +Thanks to early contributors including: |
| 96 | + |
| 97 | +- sroy9675 |
| 98 | +- pselvana |
| 99 | +- sidmohan0 |
0 commit comments