Skip to content

Commit 73433bc

Browse files
setup.py scripts/test.py: fix for manual invocation of actions.
It doesn't seem possible to set an Action variable as unset if it has a default value, so we we treat '-' as unset.
1 parent 98ade1c commit 73433bc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

scripts/test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def main(argv):
188188
implementations = next(args)
189189
elif arg in ('--mupdf', '-m'):
190190
mupdf = next(args)
191-
if not mupdf.startswith('git:'):
191+
if not mupdf.startswith('git:') and mupdf != '-':
192192
assert os.path.isdir(mupdf), f'Not a directory: {mupdf=}.'
193193
mupdf = os.path.abspath(mupdf)
194194
os.environ['PYMUPDF_SETUP_MUPDF_BUILD'] = mupdf

setup.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@
8080
For internal testing.
8181
8282
PYMUPDF_SETUP_MUPDF_BUILD
83-
If set, overrides location of MuPDF when building PyMuPDF:
83+
If unset or '-', use internal hard-coded default MuPDF location.
84+
Otherwise overrides location of MuPDF when building PyMuPDF:
8485
Empty string:
8586
Build PyMuPDF with the system MuPDF.
8687
A string starting with 'git:':
@@ -526,6 +527,9 @@ def get_mupdf(path=None, sha=None):
526527
PYMUPDF_SETUP_MUPDF_BUILD; see docs at start of this file for details.
527528
'''
528529
m = os.environ.get('PYMUPDF_SETUP_MUPDF_BUILD')
530+
if m == '-':
531+
# This allows easy specification in Github actions.
532+
m = None
529533
if m is None and os.path.isfile(mupdf_tgz):
530534
# This makes us use tgz inside sdist.
531535
log(f'Using local tgz: {mupdf_tgz=}')

0 commit comments

Comments
 (0)