Use a prebuilt calibre binary to build POT

This commit is contained in:
Kovid Goyal 2020-08-23 12:54:43 +05:30
parent a6b4ceff58
commit 15e5f5987a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 11 additions and 10 deletions

View File

@ -19,16 +19,9 @@ jobs:
with:
python-version: 3.8
- name: Install calibre dependencies
run:
python setup/unix-ci.py install
- name: Install translations dependencies
run:
python -m pip install -U transifex-client sphinx msgpack
- name: Bootstrap calibre
run: python setup/unix-ci.py bootstrap
python -m pip install -U transifex-client sphinx
- name: Update translations
env:

View File

@ -83,6 +83,14 @@ def download_and_decompress(url, dest, compression=None):
raise SystemExit('Failed to download ' + url)
def install_calibre_binary():
dest = os.path.expanduser('~/calibre-bin')
os.mkdir(dest)
# change this to the canonical download url once 5.0 is released
download_and_decompress('https://download.calibre-ebook.com/calibre-4.99.12-x86_64.txz', dest, 'J')
return os.path.join(dest, 'calibre-debug')
def run_python(*args):
python = os.path.expandvars('$SW/bin/python')
if len(args) == 1:
@ -115,7 +123,6 @@ def main():
run_python('setup.py bootstrap --ephemeral')
elif action == 'pot':
install_env()
transifexrc = '''\
[https://www.transifex.com]
api_hostname = https://api.transifex.com
@ -125,7 +132,8 @@ username = api
'''.replace('PASSWORD', os.environ['tx'])
with open(os.path.expanduser('~/.transifexrc'), 'w') as f:
f.write(transifexrc)
run_python('setup.py pot')
interpreter = install_calibre_binary()
run(interpreter, 'setup.py', 'pot')
elif action == 'test':
os.environ['CI'] = 'true'