summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Bangert <ben@groovie.org>2020-10-13 16:22:54 -0700
committerGitHub <noreply@github.com>2020-10-13 16:22:54 -0700
commitecb9acc4231fb8095848ab191cb9465127f1b39c (patch)
treeb3912b49a9175f885c46d5983187ffe383a407e7
parent42c91992409d5e9270a6857c11f1e3e7bc0b8844 (diff)
downloadroutes-ecb9acc4231fb8095848ab191cb9465127f1b39c.tar.gz
chore: add github action for ci (#97)
* chore: add github action for ci Co-authored-by: Sviatoslav Sydorenko <wk@sydorenko.org.ua>
-rw-r--r--.github/workflows/python-package.yml85
-rw-r--r--.travis.yml15
-rw-r--r--routes/middleware.py6
3 files changed, 88 insertions, 18 deletions
diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml
new file mode 100644
index 0000000..52a7118
--- /dev/null
+++ b/.github/workflows/python-package.yml
@@ -0,0 +1,85 @@
+name: Python package
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+ branches: [main]
+ schedule:
+ - cron: 1 0 * * * # Run daily at 0:01 UTC
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ python-version:
+ - 2.7
+ - 3.5
+ - 3.6
+ - pypy2
+
+ env:
+ TOX_PARALLEL_NO_SPINNER: 1
+ TOXENV: python
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Install dependencies
+ run: pip install tox
+ - name: "Initialize tox envs"
+ run: >-
+ python -m
+ tox
+ --parallel auto
+ --parallel-live
+ --notest
+ --skip-missing-interpreters false
+ - name: Test with tox
+ run: >-
+ python -m
+ tox
+ --parallel auto
+ --parallel-live
+ --
+ -vvvvv
+ lint:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python-version:
+ - 3.9
+ toxenv:
+ - style
+ env:
+ TOX_PARALLEL_NO_SPINNER: 1
+ TOXENV: ${{ matrix.toxenv }}
+ steps:
+ - uses: actions/checkout@v2
+ - name: "Set up Python ${{ matrix.python-version }}"
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Install dependencies
+ run: pip install tox
+ - name: "Initialize tox envs: ${{ env.TOXENV }}"
+ run: >-
+ python -m
+ tox
+ --parallel auto
+ --parallel-live
+ --notest
+ --skip-missing-interpreters false
+ - name: Test with tox
+ run: >-
+ python -m
+ tox
+ --parallel auto
+ --parallel-live
+ --
+ -vvvvv
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 2496887..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-language: python
-python:
- - "2.7"
- - "3.5"
- - "3.6"
- - nightly
- - pypy
- - pypy3
-matrix:
- allow_failures:
- - python: nightly
-install: pip install tox-travis
-script: tox
-after_success:
- - codecov
diff --git a/routes/middleware.py b/routes/middleware.py
index 4ee47da..649aa25 100644
--- a/routes/middleware.py
+++ b/routes/middleware.py
@@ -61,12 +61,12 @@ class RoutesMiddleware(object):
if '_method' in qs:
req = Request(environ)
req.errors = 'ignore'
-
+
try:
method = req.GET.get('_method')
except UnicodeDecodeError:
method = None
-
+
if method:
old_method = environ['REQUEST_METHOD']
environ['REQUEST_METHOD'] = method.upper()
@@ -83,7 +83,7 @@ class RoutesMiddleware(object):
method = req.POST.get('_method')
except UnicodeDecodeError:
method = None
-
+
if method:
old_method = environ['REQUEST_METHOD']
environ['REQUEST_METHOD'] = method.upper()