-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathtasks.py
41 lines (27 loc) · 1.12 KB
/
tasks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import os
import sys
from invoke import Collection, task
from _docs import bundle, intl, site
# Disable pipenv warning, we run potentially inside the virtualenv already,
# Visual Code e.g. picks it up and there is no harm in that. This is only
# to not confuse people with a pipenv warning that it may not be working.
os.environ["PIPENV_VERBOSITY"] = "-1"
os.environ["PIPENV_IGNORE_VIRTUALENVS"] = "1"
@task
def virtualenv(c):
"""create and install env"""
c.run(f"{sys.executable} -m pip install -U pipenv")
c.run(f"{sys.executable} -m pipenv install --dev")
# Workaround pipenv failing to pin black version due to it being pre-release
# always.
# c.run(f"{sys.executable} -m pipenv run python -m pip install black==24.10.0")
@task
def serve(c):
c.run(f"{sys.executable} -m pipenv run python update.py --serve-site")
@task
def update_docs(c):
c.run(f"{sys.executable} -m pipenv run python update.py --update-docs")
@task
def post_process(c):
c.run(f"{sys.executable} -m pipenv run python update.py --post-process")
ns = Collection(intl, site, bundle, serve, update_docs, post_process, virtualenv)