379379pymupdf_dir_abs = os .path .abspath ( f'{ __file__ } /../..' )
380380
381381try :
382- sys .path .insert (0 , pymupdf_dir_abs )
382+ sys .path .insert (0 , f' { pymupdf_dir_abs } /src' )
383383 import pipcl
384384finally :
385385 del sys .path [0 ]
@@ -1140,13 +1140,9 @@ def get_requires_for_build_wheel(config_settings=None):
11401140 with open (f'{ testdir } /pyproject.toml' , 'w' ) as f :
11411141 f .write (textwrap .dedent ('''
11421142 [build-system]
1143- # We define required packages in setup.py:get_requires_for_build_wheel().
1144- requires = []
1145-
1146- # See pep-517.
1147- #
1148- build-backend = "setup"
1149- backend-path = ["."]
1143+ requires = ['pipcl']
1144+ build-backend = 'setup'
1145+ backend-path = ['.']
11501146 ''' ))
11511147
11521148 shutil .copy2 (f'{ pymupdf_dir_abs } /pipcl.py' , f'{ testdir } /pipcl.py' )
@@ -1513,16 +1509,17 @@ def getmtime(path):
15131509
15141510def get_pyproject_required (ppt = None ):
15151511 '''
1516- Returns space-separated names of required packages in pyproject.toml. We
1512+ Returns list of names of required packages in pyproject.toml. We
15171513 do not do a proper parse and rely on the packages being in a single line.
15181514 '''
15191515 if ppt is None :
15201516 ppt = os .path .abspath (f'{ __file__ } /../../pyproject.toml' )
15211517 with open (ppt ) as f :
15221518 for line in f :
1523- m = re .match ('^requires = \\ [(.*)\\ ]$' , line )
1519+ m = re .match ('^ * requires = \\ [(.*)\\ ]$' , line )
15241520 if m :
1525- names = m .group (1 ).replace (',' , ' ' ).replace ('"' , '' )
1521+ names = m .group (1 ).replace (',' , ' ' ).replace ('"' , '' ).replace ("'" , '' )
1522+ names = names .split ()
15261523 return names
15271524 else :
15281525 assert 0 , f'Failed to find "requires" line in { ppt } '
@@ -1538,6 +1535,7 @@ def wrap_get_requires_for_build_wheel(dir_):
15381535 ppt = os .path .join (dir_abs , 'pyproject.toml' )
15391536 if os .path .exists (ppt ):
15401537 ret += get_pyproject_required (ppt )
1538+ log (f'{ ret = } ' )
15411539 if os .path .exists (os .path .join (dir_abs , 'setup.py' )):
15421540 sys .path .insert (0 , dir_abs )
15431541 try :
0 commit comments