Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move CI from Travis to GitHub Actions #26

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: nameko-sentry CI build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.8, 3.9]
services:
rabbitmq:
image: rabbitmq:3-management
ports:
- 5672:5672
- 15672:15672
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
- name: Upgrade pip
run: pip install pip setuptools wheel --upgrade
- name: Install tox
run: pip install tox tox-gh-actions
- name: Run tox
run: python -m tox
42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ pylint:
pylint nameko_sentry -E

pytest:
coverage run --concurrency=eventlet --source nameko_sentry.py --branch -m pytest test_nameko_sentry.py
nameko test --cov -vv
coverage report --show-missing --fail-under=100
2 changes: 1 addition & 1 deletion nameko_sentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def http_context(self, worker_ctx):
'headers': dict(get_headers(request.environ)),
'env': dict(get_environ(request.environ)),
})
except:
except Exception:
pass # probably not a compatible entrypoint

self.client.http_context(http)
Expand Down
16 changes: 9 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@
py_modules=['nameko_sentry'],
install_requires=[
"nameko>=2.5.1",
"raven>=3.0.0"
"raven>=3.0.0",
"werkzeug<3",
],
extras_require={
'dev': [
"coverage==4.0.3",
"flake8==3.3.0",
"pylint==1.8.2",
"pytest==2.8.3",
"objgraph==3.1.0"
"dev": [
"coverage==6.0.1",
"flake8==3.9.2",
"objgraph==3.5.0",
"pylint==2.11.1",
"pytest==6.0.2",
"pytest-cov==3.0.0",
]
},
zip_safe=True,
Expand Down
2 changes: 1 addition & 1 deletion test_nameko_sentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ def resource(self, request):
_, kwargs = sentry.client.send.call_args

received_data = kwargs['request']['data']
assert received_data == json.dumps(submitted_data).encode('utf-8')
assert received_data == json.dumps(submitted_data)

def test_form_submission(
self, container_factory, config, web_session
Expand Down
13 changes: 9 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
[tox]
envlist = {py27,py36}-static, {py27,py34,py35,py36}-test
envlist = py39-static, py{38,39}-test
skipsdist = True

[testenv]
whitelist_externals = make
allowlist_externals = make

commands =
static: pip install --editable .[dev]
static: make flake8
static: make pylint

lib: pip install --editable .[dev]
lib: make pytest
test: pip install --editable .[dev]
test: make pytest

[gh-actions]
python =
3.8: py38-test
3.9: py39-test, py39-static