Skip to content

Commit e7f734c

Browse files
author
Igor Serko
authored
CI improvements (lyst#541)
* move circle.yml to the default location .circleci/config.yml * added 2.0/2.1 workflows * allow restore_cache to restore from multiple keys * expose test results to CircleCI * test using multiple python versions * ignoring non-pep8 compliant E203 error * fix appveyor reference to requirements * black-ify setup.py and remove deprecated test command * update travis osx build to py3
1 parent 39b0b88 commit e7f734c

10 files changed

+192
-132
lines changed

.circleci/config.yml

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
version: 2.1
2+
3+
jobs:
4+
pytest:
5+
parameters:
6+
image:
7+
description: "Docker image to run tests in"
8+
default: "circleci/python:3.8.3-buster-browsers"
9+
type: string
10+
python_version:
11+
description: "Python version used to separate cache"
12+
default: "py38"
13+
type: string
14+
docker:
15+
- image: << parameters.image >>
16+
steps:
17+
- checkout
18+
- restore_cache:
19+
keys:
20+
- deps-<< parameters.python_version>>-{{ .Branch }}-{{ checksum "test-requirements.txt" }}
21+
- deps-<< parameters.python_version>>-{{ .Branch }}-
22+
- deps-<< parameters.python_version>>-
23+
- run:
24+
name: Install test requirements
25+
command: |
26+
python3 -m venv venv
27+
. venv/bin/activate
28+
pip install -r test-requirements.txt .
29+
- save_cache:
30+
key: deps-<< parameters.python_version>>-{{ .Branch }}-{{ checksum "test-requirements.txt" }}
31+
paths:
32+
- "venv"
33+
- run:
34+
name: Test run
35+
command: |
36+
. venv/bin/activate
37+
mkdir test_results
38+
mv lightfm _lightfm
39+
py.test -xv --junitxml=test_results/junit.xml tests
40+
- store_test_results:
41+
path: test_results
42+
lint:
43+
docker:
44+
- image: circleci/python:3.8.3-buster
45+
steps:
46+
- checkout
47+
- restore_cache:
48+
keys:
49+
- deps-lint-{{ .Branch }}-{{ checksum "lint-requirements.txt"}}
50+
- deps-lint-{{ .Branch }}-
51+
- deps-lint-
52+
- run:
53+
name: Install lint requirements
54+
command: |
55+
python3 -m venv venv
56+
. venv/bin/activate
57+
pip install -r "lint-requirements.txt"
58+
- save_cache:
59+
key: deps-lint-{{ .Branch }}-{{ checksum "lint-requirements.txt" }}
60+
paths:
61+
- "venv"
62+
- run:
63+
name: Lint
64+
command: |
65+
. venv/bin/activate
66+
flake8 setup.py lightfm tests
67+
black --check setup.py lightfm tests
68+
69+
workflows:
70+
version: 2
71+
test:
72+
jobs:
73+
- lint
74+
- pytest:
75+
image: circleci/python:3.6.10-stretch-browsers
76+
python_version: py36
77+
- pytest:
78+
image: circleci/python:3.7.7-buster-browsers
79+
python_version: py37
80+
- pytest:
81+
image: circleci/python:3.8.3-buster-browsers
82+
python_version: py38

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
venv/
12
*.pyc
23
*.egg*
34
*~

.travis.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
os:
22
- osx
33
before_install:
4-
- pip2 install -r dev-requirements.txt
4+
- python3 -m venv venv
5+
- venv/bin/pip install -r test-requirements.txt
56
install:
6-
- pip2 install -e .
7-
script: py.test tests/
7+
- venv/bin/pip install -e .
8+
script: venv/bin/py.test -xv tests/

appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ install:
1717
- activate lightfm
1818

1919
# Install the build dependencies of the project.
20-
- conda install --yes --file dev-requirements.txt
20+
- conda install --yes --file test-requirements.txt
2121

2222
# Install lightfm
2323
- pip install -e .

circle.yml

-28
This file was deleted.

dev-requirements.txt

-8
This file was deleted.

lint-requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
black
2+
flake8

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description-file = README.md
33

44
[flake8]
5-
ignore = I100, W503
5+
ignore = I100, W503, E203
66
max-line-length = 100
77
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist,docs,doc
88

0 commit comments

Comments
 (0)