feat: add sdist intermediate stage

This commit is contained in:
Félix Voituret
2019-11-08 19:35:30 -05:00
parent 5f67eec9a2
commit 647a163635

View File

@@ -1,5 +1,8 @@
version: 2 version: 2
jobs: jobs:
# =======================================================================================
# Python 3.6 testing.
# =======================================================================================
test-3.6: test-3.6:
docker: docker:
- image: python:3.6 - image: python:3.6
@@ -8,7 +11,8 @@ jobs:
- checkout - checkout
- restore_cache: - restore_cache:
keys: keys:
- python-3.6-cache-{{ checksum requirements.txt }} - python-3.6-cache-{{ .branch }}-{{ checksum requirements.txt }}
- python-3.6-cache-{{ .branch }}-
- python-3.6-cache- - python-3.6-cache-
- run: - run:
name: install ffmpeg name: install ffmpeg
@@ -17,13 +21,17 @@ jobs:
name: install python dependencies name: install python dependencies
command: pip install -r requirements.txt && pip install pytest command: pip install -r requirements.txt && pip install pytest
- save_cache: - save_cache:
key: python-3.6-cache-{{ checksum requirements.txt }} key: python-3.6-cache-{{ .branch }}-{{ checksum requirements.txt }}
paths: paths:
- "pretrained_models"
- "/usr/local/bin" - "/usr/local/bin"
- "/usr/local/lib/python3.6/site-packages" - "/usr/local/lib/python3.6/site-packages"
- run: - run:
name: pytest name: pytest
command: pytest -W ignore::FutureWarning -W ignore::DeprecationWarning command: pytest -W ignore::FutureWarning -W ignore::DeprecationWarning
# =======================================================================================
# Python 3.7 testing.
# =======================================================================================
test-3.7: test-3.7:
docker: docker:
- image: python:3.7 - image: python:3.7
@@ -32,7 +40,8 @@ jobs:
- checkout - checkout
- restore_cache: - restore_cache:
keys: keys:
- python-3.7-cache-{{ checksum requirements.txt }} - python-3.7-cache-{{ .branch }}-{{ checksum requirements.txt }}
- python-3.7-cache-{{ .branch }}-
- python-3.7-cache- - python-3.7-cache-
- run: - run:
name: install ffmpeg name: install ffmpeg
@@ -40,15 +49,19 @@ jobs:
- run: - run:
name: install python dependencies name: install python dependencies
command: pip install -r requirements.txt && pip install pytest command: pip install -r requirements.txt && pip install pytest
- save_cache:
key: python-3.7-cache-{{ checksum requirements.txt }}
paths:
- "/usr/local/bin"
- "/usr/local/lib/python3.7/site-packages"
- run: - run:
name: pytest name: pytest
command: pytest -W ignore::FutureWarning -W ignore::DeprecationWarning command: pytest -W ignore::FutureWarning -W ignore::DeprecationWarning
pypi-deploy: - save_cache:
key: python-3.7-cache-{{ .branch }}-{{ checksum requirements.txt }}
paths:
- "pretrained_models"
- "/usr/local/bin"
- "/usr/local/lib/python3.7/site-packages"
# =======================================================================================
# Source distribution packaging.
# =======================================================================================
sdist:
docker: docker:
- image: python:3 - image: python:3
steps: steps:
@@ -56,6 +69,20 @@ jobs:
- run: - run:
name: package name: package
command: python setup.py sdist command: python setup.py sdist
- save_cache:
key: sdist-{{ .branch }}-{{ checksum setup.py }}
paths:
- dist
# =======================================================================================
# PyPi deployment.
# =======================================================================================
pypi-deploy:
docker:
- image: python:3
steps:
- checkout
- restore_cache:
key: sdist-{{ .branch }}-{{ checksum setup.py }}
- run: - run:
name: upload to PyPi name: upload to PyPi
command: pip install twine && twine upload dist/* command: pip install twine && twine upload dist/*
@@ -65,11 +92,15 @@ workflows:
jobs: jobs:
- test-3.6 - test-3.6
- test-3.7 - test-3.7
- sdist:
requires:
- test-3.6
- test-3.7
- pypi-deploy: - pypi-deploy:
filters: filters:
branches: branches:
only: only:
- master - master
- development
requires: requires:
- test-3.6 - sdist
- test-3.7