-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
57 lines (50 loc) · 1.9 KB
/
.gitlab-ci.yml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Gitlab CI/CD Configuration
# https://docs.gitlab.com/ee/ci/yaml/
stages:
# Primary test stage runs linting, docs, tests on single platform
- test:primary
# Secondary test stage runs tests on other supported platforms
# Only run if primary passes, to avoid wasting cycles
- test:secondary
variables:
PYTHON: python3
before_script:
- $PYTHON --version
- $PYTHON -m pip install --upgrade setuptools tox wheel
# Note: Using Docker Official Images for Python and PyPy:
# https://hub.docker.com/_/python
# https://hub.docker.com/_/pypy
#
# Alpine images are avoided due to:
# 1. Lack of wheels. Most wheels target https://github.com/pypa/manylinux
# which requires glibc (which is enforced since pip 21:
# https://github.com/pypa/pip/issues/9735). Although
# https://www.python.org/dev/peps/pep-0656/ for musl has been accepted,
# wheels are still rare.
#
# Specifically: black requires regex, which only has manylinux wheels:
# https://github.com/psf/black/issues/1112
# https://bitbucket.org/mrabarnett/mrab-regex/issues/311/linux-wheel-availability-on-pypi#comment-55493041
# 2. Prevalence of compatibility and performance issues.
# https://bugs.python.org/issue32307
# https://github.com/iron-io/dockers/issues/42#issuecomment-290763088
# https://superuser.com/q/1219609
# (I'm not opposed to finding/fixing these, but the community consensus
# seems to be avoiding Alpine and I don't want to fight a 1-person battle.)
# Lint, Docs, Test on latest supported release of Python
test:primary:
stage: test:primary
image: python:slim
script: $PYTHON -m tox -vv -e lint,docs,py3
# Test with earliest supported version of Python 3
test:py37:
stage: test:secondary
image: python:3.7-slim
script: $PYTHON -m tox -vv -e py37
# Test with latest supported version of PyPy 3
test:pypy3:
stage: test:secondary
image: pypy:slim
variables:
PYTHON: pypy3
script: $PYTHON -m tox -vv -e pypy3