Skip to content

Commit 0b12e71

Browse files
DeuchnordJérôme Deuchnord
authored and
Jérôme Deuchnord
committed
ci(compatibility): test on more Python versions and on macOS (#131)
BREAKING CHANGE: on Ubuntu 20.04+, the `texlive-latex-extra` package is needed to generate the PDF output
1 parent c619a77 commit 0b12e71

21 files changed

+358
-272
lines changed

.coveragerc

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ branch = true
33
source =
44
kosmorrolib
55
omit =
6+
kosmorrolib/main.py
67
test/*

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@ trim_trailing_whitespace = true
1212
[*.md]
1313
trim_trailing_whitespace = false
1414

15+
[*.yml]
16+
indent_size = 2
17+
1518
[Makefile]
1619
indent_style = tab

.github/workflows/commitlint.yml

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
name: Commit lint
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: [master, features]
6+
pull_request:
7+
branches: [master, features]
48

59
jobs:
6-
build:
10+
commitlint:
711
runs-on: ubuntu-latest
812

913
steps:
1014
- uses: actions/checkout@v1
1115
- name: Set up Python
1216
uses: actions/setup-python@v1
1317
with:
14-
python-version: 3.8
18+
python-version: 3.9
1519
- name: Install dependencies
1620
run: |
17-
pip install --upgrade pip pipenv
18-
pipenv sync -d
21+
pip install --upgrade pip comlipy
1922
- name: Lint
2023
run: |
2124
message="$(git log --format=%B -n 1 HEAD)"
2225
echo $message
23-
pipenv run comlipy -c config-comlipy.yml "$message"
26+
comlipy -c config-comlipy.yml "$message"
2427

.github/workflows/e2e.yml

+20-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,33 @@
11
name: E2E tests
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: [master, features]
6+
pull_request:
7+
branches: [master, features]
48

59
jobs:
6-
build:
7-
runs-on: ubuntu-latest
8-
10+
e2e-tests:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os:
16+
- ubuntu-18.04
17+
- ubuntu-20.04
18+
python-version:
19+
- '3.7'
20+
- '3.8'
21+
- '3.9'
22+
23+
name: E2E tests (Python ${{ matrix.python-version }} on ${{ matrix.os }})
924
steps:
1025
- uses: actions/checkout@v1
1126

1227
- name: Set up Python
1328
uses: actions/setup-python@v1
1429
with:
15-
python-version: 3.8
30+
python-version: ${{ matrix.python-version }}
1631

1732
- name: Prepare tests
1833
run: |

.github/workflows/i18n.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
name: Internationalization check
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: [master, features]
6+
pull_request:
7+
branches: [master, features]
48

59
jobs:
6-
build:
10+
internationalization:
711
runs-on: ubuntu-latest
812

913
steps:

.github/workflows/pylint.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1-
name: PyLint
1+
name: Python Lint
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: [master, features]
6+
pull_request:
7+
branches: [master, features]
48

59
jobs:
6-
build:
10+
pylint:
711
runs-on: ubuntu-latest
812

13+
name: PyLint
914
steps:
1015
- uses: actions/checkout@v1
1116
- name: Set up Python
1217
uses: actions/setup-python@v1
1318
with:
14-
python-version: 3.8
19+
python-version: 3.9
1520
- name: Install dependencies
1621
run: |
1722
pip install --upgrade pip pipenv

.github/workflows/unit-tests.yml

+21-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
11
name: Unit tests
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: [master, features]
6+
pull_request:
7+
branches: [master, features]
48

59
jobs:
6-
build:
7-
runs-on: ubuntu-latest
10+
unit-tests:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os:
16+
- ubuntu-18.04
17+
- ubuntu-20.04
18+
- macos-10.15
19+
- macos-11.0
20+
python-version:
21+
- '3.7'
22+
- '3.8'
23+
- '3.9'
824

25+
name: Unit tests (Python ${{ matrix.python-version }} on ${{ matrix.os }})
926
steps:
1027
- uses: actions/checkout@v1
1128
- name: Set up Python
1229
uses: actions/setup-python@v1
1330
with:
14-
python-version: 3.8
31+
python-version: ${{ matrix.python-version }}
1532
- name: Install dependencies
1633
run: |
1734
pip install --upgrade pip pipenv

.pylintrc

+3-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ disable=print-statement,
147147
too-few-public-methods,
148148
protected-access,
149149
unnecessary-comprehension,
150-
too-many-arguments
150+
too-many-arguments,
151+
unsubscriptable-object,
152+
too-many-return-statements
151153

152154
# Enable the message, report, category or checker with the given id(s). You can
153155
# either give multiple identifier separated by comma (,) or put this option

.scripts/tests-e2e.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ assertSuccess "LATITUDE=50.5876 LONGITUDE=3.0624 TIMEZONE=-1 kosmorro -d 2020-01
101101
# Missing dependencies, should fail
102102
assertFailure "kosmorro --latitude=50.5876 --longitude=3.0624 -d 2020-01-27 --format=pdf -o /tmp/document.pdf"
103103

104-
assertSuccess "sudo apt-get install -y texlive" "CI"
105-
assertSuccess "$PIP_BIN install latex" "CI"
104+
assertSuccess "sudo apt-get install -y texlive texlive-latex-extra" "CI"
106105

107106
# Dependencies installed, should not fail
108107
assertSuccess "kosmorro --latitude=50.5876 --longitude=3.0624 -d 2020-01-27 --format=pdf -o /tmp/document.pdf"

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
.PHONY: test
22

33
test:
4+
export LC_ALL=C.UTF-8; \
5+
export LANG=C.UTF-8; \
46
unset KOSMORRO_LATITUDE; \
57
unset KOSMORRO_LONGITUDE; \
68
unset KOSMORRO_TIMEZONE; \

Pipfile

-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@ pylint = "*"
99
babel = "*"
1010
unittest-data-provider = "*"
1111
coveralls = "*"
12-
comlipy = "*"
1312

1413
[packages]
1514
skyfield = ">=1.32.0,<2.0.0"
1615
tabulate = "*"
1716
numpy = ">=1.17.0,<2.0.0"
1817
termcolor = "*"
19-
latex = "*"
2018
python-dateutil = "*"
2119

2220
[requires]

0 commit comments

Comments
 (0)