Skip to content

Commit

Permalink
production: Fix generating bot static files in production.
Browse files Browse the repository at this point in the history
For upgrade-zulip-from-git to work, we need to be able to run
update-prod-static on production systems, which means provision code
like this cairosvg logic needs to be there for now.
  • Loading branch information
timabbott committed Apr 17, 2020
1 parent 0ccc0f0 commit 561ded5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
3 changes: 3 additions & 0 deletions requirements/common.in
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ https://github.com/zulip/libthumbor/archive/60ed2431c07686a12f2770b2d852c5650f3c
# Needed for string matching in AlertWordProcessor
pyahocorasick

# Needed for using integration logo svg files as bot avatars
cairosvg

# Needed for function decorators that don't break introspection.
# Used for rate limiting authentication.
decorator
Expand Down
3 changes: 0 additions & 3 deletions requirements/dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,3 @@ https://github.com/zulip/zulint/archive/aaed679f1ad38b230090eadd3870b7682500f60c
importlib-metadata
# built-in python > 3.6 needed by cfn-lint
importlib-resources

# Needed for using integration logo svg files as bot avatars
cairosvg
22 changes: 20 additions & 2 deletions requirements/prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ cachetools==4.0.0 \
--hash=sha256:9a52dd97a85f257f4e4127f15818e71a0c7899f121b34591fcc1173ea79a0198 \
--hash=sha256:b304586d357c43221856be51d73387f93e2a961598a9b6b6670664746f3b6c6c \
# via premailer
cairocffi==1.1.0 \
--hash=sha256:f1c0c5878f74ac9ccb5d48b2601fcc75390c881ce476e79f4cfedd288b1b05db \
# via cairosvg
cairosvg==2.4.2 \
--hash=sha256:4e668f96653326780036ebb0a9ff2bb59a8443d7bcfc51a14aab77b57a8e67ad \
--hash=sha256:9cb1df7e9bc60f75fb87f67940a8fb805aad544337a67a40b67c05cfe33711a2
cchardet==2.1.5 \
--hash=sha256:0f7ec49fcd28088c387d4afcc02c0549434d9e07deb2519365a6baa5b6c7ebb4 \
--hash=sha256:1a6d00b7cbd8acfc5e3093cb5f983a667d0752dc328123c8dcb293e252bfb024 \
Expand Down Expand Up @@ -112,7 +118,7 @@ cffi==1.13.2 \
--hash=sha256:dcd65317dd15bc0451f3e01c80da2216a31916bdcffd6221ca1202d96584aa25 \
--hash=sha256:e570d3ab32e2c2861c4ebe6ffcad6a8abf9347432a37608fe1fbd157b3f0036b \
--hash=sha256:fd43a88e045cf992ed09fa724b5315b790525f2676883a6ea64e3263bae6549d \
# via argon2-cffi, cryptography
# via argon2-cffi, cairocffi, cryptography
chardet==3.0.4 \
--hash=sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae \
--hash=sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691 \
Expand Down Expand Up @@ -140,6 +146,10 @@ cryptography==2.8 \
--hash=sha256:ecadccc7ba52193963c0475ac9f6fa28ac01e01349a2ca48509667ef41ffd2cf \
--hash=sha256:fb81c17e0ebe3358486cd8cc3ad78adbae58af12fc2bf2bc0bb84e8090fa5ce8 \
# via apns2, pyopenssl, requests, social-auth-core
cssselect2==0.3.0 \
--hash=sha256:5c2716f06b5de93f701d5755a9666f2ee22cbcd8b4da8adddfc30095ffea3abc \
--hash=sha256:97d7d4234f846f9996d838964d38e13b45541c18143bc55cf00e4bc1281ace76 \
# via cairosvg
cssselect==1.1.0 \
--hash=sha256:f612ee47b749c877ebae5bb77035d8f4202c6ad0f0fc1271b3c18ad6c4468ecf \
--hash=sha256:f95f8dedd925fd8f54edb3d2dfb44c190d9d18512377d3c1e2388d16126879bc \
Expand Down Expand Up @@ -545,6 +555,10 @@ stripe==2.42.0 \
--hash=sha256:eb5c2c35b2d31eaccb43983ca83de513b335100d9b71e79ca4c60085da464b77
https://github.com/zulip/talon/archive/7d8bdc4dbcfcc5a73298747293b99fe53da55315.zip#egg=talon==1.2.10.zulip1 \
--hash=sha256:21d87c437379287d09df7a2d2af7bd818d4fa00be619dff446dacbdb4338d921
tinycss2==1.0.2 \
--hash=sha256:6427d0e3faa0a5e0e8c9f6437e2de26148a7a197a8b0992789f23d9a802788cf \
--hash=sha256:9fdacc0e22d344ddd2ca053837c133900fe820ae1222f63b79617490a498507a \
# via cairosvg, cssselect2
tornado==4.5.3 \
--hash=sha256:5ef073ac6180038ccf99411fe05ae9aafb675952a2c8db60592d5daf8401f803 \
--hash=sha256:6d14e47eab0e15799cf3cdcc86b0b98279da68522caace2bd7ce644287685f0a \
Expand Down Expand Up @@ -576,6 +590,10 @@ wcwidth==0.1.8 \
--hash=sha256:8fd29383f539be45b20bd4df0dc29c20ba48654a41e661925e612311e9f3c603 \
--hash=sha256:f28b3e8a6483e5d49e7f8949ac1a78314e740333ae305b4ba5defd3e74fb37a8 \
# via prompt-toolkit
webencodings==0.5.1 \
--hash=sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78 \
--hash=sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923 \
# via cssselect2, tinycss2
xmlsec==1.3.3 \
--hash=sha256:e573c0172174973223d874ffd158ecd4e0faa761015474385289a6468dd29ed6 \
# via python3-saml
Expand All @@ -596,4 +614,4 @@ pip==20.0.2 \
setuptools==45.1.0 \
--hash=sha256:68e7fd3508687f94367f1aa090a3ed921cd045a60b73d8b0aa1f305199a0ca28 \
--hash=sha256:91f72d83602a6e5e4a9e4fe296e27185854038d7cbda49dcd7006c4d3b3b89d5 \
# via ipython, markdown
# via cairocffi, cssselect2, ipython, markdown, tinycss2
6 changes: 4 additions & 2 deletions tools/setup/generate_zulip_bots_static_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
import tempfile
from typing import List, Optional

import cairosvg

ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
if ZULIP_PATH not in sys.path:
sys.path.append(ZULIP_PATH)
from scripts.lib.setup_path import setup_path
setup_path()

import cairosvg

from zulip_bots.lib import get_bots_directory_path

Expand Down

0 comments on commit 561ded5

Please sign in to comment.