From ecb9acc4231fb8095848ab191cb9465127f1b39c Mon Sep 17 00:00:00 2001 From: Ben Bangert Date: Tue, 13 Oct 2020 16:22:54 -0700 Subject: chore: add github action for ci (#97) * chore: add github action for ci Co-authored-by: Sviatoslav Sydorenko --- .github/workflows/python-package.yml | 85 ++++++++++++++++++++++++++++++++++++ .travis.yml | 15 ------- routes/middleware.py | 6 +-- 3 files changed, 88 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/python-package.yml delete mode 100644 .travis.yml 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() -- cgit v1.2.1