-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
1d7b7e6
commit 0af44a1
Showing
51 changed files
with
2,181 additions
and
1,245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,23 @@ | ||
[run] | ||
branch = False | ||
source = codecov | ||
omit = | ||
*/venv/* | ||
*/.venv/* | ||
*/.env/* | ||
*/.tox/* | ||
*/docs/* | ||
tests/* | ||
setup.py | ||
|
||
[report] | ||
omit = | ||
*/python?.?/* | ||
*/site-packages/nose/* | ||
*__init__* | ||
*/venv/* | ||
*/.venv/* | ||
*/.env/* | ||
*/.tox/* | ||
*/docs/* | ||
tests/* | ||
setup.py | ||
exclude_lines = | ||
pragma: no cover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: Continous Integration | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
linux-tests: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- python-version: 3.6 | ||
tox: 36 | ||
- python-version: 3.7 | ||
tox: 37 | ||
- python-version: 3.8 | ||
tox: 38 | ||
- python-version: 3.9 | ||
tox: 39 | ||
- python-version: pypy-3.6 | ||
tox: py3 | ||
- python-version: pypy-3.7 | ||
tox: py3 | ||
poetry-version: [ 1.1.4 ] | ||
os: [ macos-latest, windows-2019, ubuntu-20.04, ubuntu-18.04 ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up testing Python ${{ matrix.config.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.config.python-version }} | ||
architecture: x64 | ||
- name: Set up base Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
architecture: x64 | ||
- name: Python Poetry Action | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: ${{ matrix.poetry-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox | ||
- name: Run Tox | ||
run: tox -e py${{ matrix.config.tox }} | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
flags: unittests | ||
env_vars: OS,PYTHON | ||
name: codecov-umbrella | ||
fail_ci_if_error: true | ||
verbose: true | ||
build-and-publish: | ||
name: Build and publish Python distributions 📦 to PyPI and TestPyPI | ||
runs-on: ubuntu-20.04 | ||
needs: | ||
- linux-tests | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up base Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Python Poetry Action | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: 1.1.4 | ||
- name: Publish distribution 📦 with test.pypi.org | ||
if: startsWith(github.ref, 'refs/tags') | ||
run: | | ||
poetry config repositories.testpypi https://test.pypi.org/legacy/ | ||
poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
poetry build | ||
poetry publish -r testpypi | ||
- name: Publish distribution 📦 to PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
run: | | ||
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }} | ||
poetry build | ||
poetry publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,80 @@ | ||
name: tests | ||
|
||
on: | ||
on: | ||
pull_request: | ||
branches: '**' | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
lint: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
- name: Install Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Python Poetry Action | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: 1.1.4 | ||
- name: Install lint dependencies | ||
run: | | ||
pip install tox pytest pytest-cov | ||
- name: Install and run pre-commit | ||
uses: pre-commit/[email protected] | ||
with: | ||
extra_args: --all-files | ||
test: | ||
needs: | ||
- lint | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-20.04] | ||
python_version: [ | ||
3.7, | ||
3.8, | ||
3.9, | ||
pypy3 | ||
] | ||
config: | ||
- python-version: 3.6 | ||
tox: 36 | ||
- python-version: 3.7 | ||
tox: 37 | ||
- python-version: 3.8 | ||
tox: 38 | ||
- python-version: 3.9 | ||
tox: 39 | ||
- python-version: pypy-3.6 | ||
tox: py3 | ||
- python-version: pypy-3.7 | ||
tox: py3 | ||
poetry-version: [ 1.1.4 ] | ||
os: [ macos-latest, windows-2019, ubuntu-20.04, ubuntu-18.04 ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python_version }} | ||
- name: Set up testing Python ${{ matrix.config.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.config.python-version }} | ||
architecture: x64 | ||
- name: Set up base Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python_version }} | ||
python-version: 3.9 | ||
architecture: x64 | ||
- name: Python Poetry Action | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: ${{ matrix.poetry-version }} | ||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements-dev.txt | ||
- name: nosetests | ||
run: | | ||
nosetests --with-coverage --cover-erase --cover-package=openrouteservice -v | ||
- name: coveralls | ||
run: | | ||
coveralls --service=github | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
python -m pip install --upgrade pip | ||
pip install tox | ||
- name: Run Tox | ||
run: tox -e py${{ matrix.config.tox }} | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
flags: unittests | ||
env_vars: OS,PYTHON | ||
name: codecov-umbrella | ||
fail_ci_if_error: true | ||
verbose: true |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.2.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
exclude: | | ||
(?x)( | ||
^conda.recipe/meta.yaml | ||
) | ||
- id: check-json | ||
- id: forbid-new-submodules | ||
- id: mixed-line-ending | ||
args: [ '--fix=lf' ] | ||
description: Forces to replace line ending by the UNIX 'lf' character. | ||
- id: pretty-format-json | ||
args: [ '--no-sort-keys' ] | ||
- id: no-commit-to-branch | ||
args: [ --branch, master ] | ||
- id: no-commit-to-branch | ||
args: [ --branch, main ] | ||
|
||
- repo: https://github.com/ambv/black | ||
rev: stable | ||
hooks: | ||
- id: black | ||
args: # arguments to configure black | ||
- --line-length=80 | ||
language_version: python3.9 | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: "3.8.4" | ||
hooks: | ||
- id: flake8 | ||
exclude: | | ||
(?x)( | ||
^test/* | | ||
^docs/* | ||
) | ||
args: | ||
- "--max-line-length=120" | ||
- "--ignore=P101,D202,D401" | ||
additional_dependencies: | ||
[ | ||
"flake8-bugbear==19.8.0", | ||
"flake8-coding==1.3.2", | ||
"flake8-comprehensions==3.0.1", | ||
"flake8-debugger==3.2.1", | ||
"flake8-deprecated==1.3", | ||
"flake8-pep3101==1.2.1", | ||
"flake8-polyfill==1.0.2", | ||
"flake8-print==3.1.4", | ||
"flake8-string-format==0.2.3", | ||
"flake8-docstrings==1.5.0", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
include README.rst | ||
include README.rst |
Oops, something went wrong.