Skip to content

Commit 0af44a1

Browse files
authored
Migrate openrouteservie-py to the year 2021 (#60)
Enforce more code styles. Migrate to poetry. New publishing routines. No Conda specific release anymore. No python < 3 support.
1 parent 1d7b7e6 commit 0af44a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2181
-1245
lines changed

.condarc

Lines changed: 0 additions & 4 deletions
This file was deleted.

.coveragerc

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
1+
[run]
2+
branch = False
3+
source = codecov
4+
omit =
5+
*/venv/*
6+
*/.venv/*
7+
*/.env/*
8+
*/.tox/*
9+
*/docs/*
10+
tests/*
11+
setup.py
12+
113
[report]
214
omit =
3-
*/python?.?/*
4-
*/site-packages/nose/*
5-
*__init__*
15+
*/venv/*
16+
*/.venv/*
17+
*/.env/*
18+
*/.tox/*
19+
*/docs/*
20+
tests/*
21+
setup.py
22+
exclude_lines =
23+
pragma: no cover

.github/workflows/ci-production.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Continous Integration
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
release:
9+
types:
10+
- created
11+
12+
jobs:
13+
linux-tests:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
config:
18+
- python-version: 3.6
19+
tox: 36
20+
- python-version: 3.7
21+
tox: 37
22+
- python-version: 3.8
23+
tox: 38
24+
- python-version: 3.9
25+
tox: 39
26+
- python-version: pypy-3.6
27+
tox: py3
28+
- python-version: pypy-3.7
29+
tox: py3
30+
poetry-version: [ 1.1.4 ]
31+
os: [ macos-latest, windows-2019, ubuntu-20.04, ubuntu-18.04 ]
32+
runs-on: ${{ matrix.os }}
33+
steps:
34+
- uses: actions/checkout@v2
35+
- name: Set up testing Python ${{ matrix.config.python-version }}
36+
uses: actions/setup-python@v2
37+
with:
38+
python-version: ${{ matrix.config.python-version }}
39+
architecture: x64
40+
- name: Set up base Python 3.9
41+
uses: actions/setup-python@v2
42+
with:
43+
python-version: 3.9
44+
architecture: x64
45+
- name: Python Poetry Action
46+
uses: abatilo/[email protected]
47+
with:
48+
poetry-version: ${{ matrix.poetry-version }}
49+
- name: Install dependencies
50+
run: |
51+
python -m pip install --upgrade pip
52+
pip install tox
53+
- name: Run Tox
54+
run: tox -e py${{ matrix.config.tox }}
55+
- name: Upload coverage to Codecov
56+
uses: codecov/codecov-action@v1
57+
with:
58+
token: ${{ secrets.CODECOV_TOKEN }}
59+
flags: unittests
60+
env_vars: OS,PYTHON
61+
name: codecov-umbrella
62+
fail_ci_if_error: true
63+
verbose: true
64+
build-and-publish:
65+
name: Build and publish Python distributions 📦 to PyPI and TestPyPI
66+
runs-on: ubuntu-20.04
67+
needs:
68+
- linux-tests
69+
steps:
70+
- uses: actions/checkout@v2
71+
- name: Set up base Python 3.9
72+
uses: actions/setup-python@v2
73+
with:
74+
python-version: 3.9
75+
- name: Python Poetry Action
76+
uses: abatilo/[email protected]
77+
with:
78+
poetry-version: 1.1.4
79+
- name: Publish distribution 📦 with test.pypi.org
80+
if: startsWith(github.ref, 'refs/tags')
81+
run: |
82+
poetry config repositories.testpypi https://test.pypi.org/legacy/
83+
poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_API_TOKEN }}
84+
poetry build
85+
poetry publish -r testpypi
86+
- name: Publish distribution 📦 to PyPI
87+
if: startsWith(github.ref, 'refs/tags')
88+
run: |
89+
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
90+
poetry build
91+
poetry publish

.github/workflows/ci-tests.yml

Lines changed: 66 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,80 @@
11
name: tests
22

3-
on:
3+
on:
44
pull_request:
55
branches: '**'
6-
push:
7-
branches:
8-
- master
96

107
jobs:
11-
build:
12-
runs-on: ${{ matrix.os }}
8+
lint:
9+
runs-on: ubuntu-20.04
10+
steps:
11+
- name: checkout
12+
uses: actions/checkout@v2
13+
- name: Install Python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3.9
17+
- name: Python Poetry Action
18+
uses: abatilo/[email protected]
19+
with:
20+
poetry-version: 1.1.4
21+
- name: Install lint dependencies
22+
run: |
23+
pip install tox pytest pytest-cov
24+
- name: Install and run pre-commit
25+
uses: pre-commit/[email protected]
26+
with:
27+
extra_args: --all-files
28+
test:
29+
needs:
30+
- lint
1331
strategy:
32+
fail-fast: false
1433
matrix:
15-
os: [ubuntu-20.04]
16-
python_version: [
17-
3.7,
18-
3.8,
19-
3.9,
20-
pypy3
21-
]
34+
config:
35+
- python-version: 3.6
36+
tox: 36
37+
- python-version: 3.7
38+
tox: 37
39+
- python-version: 3.8
40+
tox: 38
41+
- python-version: 3.9
42+
tox: 39
43+
- python-version: pypy-3.6
44+
tox: py3
45+
- python-version: pypy-3.7
46+
tox: py3
47+
poetry-version: [ 1.1.4 ]
48+
os: [ macos-latest, windows-2019, ubuntu-20.04, ubuntu-18.04 ]
49+
runs-on: ${{ matrix.os }}
2250
steps:
2351
- uses: actions/checkout@v2
24-
- name: Set up Python ${{ matrix.python_version }}
52+
- name: Set up testing Python ${{ matrix.config.python-version }}
53+
uses: actions/setup-python@v2
54+
with:
55+
python-version: ${{ matrix.config.python-version }}
56+
architecture: x64
57+
- name: Set up base Python 3.9
2558
uses: actions/setup-python@v2
2659
with:
27-
python-version: ${{ matrix.python_version }}
60+
python-version: 3.9
61+
architecture: x64
62+
- name: Python Poetry Action
63+
uses: abatilo/[email protected]
64+
with:
65+
poetry-version: ${{ matrix.poetry-version }}
2866
- name: Install dependencies
2967
run: |
30-
pip install -r requirements-dev.txt
31-
- name: nosetests
32-
run: |
33-
nosetests --with-coverage --cover-erase --cover-package=openrouteservice -v
34-
- name: coveralls
35-
run: |
36-
coveralls --service=github
37-
env:
38-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
python -m pip install --upgrade pip
69+
pip install tox
70+
- name: Run Tox
71+
run: tox -e py${{ matrix.config.tox }}
72+
- name: Upload coverage to Codecov
73+
uses: codecov/codecov-action@v1
74+
with:
75+
token: ${{ secrets.CODECOV_TOKEN }}
76+
flags: unittests
77+
env_vars: OS,PYTHON
78+
name: codecov-umbrella
79+
fail_ci_if_error: true
80+
verbose: true

.github/workflows/conda-package.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/python-package.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.tox/
12
.venv/
23
.coverage
34
**/.ipynb_checkpoints/
@@ -16,3 +17,6 @@ test.py
1617

1718
cover/
1819
conda/
20+
*coverage.xml
21+
/setup.py
22+
/requirements.txt

.pre-commit-config.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v3.2.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
exclude: |
9+
(?x)(
10+
^conda.recipe/meta.yaml
11+
)
12+
- id: check-json
13+
- id: forbid-new-submodules
14+
- id: mixed-line-ending
15+
args: [ '--fix=lf' ]
16+
description: Forces to replace line ending by the UNIX 'lf' character.
17+
- id: pretty-format-json
18+
args: [ '--no-sort-keys' ]
19+
- id: no-commit-to-branch
20+
args: [ --branch, master ]
21+
- id: no-commit-to-branch
22+
args: [ --branch, main ]
23+
24+
- repo: https://github.com/ambv/black
25+
rev: stable
26+
hooks:
27+
- id: black
28+
args: # arguments to configure black
29+
- --line-length=80
30+
language_version: python3.9
31+
- repo: https://gitlab.com/pycqa/flake8
32+
rev: "3.8.4"
33+
hooks:
34+
- id: flake8
35+
exclude: |
36+
(?x)(
37+
^test/* |
38+
^docs/*
39+
)
40+
args:
41+
- "--max-line-length=120"
42+
- "--ignore=P101,D202,D401"
43+
additional_dependencies:
44+
[
45+
"flake8-bugbear==19.8.0",
46+
"flake8-coding==1.3.2",
47+
"flake8-comprehensions==3.0.1",
48+
"flake8-debugger==3.2.1",
49+
"flake8-deprecated==1.3",
50+
"flake8-pep3101==1.2.1",
51+
"flake8-polyfill==1.0.2",
52+
"flake8-print==3.1.4",
53+
"flake8-string-format==0.2.3",
54+
"flake8-docstrings==1.5.0",
55+
]

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include README.rst
1+
include README.rst

0 commit comments

Comments
 (0)