Skip to content

Commit 7ddc587

Browse files
committed
Merge branch 'hpy-import'
2 parents 7529158 + 7b9fc7e commit 7ddc587

File tree

11 files changed

+359
-332
lines changed

11 files changed

+359
-332
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

22
// automatically generated by setup.py:get_scm_config()
3-
#define HPY_VERSION "0.0.3.dev317+ng8fe1487"
4-
#define HPY_GIT_REVISION "8fe1487"
3+
#define HPY_VERSION "0.0.3"
4+
#define HPY_GIT_REVISION "33c8692"

graalpython/lib-graalpython/modules/hpy.devel.egg-info/PKG-INFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: hpy.devel
3-
Version: 0.0.3.dev317+ng8fe1487
3+
Version: 0.0.3
44
Summary: UNKNOWN
55
Home-page: UNKNOWN
66
License: UNKNOWN

graalpython/lib-graalpython/modules/hpy/devel/src/runtime/argparse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@
150150
* used as the error message instead of the default error message. : and ;
151151
* are mutually exclusive and whichever occurs first takes precedence.
152152
*
153-
* API
154-
* ---
153+
* Argument Parsing API
154+
* --------------------
155155
*
156156
*/
157157

graalpython/lib-graalpython/modules/hpy/devel/src/runtime/helpers.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
* These are not part of the HPy context or ABI, but are available for
2929
* HPy extensions to incorporate at compile time.
3030
*
31-
* API
32-
* ---
31+
* Runtime Helpers API
32+
* -------------------
3333
*
3434
*/
3535

graalpython/lib-graalpython/modules/hpy/devel/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222
# SOFTWARE.
2323

2424
# automatically generated by setup.py:get_scm_config()
25-
__version__ = "0.0.3.dev317+ng8fe1487"
26-
__git_revision__ = "8fe1487"
25+
__version__ = "0.0.3"
26+
__git_revision__ = "33c8692"

graalpython/lib-graalpython/modules/hpy/test/check_py27_compat.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,19 @@
3838
import py
3939

4040
ROOT = py.path.local(__file__).join('..', '..')
41+
TEST_DIRS = [ROOT / 'test', ROOT / 'test' / 'debug']
42+
43+
# PyPy does NOT import these files using py2
44+
PY3_ONLY = ['test_support.py', 'test_handles.py']
4145

4246
def try_import(name):
4347
try:
44-
print('Trying to import %s... ' % name, end='')
45-
__import__(name)
48+
if isinstance(name, py.path.local):
49+
print('Trying to import %s... ' % ROOT.bestrelpath(name), end='')
50+
name.pyimport()
51+
else:
52+
print('Trying to import %s... ' % name, end='')
53+
__import__(name)
4654
except:
4755
print('ERROR!')
4856
print()
@@ -71,15 +79,17 @@ def try_import_hpy_devel():
7179
init_py.remove()
7280
return failed
7381

74-
def try_import_tests():
82+
def try_import_tests(dirs):
7583
failed = 0
76-
for t in ROOT.join('test').listdir('test_*.py'):
77-
if t.purebasename == 'test_support':
78-
continue
79-
if not try_import('test.%s' % t.purebasename):
80-
failed += 1
84+
for d in dirs:
85+
for t in d.listdir('test_*.py'):
86+
if t.basename in PY3_ONLY:
87+
continue
88+
if not try_import(t):
89+
failed += 1
8190
return failed
8291

92+
8393
def main():
8494
if sys.version_info[:2] != (2, 7):
8595
print('ERROR: this script should be run on top of python 2.7')
@@ -88,7 +98,7 @@ def main():
8898
sys.path.insert(0, str(ROOT))
8999
failed = 0
90100
failed += try_import_hpy_devel()
91-
failed += try_import_tests()
101+
failed += try_import_tests(TEST_DIRS)
92102
print()
93103
if failed == 0:
94104
print('Everything ok!')

graalpython/lib-graalpython/modules/hpy/test/conftest.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
# SOFTWARE.
2323
import sys
2424
import pytest
25-
from .support import ExtensionCompiler
26-
from hpy.debug.pytest import hpy_debug # make it available to all tests
25+
from .support import ExtensionCompiler, DefaultExtensionTemplate
26+
from hpy.debug.leakdetector import LeakDetector
2727

2828
GRAALPYTHON_NATIVE = sys.implementation.name == 'graalpython' and __graalpython__.platform_id == 'native'
2929

@@ -39,16 +39,27 @@ def hpy_devel(request):
3939

4040
@pytest.fixture(params=['cpython', 'universal', 'debug', 'nfi'] if GRAALPYTHON_NATIVE else ['cpython', 'universal', 'debug'])
4141
def hpy_abi(request):
42-
return request.param
42+
abi = request.param
43+
if abi == 'debug':
44+
with LeakDetector():
45+
yield abi
46+
else:
47+
yield abi
4348

4449
@pytest.fixture
45-
def compiler(request, tmpdir, hpy_devel, hpy_abi):
50+
def ExtensionTemplate():
51+
return DefaultExtensionTemplate
52+
53+
54+
@pytest.fixture
55+
def compiler(request, tmpdir, hpy_devel, hpy_abi, ExtensionTemplate):
4656
compiler_verbose = request.config.getoption('--compiler-v')
4757
return ExtensionCompiler(tmpdir, hpy_devel, hpy_abi,
48-
compiler_verbose=compiler_verbose)
58+
compiler_verbose=compiler_verbose,
59+
ExtensionTemplate=ExtensionTemplate)
4960

5061
@pytest.fixture()
5162
def skip_nfi(self, hpy_abi):
5263
# skip all tests in this class for NFI mode
5364
if hpy_abi == 'nfi':
54-
pytest.skip()
65+
pytest.skip()

0 commit comments

Comments
 (0)