| 1 |
This directory contains all the patches that we need to apply to the _vendored |
| 2 |
HPy files in order to use them. |
| 3 |
|
| 4 |
Ideally, it should be empty. When possible, it is much better to fix the HPy |
| 5 |
code upstream in such a way that we don't need a patch, but sometimes it is |
| 6 |
not possible and/or it is much easier to just put a patch here. |
| 7 |
|
| 8 |
There are two kinds of patches: |
| 9 |
|
| 10 |
- long-term patches: we expect these to be applied "forever". For example, |
| 11 |
00_fix_import_in_test_handles.patch |
| 12 |
|
| 13 |
- FIXME patches: these are temporary workarounds which we expect to delete |
| 14 |
soon and/or to incorporate upstream. For example, sometimes it is |
| 15 |
necessary to tweak a test to make it passing on |
| 16 |
pypy. _hpy_universal/update_vendored.sh reminds you about the number of |
| 17 |
FIXME patches: when you update to a new HPy revision, it might be a good |
| 18 |
idea to check whether you can kill some of them. |
| 19 |
|
| 20 |
If a patch fails to apply, too bad :(. You need to understand what's going on |
| 21 |
and either fix or delete it. |
| 22 |
|
| 23 |
|
| 24 |
To create a patch: |
| 25 |
|
| 26 |
1. ./pypy/module/_hpy_universal/update_vendored.sh to the desired HPy revision |
| 27 |
|
| 28 |
2. modify the files as you like |
| 29 |
|
| 30 |
3. hg diff _vendored test/_vendored > patches/FILENAME.patch |
| 31 |
|
| 32 |
The patch format allows to put arbirary text BEFORE the patch itself, so it is |
| 33 |
a good idea to put an explanation of why the patch is needed. E.g.: |
| 34 |
|
| 35 |
Here you can put whatever you want, it will be ignored by "patch". The |
| 36 |
real patch begins at the "diff" line below |
| 37 |
|
| 38 |
diff --git a/pypy/module/_hpy_universal/test/_vendored/test_00_basic.py b/pypy/module/_hpy_universal/test/_vendored/test_00_basic.py |
| 39 |
--- a/pypy/module/_hpy_universal/test/_vendored/test_00_basic.py |
| 40 |
+++ b/pypy/module/_hpy_universal/test/_vendored/test_00_basic.py |
| 41 |
@@ -8,6 +8,7 @@ |
| 42 |
""" |
| 43 |
from .support import HPyTest |
| 44 |
|
| 45 |
+# THIS IS JUST A TEST |
| 46 |
|
| 47 |
class TestBasic(HPyTest): |
| 48 |
|