fix test pip deployments

This commit is contained in:
Dima Gerasimov 2020-04-19 17:56:37 +01:00 committed by karlicoss
parent 4a83ff4864
commit caabe4a3c8
2 changed files with 10 additions and 3 deletions

View file

@ -5,6 +5,7 @@ from pathlib import Path
from subprocess import check_call
import shutil
is_ci = os.environ.get('CI') is not None
def main():
import argparse
@ -19,6 +20,10 @@ def main():
root = Path(__file__).absolute().parent.parent
os.chdir(root) # just in case
if is_ci:
# see https://github.com/actions/checkout/issues/217
check_call('git fetch --prune --unshallow'.split())
dist = root / 'dist'
if dist.exists():
shutil.rmtree(dist)