2019-11-13 11:03:13 +00:00
|
|
|
# Python CircleCI 2.0 configuration file
|
|
|
|
#
|
|
|
|
# Check https://circleci.com/docs/2.0/language-python/ for more details
|
|
|
|
#
|
|
|
|
version: 2.0
|
|
|
|
|
|
|
|
references:
|
|
|
|
|
|
|
|
install_deps: &install_deps
|
|
|
|
run:
|
|
|
|
name: Install Dependences
|
|
|
|
command: |
|
2020-04-22 21:39:08 +00:00
|
|
|
sudo apt-get update && sudo apt-get install -y cmake
|
2020-04-02 16:28:44 +00:00
|
|
|
pip install "$TORCH_VERSION"
|
|
|
|
pip install -r requirements.txt -q
|
|
|
|
sudo pip install pytest pytest-cov pytest-flake8 -q
|
|
|
|
pip install -r ./tests/requirements.txt -q
|
2019-11-13 11:03:13 +00:00
|
|
|
|
2020-01-16 12:22:29 +00:00
|
|
|
tests: &tests
|
2019-11-13 11:03:13 +00:00
|
|
|
run:
|
2020-01-16 12:22:29 +00:00
|
|
|
name: Testing
|
2019-11-13 11:03:13 +00:00
|
|
|
command: |
|
|
|
|
python --version ; pip --version ; pip list
|
2020-03-25 11:46:27 +00:00
|
|
|
py.test pytorch_lightning tests -v --doctest-modules --junitxml=test-reports/pytest_junit.xml
|
2020-04-02 16:28:44 +00:00
|
|
|
no_output_timeout: 30m
|
2020-03-25 11:46:27 +00:00
|
|
|
|
|
|
|
examples: &examples
|
|
|
|
run:
|
|
|
|
name: PL Examples
|
|
|
|
command: |
|
|
|
|
pip install -r ./pl_examples/requirements.txt --user
|
|
|
|
python --version ; pip --version ; pip list
|
|
|
|
py.test pl_examples -v --doctest-modules --junitxml=test-reports/pytest_junit.xml
|
2020-04-02 16:28:44 +00:00
|
|
|
no_output_timeout: 20m
|
2019-11-13 11:03:13 +00:00
|
|
|
|
2020-02-12 16:28:47 +00:00
|
|
|
install_pkg: &install_pkg
|
|
|
|
run:
|
|
|
|
name: Install package
|
|
|
|
command: |
|
|
|
|
virtualenv vEnv ; source vEnv/bin/activate
|
|
|
|
pip install --editable . ; cd .. & python -c "import pytorch_lightning ; print(pytorch_lightning.__version__)"
|
|
|
|
deactivate ; rm -rf vEnv
|
|
|
|
|
2020-02-16 01:30:00 +00:00
|
|
|
create_pkg: &create_pkg
|
|
|
|
run:
|
|
|
|
name: Create package
|
|
|
|
command: |
|
2020-02-17 02:08:20 +00:00
|
|
|
sudo pip install twine==1.13.0
|
2020-02-16 01:30:00 +00:00
|
|
|
python setup.py sdist
|
|
|
|
twine check dist/*
|
2020-02-17 02:08:20 +00:00
|
|
|
python setup.py clean
|
2020-02-16 01:30:00 +00:00
|
|
|
|
2020-01-16 12:22:29 +00:00
|
|
|
format: &format
|
|
|
|
run:
|
|
|
|
name: Formatting
|
|
|
|
command: |
|
2020-04-02 16:28:44 +00:00
|
|
|
python --version ; pip --version
|
|
|
|
sudo pip install flake8 -q
|
|
|
|
pip list
|
|
|
|
flake8 .
|
2020-01-16 12:22:29 +00:00
|
|
|
|
2019-11-28 17:48:55 +00:00
|
|
|
make_docs: &make_docs
|
|
|
|
run:
|
|
|
|
name: Make Documentation
|
|
|
|
command: |
|
|
|
|
# sudo apt-get install pandoc
|
|
|
|
pip install -r requirements.txt --user
|
|
|
|
sudo pip install -r docs/requirements.txt
|
|
|
|
# sphinx-apidoc -o ./docs/source ./pytorch_lightning **/test_* --force --follow-links
|
2020-03-20 19:49:01 +00:00
|
|
|
cd docs; make clean ; make html --debug --jobs 2 SPHINXOPTS="-W"
|
2019-11-28 17:48:55 +00:00
|
|
|
|
2019-11-13 11:03:13 +00:00
|
|
|
jobs:
|
|
|
|
|
2019-11-28 17:48:55 +00:00
|
|
|
Build-Docs:
|
|
|
|
docker:
|
|
|
|
- image: circleci/python:3.7
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- *make_docs
|
2020-04-19 21:07:16 +00:00
|
|
|
- store_artifacts:
|
|
|
|
# allows us to preview the generated html pages
|
|
|
|
path: docs/build/html/
|
|
|
|
destination: html
|
2019-11-28 17:48:55 +00:00
|
|
|
|
2020-01-16 12:22:29 +00:00
|
|
|
Formatting:
|
|
|
|
docker:
|
|
|
|
- image: circleci/python:3.7
|
|
|
|
environment:
|
|
|
|
- TORCH_VERSION: "torch"
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- *format
|
|
|
|
|
2019-11-13 11:03:13 +00:00
|
|
|
PyTorch:
|
|
|
|
docker:
|
2020-04-02 16:28:44 +00:00
|
|
|
- image: circleci/python:3.6
|
2019-11-13 11:03:13 +00:00
|
|
|
environment:
|
|
|
|
- TORCH_VERSION: "torch"
|
|
|
|
steps: &steps
|
|
|
|
- checkout
|
2020-04-02 16:28:44 +00:00
|
|
|
#- restore_cache:
|
|
|
|
# keys:
|
|
|
|
# # when lock file changes, use increasingly general patterns to restore cache
|
|
|
|
# - pip-packages--{{ .Environment.CIRCLE_JOB }}
|
|
|
|
# - pip-packages--
|
2019-11-13 11:03:13 +00:00
|
|
|
- *install_deps
|
2020-04-02 16:28:44 +00:00
|
|
|
#- save_cache:
|
|
|
|
# key: pip-packages--{{ .Environment.CIRCLE_JOB }}
|
|
|
|
# paths:
|
|
|
|
# # this path depends on where pipenv creates a virtualenv
|
|
|
|
# - "~/.cache/pip"
|
|
|
|
# - "/usr/local/lib/python3.6/site-packages"
|
|
|
|
# - "/usr/local/lib/site-python"
|
2020-01-16 12:22:29 +00:00
|
|
|
- *tests
|
2019-11-13 11:03:13 +00:00
|
|
|
- store_test_results:
|
|
|
|
path: test-reports
|
|
|
|
- store_artifacts:
|
|
|
|
path: test-reports
|
|
|
|
|
2020-04-02 16:28:44 +00:00
|
|
|
PyTorch-v1_1:
|
2019-11-13 11:03:13 +00:00
|
|
|
docker:
|
|
|
|
- image: circleci/python:3.6
|
|
|
|
environment:
|
|
|
|
- TORCH_VERSION: "torch>=1.1, <1.2"
|
|
|
|
steps: *steps
|
|
|
|
|
2020-04-02 16:28:44 +00:00
|
|
|
PyTorch-v1_2:
|
2019-11-13 11:03:13 +00:00
|
|
|
docker:
|
|
|
|
- image: circleci/python:3.6
|
|
|
|
environment:
|
|
|
|
- TORCH_VERSION: "torch>=1.2, <1.3"
|
|
|
|
steps: *steps
|
|
|
|
|
2020-04-02 16:28:44 +00:00
|
|
|
PyTorch-v1_3:
|
2019-11-13 11:03:13 +00:00
|
|
|
docker:
|
|
|
|
- image: circleci/python:3.6
|
|
|
|
environment:
|
|
|
|
- TORCH_VERSION: "torch>=1.3, <1.4"
|
|
|
|
steps: *steps
|
|
|
|
|
2020-04-02 16:28:44 +00:00
|
|
|
PyTorch-v1_4:
|
2020-01-16 12:22:29 +00:00
|
|
|
docker:
|
|
|
|
- image: circleci/python:3.6
|
|
|
|
environment:
|
|
|
|
- TORCH_VERSION: "torch>=1.4, <1.5"
|
|
|
|
steps: *steps
|
|
|
|
|
2020-04-22 14:10:23 +00:00
|
|
|
PyTorch-v1_5:
|
|
|
|
docker:
|
|
|
|
- image: circleci/python:3.6
|
|
|
|
environment:
|
|
|
|
- TORCH_VERSION: "torch>=1.5, <1.6"
|
|
|
|
steps: *steps
|
|
|
|
|
2020-03-25 11:46:27 +00:00
|
|
|
Examples:
|
|
|
|
docker:
|
|
|
|
- image: circleci/python:3.7
|
|
|
|
environment:
|
|
|
|
- TORCH_VERSION: "torch"
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- *install_deps
|
|
|
|
- *examples
|
|
|
|
|
2020-02-12 16:28:47 +00:00
|
|
|
Install-pkg:
|
|
|
|
docker:
|
|
|
|
- image: circleci/python:3.7
|
|
|
|
steps:
|
|
|
|
- checkout
|
2020-02-16 01:30:00 +00:00
|
|
|
- *create_pkg
|
2020-02-12 16:28:47 +00:00
|
|
|
- *install_pkg
|
|
|
|
|
2020-04-02 16:28:44 +00:00
|
|
|
#orbs:
|
|
|
|
# python: circleci/python@0.2.1
|
2020-02-12 16:28:47 +00:00
|
|
|
|
2019-11-13 11:03:13 +00:00
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
build:
|
|
|
|
jobs:
|
2020-01-16 12:22:29 +00:00
|
|
|
- Formatting
|
2019-11-28 17:48:55 +00:00
|
|
|
- Build-Docs
|
2020-04-02 16:28:44 +00:00
|
|
|
- PyTorch-v1_1
|
|
|
|
- PyTorch-v1_2
|
|
|
|
- PyTorch-v1_3
|
|
|
|
- PyTorch-v1_4
|
2020-04-22 14:10:23 +00:00
|
|
|
- PyTorch-v1_5
|
2020-02-12 16:28:47 +00:00
|
|
|
- Install-pkg
|
2020-03-25 11:46:27 +00:00
|
|
|
- Examples
|