-
Notifications
You must be signed in to change notification settings - Fork 4
/
tasks.py
36 lines (26 loc) · 888 Bytes
/
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
from invoke import task
@task
def setup(c, version=None):
"""
Setup dev environment, requires conda
"""
version = version or "3.9"
suffix = "" if version == "3.9" else version.replace(".", "")
env_name = f"ploomber_dummy{suffix}"
c.run(f"conda create --name {env_name} python={version} --yes")
c.run(
'eval "$(conda shell.bash hook)" '
f"&& conda activate {env_name} "
"&& pip install --editable .[dev]"
)
print(f"Done! Activate your environment with:\nconda activate {env_name}")
@task(aliases=["v"])
def version(c):
"""Create a new stable version commit"""
from pkgmt import versioneer
versioneer.version(project_root=".", tag=True)
@task(aliases=["r"])
def release(c, tag, production=True):
"""Upload to PyPI"""
from pkgmt import versioneer
versioneer.upload(tag, production=production)