qrpack 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- qrpack-0.1.0/CONTRIBUTING.md +122 -0
- qrpack-0.1.0/LICENSE +21 -0
- qrpack-0.1.0/MANIFEST.in +7 -0
- qrpack-0.1.0/PKG-INFO +667 -0
- qrpack-0.1.0/README.md +633 -0
- qrpack-0.1.0/pyproject.toml +63 -0
- qrpack-0.1.0/qrpack/__init__.py +35 -0
- qrpack-0.1.0/qrpack/calibrate.py +208 -0
- qrpack-0.1.0/qrpack/cli.py +243 -0
- qrpack-0.1.0/qrpack/core.py +274 -0
- qrpack-0.1.0/qrpack/scan.py +135 -0
- qrpack-0.1.0/qrpack/sheet.py +247 -0
- qrpack-0.1.0/qrpack.egg-info/PKG-INFO +667 -0
- qrpack-0.1.0/qrpack.egg-info/SOURCES.txt +42 -0
- qrpack-0.1.0/qrpack.egg-info/dependency_links.txt +1 -0
- qrpack-0.1.0/qrpack.egg-info/entry_points.txt +2 -0
- qrpack-0.1.0/qrpack.egg-info/requires.txt +6 -0
- qrpack-0.1.0/qrpack.egg-info/top_level.txt +1 -0
- qrpack-0.1.0/setup.cfg +4 -0
- qrpack-0.1.0/tests/measure_archive_rules.py +64 -0
- qrpack-0.1.0/tests/measure_damaged_sheet.py +103 -0
- qrpack-0.1.0/tests/measure_ecc_cost.py +49 -0
- qrpack-0.1.0/tests/measure_scan_decoders.py +88 -0
- qrpack-0.1.0/tests/test_calibrate.py +79 -0
- qrpack-0.1.0/tests/test_calibrate_cli.py +82 -0
- qrpack-0.1.0/tests/test_calibrate_survives.py +137 -0
- qrpack-0.1.0/tests/test_cli.py +88 -0
- qrpack-0.1.0/tests/test_cli_pack.py +51 -0
- qrpack-0.1.0/tests/test_cli_restore.py +43 -0
- qrpack-0.1.0/tests/test_core_archive_rules.py +91 -0
- qrpack-0.1.0/tests/test_core_framing.py +106 -0
- qrpack-0.1.0/tests/test_core_pack.py +64 -0
- qrpack-0.1.0/tests/test_core_verify.py +91 -0
- qrpack-0.1.0/tests/test_damaged_sheet.py +170 -0
- qrpack-0.1.0/tests/test_readme_usage.py +113 -0
- qrpack-0.1.0/tests/test_release.py +22 -0
- qrpack-0.1.0/tests/test_scan.py +38 -0
- qrpack-0.1.0/tests/test_scan_reassemble.py +49 -0
- qrpack-0.1.0/tests/test_scan_sheet.py +24 -0
- qrpack-0.1.0/tests/test_sheet.py +48 -0
- qrpack-0.1.0/tests/test_sheet_ecc.py +87 -0
- qrpack-0.1.0/tests/test_sheet_layout.py +58 -0
- qrpack-0.1.0/tests/test_sheet_render_codes.py +80 -0
- qrpack-0.1.0/tests/test_smoke.py +17 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Contributing to qrpack
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in qrpack. This document covers how to get set up, the
|
|
4
|
+
conventions the project follows, and what a change needs before it can be merged.
|
|
5
|
+
|
|
6
|
+
## Getting set up
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
git clone https://github.com/arsentis/qrpack.git
|
|
10
|
+
cd qrpack
|
|
11
|
+
python3 -m venv .venv && source .venv/bin/activate
|
|
12
|
+
pip install -e ".[dev]"
|
|
13
|
+
python -m pytest -q
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The suite should pass before you change anything. If it does not, that is a bug
|
|
17
|
+
worth reporting on its own.
|
|
18
|
+
|
|
19
|
+
## Making a change
|
|
20
|
+
|
|
21
|
+
Work on a branch, never directly on `main`:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
git switch -c scan/report-missing-parts
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Branch names are prefixed with the area they touch — `core/`, `sheet/`, `scan/`,
|
|
28
|
+
`calibrate/`, `cli/`, `docs/`, `ci/` — followed by a short description.
|
|
29
|
+
|
|
30
|
+
Before opening a pull request:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
python -m pytest -q
|
|
34
|
+
git rebase origin/main
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Rebasing matters: CI tests your branch *merged with* `main`, so a green check on
|
|
38
|
+
a stale branch does not prove the branch works. Rebase first and run the tests
|
|
39
|
+
locally.
|
|
40
|
+
|
|
41
|
+
## Code conventions
|
|
42
|
+
|
|
43
|
+
- **`core.py` imports nothing outside the standard library.** It is the path
|
|
44
|
+
that decides whether a user's bytes come back intact; third-party code does
|
|
45
|
+
not belong there.
|
|
46
|
+
- **Validate before writing.** Build and check everything first, then create
|
|
47
|
+
files. A failure should never leave a half-written sheet or a partial restore.
|
|
48
|
+
- **Fail loudly and exit non-zero.** A backup tool that exits `0` without
|
|
49
|
+
writing anything is worse than one that crashes. Error messages name the
|
|
50
|
+
cause; tracebacks are not an interface.
|
|
51
|
+
- **Keep archives deterministic.** Entries are sorted and metadata zeroed so the
|
|
52
|
+
same input always produces the same bytes. Without that, the printed digest
|
|
53
|
+
verifies nothing.
|
|
54
|
+
- Type hints on public functions, and a docstring explaining *why* rather than
|
|
55
|
+
restating the signature.
|
|
56
|
+
|
|
57
|
+
## Tests
|
|
58
|
+
|
|
59
|
+
Every behavioural change needs a test. New tests go in `tests/test_<area>.py`
|
|
60
|
+
and should fail before your fix and pass after it.
|
|
61
|
+
|
|
62
|
+
Two conventions specific to this repository:
|
|
63
|
+
|
|
64
|
+
- **`tests/measure_*.py` are not tests.** They are measurement scripts whose
|
|
65
|
+
output is quoted in the README. If you change behaviour they describe, re-run
|
|
66
|
+
them and update the README with the new numbers.
|
|
67
|
+
- **`tests/test_readme_usage.py` guards the documentation.** It re-runs the
|
|
68
|
+
commands shown in the README and fails if their output no longer matches, so
|
|
69
|
+
stale documentation breaks the build instead of misleading a reader. If you
|
|
70
|
+
change the CLI, regenerate the transcripts with `bash tests/capture_usage.sh`.
|
|
71
|
+
|
|
72
|
+
Any number added to the README should name the command that reproduces it.
|
|
73
|
+
|
|
74
|
+
## Commits
|
|
75
|
+
|
|
76
|
+
One logical change per commit, with a message in the imperative mood and the
|
|
77
|
+
area as a prefix:
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
scan: report which parts are missing
|
|
81
|
+
core: reject archive members with absolute paths
|
|
82
|
+
docs: record the measured ECC cost in printed pixels
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Explain *why* in the body if the reason is not obvious from the diff.
|
|
86
|
+
|
|
87
|
+
## Pull requests
|
|
88
|
+
|
|
89
|
+
Open the pull request against `main` with:
|
|
90
|
+
|
|
91
|
+
- a description of what changed and why;
|
|
92
|
+
- the test output, or the commands you ran to verify it;
|
|
93
|
+
- `Closes #N` in the description if it resolves an issue. Only the description
|
|
94
|
+
works — a closing keyword in the title or a comment is ignored by GitHub.
|
|
95
|
+
|
|
96
|
+
Keep pull requests focused and reasonably small; they get reviewed faster and
|
|
97
|
+
regressions are easier to trace later.
|
|
98
|
+
|
|
99
|
+
One approving review is required before merge, and `main` is protected. Merge
|
|
100
|
+
with **rebase and merge** so individual commits are preserved in the history.
|
|
101
|
+
|
|
102
|
+
## Definition of done
|
|
103
|
+
|
|
104
|
+
A change is done when:
|
|
105
|
+
|
|
106
|
+
- [ ] the full suite passes locally and in CI;
|
|
107
|
+
- [ ] new behaviour has a test that fails without the change;
|
|
108
|
+
- [ ] errors exit non-zero with a message that names the cause;
|
|
109
|
+
- [ ] the README is updated if behaviour, output or measured numbers changed;
|
|
110
|
+
- [ ] the branch is rebased on `main` and has one approving review.
|
|
111
|
+
|
|
112
|
+
## Reporting bugs
|
|
113
|
+
|
|
114
|
+
Open an issue with the command you ran, the output you got, the output you
|
|
115
|
+
expected, and your Python and OpenCV versions:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
python -c "import sys, cv2; print(sys.version); print(cv2.__version__)"
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Decoding behaviour in particular varies between OpenCV builds, so that version
|
|
122
|
+
is often the most useful line in the report.
|
qrpack-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Arsen Toktarbek
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|