Skip to content

Commit

Permalink
Merge 84ec8f6 into 1d7b7e6
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelsJP committed Feb 6, 2021
2 parents 1d7b7e6 + 84ec8f6 commit 4be4205
Show file tree
Hide file tree
Showing 49 changed files with 2,731 additions and 1,115 deletions.
2 changes: 1 addition & 1 deletion .condarc
@@ -1,4 +1,4 @@
channels:
- michaelsjp

show_channel_urls: True
show_channel_urls: True
21 changes: 18 additions & 3 deletions .coveragerc
@@ -1,5 +1,20 @@
[run]
branch = True
concurrency = multiprocessing
omit =
*/venv/*
*/.venv/*
*/.env/*
*/.tox/*
*/docs/*

[report]
omit =
*/python?.?/*
*/site-packages/nose/*
*__init__*
*/venv/*
*/.venv/*
*/.env/*
*/.tox/*
*/docs/*

exclude_lines =
pragma: no cover
61 changes: 44 additions & 17 deletions .github/workflows/ci-tests.yml
@@ -1,36 +1,63 @@
name: tests

on:
on:
pull_request:
branches: '**'
push:
branches:
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: Install lint dependencies
run: |
python -m pip install --upgrade pip
pip install pre-commit pycodestyle
- name: Install and run pre-commit
uses: pre-commit/action@v2.0.0
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
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 Python ${{ matrix.config.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python_version }}
python-version: ${{ matrix.config.python-version }}
- name: Python Poetry Action
uses: abatilo/actions-poetry@v2.1.0
with:
poetry-version: 1.1.2
- name: Install dependencies
run: |
pip install -r requirements-dev.txt
- name: nosetests
run: |
nosetests --with-coverage --cover-erase --cover-package=openrouteservice -v
pip install tox coveralls
- name: Run Tox
run: tox -e py${{ matrix.config.tox }}
- name: coveralls
run: |
coveralls --service=github
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/conda-package.yml
Expand Up @@ -7,13 +7,28 @@ on:

jobs:
publish:
name: Build and publish Conda distributions 📦
runs-on: Ubuntu-20.04
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@master
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dephell
run: |
pip install dephell
- name: Convert pyproject.toml to setup.py
run: |
dephell deps convert
- name: Export package version and name
run: |
export OPENROUTESERVICE_NAME=$(python setup.py --name)
export OPENROUTESERVICE_VERSION=$(python setup.py --version)
- name: publish-to-conda
uses: MichaelsJP/conda-package-publish-action@v1.0.0
with:
subDir: 'conda.recipe'
AnacondaToken: ${{ secrets.ANACONDA_TOKEN }}
platforms: 'all'
override: true
override: true
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Expand Up @@ -36,4 +36,4 @@ jobs:
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
password: ${{ secrets.PYPI_API_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -16,3 +16,6 @@ test.py

cover/
conda/
*coverage.xml
/setup.py
/requirements.txt
51 changes: 51 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,51 @@
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 ]
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
args: # arguments to configure black
- --line-length=80
- 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",
]
2 changes: 1 addition & 1 deletion MANIFEST.in
@@ -1 +1 @@
include README.rst
include README.rst
4 changes: 2 additions & 2 deletions conda.recipe/bld.bat
@@ -1,3 +1,3 @@
cd %RECIPE_DIR%\..
"%PYTHON%" setup.py install
if errorlevel 1 exit 1
"%PYTHON%" setup.py install --single-version-externally-managed --record=record.txt
if errorlevel 1 exit 1
2 changes: 1 addition & 1 deletion conda.recipe/build.sh
@@ -1,2 +1,2 @@
cd $RECIPE_DIR/..
$PYTHON setup.py install
$PYTHON setup.py install --single-version-externally-managed --record=record.txt
9 changes: 3 additions & 6 deletions conda.recipe/meta.yaml
@@ -1,13 +1,10 @@
{% set name = "openrouteservice" %}
{% set version = "2.3.3" %}

package:
name: "{{ name|lower }}"
version: "{{ version }}"
name: "{{ OPENROUTESERVICE_NAME|lower }}"
version: "{{ OPENROUTESERVICE_VERSION }}"

source:
git_url: https://github.com/GIScience/openrouteservice-py.git
git_rev: "v{{ version }}"
git_rev: "v{{ OPENROUTESERVICE_VERSION }}"


requirements:
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Expand Up @@ -17,4 +17,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

0 comments on commit 4be4205

Please sign in to comment.