Skip to content

Commit

Permalink
Merge pull request #42 from nvllsvm/ci
Browse files Browse the repository at this point in the history
Replace Travis with GitHub Actions
  • Loading branch information
nvllsvm committed Mar 7, 2022
2 parents 89b6ebf + e6aa8ac commit 95423f8
Show file tree
Hide file tree
Showing 9 changed files with 101 additions and 64 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Deployment
on:
push:
branches-ignore: ["*"]
tags: ["*"]
jobs:
deploy:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'sprockets/sprockets.mixins.http'
container: python:3.9-alpine
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Build package
run: python3 setup.py bdist_wheel sdist
- name: Publish package
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
43 changes: 43 additions & 0 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Testing
on:
push:
branches: ["*"]
paths-ignore:
- 'docs/**'
- 'setup.*'
- '*.md'
- '*.rst'
tags-ignore: ["*"]
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 3
strategy:
matrix:
python: [3.7, 3.8, 3.9]
container:
image: python:${{ matrix.python }}-alpine
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install testing dependencies
run: pip3 --no-cache-dir install -e . -r requires/testing.txt

- name: Run flake8 tests
run: flake8

- name: Run tests
run: coverage run

- name: Output coverage
run: coverage report && coverage xml

- name: Upload Coverage
uses: codecov/codecov-action@v1.0.2
if: github.event_name == 'push' && github.repository == 'sprockets/sprockets.mixins.http'
with:
token: ${{secrets.CODECOV_TOKEN}}
file: build/coverage.xml
flags: unittests
fail_ci_if_error: true
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

7 changes: 4 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sprockets.mixins.http
=====================
HTTP Client Mixin for Tornado RequestHandlers. Automatically retries on errors, sleep when rate limited, and handles content encoding and decoding using `MsgPack <https://msgpack.org>`_ and JSON.

|Version| |Travis| |CodeCov| |Docs|
|Version| |Status| |CodeCov| |Docs|

Installation
------------
Expand Down Expand Up @@ -115,8 +115,9 @@ License
.. |Version| image:: https://badge.fury.io/py/sprockets.mixins.http.svg?
:target: https://badge.fury.io/py/sprockets.mixins.http

.. |Travis| image:: https://travis-ci.org/sprockets/sprockets.mixins.http.svg?branch=master
:target: https://travis-ci.org/sprockets/sprockets.mixins.http
.. |Status| image:: https://github.com/sprockets/sprockets.mixins.http/workflows/Testing/badge.svg?
:target: https://github.com/sprockets/sprockets.mixins.http/actions?workflow=Testing
:alt: Build Status

.. |CodeCov| image:: https://codecov.io/github/sprockets/sprockets.mixins.http/coverage.svg?branch=master
:target: https://codecov.io/github/sprockets/sprockets.mixins.http?branch=master
Expand Down
4 changes: 2 additions & 2 deletions requires/docs.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sphinx==4.2.0
sphinx==4.4.0
sphinx-rtd-theme==1.0.0
sphinxcontrib-httpdomain==1.7.0
sphinxcontrib-httpdomain==1.8.0
21 changes: 10 additions & 11 deletions requires/testing.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
asynctest==0.13.0
coverage==4.5.4
codecov==2.0.15
flake8==3.7.9
flake8-comprehensions==2.2.0
coverage==6.3.2
codecov==2.1.12
flake8==4.0.1
flake8-comprehensions==3.8.0
flake8-deprecated==1.3
flake8-html==0.4.0
flake8-html==0.4.1
flake8-import-order==0.18.1
flake8-quotes==2.1.0
flake8-rst-docstrings==0.0.11
flake8-tuple==0.4.0
nose==1.3.7
u-msgpack-python==2.5.2
yapf==0.30.0
flake8-quotes==3.3.1
flake8-rst-docstrings==0.2.5
flake8-tuple==0.4.1
u-msgpack-python==2.7.1
yapf==0.32.0
-r installation.txt
21 changes: 8 additions & 13 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,22 @@
universal = 1

[coverage:report]
show_missing = 1
show_missing = True
include =
sprockets/*

[coverage:run]
branch = True
command_line = -m unittest discover . --buffer --verbose

[flake8]
application-import-names=sprockets.mixins.http
exclude=build,env
ignore=RST304
import-order-style=google

[nosetests]
cover-branches=1
cover-erase=1
cover-html=1
cover-html-dir=build/coverage
cover-package=sprockets.mixins.http
cover-tests=1
with-coverage=1
logging-level=DEBUG
verbosity=2

[upload_docs]
upload-dir = build/sphinx/html
upload_dir = build/sphinx/html

[yapf]
allow_split_before_dict_value = False
7 changes: 4 additions & 3 deletions sprockets/mixins/http/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,10 @@ def links(self):
return None
links = []
if 'Link' in self._responses[-1].headers:
for l in headers.parse_link(self._responses[-1].headers['Link']):
link = {'target': l.target}
link.update({k: v for (k, v) in l.parameters})
for parsed in headers.parse_link(
self._responses[-1].headers['Link']):
link = {'target': parsed.target}
link.update({k: v for (k, v) in parsed.parameters})
links.append(link)
return links

Expand Down
16 changes: 10 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
[tox]
envlist = lint,py37,py38,py39
indexserver =
default = https://pypi.org/simple
default = https://pypi.python.org/simple
toxworkdir = build/tox
skip_missing_interpreters = True
use_develop = True

[testenv]
commands =
python -m unittest
deps = -rrequires/testing.txt
use_develop = True
coverage run

deps =
.
-rrequires/testing.txt

[testenv_lint]
commands =
flake8
yapf -dr sprockets tests.py
flake8
yapf -dr sprockets tests.py

0 comments on commit 95423f8

Please sign in to comment.