patchcraft 0.2.1__tar.gz → 0.2.2__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.
Files changed (49) hide show
  1. {patchcraft-0.2.1 → patchcraft-0.2.2}/.github/workflows/release.yml +128 -128
  2. {patchcraft-0.2.1 → patchcraft-0.2.2}/CHANGELOG.md +340 -271
  3. {patchcraft-0.2.1 → patchcraft-0.2.2}/CONTRIBUTING.md +98 -98
  4. patchcraft-0.2.2/PKG-INFO +155 -0
  5. patchcraft-0.2.2/README.md +138 -0
  6. patchcraft-0.2.2/README.pt-BR.md +138 -0
  7. patchcraft-0.2.2/README.pypi.md +115 -0
  8. {patchcraft-0.2.1 → patchcraft-0.2.2}/docs/ADR/0001-patch-extraction-api.md +100 -100
  9. {patchcraft-0.2.1 → patchcraft-0.2.2}/docs/ADR/0002-patchify-transform.md +101 -101
  10. patchcraft-0.2.2/docs/ADR/0003-reversibility-classes.md +107 -0
  11. {patchcraft-0.2.1 → patchcraft-0.2.2}/docs/AUXILIARY.md +169 -169
  12. patchcraft-0.2.2/docs/FOCO-1.0.md +110 -0
  13. patchcraft-0.2.2/docs/GUIDE.md +848 -0
  14. {patchcraft-0.2.1 → patchcraft-0.2.2}/docs/ROADMAP.md +111 -111
  15. {patchcraft-0.2.1 → patchcraft-0.2.2}/docs/SCOPE.md +293 -293
  16. {patchcraft-0.2.1 → patchcraft-0.2.2}/docs/STUDIES/2026-08-04-patch-techniques.md +29 -4
  17. {patchcraft-0.2.1 → patchcraft-0.2.2}/docs/THEORY.md +460 -460
  18. {patchcraft-0.2.1 → patchcraft-0.2.2}/docs/USAGE.md +491 -485
  19. {patchcraft-0.2.1 → patchcraft-0.2.2}/pyproject.toml +100 -100
  20. {patchcraft-0.2.1 → patchcraft-0.2.2}/src/patchcraft/__init__.py +40 -40
  21. {patchcraft-0.2.1 → patchcraft-0.2.2}/src/patchcraft/cache.py +247 -247
  22. {patchcraft-0.2.1 → patchcraft-0.2.2}/src/patchcraft/extract.py +116 -116
  23. {patchcraft-0.2.1 → patchcraft-0.2.2}/src/patchcraft/geometry.py +290 -290
  24. {patchcraft-0.2.1 → patchcraft-0.2.2}/src/patchcraft/metrics.py +159 -159
  25. {patchcraft-0.2.1 → patchcraft-0.2.2}/src/patchcraft/pair.py +166 -161
  26. {patchcraft-0.2.1 → patchcraft-0.2.2}/src/patchcraft/reconstruct.py +155 -148
  27. {patchcraft-0.2.1 → patchcraft-0.2.2}/src/patchcraft/resize.py +202 -202
  28. {patchcraft-0.2.1 → patchcraft-0.2.2}/src/patchcraft/stitch.py +239 -239
  29. {patchcraft-0.2.1 → patchcraft-0.2.2}/tests/_datasets.py +117 -117
  30. {patchcraft-0.2.1 → patchcraft-0.2.2}/tests/conftest.py +1 -1
  31. {patchcraft-0.2.1 → patchcraft-0.2.2}/tests/test_cache.py +254 -254
  32. {patchcraft-0.2.1 → patchcraft-0.2.2}/tests/test_extract.py +250 -250
  33. {patchcraft-0.2.1 → patchcraft-0.2.2}/tests/test_geometry.py +333 -333
  34. {patchcraft-0.2.1 → patchcraft-0.2.2}/tests/test_import.py +14 -14
  35. {patchcraft-0.2.1 → patchcraft-0.2.2}/tests/test_metrics.py +213 -213
  36. {patchcraft-0.2.1 → patchcraft-0.2.2}/tests/test_pair.py +241 -212
  37. {patchcraft-0.2.1 → patchcraft-0.2.2}/tests/test_reconstruct.py +262 -262
  38. {patchcraft-0.2.1 → patchcraft-0.2.2}/tests/test_resize.py +229 -229
  39. {patchcraft-0.2.1 → patchcraft-0.2.2}/tests/test_stitch.py +283 -283
  40. patchcraft-0.2.1/PKG-INFO +0 -208
  41. patchcraft-0.2.1/README.md +0 -168
  42. {patchcraft-0.2.1 → patchcraft-0.2.2}/.github/workflows/test.yml +0 -0
  43. {patchcraft-0.2.1 → patchcraft-0.2.2}/.gitignore +0 -0
  44. {patchcraft-0.2.1 → patchcraft-0.2.2}/.python-version +0 -0
  45. {patchcraft-0.2.1 → patchcraft-0.2.2}/LICENSE +0 -0
  46. {patchcraft-0.2.1 → patchcraft-0.2.2}/src/patchcraft/py.typed +0 -0
  47. {patchcraft-0.2.1 → patchcraft-0.2.2}/tests/__init__.py +0 -0
  48. {patchcraft-0.2.1 → patchcraft-0.2.2}/tests/test_datasets_helper.py +0 -0
  49. {patchcraft-0.2.1 → patchcraft-0.2.2}/uv.lock +0 -0
