-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_deploy.py
37 lines (28 loc) · 1.02 KB
/
build_deploy.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
import logging as log
import shutil
from shell_utils import shell
log.basicConfig(level=log.INFO, format='%(message)s')
def __execute(command: str):
return print(shell(command, capture=True, silent=True).stdout)
def unit_test():
log.info('Running unit tests ...')
__execute('python -m pytest tests/unit/')
def int_test():
log.info('Running integration tests ...')
__execute('python -m pytest tests/integration/')
def install():
log.info('Installing package locally ...')
__execute('pip install .')
def build():
log.info('Building package ...')
shutil.rmtree('dist', ignore_errors=True)
__execute('python setup.py sdist bdist_wheel')
def check():
log.info('Checking package ...')
__execute('twine check dist/*')
def doc():
log.info('Generating documentation ...')
__execute('pdoc --force --html --output-dir docs fplpandas')
def publish(repository='testpypi'):
log.info(f'Publishing package to {repository} ...')
__execute(f'twine upload --repository {repository} dist/*')