@@ -1,128 +1,128 @@
1
- name: release
2
-
3
- # Triggered when a version tag is pushed (vX.Y.Z[.aN, .bN, .rcN]).
4
- # Steps:
5
- # 1. Re-run the test job that test.yml uses (sanity check on the
6
- # exact ref being released).
7
- # 2. Build the wheel + sdist with `uv build`.
8
- # 3. Publish to PyPI via Trusted Publishing (OIDC) -- no token,
9
- # no secret. The pypi.org side must have a configured publisher
10
- # pointing at THIS repo + THIS workflow + the `pypi` environment.
11
- # 4. Create / update the GitHub Release page and attach the
12
- # `dist/*.whl` and `dist/*.tar.gz` files.
13
-
14
- on:
15
- push:
16
- tags:
17
- - "v[0-9]+.[0-9]+.[0-9]+"
18
- - "v[0-9]+.[0-9]+.[0-9]+.[ab][0-9]+"
19
- - "v[0-9]+.[0-9]+.[0-9]+.rc[0-9]+"
20
-
21
- permissions:
22
- contents: read
23
-
24
- jobs:
25
- validate:
26
- name: re-run tests at tag ref
27
- runs-on: ubuntu-latest
28
- env:
29
- UV_PYTHON: "3.13"
30
- steps:
31
- - uses: actions/checkout@v4
32
- - uses: astral-sh/setup-uv@v3
33
- with:
34
- enable-cache: true
35
- - run: uv python install
36
- - run: uv sync --locked --extra cache --extra dev
37
- - name: Tag must match __version__
38
- run: |
39
- tag="${GITHUB_REF_NAME#v}"
40
- pkg="$(uv run python -c 'import patchcraft; print(patchcraft.__version__)')"
41
- if [ "$tag" != "$pkg" ]; then
42
- echo "::error::tag ${GITHUB_REF_NAME} implies version '${tag}' but patchcraft.__version__ is '${pkg}'"
43
- exit 1
44
- fi
45
- echo "tag ${GITHUB_REF_NAME} matches __version__ ${pkg}"
46
- - run: uv run ruff check src tests
47
- - run: uv run mypy --strict src
48
- - run: uv run pytest -m "not gpu"
49
-
50
- build:
51
- name: build wheel + sdist
52
- runs-on: ubuntu-latest
53
- needs: validate
54
- steps:
55
- - uses: actions/checkout@v4
56
- - uses: astral-sh/setup-uv@v3
57
- - run: uv build
58
- - name: Inspect dist metadata
59
- run: |
60
- uv run --with twine twine check dist/*
61
- ls -la dist/
62
- - uses: actions/upload-artifact@v4
63
- with:
64
- name: dist
65
- path: dist/
66
-
67
- publish-pypi:
68
- name: publish to PyPI (Trusted Publishing)
69
- runs-on: ubuntu-latest
70
- needs: build
71
- environment:
72
- name: pypi
73
- url: https://pypi.org/project/patchcraft/
74
- permissions:
75
- id-token: write # required for OIDC token exchange with PyPI
76
- steps:
77
- - uses: actions/download-artifact@v4
78
- with:
79
- name: dist
80
- path: dist/
81
- - name: Publish via Trusted Publishing
82
- uses: pypa/gh-action-pypi-publish@release/v1
83
- with:
84
- # A version already on PyPI is a no-op instead of a hard failure.
85
- # Without this, re-running the pipeline (or tagging a version that
86
- # was uploaded by hand) fails here, and `github-release` never runs
87
- # because it is `needs: publish-pypi`.
88
- skip-existing: true
89
- # No `password` field -- OIDC handles authentication.
90
- # The pypi.org "Pending publisher" config must match:
91
- # PyPI project name: patchcraft
92
- # Owner: LeoPR
93
- # Repository: PatchCraft
94
- # Workflow: release.yml
95
- # Environment: pypi
96
-
97
- github-release:
98
- name: create GitHub Release with assets
99
- runs-on: ubuntu-latest
100
- needs: publish-pypi
101
- permissions:
102
- contents: write # required to create a Release
103
- steps:
104
- - uses: actions/checkout@v4
105
- - uses: actions/download-artifact@v4
106
- with:
107
- name: dist
108
- path: dist/
109
- - name: Extract version from tag
110
- id: ver
111
- run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
112
- - name: Create Release + attach assets
113
- uses: softprops/action-gh-release@v2
114
- with:
115
- name: "PatchCraft ${{ github.ref_name }}"
116
- body: |
117
- See [`CHANGELOG.md`](https://github.com/LeoPR/PatchCraft/blob/main/CHANGELOG.md) for the full notes.
118
-
119
- Install:
120
- ```
121
- pip install patchcraft==${{ steps.ver.outputs.version }}
122
- ```
123
- files: |
124
- dist/*.whl
125
- dist/*.tar.gz
126
- fail_on_unmatched_files: true
127
- draft: false
128
- prerelease: false
1
+ name: release
2
+
3
+ # Triggered when a version tag is pushed (vX.Y.Z[.aN, .bN, .rcN]).
4
+ # Steps:
5
+ # 1. Re-run the test job that test.yml uses (sanity check on the
6
+ # exact ref being released).
7
+ # 2. Build the wheel + sdist with `uv build`.
8
+ # 3. Publish to PyPI via Trusted Publishing (OIDC) -- no token,
9
+ # no secret. The pypi.org side must have a configured publisher
10
+ # pointing at THIS repo + THIS workflow + the `pypi` environment.
11
+ # 4. Create / update the GitHub Release page and attach the
12
+ # `dist/*.whl` and `dist/*.tar.gz` files.
13
+
14
+ on:
15
+ push:
16
+ tags:
17
+ - "v[0-9]+.[0-9]+.[0-9]+"
18
+ - "v[0-9]+.[0-9]+.[0-9]+.[ab][0-9]+"
19
+ - "v[0-9]+.[0-9]+.[0-9]+.rc[0-9]+"
20
+
21
+ permissions:
22
+ contents: read
23
+
24
+ jobs:
25
+ validate:
26
+ name: re-run tests at tag ref
27
+ runs-on: ubuntu-latest
28
+ env:
29
+ UV_PYTHON: "3.13"
30
+ steps:
31
+ - uses: actions/checkout@v4
32
+ - uses: astral-sh/setup-uv@v3
33
+ with:
34
+ enable-cache: true
35
+ - run: uv python install
36
+ - run: uv sync --locked --extra cache --extra dev
37
+ - name: Tag must match __version__
38
+ run: |
39
+ tag="${GITHUB_REF_NAME#v}"
40
+ pkg="$(uv run python -c 'import patchcraft; print(patchcraft.__version__)')"
41
+ if [ "$tag" != "$pkg" ]; then
42
+ echo "::error::tag ${GITHUB_REF_NAME} implies version '${tag}' but patchcraft.__version__ is '${pkg}'"
43
+ exit 1
44
+ fi
45
+ echo "tag ${GITHUB_REF_NAME} matches __version__ ${pkg}"
46
+ - run: uv run ruff check src tests
47
+ - run: uv run mypy --strict src
48
+ - run: uv run pytest -m "not gpu"
49
+
50
+ build:
51
+ name: build wheel + sdist
52
+ runs-on: ubuntu-latest
53
+ needs: validate
54
+ steps:
55
+ - uses: actions/checkout@v4
56
+ - uses: astral-sh/setup-uv@v3
57
+ - run: uv build
58
+ - name: Inspect dist metadata
59
+ run: |
60
+ uv run --with twine twine check dist/*
61
+ ls -la dist/
62
+ - uses: actions/upload-artifact@v4
63
+ with:
64
+ name: dist
65
+ path: dist/
66
+
67
+ publish-pypi:
68
+ name: publish to PyPI (Trusted Publishing)
69
+ runs-on: ubuntu-latest
70
+ needs: build
71
+ environment:
72
+ name: pypi
73
+ url: https://pypi.org/project/patchcraft/
74
+ permissions:
75
+ id-token: write # required for OIDC token exchange with PyPI
76
+ steps:
77
+ - uses: actions/download-artifact@v4
78
+ with:
79
+ name: dist
80
+ path: dist/
81
+ - name: Publish via Trusted Publishing
82
+ uses: pypa/gh-action-pypi-publish@release/v1
83
+ with:
84
+ # A version already on PyPI is a no-op instead of a hard failure.
85
+ # Without this, re-running the pipeline (or tagging a version that
86
+ # was uploaded by hand) fails here, and `github-release` never runs
87
+ # because it is `needs: publish-pypi`.
88
+ skip-existing: true
89
+ # No `password` field -- OIDC handles authentication.
90
+ # The pypi.org "Pending publisher" config must match:
91
+ # PyPI project name: patchcraft
92
+ # Owner: LeoPR
93
+ # Repository: PatchCraft
94
+ # Workflow: release.yml
95
+ # Environment: pypi
96
+
97
+ github-release:
98
+ name: create GitHub Release with assets
99
+ runs-on: ubuntu-latest
100
+ needs: publish-pypi
101
+ permissions:
102
+ contents: write # required to create a Release
103
+ steps:
104
+ - uses: actions/checkout@v4
105
+ - uses: actions/download-artifact@v4
106
+ with:
107
+ name: dist
108
+ path: dist/
109
+ - name: Extract version from tag
110
+ id: ver
111
+ run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
112
+ - name: Create Release + attach assets
113
+ uses: softprops/action-gh-release@v2
114
+ with:
115
+ name: "PatchCraft ${{ github.ref_name }}"
116
+ body: |
117
+ See [`CHANGELOG.md`](https://github.com/LeoPR/PatchCraft/blob/main/CHANGELOG.md) for the full notes.
118
+
119
+ Install:
120
+ ```
121
+ pip install patchcraft==${{ steps.ver.outputs.version }}
122
+ ```
123
+ files: |
124
+ dist/*.whl
125
+ dist/*.tar.gz
126
+ fail_on_unmatched_files: true
127
+ draft: false
128
+ prerelease: false